Skip to content

Commit

Permalink
code improve
Browse files Browse the repository at this point in the history
  • Loading branch information
martec committed Aug 30, 2014
1 parent cedb56b commit 20e6e63
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions inc/plugins/quickadveditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function quickadveditor_info ()
"website" => "",
"author" => "martec",
"authorsite" => "",
"version" => "3.3.2",
"version" => "4.0.0",
"guid" => "",
"compatibility" => "17*,18*"
);
Expand Down Expand Up @@ -136,46 +136,42 @@ function quickadveditor_activate()
});
}
(\$.fn.on || \$.fn.live).call(\$(document), \'focus\', \'#message\', function () {
function call_editor() {
if (typeof sceditor == \'undefined\') {
\$(this).sceditor(opt_editor);
\$(\'#message\').sceditor(opt_editor);
if(\$(\'#clickable_smilies\').length) {
\$(\'#clickable_smilies\').closest(\'div\').show();
}
MyBBEditor = \$(this).sceditor(\'instance\');
setTimeout(function() {
if (MyBBEditor) {
MyBBEditor.focus();
}
offset = \$(\'#message\').next().offset().top - 60;
setTimeout(function() {
\$(\'html, body\').animate({
scrollTop: offset
}, 700);
},200);
},100);
MyBBEditor = \$(\'#message\').sceditor(\'instance\');
{\$sourcemode}
}
}
function focus_editor() {
setTimeout(function() {
if (MyBBEditor) {
MyBBEditor.focus();
}
offset = \$(\'#message\').next().offset().top - 60;
setTimeout(function() {
\$(\'html, body\').animate({
scrollTop: offset
}, 700);
},200);
},100);
}
(\$.fn.on || \$.fn.live).call(\$(document), \'focus\', \'#message\', function () {
call_editor();
focus_editor();
});
(\$.fn.on || \$.fn.live).call(\$(document), \'click\', \'a[id*=\"multiquote_link_\"]\', function () {
if (typeof sceditor == \'undefined\') {
\$(\'#message\').sceditor(opt_editor);
if(\$(\'#clickable_smilies\').length) {
\$(\'#clickable_smilies\').closest(\'div\').show();
}
MyBBEditor = \$(\'#message\').sceditor(\'instance\');
{\$sourcemode}
}
call_editor();
});
if(Cookie.get(\'multiquote\')) {
\$(\'#message\').sceditor(opt_editor);
if(\$(\'#clickable_smilies\').length) {
\$(\'#clickable_smilies\').closest(\'div\').show();
}
MyBBEditor = \$(\'#message\').sceditor(\'instance\');
{\$sourcemode}
call_editor();
};
/**********************************
Expand Down Expand Up @@ -218,7 +214,7 @@ function quickadveditor_activate()
'#' . preg_quote('<body>') . '#i',
'<body>
{$codebutquickedt}'
);
);
}

function quickadveditor_deactivate()
Expand All @@ -245,7 +241,7 @@ function quickadveditor_deactivate()
'#' . preg_quote('<body>
{$codebutquickedt}') . '#i',
'<body>'
);
);
}

function mycode_inserter_quick($smilies = true)
Expand Down Expand Up @@ -488,7 +484,7 @@ function codebuttonsquick () {
}
if($mybb->settings['quickreply'] == 0) {
$codebutquickedt = mycode_inserter_quick();
}
}
}

?>

0 comments on commit 20e6e63

Please sign in to comment.