filamentgroup / enhancejs Goto Github PK
View Code? Open in Web Editor NEWAre you looking for the new "Enhance"? Try here https://github.com/filamentgroup/enhance
License: Other
Are you looking for the new "Enhance"? Try here https://github.com/filamentgroup/enhance
License: Other
Google Code lists a minified version of EnhanceJS 1.1. Please add this file to GitHub. Cheers ^_^
To move the link, as described on p134 of DWPE, I have to use a timeout:
$(document).ready(function() {
var moveLink = function() {
var link = $('.enhanced_toggleResult');
console.log(link.length);
};
setTimeout(moveLink, 1000);
});
Because I'm loading a few JavaScript files, a timeout of around a second seems to be working for me. However, if end users have slower links, maybe that time period should be greater. This feels wrong.
Couldn't the link be created once the capabilities tests have been completed, and before additional CSS and scripts are downloaded?
I am trying to create a file upload utility using Enahnce, and I am trying to always show it in high-bandwidth version in IE8 (I also wanna remove the appenDtoggleLinks altogether:
For some reason the following code will not work:
<script type="text/javascript"> // Run capabilities test enhance({ loadScripts: [ 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'scripts/jQuery.fileinput.js', 'scripts/example.js' ], loadStyles: ['css/enhanced.css'] }); enhance.forcePass(); </script>Can anyone tell me what I am doing wrong? How can I force a pass?
Observed in Konqueror 4.6.5.
If I specify a media type in the call to enhance()
, then all CSS fails (including basic.css
, i.e. not loaded via enhance.js
).
This will not work:
enhance({
alertOnFailure: true,
loadStyles: [
{href: 'enhanced.css', media: 'screen'}
]
});
However, the following works OK:
enhance({
alertOnFailure: true,
loadStyles: [
'enhanced.css'
]
});
Also, post-test, enhance.query('screen')
returns false
.
I did some digging, and in the function assigned to mediaquery
, the expression divWidth == 10
is returning false
.
It looks like the dynamically injected styleblock is not being applied to the node at #ejs-qtest
.
When running enhance.forceFail();
some time after the enhance() script has excetuted I get "Settings undefine" in the console. It seems like "settings.testName" is unreachable.
I guess the same priblem applies to issue #5 as well.
I have in my <head>
section this code:
<script type="text/javascript">
//<!--
enhance({
loadStyles: [
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css',
'/_assets/css/precedent/desktop.css'
],
loadScripts: [
'http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js',
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js',
'/_assets/js/precedent/desktop.js'
],
onScriptsLoaded: function() {
scriptsLoaded();
}
});
//-->
</script>
That's generic. On a particular page, I want to load additional JavaScript in the enhanced experience, so I have this extra code, still inside <head>
:
<script type="text/javascript">
//<!--
enhance({
testName: "enhancedCourseSearch",
loadScripts: [ "/_assets/js/precedent/course-search.js" ]
});
//-->
</script>
I'm seeing this appended to the end of my document:
<a href="#" class="enhancedCourseSearch_toggleResult">View high-bandwidth version</a>
<a href="#" class="enhancedCourseSearch_toggleResult">View high-bandwidth version</a>
Setting testName
in the second call to enhance()
has resulted in both anchors having the same name.
AFAICT, the first anchor should have a class of enhanced_toggleResult
.
Bug?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.