MyBB Community Forums

Full Version: [1.8] AutoSave Draft
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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?

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

if you use Quick Advanced Editor you can put {$mybb->settings['quickadveditor_save_lang']}
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-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
It is not working for me -> when I change codebutton template -> sceditor bar is not shown anymore
(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
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
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
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!
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!
Pages: 1 2 3 4