-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nicer code, Better compression, Ability to call nbl.l() multiple times #3
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution. Could you please give me some more background, as the diff just replaces all code wholesale? |
First of all, I decided to change the NBL a bit (as in third commit), but i found the code unreadable (it was like a minfied or obfuscated code). It appears you had used short varialbe and function names to reduce the code size, but it can achieved by using a good minifier (like google clousre compiler). At first commit, I only changed variable names (to meaningful ones) and also i converted object like structrue of NBL to function. So NBL is now a function with local variables rather than an object with multiple properties. At second commit, i changed the NBL to be jslint compliant. There are some small changes like converting "a && b()" to "if (a){ b();}". Note that google closure converted it back to "a && b()" at compile time ;) The third commit, is my goal to change NBL. The problem is that multiple calls to "nbl.l(['myscript.js'])" will add "myscript.js" to <head> multiple times. I used NBL at a situation like this: document.getElementById('showCalendar').onclick = function(){
// Try to load calendar scripts files
nbl.l([ ['calendar_script.js'], function() {
// script is loaded
showCalendar();
}]);
}; I excpected that 'calendar_script.js' added to <head> once, but the new <script> is added with every call to nbl.l |
No description provided.