gecko/browser/base/content/tabcandy/app/switch.js
Ian Gilman dac099a53e + Put Natural Docs (http://www.naturaldocs.org/) -friendly comments in items.js
+ Added a doc folder that contains generated documentation
+ Now pointing to the doc folder from the Tab Candy home page
+ The Tab Candy home page is now accessible from the Candy drop-down
2010-04-08 16:36:11 -07:00

41 lines
1.1 KiB
JavaScript

(function(){
window.Switch = {
insert: function(selector, style) {
var chunks = window.location.toString().split('/');
var myName = chunks[chunks.length - 2];
var html = '<div style="font-size: 11px; margin: 5px 0px 0px 5px;'
+ style
+ '">Candy: <select id="visualization-select">';
var names = Utils.getVisualizationNames();
var count = names.length;
var a;
for(a = 0; a < count; a++) {
var name = names[a];
html += '<option value="'
+ name
+ '"'
+ (name == myName ? ' selected="true"' : '')
+ '>'
+ name
+ '</option>';
}
html += '<option disabled="disabled">----------</option>';
html += '<option value="">Home</option>';
html += '</select>';
$(selector).prepend(html);
$('#visualization-select').change(function () {
var name = $(this).val();
if(name)
location.href = '../' + name + '/index.html';
else
location.href = '../../index.html';
});
}
};
})();