1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2<!--
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5 *
6 * == BEGIN LICENSE ==
7 *
8 * Licensed under the terms of any of the following licenses at your
9 * choice:
10 *
11 *  - GNU General Public License Version 2 or later (the "GPL")
12 *    http://www.gnu.org/licenses/gpl.html
13 *
14 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 *    http://www.gnu.org/licenses/lgpl.html
16 *
17 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18 *    http://www.mozilla.org/MPL/MPL-1.1.html
19 *
20 * == END LICENSE ==
21 *
22 * Smileys (emoticons) dialog window.
23-->
24<html xmlns="http://www.w3.org/1999/xhtml">
25<head>
26	<title></title>
27	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
28	<meta name="robots" content="noindex, nofollow" />
29	<style type="text/css">
30		.Hand
31		{
32			cursor: pointer;
33			cursor: hand;
34		}
35        a.InfWin
36        {
37          color: gray;
38          text-decoration:none;
39          font-size: 9pt;
40        }
41
42	</style>
43	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
44	<script type="text/javascript">
45
46var dialog	= window.parent ;
47var oEditor = dialog.InnerDialogLoaded() ;
48var FCKLang		= oEditor.FCKLang ;
49window.onload = function ()
50{
51	// First of all, translate the dialog box texts
52	oEditor.FCKLanguageManager.TranslatePage(document) ;
53
54       dialog.SetAutoSize( true ) ;
55    //  dialog.SetOkButton( true )
56}
57
58function Ok() {
59  return true;
60}
61function InsertSmiley( url )
62{
63	oEditor.FCKUndo.SaveUndoStep() ;
64
65	var oImg = oEditor.FCK.InsertElement( 'img' ) ;
66	oImg.src = url ;
67	oImg.setAttribute( '_fcksavedurl', url ) ;
68
69	// For long smileys list, it seams that IE continues loading the images in
70	// the background when you quickly select one image. so, let's clear
71	// everything before closing.
72	document.body.innerHTML = '' ;
73
74	dialog.Cancel() ;
75}
76
77function InsertDokuSmiley(code) {
78  code += ' ';
79  oEditor.FCK.InsertHtml(code) ;
80  // FCKConfig.insertedDokuSmiley = true;
81	dialog.Cancel() ;
82}
83
84function over(td)
85{
86	td.className = 'LightBackground Hand' ;
87}
88
89function out(td)
90{
91	td.className = 'DarkBackground Hand' ;
92}
93
94var smileyInfWinOpen=false;
95function show_SmileyInfo() {
96  var inf = document.getElementById('smiley_info_window');
97  if(!smileyInfWinOpen) {
98     inf.style.display='block';
99  }
100  else {
101  inf.style.display='inline';
102      inf.style.display='none';
103  }
104  smileyInfWinOpen=!smileyInfWinOpen;
105}
106	</script>
107</head>
108<body style="overflow: auto">
109<a href="javascript:show_SmileyInfo();void 0;" class="InfWin"><b>info</b></a>
110<div id="smiley_info_window" style="display:none;">
111<span fckLang="SmileysDlgInfo" style="font-size: 9pt;">FCKeditor smileys are inserted as images, Dokuwiki smileys as text</span>
112</div>
113	<table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%">
114		<script type="text/javascript">
115
116var FCKConfig = oEditor.FCKConfig ;
117
118var sBasePath	= FCKConfig.SmileyPath ;
119var aImages		= FCKConfig.SmileyImages ;
120var iCols		= FCKConfig.SmileyColumns ;
121var iColWidth	= parseInt( 100 / iCols, 10 ) ;
122var dImages = FCKConfig.dokuSmileyConfImages ? FCKConfig.dokuSmileyConfImages : FCKConfig.dokuSmileyImages;
123
124var dBasePath = FCKConfig.dokuSmileyPath;
125 	document.write( '<tr>' ) ;
126	document.write( '<td align="center" style="font-size:9pt" colspan = ' + iCols + '><b>' + FCKLang.FckEditorSmileys + '</b></td>' ) ;
127
128var i = 0 ;
129while (i < aImages.length)
130{
131	document.write( '<tr>' ) ;
132	for(var j = 0 ; j < iCols ; j++)
133	{
134		if (aImages[i])
135		{
136			var sUrl = sBasePath + aImages[i] ;
137			document.write( '<td width="' + iColWidth + '%" align="center" class="DarkBackground Hand" onclick="InsertSmiley(\'' + sUrl.replace(/'/g, "\\'" ) + '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
138			document.write( '<img src="' + sUrl + '" border="0" />' ) ;
139		}
140		else
141			document.write( '<td width="' + iColWidth + '%" class="DarkBackground">&nbsp;' ) ;
142		document.write( '<\/td>' ) ;
143		i++ ;
144	}
145	document.write('<\/tr>') ;
146}
147
148 	document.write( '<tr>' ) ;
149	document.write( '<td align="center" style="font-size:9pt" colspan = ' + iCols + '><b>' + FCKLang.DokuwikiSmileys + '</b></td>' ) ;
150
151var i = 0 ;
152var dokuMeImages = new Array(['DELETEME','delete.gif'],['FIXME','fixme.gif']);
153
154while (i < dImages.length)
155{
156	document.write( '<tr>' ) ;
157	for(var j = 0 ; j < iCols ; j++)
158	{
159		if (dImages[i])
160		{
161			var sUrl = dBasePath + dImages[i][1] ;
162			document.write( '<td width="' + iColWidth + '%" align="center" class="DarkBackground Hand" onclick="InsertDokuSmiley(\'' + dImages[i][0]+ '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
163			document.write( '<img src="' + sUrl + '" border="0" />' ) ;
164		}
165		else
166			document.write( '<td width="' + iColWidth + '%" class="DarkBackground">&nbsp;' ) ;
167		document.write( '<\/td>' ) ;
168		i++ ;
169	}
170	document.write('<\/tr>') ;
171}
172
173    document.write( '<tr>' ) ;
174      for(var i=0; i < dokuMeImages.length; i++) {
175			var sUrl = dBasePath + dokuMeImages[i][1] ;
176			document.write( '<td colspan = "4" align ="center" class="DarkBackground Hand" onclick="InsertDokuSmiley(\'' + dokuMeImages[i][0]+ '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
177			document.write( '<img src="' + sUrl + '" border="0" />' ) ;
178      }
179
180	document.write('<\/tr>') ;
181		</script>
182	</table>
183<br />
184</body>
185</html>
186