webkitinit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for controlling YUI lazy loading caching | |
var moduleRevision = 1; | |
var configObj = { | |
modules: { | |
'webkit': { | |
fullpath: '/nm_webkit/libs/webkit.js?wk=' + moduleRevision | |
}, | |
'prototype': { | |
fullpath: 'https://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js?wk=' + moduleRevision | |
}, | |
'scriptaculous': { | |
fullpath: 'https://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/effects.js?wk=' + moduleRevision | |
}, | |
'modalbox': { | |
requires: ['modalboxcss'], | |
fullpath: '/nm_webkit/libs/modalbox/modalbox.js?wk=' + moduleRevision | |
}, | |
'modalboxcss': { | |
fullpath: '/nm_webkit/libs/modalbox/modalbox.css?wk=' + moduleRevision, | |
type: 'css' | |
}, | |
'storenew_css': { | |
fullpath: '/nm_webkit/CSS/store_defaultsnew.css?wk=' + moduleRevision, | |
type: 'css' | |
}, | |
'storenew': { | |
fullpath: '/nm_webkit/libs/storenew.js?wk=' + moduleRevision, | |
requires: ['storenew_css'] | |
}, | |
'jplayer': { | |
fullpath: '/nm_webkit/libs/jplayer/jquery.jplayer.min.js?wk=' + moduleRevision, | |
requires: ['jquery', 'soundclips-mobile'] | |
}, | |
'jquery': { | |
fullpath: 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js?wk=' + moduleRevision | |
}, | |
'soundclips-mobile': { | |
fullpath: ('/nm_webkit/libs/soundclips.js?wk=' + moduleRevision) | |
}, | |
'lightwindow': { | |
requires: ['lightwindowcss'], | |
fullpath: ('/nm_webkit/libs/lightwindow/javascript/lightwindow.js?wk=' + moduleRevision) | |
}, | |
'lightwindowcss': { | |
fullpath: ('/nm_webkit/libs/lightwindow/css/lightwindow.css?wk=' + moduleRevision), | |
type: 'css' | |
}, | |
'localjs': { | |
fullpath: '/js/main.js?wk=' + moduleRevision | |
} | |
} | |
} | |
YUI().use('event-custom', 'node', function(Y) { | |
// subscribe to webkit init event | |
Y.Global.on('webkitevent:init', function() { | |
Y.log('webkit inited'); | |
YUI(configObj).use('localjs', function() { | |
// all stuff that requires the DOM to be loaded should be invoked locally | |
Y.log('localjs loaded'); | |
webkit.localjsloaded = true; | |
webkit.customevent.fire('localjs:init'); | |
}); | |
}); | |
configObj.loadModules = ['prototype', 'scriptaculous', 'webkit', 'modalbox']; | |
var depends = document.getElementsByName('nmdepend'); | |
for (i=0; i < depends.length; i++) { | |
Y.log('add ' + depends[i].content + ' to webkit core'); | |
configObj.loadModules.push(depends[i].content); | |
} | |
YUI.use.apply(YUI(configObj), configObj.loadModules, function(Y) { | |
Y.log('webkit core loaded'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment