fck_smiley.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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-2010 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. </style>
  36. <script src="common/fck_dialog_common.js" type="text/javascript"></script>
  37. <script type="text/javascript">
  38. var dialog = window.parent ;
  39. var oEditor = dialog.InnerDialogLoaded() ;
  40. var FCK = oEditor.FCK ;
  41. window.onload = function ()
  42. {
  43. // First of all, translate the dialog box texts
  44. oEditor.FCKLanguageManager.TranslatePage(document) ;
  45. dialog.SetAutoSize( true ) ;
  46. }
  47. function InsertSmiley( url )
  48. {
  49. // Semi-absolute URLs are to be recorded.
  50. url = FCK.GetUrl( url, FCK.SEMI_ABSOLUTE_URL ) ;
  51. oEditor.FCKUndo.SaveUndoStep() ;
  52. var oImg = oEditor.FCK.InsertElement( 'img' ) ;
  53. oImg.src = url ;
  54. oImg.setAttribute( '_fcksavedurl', url ) ;
  55. // For long smileys list, it seams that IE continues loading the images in
  56. // the background when you quickly select one image. so, let's clear
  57. // everything before closing.
  58. document.body.innerHTML = '' ;
  59. dialog.Cancel() ;
  60. }
  61. function over(td)
  62. {
  63. td.className = 'LightBackground Hand' ;
  64. }
  65. function out(td)
  66. {
  67. td.className = 'DarkBackground Hand' ;
  68. }
  69. </script>
  70. <style type="text/css">
  71. body, td, input, textarea, select, label { font-family: Arial, Verdana, Geneva, helvetica, sans-serif; font-size: 11px; }
  72. </style>
  73. </head>
  74. <body style="overflow: hidden">
  75. <table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%">
  76. <script type="text/javascript">
  77. var FCKConfig = oEditor.FCKConfig ;
  78. var sBasePath = FCKConfig.SmileyPath ;
  79. var aImages = FCKConfig.SmileyImages ;
  80. var iCols = FCKConfig.SmileyColumns ;
  81. var iColWidth = parseInt( 100 / iCols, 10 ) ;
  82. var i = 0 ;
  83. while (i < aImages.length)
  84. {
  85. document.write( '<tr>' ) ;
  86. for(var j = 0 ; j < iCols ; j++)
  87. {
  88. if (aImages[i])
  89. {
  90. var sUrl = sBasePath + aImages[i] ;
  91. document.write( '<td width="' + iColWidth + '%" align="center" class="DarkBackground Hand" onclick="InsertSmiley(\'' + sUrl.replace(/'/g, "\\'" ) + '\')" onmouseover="over(this)" onmouseout="out(this)">' ) ;
  92. document.write( '<img src="' + sUrl + '" border="0" />' ) ;
  93. }
  94. else
  95. document.write( '<td width="' + iColWidth + '%" class="DarkBackground">&nbsp;' ) ;
  96. document.write( '<\/td>' ) ;
  97. i++ ;
  98. }
  99. document.write('<\/tr>') ;
  100. }
  101. </script>
  102. </table>
  103. </body>
  104. </html>