forked from GithubBackups/vichan
multi-line quotes & init no longer uses jQuery
This commit is contained in:
parent
5acdf16f5e
commit
a8312b5196
@ -333,21 +333,23 @@ function citeReply(id, with_link) {
|
|||||||
// ???
|
// ???
|
||||||
textarea.value += '>>' + id + '\n';
|
textarea.value += '>>' + id + '\n';
|
||||||
}
|
}
|
||||||
if (typeof $ != 'undefined') {
|
|
||||||
// multiline quotes
|
|
||||||
var select = sessionStorage.quoteClipboard;
|
|
||||||
if (select) {
|
|
||||||
select = select.split('\n');
|
|
||||||
$(select).each(function () {
|
|
||||||
if (this !== '')
|
|
||||||
var str = '>'+ this +'\n';
|
|
||||||
else
|
|
||||||
var str = '\n';
|
|
||||||
textarea.value += str;
|
|
||||||
});
|
|
||||||
delete sessionStorage.quoteClipboard;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// multiline quotes
|
||||||
|
var select = sessionStorage.quoteClipboard;
|
||||||
|
if (select) {
|
||||||
|
select = select.split('\n');
|
||||||
|
select.forEach(function (str) {
|
||||||
|
if (str !== '') {
|
||||||
|
str = '>' + str + '\n';
|
||||||
|
} else {
|
||||||
|
str = '\n';
|
||||||
|
}
|
||||||
|
textarea.value += str;
|
||||||
|
});
|
||||||
|
delete sessionStorage.quoteClipboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof $ != 'undefined') {
|
||||||
$(window).trigger('cite', [id, with_link]);
|
$(window).trigger('cite', [id, with_link]);
|
||||||
$(textarea).change();
|
$(textarea).change();
|
||||||
}
|
}
|
||||||
@ -408,12 +410,10 @@ var script_settings = function(script_name) {
|
|||||||
function init() {
|
function init() {
|
||||||
init_stylechooser();
|
init_stylechooser();
|
||||||
|
|
||||||
if (typeof $ != 'undefined') {
|
// store highlighted text for citeReply()
|
||||||
// store highlighted text for citeReply()
|
document.querySelector('form[name="postcontrols"]').addEventListener('mouseup', function (e) {
|
||||||
$('form[name="postcontrols"]').on('mouseup', function (e) {
|
sessionStorage.quoteClipboard = window.getSelection().toString();
|
||||||
sessionStorage.quoteClipboard = window.getSelection().toString();
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
{% if config.allow_delete %}
|
{% if config.allow_delete %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user