Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
20 changes: 10 additions & 10 deletions LAB.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
all_scripts = {},
reFilename = /.*\/([^\?\#]+)(?:\?.*)?(?:\#.*)?$/,
toString = Object.prototype.toString;
function scriptFilename(src) {

function scriptFilename(src) {
return (src && src.length) ? src.match(reFilename)[1].toLowerCase() : '';
}

function scriptTagExists(filename) {
var scripts = doc.getElementsByTagName('script'), i = 0, script;
while (script = scripts[i++]) {
Expand All @@ -28,18 +28,18 @@
}
return false;
}

function engine(queueExec,_which) {
queueExec = !!queueExec;
_which = (typeof _which === JSSTR) ? _which : HEAD;

var _ready = false,
_scripts_loading = false,
publicAPI,
_wait,
_scripts = {},
exec = [];

function handleScriptLoad(scriptentry) {
if ((this.readyState && this.readyState != 'complete' && this.readyState != 'loaded') || scriptentry.done) { return; }
this.onload = this.onreadystatechange = null; // prevent memory leak
Expand All @@ -64,7 +64,7 @@
delay(function(){
var __append = _append_to[__which] || doc.getElementsByTagName(__which)[0];
if (!__append && (count++ < 10)) {
return delay(arguments.callee,25);
return delay(arguments.callee,25);
}
var scriptElem = doc.createElement('script');
scriptElem.setAttribute('type', type || 'text/javascript');
Expand All @@ -75,15 +75,15 @@
},0);
})(_which);
}

function executeOrQueue(execBody,retObj) {
if (queueExec) {
exec.push(execBody);
return retObj;
}
else return execBody();
}

publicAPI = {
script:function() {
var args = arguments;
Expand Down Expand Up @@ -127,7 +127,7 @@
};
return publicAPI;
};

global.$LAB = function() {
return {
script:function(){
Expand Down