forked from leftypol/leftypol
Merged lainchan with vichan master at 25/9/2016 0bd63149b7
@czaks czaks committed on GitHub 2 days ago
This commit is contained in:
commit
c58e37ce39
114 changed files with 5580 additions and 898 deletions
|
@ -70,26 +70,40 @@ var datelocale =
|
|||
};
|
||||
|
||||
|
||||
function alert(a) {
|
||||
var handler, div;
|
||||
var close = function() {
|
||||
handler.fadeOut(400, function() { handler.remove(); });
|
||||
return false;
|
||||
};
|
||||
function alert(a, do_confirm, confirm_ok_action, confirm_cancel_action) {
|
||||
var handler, div, bg, closebtn, okbtn;
|
||||
var close = function() {
|
||||
handler.fadeOut(400, function() { handler.remove(); });
|
||||
return false;
|
||||
};
|
||||
|
||||
handler = $("<div id='alert_handler'></div>").hide().appendTo('body');
|
||||
handler = $("<div id='alert_handler'></div>").hide().appendTo('body');
|
||||
|
||||
$("<div id='alert_background'></div>").click(close).appendTo(handler);
|
||||
bg = $("<div id='alert_background'></div>").appendTo(handler);
|
||||
|
||||
div = $("<div id='alert_div'></div>").appendTo(handler);
|
||||
$("<a id='alert_close' href='javascript:void(0)'><i class='fa fa-times'></i></div>")
|
||||
.click(close).appendTo(div);
|
||||
div = $("<div id='alert_div'></div>").appendTo(handler);
|
||||
closebtn = $("<a id='alert_close' href='javascript:void(0)'><i class='fa fa-times'></i></div>")
|
||||
.appendTo(div);
|
||||
|
||||
$("<div id='alert_message'></div>").html(a).appendTo(div);
|
||||
$("<div id='alert_message'></div>").html(a).appendTo(div);
|
||||
|
||||
$("<button class='button alert_button'>"+_("OK")+"</button>").click(close).appendTo(div);
|
||||
okbtn = $("<button class='button alert_button'>"+_("OK")+"</button>").appendTo(div);
|
||||
|
||||
handler.fadeIn(400);
|
||||
if (do_confirm) {
|
||||
confirm_ok_action = (typeof confirm_ok_action !== "function") ? function(){} : confirm_ok_action;
|
||||
confirm_cancel_action = (typeof confirm_cancel_action !== "function") ? function(){} : confirm_cancel_action;
|
||||
okbtn.click(confirm_ok_action);
|
||||
$("<button class='button alert_button'>"+_("Cancel")+"</button>").click(confirm_cancel_action).click(close).appendTo(div);
|
||||
bg.click(confirm_cancel_action);
|
||||
okbtn.click(confirm_cancel_action);
|
||||
closebtn.click(confirm_cancel_action);
|
||||
}
|
||||
|
||||
bg.click(close);
|
||||
okbtn.click(close);
|
||||
closebtn.click(close);
|
||||
|
||||
handler.fadeIn(400);
|
||||
}
|
||||
|
||||
var saved = {};
|
||||
|
@ -106,7 +120,10 @@ var codestyles = {
|
|||
{% for stylesheet in code_stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}',
|
||||
{% endraw %}{% endfor %}{% raw %}
|
||||
};
|
||||
var board_name = false;
|
||||
|
||||
if (typeof board_name === 'undefined') {
|
||||
var board_name = false;
|
||||
}
|
||||
|
||||
function changeStyle(styleName, link) {
|
||||
{% endraw %}
|
||||
|
@ -163,13 +180,7 @@ function changeStyle(styleName, link) {
|
|||
|
||||
{% endraw %}
|
||||
{% if config.stylesheets_board %}
|
||||
{# This is such an unacceptable mess. There needs to be an easier way. #}
|
||||
{# Needs fix for slugify #}
|
||||
var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }})/);
|
||||
{% raw %}
|
||||
if (matches) {
|
||||
board_name = matches[1];
|
||||
}
|
||||
|
||||
if (!localStorage.board_stylesheets) {
|
||||
localStorage.board_stylesheets = '{}';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue