test-ui.js (lodash-3.0.0) | : | test-ui.js (lodash-4.0.0) | ||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
var toolbar = document.getElementById('qunit-testrunner-toolbar'); | var toolbar = document.getElementById('qunit-testrunner-toolbar'); | |||
if (!toolbar) { | if (!toolbar) { | |||
setTimeout(init, 15); | setTimeout(init, 15); | |||
return; | return; | |||
} | } | |||
toolbar.appendChild(span1); | toolbar.appendChild(span1); | |||
toolbar.appendChild(span2); | toolbar.appendChild(span2); | |||
buildList.selectedIndex = (function() { | buildList.selectedIndex = (function() { | |||
switch (build) { | switch (build) { | |||
case 'lodash-compat': return 1; | case 'lodash': return 1; | |||
case 'lodash-modern-dev': return 2; | case 'lodash-core-dev': return 2; | |||
case 'lodash-modern': return 3; | case 'lodash-core': return 3; | |||
case 'lodash-custom-dev': return 4; | case 'lodash-dev': | |||
case 'lodash-custom': return 5; | ||||
case 'lodash-compat-dev': | ||||
case null: return 0; | case null: return 0; | |||
} | } | |||
return -1; | return -1; | |||
}()); | }()); | |||
loaderList.selectedIndex = (function() { | loaderList.selectedIndex = (function() { | |||
switch (loader) { | switch (loader) { | |||
case 'curl': return 1; | case 'curl': return 1; | |||
case 'dojo': return 2; | case 'dojo': return 2; | |||
case 'requirejs': return 3; | case 'requirejs': return 3; | |||
skipping to change at line 98 | skipping to change at line 96 | |||
addListener(buildList, 'change', eventHandler); | addListener(buildList, 'change', eventHandler); | |||
addListener(loaderList, 'change', eventHandler); | addListener(loaderList, 'change', eventHandler); | |||
} | } | |||
var span1 = document.createElement('span'); | var span1 = document.createElement('span'); | |||
span1.style.cssText = 'float:right'; | span1.style.cssText = 'float:right'; | |||
span1.innerHTML = | span1.innerHTML = | |||
'<label for="qunit-build">Build: </label>' + | '<label for="qunit-build">Build: </label>' + | |||
'<select id="qunit-build">' + | '<select id="qunit-build">' + | |||
'<option value="lodash-compat-dev">lodash (compat development)</option>' + | '<option value="lodash-dev">lodash (development)</option>' + | |||
'<option value="lodash-compat">lodash (compat production)</option>' + | '<option value="lodash">lodash (production)</option>' + | |||
'<option value="lodash-modern-dev">lodash (modern development)</option>' + | '<option value="lodash-core-dev">lodash-core (development)</option>' + | |||
'<option value="lodash-modern">lodash (modern production)</option>' + | '<option value="lodash-core">lodash-core (production)</option>' + | |||
'<option value="lodash-custom-dev">lodash (custom development)</option>' + | ||||
'<option value="lodash-custom">lodash (custom production)</option>' + | ||||
'</select>'; | '</select>'; | |||
var span2 = document.createElement('span'); | var span2 = document.createElement('span'); | |||
span2.style.cssText = 'float:right'; | span2.style.cssText = 'float:right'; | |||
span2.innerHTML = | span2.innerHTML = | |||
'<label for="qunit-loader">Loader: </label>' + | '<label for="qunit-loader">Loader: </label>' + | |||
'<select id="qunit-loader">' + | '<select id="qunit-loader">' + | |||
'<option value="none">None</option>' + | '<option value="none">None</option>' + | |||
'<option value="curl">Curl</option>' + | '<option value="curl">Curl</option>' + | |||
'<option value="dojo">Dojo</option>' + | '<option value="dojo">Dojo</option>' + | |||
skipping to change at line 127 | skipping to change at line 123 | |||
var buildList = span1.lastChild, | var buildList = span1.lastChild, | |||
loaderList = span2.lastChild; | loaderList = span2.lastChild; | |||
setTimeout(function() { | setTimeout(function() { | |||
ui.timing.loadEventEnd = +new Date; | ui.timing.loadEventEnd = +new Date; | |||
}, 1); | }, 1); | |||
init(); | init(); | |||
}); | }); | |||
// Used to indicate testing a foreign file. | ||||
ui.isForeign = RegExp('^(\\w+:)?//').test(build); | ||||
// Used to indicate testing a modularized build. | ||||
ui.isModularize = /\b(?:amd|commonjs|es6?|node|npm|(index|main)\.js)\b/.test([ | ||||
location.pathname, location.search]); | ||||
// Used to indicate testing in Sauce Labs' automated test cloud. | ||||
ui.isSauceLabs = location.port == '9001'; | ||||
// Used to indicate that lodash is in strict mode. | ||||
ui.isStrict = /\bes6?\b/.test([location.pathname, location.search]); | ||||
// The lodash build file path. | // The lodash build file path. | |||
ui.buildPath = (function() { | ui.buildPath = (function() { | |||
var result; | var result; | |||
switch (build) { | switch (build) { | |||
case 'lodash-compat': result = 'lodash.compat.min.js'; break; | case 'lodash': result = 'dist/lodash.min.js'; break; | |||
case 'lodash-modern-dev': result = 'lodash.js'; break; | case 'lodash-core-dev': result = 'dist/lodash.core.js'; break; | |||
case 'lodash-modern': result = 'lodash.min.js'; break; | case 'lodash-core': result = 'dist/lodash.core.min.js'; break; | |||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break; | case null: build = 'lodash-dev'; | |||
case 'lodash-custom': result = 'lodash.custom.min.js'; break; | case 'lodash-dev': result = 'lodash.js'; break; | |||
case null: build = 'lodash-compat-dev'; | ||||
case 'lodash-compat-dev': result = 'lodash.src.js'; break; | ||||
default: return build; | default: return build; | |||
} | } | |||
return basePath + result; | return basePath + result; | |||
}()); | }()); | |||
// The module loader file path. | // The module loader file path. | |||
ui.loaderPath = (function() { | ui.loaderPath = (function() { | |||
var result; | var result; | |||
switch (loader) { | switch (loader) { | |||
case 'curl': result = 'node_modules/curl-amd/dist/curl-kitchen-sink/c url.js'; break; | case 'curl': result = 'node_modules/curl-amd/dist/curl-kitchen-sink/c url.js'; break; | |||
case 'dojo': result = 'node_modules/dojo/dojo.js'; break; | case 'dojo': result = 'node_modules/dojo/dojo.js'; break; | |||
case 'requirejs': result = 'node_modules/requirejs/require.js'; break; | case 'requirejs': result = 'node_modules/requirejs/require.js'; break; | |||
case null: loader = 'none'; return ''; | case null: loader = 'none'; return ''; | |||
default: return loader; | default: return loader; | |||
} | } | |||
return basePath + result; | return basePath + result; | |||
}()); | }()); | |||
// Used to indicate testing a core build. | ||||
ui.isCore = /\bcore(\.min)?\.js\b/.test(ui.buildPath); | ||||
// Used to indicate testing a foreign file. | ||||
ui.isForeign = RegExp('^(\\w+:)?//').test(build); | ||||
// Used to indicate testing a modularized build. | ||||
ui.isModularize = /\b(?:amd|commonjs|es6?|node|npm|(index|main)\.js)\b/.test([ | ||||
location.pathname, location.search]); | ||||
// Used to indicate testing in Sauce Labs' automated test cloud. | ||||
ui.isSauceLabs = location.port == '9001'; | ||||
// Used to indicate that lodash is in strict mode. | ||||
ui.isStrict = /\bes6?\b/.test([location.pathname, location.search]); | ||||
ui.urlParams = { 'build': build, 'loader': loader }; | ui.urlParams = { 'build': build, 'loader': loader }; | |||
ui.timing = { 'loadEventEnd': 0 }; | ui.timing = { 'loadEventEnd': 0 }; | |||
window.ui = ui; | window.ui = ui; | |||
}(this)); | }(this)); | |||
End of changes. 5 change blocks. | ||||
32 lines changed or deleted | 29 lines changed or added |