-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ae47da
commit a7b3012
Showing
13 changed files
with
527 additions
and
112 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.name{ | ||
color:#ddd; | ||
} | ||
.hide_me{ | ||
display: none; | ||
} | ||
|
||
.optgroup-header{ | ||
font-weight: bold; | ||
font-size: 0.7em; | ||
} | ||
|
||
.item_biosphere{ | ||
background-color: #EFFFF7; | ||
|
||
|
||
} | ||
.item_method{ | ||
background-color: aliceblue; | ||
display: block; | ||
} | ||
|
||
.item_intermediate{ | ||
background-color: #FEFFEF; | ||
} | ||
|
||
.item_input{ | ||
background-color: #FAEFFF; | ||
} | ||
.item_number{ | ||
background-color: #ddd | ||
} | ||
|
||
.item_global{ | ||
background-color: #FEF9F9; | ||
} | ||
|
||
.method_group{ | ||
display: block; | ||
font-size: 0.7em; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
function setUpSelectize(external_data, current_methods){ | ||
////console.log('Hello from setUpSelectize') | ||
console.log(external_data); | ||
|
||
// set up the operators in the options and optgroups | ||
var my_optgroups = [], | ||
my_options = [], | ||
optgroup_list = []; | ||
|
||
for(m in external_data){ | ||
this_method = external_data[m] | ||
//console.log(this_method) | ||
//console.log($.inArray(this_method[0], my_optgroups)) | ||
if ($.inArray(this_method[0], optgroup_list) == -1){ | ||
optgroup_list.push(this_method[0]) | ||
my_optgroups.push({label: this_method[0], value: this_method[0]}) | ||
} | ||
|
||
my_description = this_method.slice(1).join(", ") | ||
|
||
my_options.push({value: this_method , text: my_description, optgroup: this_method[0]}); | ||
} | ||
|
||
|
||
console.log(current_methods) | ||
|
||
|
||
$select = $('#settings_methods').selectize({ | ||
delimiter: ',', | ||
items: current_methods, | ||
options: my_options, | ||
optgroups: my_optgroups, | ||
optgroupField: 'optgroup', | ||
labelField: 'text', | ||
searchField: ['optgroup', 'text'], | ||
render: { | ||
optgroup_header: function(data, escape){ | ||
return '<div class="optgroup-header">' + escape(data.label) + '</div>'; | ||
}, | ||
option: custom_option, | ||
item: custom_item, | ||
|
||
}, | ||
|
||
})// end of selectize | ||
|
||
|
||
function custom_option(data, escape){ | ||
////console.log(data) | ||
$option = $("<div></div>"); | ||
$option.append(data.text) | ||
|
||
$option.append('<span class="grey pull-right">'+data.optgroup+'</span>') | ||
|
||
html = $option.prop('outerHTML'); | ||
|
||
////console.log(html) | ||
|
||
return html | ||
}//end of custom_option | ||
|
||
function custom_item(data, escape){ | ||
$item = $("<div></div>"); | ||
$item.append('<span class="grey method_group">' + data.value[0] + '</span> <span>' + data.text + '</span>') | ||
//console.log(data) | ||
|
||
$item.addClass("item_method") | ||
|
||
html = $item.prop('outerHTML'); | ||
|
||
//console.log(html) | ||
|
||
return html | ||
} | ||
|
||
|
||
|
||
}//end of setUpSelectize | ||
|
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
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
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
Oops, something went wrong.