New template that removes Bootstrap and jQuery from code snippet
This commit is contained in:
@@ -36,8 +36,19 @@
|
||||
var urlMode = window.location.href.match(/mode=([a-z0-9\-]+)\&?/i);
|
||||
var curMode = urlMode ? urlMode[1] : 'advanced';
|
||||
|
||||
var modeChangedMethod = function() {
|
||||
var newMode = this.value;
|
||||
for (var mode in possibleModes) {
|
||||
if (possibleModes.hasOwnProperty(mode)) {
|
||||
var option = document.createElement('option');
|
||||
var modeTxt = possibleModes[mode];
|
||||
option.value = mode;
|
||||
option.innerHTML = modeTxt;
|
||||
option.selected = curMode === mode;
|
||||
select.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
select.onchange = function(event) {
|
||||
var newMode = event.target.value;
|
||||
var search = window.location.search.substring(1);
|
||||
var baseUrl = window.location.href.split('?')[0];
|
||||
var chunks = search ? search.split('&') : [];
|
||||
@@ -61,18 +72,6 @@
|
||||
location.href = baseUrl + '?' + pairs.join('&');
|
||||
};
|
||||
|
||||
for (var mode in possibleModes) {
|
||||
if (possibleModes.hasOwnProperty(mode)) {
|
||||
var option = document.createElement('option');
|
||||
var modeTxt = possibleModes[mode];
|
||||
option.value = mode;
|
||||
option.innerHTML = modeTxt;
|
||||
option.selected = curMode === mode;
|
||||
select.appendChild(option);
|
||||
}
|
||||
}
|
||||
|
||||
$(select).change(modeChangedMethod);
|
||||
select.className = 'input-medium';
|
||||
|
||||
form.className = 'navbar-form pull-right';
|
||||
|
||||
Reference in New Issue
Block a user