forked from leftypol/leftypol
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: stylesheets/dark.css stylesheets/futaba+vichan.css stylesheets/miku.css stylesheets/stripes.css stylesheets/testorange.css stylesheets/wasabi.css
This commit is contained in:
commit
1ed45ebe9e
153 changed files with 6616 additions and 2399 deletions
44
js/style-select.js
Normal file
44
js/style-select.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* style-select.js
|
||||
* https://github.com/savetheinternet/Tinyboard/blob/master/js/style-select.js
|
||||
*
|
||||
* Changes the stylesheet chooser links to a <select>
|
||||
*
|
||||
* Released under the MIT license
|
||||
* Copyright (c) 2013 Michael Save <savetheinternet@tinyboard.org>
|
||||
*
|
||||
* Usage:
|
||||
* $config['additional_javascript'][] = 'js/jquery.min.js';
|
||||
* $config['additional_javascript'][] = 'js/style-select.js';
|
||||
*
|
||||
*/
|
||||
|
||||
onready(function(){
|
||||
var stylesDiv = $('div.styles');
|
||||
var stylesSelect = $('<select></select>');
|
||||
|
||||
var i = 1;
|
||||
stylesDiv.children().each(function() {
|
||||
var opt = $('<option></option>')
|
||||
.text(this.innerText.replace(/(^\[|\]$)/g, ''))
|
||||
.val(i);
|
||||
if ($(this).hasClass('selected'))
|
||||
opt.attr('selected', true);
|
||||
stylesSelect.append(opt);
|
||||
$(this).attr('id', 'style-select-' + i);
|
||||
i++;
|
||||
});
|
||||
|
||||
stylesSelect.change(function() {
|
||||
$('#style-select-' + $(this).val()).click();
|
||||
});
|
||||
|
||||
stylesDiv.hide();
|
||||
|
||||
stylesDiv.after(
|
||||
$('<div style="float:right;margin-bottom:10px"></div>')
|
||||
.text(_('Style: '))
|
||||
.append(stylesSelect)
|
||||
);
|
||||
});
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue