2014-10-14, 08:48 PM
Can I replace the 'Auto Save: Message Saved.' with a variable like {$lang->msg_saved} and then have it in different languages adding them to the various global.lang. Is this correct?
(2014-10-14, 08:48 PM)TBO29 Wrote: [ -> ]Can I replace the 'Auto Save: Message Saved.' with a variable like {$lang->msg_saved} and then have it in different languages adding them to the various global.lang. Is this correct?
(2014-10-17, 12:47 AM)TBO29 Wrote: [ -> ]Does not work.
I use {$mybb->settings['quickadveditor_save_lang']} and {$mybb->settings[\'quickadveditor_restor_lang']}. Placed the translated files config_quickadveditor.lang.php in the different admin language folders. Then when the user select a different language from the lower selection switch I still get the original language. Also changing the language of the ACP does not change the language.
I believe that is because your plugin inserts the values from the installation language into the db and then reads it's values, therefore changing language with the selector does not change the save and restore button text.
(2014-12-24, 08:14 PM)Eldenroot Wrote: [ -> ]It is not working for me -> when I change codebutton template -> sceditor bar is not shown anymore
Quote:Sorry, but you did not select any threads to perform inline moderation on, or your previous moderation session has expired (Automatically after 1 hour of inactivity). Please select some threads and try again.
var restorebut = [
'<a class="sceditor-button" title="Restore" onclick="MyBBEditor.insert(restitem);">',
'<div style="background-image: url(images/rest.png); opacity: 1; cursor: pointer;">Restore</div>',
'</a>'
];
$(restorebut.join('')).appendTo('.sceditor-group:last');
var restorebut = "<a class=\"sceditor-button\" title=\"Restore\" onclick=\"MyBBEditor.insert(restitem);\"><div style=\"background-image: url(images/rest.png); opacity: 1; cursor: pointer;\">Restore</div></a>";
$(restorebut).appendTo('.sceditor-group:last');
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/editor_themes/{$theme['editortheme']}" type="text/css" media="all" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/jquery.sceditor.bbcode.min.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/bbcodes_sceditor.js"></script>
<script type="text/javascript">
var partialmode = {$mybb->settings['partialmode']},
opt_editor = {
plugins: "bbcode",
style: "{$mybb->asset_url}/jscripts/sceditor/textarea_styles/jquery.sceditor.{$theme['editortheme']}",
rtl: {$lang->settings['rtl']},
locale: "mybblang",
enablePasteFiltering: true,
emoticonsEnabled: {$emoticons_enabled},
emoticons: {
// Emoticons to be included in the dropdown
dropdown: {
{$dropdownsmilies}
},
// Emoticons to be included in the more section
more: {
{$moresmilies}
},
// Emoticons that are not shown in the dropdown but will still be converted. Can be used for things like aliases
hidden: {
{$hiddensmilies}
}
},
emoticonsCompat: true,
toolbar: "{$basic1}{$align}{$font}{$size}{$color}{$removeformat}{$basic2}image,{$email}{$link}|video{$emoticon}|{$list}{$code}quote|maximize,source",
};
{$editor_language}
$(function() {
$("#{$bind}").sceditor(opt_editor);
MyBBEditor = $("#{$bind}").sceditor("instance");
{$sourcemode}
});
function qae_as() {
if (MyBBEditor) {
sc_asd = JSON.parse(localStorage.getItem('sc_as'));
link_can = location.href;
if (!sc_asd) {
sc_asd = {};
}
if (MyBBEditor.val() != sc_asd[link_can]) {
if ($.trim(MyBBEditor.val())) {
if(!$('#autosave').length) {
$('<div/>', { id: 'autosave', class: 'bottom-right' }).appendTo('body');
}
setTimeout(function() {
$('#autosave').jGrowl('Auto Save: Message Saved.', { life: 500 });
},200);
sc_asd[link_can] = MyBBEditor.val();
localStorage.setItem('sc_as', JSON.stringify(sc_asd));
}
else {
if (sc_asd[link_can]) {
delete sc_asd[link_can];
localStorage.setItem('sc_as', JSON.stringify(sc_asd));
}
}
}
}
}
function qae_ac() {
sc_asd = JSON.parse(localStorage.getItem('sc_as'));
link_can = location.href;
if (!sc_asd) {
sc_asd = {};
}
if (sc_asd[link_can]) {
delete sc_asd[link_can];
localStorage.setItem('sc_as', JSON.stringify(sc_asd));
}
}
function qae_ar() {
sc_asd = JSON.parse(localStorage.getItem('sc_as'));
if (!sc_asd) {
sc_asd = {};
}
if(Object.keys(sc_asd).length > 20) {
delete sc_asd[Object.keys(sc_asd)[0]];
localStorage.setItem('sc_as', JSON.stringify(sc_asd));
}
}
($.fn.on || $.fn.live).call($(document), 'click', 'input[name*="submit"]', function () {
qae_ac();
});
$(document).ready(function(){
setInterval(function() {
qae_as();
qae_ar();
},15000);
setTimeout(function() {
sc_asd = JSON.parse(localStorage.getItem('sc_as'));
link_can = location.href;
restitem = "";
if (sc_asd) {
restitem = sc_asd[link_can];
}
if (restitem) {
var restorebut = [
'<a class="sceditor-button" title="Restore" onclick="MyBBEditor.insert(restitem);">',
'<div style="background-image: url(images/rest.png); opacity: 1; cursor: pointer;">Restore</div>',
'</a>'
];
$(restorebut.join('')).appendTo('.sceditor-group:last');
}
},600);
MyBBEditor.blur(function(e) {
if ($.trim(MyBBEditor.val())) {
qae_as();
}
else {
qae_ac();
}
});
});
</script>