This tutorial will show you how to have the emoticon sidebar in the editor open by default
As with any tutorials or modifications that require file edits, remember to back up the affected files!
Open ./public/js/ips.editor.js
Find: (around line 370-375)
// Set controls up
this.editor_set_controls();
Add below:
// Open the emoticon sidebar
this.show_emoticon_sidebar();
Find:
/* ------------------------------ */
/**
* Builds custom styles menu & toolbars
*/
Add above:
show_emoticon_sidebar: function()
{
// Get the emoticons
if( Object.isUndefined( inACP ) || inACP == false ){
var url = ipb.vars['base_url'];
} else {
// We don't want this in ACP
return;
}
url += "app=forums&module=ajax§ion=emoticons&editor_id=" + this.id;
new Ajax.Request( url.replace(/&/g, '&'),
{
method: 'get',
onSuccess: function(t)
{
// Add the sidebar
$('editor_' + this.id).addClassName('with_sidebar');
var div = $('editor_' + this.id).down('.sidebar');
div.update( this.values.get('templates')['emoticon_wrapper'].evaluate( { id: this.id } ) );
$( this.id + '_emoticon_holder').update( t.responseText );
div.show();
this.palettes[ 'emoticons' ].doClose();
}.bind(this)
});
},
Save and upload Wyświetl pełny artykuł