Quantcast
Channel: MyBB Community Forums - Tutorials
Viewing all articles
Browse latest Browse all 690

[1.8] AutoSave Draft (sisyphus)

$
0
0
Ps. Not work with quick reply (only will work with quick reply if you use sceditor in quick reply http://community.mybb.com/thread-155797.html )

1 - Download sisyphus http://github.com/simsalabim/sisyphus/zipball/master (http://sisyphus-js.herokuapp.com/ )

2 - Extract and upload sisyphus.min.js in root/jscripts

3 - In codebuttons template

3.1 - Find:

Code:
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/editor_themes/{$theme['editortheme']}" type="text/css" media="all" />

3.1.1 - Add below:

Code:
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sisyphus.min.js"></script>

3.2 - Find:

Code:
});
</script>

3.2.1 - Replace:

Code:
});

$('form[name*="input"]').sisyphus({
    timeout: 1,
    locationBased: true,
    onSave: function() {
        MyBBEditor.updateOriginal();
    },
    onRelase: function() {
        $("#{$bind}").val('');
    }
});
</script>

If you use Sceditor in quick reply (http://community.mybb.com/thread-155797.html )

In step 3.2:

Find:

Code:
};
</script>

Replace:

Code:
};

$('form[name*="quick_reply_form"], form[name*="input"]').sisyphus({
    timeout: 1,
    locationBased: true,
    onSave: function() {
        MyBBEditor.updateOriginal();
    },
    onRelase: function() {
        $("#{$bind}").val('');
    }
});
</script>

Viewing all articles
Browse latest Browse all 690

Trending Articles