define("dojox/editor/plugins/_SmileyPalette", ["dojo", "dijit", "dojox", "dijit/_Widget", "dijit._PaletteMixin", "dojo/i18n", "i18n!dojox/editor/plugins/nls/Smiley"], function(dojo, dijit, dojox) {
dojo.experimental("dojox.editor.plugins._SmileyPalette");
dojo.declare("dojox.editor.plugins._SmileyPalette",
[dijit._Widget, dijit._Templated, dijit._PaletteMixin],
{
// summary:
// A keyboard accessible emoticon-picking widget (for inserting smiley characters)
// description:
// Grid showing various emoticons.
// Can be used standalone, or as a popup.
//
// example:
// |
//
// example:
// | var picker = new dojox.editor.plugins._SmileyPalette({ },srcNode);
// | picker.startup();
// The template of this widget.
templateString:
'
' cellSpacing=0 cellPadding=0>
',
baseClass: "dijitEditorSmileyPalette",
_palette: [
["smile", "laughing", "wink", "grin"],
["cool", "angry", "half", "eyebrow"],
["frown", "shy", "goofy", "oops"],
["tongue", "idea", "angel", "happy"],
["yes", "no", "crying", ""]
],
dyeClass: 'dojox.editor.plugins.Emoticon',
buildRendering: function(){
// Instantiate the template, which makes a skeleton into which we'll insert a bunch of
//
![]()
nodes
this.inherited(arguments);
var i18n = dojo.i18n.getLocalization("dojox.editor.plugins", "Smiley");
// Generate hash from emoticon standard name (like "smile") to translation
var emoticonI18n = {};
for(var name in i18n){
if(name.substr(0,8) == "emoticon"){
emoticonI18n[name.substr(8).toLowerCase()] = i18n[name];
}
}
this._preparePalette(
this._palette,
emoticonI18n
);