/dev/qulogic/ckeditor: a698542ef257: Set up the default smileys.

Elliott Sales de Andrade qulogic at pidgin.im
Fri Aug 9 03:13:32 EDT 2013


Changeset: a698542ef25776023157802a26c975bccbd823a9
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2013-08-09 01:57 -0400
Branch:	 default
URL: https://hg.pidgin.im/dev/qulogic/ckeditor/rev/a698542ef257

Description:

Set up the default smileys.

diffstat:

 pidgin/ckeditor/config.js    |  56 ++++++++++++++++++++++++++++++++++++++++++++
 pidgin/gtkwebview.c          |   7 +++-
 pidgin/gtkwebvieweditor.html |   3 ++
 3 files changed, 64 insertions(+), 2 deletions(-)

diffs (101 lines):

diff --git a/pidgin/ckeditor/config.js b/pidgin/ckeditor/config.js
--- a/pidgin/ckeditor/config.js
+++ b/pidgin/ckeditor/config.js
@@ -39,5 +39,61 @@ CKEDITOR.editorConfig = function( config
 
 	// Default skin
 	config.skin = 'pidgin';
+
+	// Default smileys
+	config.smiley_images = [
+		'happy.png',
+		'excited.png',
+		'sad.png',
+		'wink.png',
+		'tongue.png',
+		'shocked.png',
+		'kiss.png',
+		'glasses-cool.png',
+		'embarrassed.png',
+		'crying.png',
+		'thinking.png',
+		'angel.png',
+		'shut-mouth.png',
+		'moneymouth.png',
+		'foot-in-mouth.png',
+		'shout.png'
+	];
+	config.smiley_descriptions = [
+		':)',
+		':-D',
+		':-(',
+		';-)',
+		':P',
+		'=-O',
+		':-*',
+		'8-)',
+		':-[',
+		':\'(',
+		':-/',
+		'O:-)',
+		':-X',
+		':-$',
+		':-!',
+		'>:o'
+/*
+		[':)', ':-)'],
+		[':-D', ':-d', ':D', ':d'],
+		[':-(', ':('],
+		[';-)', ';)'],
+		[':P', ':p', ':-P', ':-p'],
+		['=-O', '=-o'],
+		[':-*'],
+		['8-)'],
+		[':-['],
+		[':\'(', ':\'-('],
+		[':-/', ':-\\'],
+		['O:-)', 'o:-)'],
+		[':-X'],
+		[':-$'],
+		[':-!'],
+		['>:o', '>:O']
+*/
+	];
 };
 
diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -1447,14 +1447,17 @@ gtk_webview_new(gboolean editable)
 		char *ck;
 		char *tmp;
 #ifdef _WIN32
-	    ck = g_build_filename(DATADIR, "ckeditor", "ckeditor.js", NULL);
+		ck = g_build_filename(DATADIR, "ckeditor", "ckeditor.js", NULL);
 #else
-	    ck = g_build_filename(DATADIR, "pidgin", "ckeditor", "ckeditor.js", NULL);
+		ck = g_build_filename(DATADIR, "pidgin", "ckeditor", "ckeditor.js", NULL);
 #endif
 		tmp = g_strdup_printf(gtkwebvieweditor_html, ck);
 		gtk_webview_load_html_string(GTK_WEBVIEW(result), tmp);
 		g_free(tmp);
 		g_free(ck);
+
+		tmp = g_strdup_printf("setSmileyBasePath('file://%s/pixmaps/pidgin/emotes/default/');", DATADIR);
+		push_to_load_queue(GTK_WEBVIEW(webview), LOAD_JS, tmp);
 	}
 
 	priv = GTK_WEBVIEW_GET_PRIVATE(webview);
diff --git a/pidgin/gtkwebvieweditor.html b/pidgin/gtkwebvieweditor.html
--- a/pidgin/gtkwebvieweditor.html
+++ b/pidgin/gtkwebvieweditor.html
@@ -9,6 +9,9 @@
 			alert('resize:' + event.data.newHeight);
 		});
 	});
+	function setSmileyBasePath(path) {
+		CKEDITOR.instances.input.config.smiley_path = path;
+	}
 	</script>
 	<style>
 	body {margin: 0px; height:100%;}



More information about the Commits mailing list