Browse Source

bugfix and work with other stylesheets

pull/40/head
Michael Foster 11 years ago
parent
commit
41a3f9be25
  1. 31
      js/quick-reply.js
  2. 5
      templates/main.js

31
js/quick-reply.js

@ -11,19 +11,21 @@
*
*/
var show_quick_reply = function(){
if($('div.banner').length == 0)
return;
if($('#quick-reply').length != 0)
return;
$('<style type="text/css">\
var do_css = function() {
$('#quick-reply-css').remove();
// Find background of reply posts
var dummy_reply = $('<div class="post reply"></div>').appendTo($('body'));
var reply_background = dummy_reply.css('background');
dummy_reply.remove();
$('<style type="text/css" id="quick-reply-css">\
#quick-reply {\
position: fixed;\
right: 0;\
top: 5%;\
float: right;\
background: #D6DAF0;\
background: ' + reply_background + ';\
display: block;\
padding: 0 0 0 0;\
width: 350px;\
@ -84,6 +86,17 @@ var show_quick_reply = function(){
}\
</style>').appendTo($('head'));
console.log('h');
};
var show_quick_reply = function(){
if($('div.banner').length == 0)
return;
if($('#quick-reply').length != 0)
return;
do_css();
var $postForm = $('form[name="post"]').clone();
$postForm.clone();
@ -193,7 +206,7 @@ var show_quick_reply = function(){
$postForm.fadeOut(100);
else
$postForm.fadeIn(100);
});
}).on('stylesheet', do_css);
};
$(window).on('cite', function(e, id, with_link) {

5
templates/main.js

@ -67,6 +67,9 @@ function changeStyle(styleName, link) {
if (link) {
link.className = 'selected';
}
if (typeof $ != 'undefined')
$(window).trigger('stylesheet', styleName);
}
@ -198,7 +201,7 @@ function citeReply(id, with_link) {
// ???
body.value += '>>' + id + '\n';
}
if ($) {
if (typeof $ != 'undefined') {
$(window).trigger('cite', [id, with_link]);
$(body).change();
}

Loading…
Cancel
Save