perf-ui.js (lodash-3.0.0) | : | perf-ui.js (lodash-4.0.0) | ||
---|---|---|---|---|
skipping to change at line 61 | skipping to change at line 61 | |||
(search ? search + '&' : '') + | (search ? search + '&' : '') + | |||
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' + | 'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' + | |||
'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value); | 'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value); | |||
} | } | |||
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="perf-build">Build: </label>' + | '<label for="perf-build">Build: </label>' + | |||
'<select id="perf-build">' + | '<select id="perf-build">' + | |||
'<option value="lodash-compat">lodash (compat)</option>' + | '<option value="lodash">lodash</option>' + | |||
'<option value="lodash-modern">lodash (modern)</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="perf-other">Other Library: </label>' + | '<label for="perf-other">Other Library: </label>' + | |||
'<select id="perf-other">' + | '<select id="perf-other">' + | |||
'<option value="underscore-dev">Underscore (development)</option>' + | '<option value="underscore-dev">Underscore (development)</option>' + | |||
'<option value="underscore">Underscore (production)</option>' + | '<option value="underscore">Underscore (production)</option>' + | |||
'<option value="lodash-compat">lodash (compat)</option>' + | '<option value="lodash">lodash</option>' + | |||
'<option value="lodash-modern">lodash (modern)</option>' + | ||||
'<option value="lodash-custom-dev">lodash (custom development)</option>' + | ||||
'<option value="lodash-custom">lodash (custom production)</option>' + | ||||
'</select>'; | '</select>'; | |||
var buildList = span1.lastChild, | var buildList = span1.lastChild, | |||
otherList = span2.lastChild, | otherList = span2.lastChild, | |||
toolbar = document.getElementById('perf-toolbar'); | toolbar = document.getElementById('perf-toolbar'); | |||
toolbar.appendChild(span2); | toolbar.appendChild(span2); | |||
toolbar.appendChild(span1); | toolbar.appendChild(span1); | |||
buildList.selectedIndex = (function() { | buildList.selectedIndex = (function() { | |||
switch (build) { | switch (build) { | |||
case 'lodash-compat': return 0; | case 'lodash': | |||
case 'lodash-custom-dev': return 2; | case null: return 0; | |||
case 'lodash-custom': return 3; | ||||
case 'lodash-modern': | ||||
case null: return 1; | ||||
} | } | |||
return -1; | return -1; | |||
}()); | }()); | |||
otherList.selectedIndex = (function() { | otherList.selectedIndex = (function() { | |||
switch (other) { | switch (other) { | |||
case 'underscore-dev': return 0; | case 'underscore-dev': return 0; | |||
case 'lodash-compat': return 2; | case 'lodash': return 2; | |||
case 'lodash-modern': return 3; | ||||
case 'lodash-custom-dev': return 4; | ||||
case 'lodash-custom': return 5; | ||||
case 'underscore': | case 'underscore': | |||
case null: return 1; | case null: return 1; | |||
} | } | |||
return -1; | return -1; | |||
}()); | }()); | |||
addListener(buildList, 'change', eventHandler); | addListener(buildList, 'change', eventHandler); | |||
addListener(otherList, 'change', eventHandler); | addListener(otherList, 'change', eventHandler); | |||
}); | }); | |||
// 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 null: build = 'lodash'; | |||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break; | case 'lodash': result = 'dist/lodash.min.js'; break; | |||
case 'lodash-custom': result = 'lodash.custom.min.js'; break; | ||||
case null: build = 'lodash-modern'; | ||||
case 'lodash-modern': result = 'lodash.min.js'; break; | ||||
default: return build; | default: return build; | |||
} | } | |||
return basePath + result; | return basePath + result; | |||
}()); | }()); | |||
// The other library file path. | // The other library file path. | |||
ui.otherPath = (function() { | ui.otherPath = (function() { | |||
var result; | var result; | |||
switch (other) { | switch (other) { | |||
case 'lodash-compat': result = 'lodash.compat.min.js'; break; | case 'lodash': result = 'dist/lodash.min.js'; break; | |||
case 'lodash-modern': result = 'lodash.min.js'; break; | ||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break; | ||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break; | ||||
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; brea k; | case 'underscore-dev': result = 'vendor/underscore/underscore.js'; brea k; | |||
case null: other = 'underscore'; | case null: other = 'underscore'; | |||
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break; | case 'underscore': result = 'vendor/underscore/underscore-min.js'; break; | |||
default: return other; | default: return other; | |||
} | } | |||
return basePath + result; | return basePath + result; | |||
}()); | }()); | |||
ui.urlParams = { 'build': build, 'other': other }; | ui.urlParams = { 'build': build, 'other': other }; | |||
End of changes. 6 change blocks. | ||||
26 lines changed or deleted | 8 lines changed or added |