[For 1.8] [1.8] AutoSave Draft
#21
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?
Reply
#22
(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?

i don´t tested...
but probably will work...

if you use Quick Advanced Editor you can put {$mybb->settings['quickadveditor_save_lang']}
Reply
#23
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.
Reply
#24
(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.

so use your method http://community.mybb.com/thread-156223-...pid1110466
Reply
#25
It is not working for me -> when I change codebutton template -> sceditor bar is not shown anymore
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#26
(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

code updated.
solved issue that work only with Quick advanced editor and not with plus
Reply
#27
how do i move this to the footer and not it seems where it is called?

i moved some JS to the bottom, so which JS does it depend on? it tells me its save but when i close the tab and start a new thread nothing is there
Reply
#28
ok i seem to have a slight problem....it works well if you start a new thread but

when its saves and you want a duplicate copy it inserts an older version as if from before you started a new thread

Does that make sense?

i dunno if thats a slight added bonus or not

ok, almost getting there,

BUT is it just me or have i lost the smilies panel?

One quick question:

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.

does the inline moderation still work? edit: well yes
Reply
#29
I had a problem with the restore button now showing up, so in case you have this very same problem, here's the fix:

Instead of

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');    

Put

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');    

I hope this helps someone!
Reply
#30
Hello,

In my codebuttons, i have this :
<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>
 

I use this plugin : http://community.mybb.com/mods.php?action=view&pid=28

But i don't work on my forum! Sad

Bye!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)