Closed (fixed)
Project:
BUEditor
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Nov 2008 at 17:42 UTC
Updated:
10 Mar 2010 at 13:40 UTC
I managed to make this code for loading a button with the smileys. It gets data via ajax from the smilyes module, but this means that is also slow.
I am looking for a way of caching that data or at least not loading it on each usage of the button...
js:
editor.dialog.open(editor.buttons[E.bindex][0], '')
$.get('/live/smileys', function(data){
html = data.replace('<div class="smileysWindowtext">Click to insert acronym. [<span class="smiley-class" id="closeSmileys">Close</span>]</div><div class="smileysWindow">', '<div id="dialogSmile" style="width:250px">');
editor.dialog.open(editor.buttons[E.bindex][0], html)
$('#dialogSmile').ready(function(){
$('img.smiley-class').click(function(){
editor.active.replaceSelection(this.alt);
editor.dialog.close();
})
})
})
Comments
Comment #1
websites-development.com commentedwith a little optimization:
Comment #2
websites-development.com commentedto get a loading icon:
instead of
put
Comment #3
websites-development.com commentedComment #4
Roulion commentedany port to 6.x version ?
Comment #5
gausarts commentedDoesn't seem to work. I tried both and got this:
BTW, where do you set that url
$.get('/live/smileys', function(data){Any hint to make it work with the latest stable?
Thanks
Comment #6
gausarts commentedThe solution was there all along, and have been there before but was forgotten. To others who may need it:
http://ufku.com/drupal/bueditor/contributions/smileys
Thanks
Oops! sorry to set it fixed. Now I can't cancel it :(
Comment #7
stevenpatz