Changeset 23234
- Timestamp:
- Jun 15, 2013, 6:52:37 PM (11 years ago)
- Location:
- extensions/SmiliesSupport
- Files:
-
- 44 added
- 23 deleted
- 9 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmiliesSupport/admin.php
r15110 r23234 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 include_once(SMILIES_PATH.'include/functions.inc.php'); 5 4 6 global $conf, $template; 5 load_language('plugin.lang', SMILIES_PATH);6 7 if (strpos($conf['smiliessupport'],',') !== false)8 {9 include(SMILIES_PATH .'maintain.inc.php');10 plugin_activate();11 }12 13 $conf_smiliessupport = unserialize($conf['smiliessupport']);14 15 // Enregistrement de la configuration16 if (isset($_POST['submit']))17 {18 // the smilies.txt file is not saved if the directory is changed19 if (isset($_POST['folder']) AND $_POST['folder'] != $conf_smiliessupport['folder'])20 {21 $not_save_file = true;22 23 if (!file_exists(SMILIES_PATH.'smilies/'.$_POST['folder'].'/'.$_POST['representant']))24 {25 $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['folder']);26 $i = 0;27 while (false !== ($file = readdir($handle)))28 {29 if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) )30 {31 $_POST['representant'] = $file;32 closedir($handle);33 break;34 }35 }36 }37 }38 39 // new configuration40 $conf_smiliessupport = array(41 'folder' => isset($_POST['folder']) ? $_POST['folder'] : 'crystal',42 'cols' => isset($_POST['cols']) ? $_POST['cols'] : '6',43 'representant' => isset($_POST['representant']) ? $_POST['representant'] : 'smile.png',44 );45 if (empty($_POST['text'])) $_POST['text'] = '';46 47 conf_update_param('smiliessupport', serialize($conf_smiliessupport));48 array_push($page['infos'], l10n('Information data registered in database'));49 50 // new definitions file51 if (!isset($not_save_file))52 {53 $smilies_file = SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/smilies.txt';54 55 if (file_exists($smilies_file)) {56 @copy($smilies_file, get_filename_wo_extension($smilies_file).'.bak');57 }58 59 if (@!file_put_contents($smilies_file, stripslashes($_POST['text']))) {60 array_push($page['errors'], l10n('File/directory read error').' : '.$smilies_file);61 }62 }63 }64 65 // check if the representant exists66 if (!file_exists(SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/'.$conf_smiliessupport['representant'])) {67 array_push($page['errors'], l10n('File/directory read error').' : smilies/'.$conf_smiliessupport['folder'].'/'.$conf_smiliessupport['representant']);68 }69 7 70 8 // get available sets 71 9 $sets = array(); 72 $handle = opendir(SMILIES_ PATH.'smilies/');73 while (false !== ($f ile= readdir($handle)))10 $handle = opendir(SMILIES_DIR); 11 while (false !== ($folder = readdir($handle))) 74 12 { 75 if ( $f ile != '.' && $file != '..' && is_dir(SMILIES_PATH.'smilies/'.$file) )13 if ( $folder != '.' && $folder != '..' && is_dir(SMILIES_DIR.$folder) ) 76 14 { 77 $sets[$file] = $file; 15 if (file_exists(SMILIES_DIR.$folder.'/representant.txt')) 16 { 17 $sets[$folder] = file_get_contents(SMILIES_DIR.$folder.'/representant.txt'); 18 } 19 else 20 { 21 $sets[$folder] = get_first_file(SMILIES_DIR.$folder, $conf['smiliessupport']['ext']); 22 } 78 23 } 79 24 } 80 25 closedir($handle); 81 26 82 // get available smilies 83 $smilies_table = $smilies = array(); 84 $handle = opendir(SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder']); 85 $i = 1; 86 while (false !== ($file = readdir($handle))) 27 28 // save configuration 29 if (isset($_POST['submit'])) 87 30 { 88 if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) ) 31 // new configuration 32 $conf['smiliessupport'] = array( 33 'folder' => $_POST['folder'], 34 'cols' => preg_match('#^([0-9]+)$#', $_POST['cols']) ? $_POST['cols'] : 6, 35 'representant' => $sets[ $_POST['folder'] ], 36 ); 37 38 conf_update_param('smiliessupport', serialize($conf['smiliessupport'])); 39 array_push($page['infos'], l10n('Information data registered in database')); 40 41 // shortcuts file 42 $used = array(); 43 $content = null; 44 45 foreach ($_POST['shortcuts'] as $file => $data) 89 46 { 90 $smilies[$file] = $file; 91 $smilies_table[] = array( 92 'PATH' => SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/'.$file, 93 'TITLE' => ':'.get_filename_wo_extension($file).':', 94 'TR' => ($i>0 AND $i%$conf_smiliessupport['cols'] == 0) ? '</tr><tr>' : null, 95 ); 96 $i++; 47 if (empty($data)) continue; 48 49 $data = explode(',', stripslashes($data)); 50 foreach ($data as $short) 51 { 52 if (array_key_exists($short, $used)) 53 { 54 $page['errors'][] = sprintf( 55 l10n('<i>%s</i>, shortcut « %s » already used for <i>%s</i>'), 56 get_filename_wo_extension($file), 57 $short, 58 get_filename_wo_extension($used[ $short ]) 59 ); 60 } 61 else 62 { 63 $used[ $short ] = $file; 64 $content.= $short."\t\t".$file."\n"; 65 } 66 } 67 } 68 69 if (file_exists(SMILIES_DIR.$_POST['folder'].'/smilies.txt')) 70 { 71 @copy(SMILIES_DIR.$_POST['folder'].'/smilies.txt', SMILIES_DIR.$_POST['folder'].'/smilies.bak'); 72 } 73 74 if (@!file_put_contents(SMILIES_DIR.$_POST['folder'].'/smilies.txt', $content)) 75 { 76 $page['errors'][] = l10n('File/directory read error').' : '.SMILIES_DIR.$_POST['folder'].'/smilies.txt'; 97 77 } 98 78 } 99 closedir($handle);100 79 80 81 // template 101 82 $template->assign(array( 102 'FOLDER' => $conf_smiliessupport['folder'], 103 'COLS' => $conf_smiliessupport['cols'], 104 'REPRESENTANT' => $conf_smiliessupport['representant'], 105 'sets' => $sets, 106 'smiliesfiles' => $smilies_table, 107 'smilies' => $smilies, 83 'FOLDER' => $conf['smiliessupport']['folder'], 84 'COLS' => $conf['smiliessupport']['cols'], 85 'SETS' => $sets, 86 'SMILIES_PATH' => SMILIES_PATH, 108 87 )); 109 88 110 // get the content of definitions file 111 $smilies_file = SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/smilies.txt'; 112 if (file_exists($smilies_file)) 113 { 114 $content_file = file_get_contents($smilies_file); 115 $template->assign(array('CONTENT_FILE' => $content_file)); 116 } 117 118 $template->assign('SMILIES_PATH', SMILIES_PATH); 89 119 90 $template->set_filename('smiliessupport_conf', dirname(__FILE__).'/template/smiliessupport_admin.tpl'); 120 91 $template->assign_var_from_handle('ADMIN_CONTENT', 'smiliessupport_conf'); -
extensions/SmiliesSupport/include/smiliessupport.inc.php
r23217 r23234 5 5 function set_smiliessupport($prefilter='picture', $textarea_id='contentid') 6 6 { 7 global $conf, $template, $page; 8 9 load_language('plugin.lang', SMILIES_PATH); 10 $conf_smiliessupport = unserialize($conf['smiliessupport']); 7 global $conf, $template; 11 8 12 9 $template->assign(array( 13 10 'SMILIES_PATH' => SMILIES_PATH, 14 'SMILIES_ID' => $textarea_id,15 'REPRESENTANT' => SMILIES_ PATH.'smilies/'.$conf_smiliessupport['folder'].'/'.$conf_smiliessupport['representant'],16 'smiliesfiles' => get_smilies( $conf_smiliessupport),11 'SMILIES_ID' => $textarea_id, 12 'REPRESENTANT' => SMILIES_DIR.$conf['smiliessupport']['folder'].'/'.$conf['smiliessupport']['representant'], 13 'smiliesfiles' => get_smilies(), 17 14 )); 18 15 … … 27 24 } 28 25 29 // return an array with available smilies (name and path) ## must received the unserialized configuration array30 function get_smilies( $conf_smiliessupport)26 // return an array with available smilies (name and path) 27 function get_smilies() 31 28 { 32 $accepted_ext = array('gif', 'jpg', 'png');29 global $conf; 33 30 34 if ($handle = opendir(SMILIES_ PATH.'smilies/'.$conf_smiliessupport['folder']))31 if ($handle = opendir(SMILIES_DIR.$conf['smiliessupport']['folder'])) 35 32 { 36 33 $i = 1; 37 34 while (false !== ($file = readdir($handle))) 38 35 { 39 if ($file != '.' AND $file != '..' AND in_array(get_extension($file), $accepted_ext))36 if ($file != '.' and $file != '..' and in_array(get_extension($file), $conf['smiliessupport']['ext'])) 40 37 { 41 38 $smilies[] = array( 42 'PATH' => SMILIES_ PATH.'smilies/'.$conf_smiliessupport['folder'].'/'.$file,39 'PATH' => SMILIES_DIR.$conf['smiliessupport']['folder'].'/'.$file, 43 40 'TITLE' => ':'.get_filename_wo_extension($file).':', 44 'TR' => ($i>0 AND $i%$conf_smiliessupport['cols'] == 0) ? '</tr><tr>' : null,41 'TR' => ($i>0 and $i%$conf['smiliessupport']['cols'] == 0) ? '</tr><tr>' : null, 45 42 ); 46 43 $i++; … … 61 58 { 62 59 global $conf; 63 64 $conf_smiliessupport = unserialize($conf['smiliessupport']); 65 $folder = get_absolute_root_url().SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder']; 66 $def_path = SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/smilies.txt'; 67 $accepted_ext = array('gif', 'jpg', 'png'); 60 61 $root_path = get_absolute_root_url(); 62 $folder = SMILIES_DIR.$conf['smiliessupport']['folder'].'/'; 68 63 $str = ' '.$str; 69 64 70 if ($handle = opendir( SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder']))65 if ($handle = opendir($folder)) 71 66 { 72 67 while (false !== ($file = readdir($handle))) 73 68 { 74 if ($file != "." && $file != ".." && in_array(get_extension($file), $ accepted_ext))69 if ($file != "." && $file != ".." && in_array(get_extension($file), $conf['smiliessupport']['ext'])) 75 70 { 76 71 $filename = get_filename_wo_extension($file); 77 72 $v = ':'.$filename.':'; 78 $s = '<img src="'.$ folder.'/'.$file.'" alt=":'.$filename.':"/>';73 $s = '<img src="'.$root_path.$folder.$file.'" alt=":'.$filename.':"/>'; 79 74 $str = str_replace($v, $s, $str); 80 75 } … … 84 79 } 85 80 86 if (file_exists($ def_path))81 if (file_exists($folder.'smilies.txt')) 87 82 { 88 $def = file($def_path); 89 foreach($def as $v) 83 foreach (file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES) as $v) 90 84 { 91 85 $v = trim($v); 92 if (preg_match('#^([^\ t]+)[ \t]+(.+)$#', $v, $matches))86 if (preg_match('#^([^\s]+)[\s]+(.+)$#', $v, $matches)) 93 87 { 94 88 $filename = get_filename_wo_extension($matches[2]); 95 89 $v = '#([^"])'.preg_quote($matches[1],'/').'#'; 96 $t = '$1<img src="'.$ folder.'/'.$matches[2].'" alt=":'.$filename.':"/>';90 $t = '$1<img src="'.$root_path.$folder.$matches[2].'" alt=":'.$filename.':"/>'; 97 91 $str = preg_replace($v, $t, $str); 98 92 } -
extensions/SmiliesSupport/language/en_UK/plugin.lang.php
r11875 r23234 1 1 <?php 2 2 3 $lang['Smileys\' folder'] = 'Smileys\' folder'; 4 $lang['Nb. columns'] = 'Nb. columns'; 5 $lang['Representative'] = 'Representative'; 6 $lang['All Smilies'] = 'All Smilies'; 7 $lang['smilies_file_help'] = 'By default when a user clicks on a smiley, Smilies Support adds a keyword matching the name of the file (smile.png -> :smile:).<br> 8 But here you can configure other strings to be replaced. Each smilies folder has its own <i>smilies.txt</i> file.'; 3 $lang['Smilies set'] = 'Smilies set'; 4 $lang['Smiley'] = 'Smiley'; 5 $lang['Shortcuts'] = 'Shortcuts'; 6 $lang['Columns'] = 'Columns'; 7 $lang['Smilies'] = 'Smilies'; 8 $lang['Edit shorcuts'] = 'Edit shorcuts'; 9 $lang['If you change current set you will lost every shortcuts changes.'] = 'If you change current set you will lost every shortcuts changes.'; 9 10 10 11 ?> -
extensions/SmiliesSupport/language/fr_FR/plugin.lang.php
r11875 r23234 1 1 <?php 2 2 3 $lang['Smileys\' folder'] = 'Dossier des smileys'; 4 $lang['Nb. columns'] = 'Nb. de colonnes'; 5 $lang['Representative'] = 'Représentant'; 6 $lang['All Smilies'] = 'Tous les smileys'; 7 $lang['smilies_file_help'] = 'Par défaut quand l\'utilisateur clique sur un smiley, Smilies Support ajoute un mot clef correspondant au nom du fichier (smile.png -> :smile:).<br> 8 Mais vous pouvez configurer ici d\'autres chaînes de caractères qui seront remplacées. Chaque dossier de smileys a son propre fichier <i>smilies.txt</i>.'; 3 $lang['Smilies set'] = 'Set de smileys'; 4 $lang['Smiley'] = 'Smiley'; 5 $lang['Shortcuts'] = 'Raccourcis'; 6 $lang['Columns'] = 'Colonnes'; 7 $lang['Smilies'] = 'Smileys'; 8 $lang['Edit shorcuts'] = 'Modifier les raccouris'; 9 $lang['If you change current set you will lost every shortcuts changes.'] = 'Si vous changez de set, vous perdrez les modifications des raccourcis.'; 9 10 10 11 ?> -
extensions/SmiliesSupport/main.inc.php
r23204 r23234 4 4 Version: auto 5 5 Description: Allow add Smilies for comments and descriptions. 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=1596 Plugin URI: auto 7 7 Author: Atadilo & P@t & Mistic 8 8 */ … … 10 10 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 11 11 12 define('SMILIES_DIR', basename(dirname(__FILE__))); 13 define('SMILIES_PATH', PHPWG_PLUGINS_PATH . SMILIES_DIR . '/'); 12 define('SMILIES_ID', basename(dirname(__FILE__))); 13 define('SMILIES_PATH', PHPWG_PLUGINS_PATH . SMILIES_ID . '/'); 14 define('SMILIES_DIR', SMILIES_PATH . 'smilies/'); 14 15 15 include_once(SMILIES_PATH.'smiliessupport.inc.php'); 16 include_once(SMILIES_PATH.'include/functions.inc.php'); 17 include_once(SMILIES_PATH.'include/smiliessupport.inc.php'); 16 18 19 add_event_handler('init', 'init_smiliessupport'); 17 20 add_event_handler('render_comment_content', 'SmiliesParse', 60); 18 21 add_event_handler('render_contact_content', 'SmiliesParse'); 19 22 add_event_handler('loc_after_page_header', 'add_smiliessupport'); 23 24 25 function init_smiliessupport() 26 { 27 global $conf; 28 29 $conf['smiliessupport'] = unserialize($conf['smiliessupport']); 30 $conf['smiliessupport']['ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG'); 31 32 load_language('plugin.lang', SMILIES_PATH); 33 } 20 34 21 35 function add_smiliessupport() … … 59 73 { 60 74 add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu'); 75 add_event_handler('init', 'smiliessupport_get_list'); 76 61 77 function smiliessupport_admin_menu($menu) 62 78 { 63 79 array_push($menu, array( 64 80 'NAME' => 'Smilies Support', 65 'URL' => get_root_url().'admin.php?page=plugin-' . SMILIES_ DIR81 'URL' => get_root_url().'admin.php?page=plugin-' . SMILIES_ID 66 82 )); 67 83 return $menu; 68 84 } 69 85 } 86 70 87 ?> -
extensions/SmiliesSupport/smilies/crystal/smilies.txt
r14526 r23234 1 :) smile.png2 :-) smile.png3 1 :D biggrin.png 4 2 :-D biggrin.png 5 ;) wink.png 6 ;-) wink.png 3 :s confused.png 4 :S confused.png 5 ;( cry.png 6 ;-( cry.png 7 oO eek.png 8 Oo eek.png 9 OO eek.png 10 <3 like.png 11 ^^ lol.png 12 :| neutral.png 13 :-| neutral.png 7 14 :P razz.png 8 15 :p razz.png … … 11 18 :( sad.png 12 19 :-( sad.png 13 ;( cry.png 14 ;-( cry.png 15 oO eek.png 16 Oo eek.png 17 OO eek.png 20 :) smile.png 21 :-) smile.png 18 22 :o surprised.png 19 23 :O surprised.png 20 24 :-o surprised.png 21 25 :-O surprised.png 22 :s confused.png 23 :S confused.png 24 :| neutral.png 25 :-| neutral.png 26 <3 like.png 27 ^^ lol.png 26 ;) wink.png 27 ;-) wink.png -
extensions/SmiliesSupport/smilies/ipb/smilies.txt
r14526 r23234 1 :) sourire.gif2 :-) sourire.gif3 1 :D happy.gif 4 2 :-D happy.gif 5 ;) wink.gif6 ;-) wink.gif7 3 :P langue.gif 8 4 :p langue.gif 9 5 :-p langue.gif 10 6 :-P langue.gif 11 :( triste.gif12 :-( triste.gif13 ;( pleure.gif14 ;-( pleure.gif15 7 oO perplexe.gif 16 8 Oo perplexe.gif 17 9 OO perplexe.gif 10 ;( pleure.gif 11 ;-( pleure.gif 12 :) sourire.gif 13 :-) sourire.gif 18 14 :o surpris.gif 19 15 :O surpris.gif 20 16 :-o surpris.gif 21 17 :-O surpris.gif 18 :( triste.gif 19 :-( triste.gif 20 ;) wink.gif 21 ;-) wink.gif 22 22 <3 wub.gif -
extensions/SmiliesSupport/smilies/sylvia/smilies.txt
r14526 r23234 1 :) smile.png2 :-) smile.png3 1 :D biggrin.png 4 2 :-D biggrin.png 5 ;) wink.png 6 ;-) wink.png 3 :s confused.png 4 :S confused.png 5 ;( cry.png 6 ;-( cry.png 7 oO eek.png 8 Oo eek.png 9 OO eek.png 10 :| neutral.png 11 :-| neutral.png 7 12 :P razz.png 8 13 :p razz.png … … 11 16 :( sad.png 12 17 :-( sad.png 13 ;( cry.png 14 ;-( cry.png 15 oO eek.png 16 Oo eek.png 17 OO eek.png 18 :) smile.png 19 :-) smile.png 18 20 :o surprised.png 19 21 :O surprised.png 20 22 :-o surprised.png 21 23 :-O surprised.png 22 :s confused.png 23 :S confused.png 24 :| neutral.png 25 :-| neutral.png 24 ;) wink.png 25 ;-) wink.png -
extensions/SmiliesSupport/template/smiliessupport_admin.tpl
r15110 r23234 1 {combine_script id='jquery. cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}2 { include file='include/autosize.inc.tpl'}1 {combine_script id='jquery.tokeninput' load='footer' path='themes/default/js/plugins/jquery.tokeninput.js'} 2 {combine_css path=$SMILIES_PATH|cat:'template/style.css'} 3 3 4 {footer_script require="jquery.cluetip"}{literal} 5 jQuery('.cluetip').cluetip({ 6 width: 550, 7 splitTitle: '|' 8 }); 4 5 {footer_script}{literal} 6 var data = {}; 7 var edit = false; 8 var edited = false; 9 10 // set changed 11 jQuery("select[name='folder']").change(function() { 12 if (edited) { 13 var ok = confirm("{/literal}{'If you change current set you will lost every shortcuts changes.'|@translate}{literal}"); 14 if (!ok) { 15 jQuery(this).val(jQuery(this).data("selected")); 16 return false; 17 } 18 } 19 20 var image = jQuery(this).find(":selected").css("background-image"); 21 jQuery(this).css("background-image", image); 22 jQuery(this).data("selected", jQuery(this).val()); 23 24 fetch(); 25 }); 26 27 // size changed 28 jQuery("input[name='cols']").change(function() { 29 update(); 30 }); 31 32 // switch preview/edit 33 jQuery(".edit").click(function() { 34 if (edit) { 35 $(this).html("{/literal}{'Edit shorcuts'|@translate}{literal}"); 36 } 37 else { 38 $(this).html("{/literal}{'Preview'|@translate}{literal}"); 39 } 40 41 edit = !edit; 42 update(); 43 return false; 44 }); 45 46 // display edit form before submit 47 jQuery("#smiliesupport").submit(function() { 48 if (!edit) jQuery(".edit").click(); 49 return true; 50 }); 51 52 /* get smilies list */ 53 function fetch() { 54 jQuery.ajax({ 55 url: 'admin.php', 56 type: 'GET', 57 dataType: 'json', 58 data: { 59 action: 'ss_preview', 60 folder: jQuery("select[name='folder']").val(), 61 }, 62 success: function(result) { 63 data = result; 64 edited = false; 65 update(); 66 } 67 }); 68 } 69 70 /* update preview/edit table */ 71 function update() { 72 var html = ''; 73 74 if (!edit) { 75 html+= '<tr>'; 76 var cols = parseInt(jQuery("input[name='cols']").val()); 77 var i=0; 78 79 for (var file in data.smilies) { 80 var smiley = data.smilies[file]; 81 html+= '<td><a href="#" title="'+ smiley.title +'"><img src="'+ data.path + smiley.file +'"/></a></td>'; 82 if ((parseInt(i)+1)%cols == 0) html+= '</tr><tr>'; 83 i++; 84 } 85 86 html+= '</tr>'; 87 } 88 else { 89 {/literal} 90 html+= '<tr>' 91 +'<th>{'Smiley'|@translate}</th>' 92 +'<th>{'Name'|@translate}</th>' 93 +'<th>{'Shortcuts'|@translate}</th>' 94 +'</tr>'; 95 {literal} 96 97 for (var file in data.smilies) { 98 var smiley = data.smilies[file]; 99 html+= '<tr data-file="'+ smiley.file +'">' 100 +'<td><img src="'+ data.path + smiley.file +'"/></td>' 101 +'<td>'+ smiley.title +'</td>' 102 +'<td>' 103 +'<select name="shortcuts['+ smiley.file +']" class="shortcuts">'; 104 105 for (var j in smiley.short) { 106 html+= '<option value="'+ smiley.short[j] +'" selected>'+ smiley.short[j] +'</option>'; 107 } 108 109 html+= '</select>' 110 +'</td>' 111 +'</tr>'; 112 } 113 } 114 115 jQuery("#preview").html(html); 116 117 // init tokeninput 118 jQuery(".shortcuts").tokenInput([], { 119 hintText: '{/literal}{'Type in a new shortcut'|@translate}{literal}', 120 newText: '', 121 animateDropdown: false, 122 preventDuplicates: true, 123 caseSensitive: true, 124 allowCreation: true, 125 minChars: 2, 126 searchDelay: 10, 127 128 onAdd: function(item) { 129 edited = true; 130 var file = $(this).parents("tr").data("file"); 131 132 if (data.smilies[file].short == null) { 133 data.smilies[file].short = [item.name]; 134 } 135 else { 136 data.smilies[file].short.push(item.name); 137 } 138 }, 139 onDelete: function(item) { 140 edited = true; 141 var file = $(this).parents("tr").data("file"); 142 143 for (var i in data.smilies[file].short) { 144 if (data.smilies[file].short[i] == item.name) { 145 data.smilies[file].short.splice(i, 1); 146 } 147 } 148 }, 149 }); 150 151 // prevent spaces 152 jQuery(".token-input-input-token input").keydown(function(e) { 153 if (e.keyCode == 32) { 154 return false; 155 } 156 }); 157 } 158 159 // init 160 fetch(); 9 161 {/literal}{/footer_script} 10 162 11 {html_head}12 <style type="text/css">13 legend .cluetip {ldelim}14 text-align:center;15 margin:20px 0 -10px 0;16 font-size:1.2em;17 }18 .cluetip:after {ldelim}19 margin-left:5px;20 vertical-align:top;21 content:url('{$themeconf.admin_icon_dir}/help.png');22 }23 .properties textarea {ldelim}24 width:60%;25 margin:0 20%;26 }27 </style>28 {/html_head}29 163 30 164 <div class="titrePage"> … … 32 166 </div> 33 167 34 <form method="post" action="" class="properties"> 35 <fieldset> 36 <legend>{'Configuration'|@translate}</legend> 37 <ul> 168 <form method="post" action="" class="properties" id="smiliesupport"> 169 170 <fieldset> 171 <legend>{'Configuration'|@translate}</legend> 172 173 <ul> 38 174 <li> 39 <span class="property">{'Smileys\' folder'|@translate}</span> 40 <select name="folder"> 41 {html_options options=$sets selected=$FOLDER} 175 <b>{'Smilies set'|@translate}</b> 176 <select name="folder" style="background-image:url('{$SMILIES_PATH}smilies/{$FOLDER}/{$SETS[$FOLDER]}');" data-selected="{$FOLDER}"> 177 {foreach from=$SETS item=rep key=set} 178 <option value="{$set}" style="background-image:url('{$SMILIES_PATH}smilies/{$set}/{$rep}');" {if $set==$FOLDER}selected{/if}>{$set}</option> 179 {/foreach} 42 180 </select> 43 181 </li> 44 182 <li> 45 <span class="property">{'Nb. columns'|@translate}</span> 46 <input type="text" size="3" name="cols" value="{$COLS}" /> 47 </li> 48 <li> 49 <span class="property">{'Representative'|@translate}</span> 50 <select name="representant"> 51 {html_options options=$smilies selected=$REPRESENTANT} 52 </select> 183 <b>{'Columns'|@translate}</b> 184 <input type="text" size="2" name="cols" value="{$COLS}"> 53 185 </li> 54 <li> 55 <table><tr> 56 {foreach from=$smiliesfiles item=smileyfile} 57 <td><a href="#" title="{$smileyfile.TITLE}"><img src="{$smileyfile.PATH}"/></a></td> 58 {$smileyfile.TR} 59 {/foreach} 60 </tr></table> 61 </li> 62 </ul> 63 </fieldset> 186 </ul> 187 </fieldset> 188 189 <fieldset> 190 <legend>{'Preview'|@translate}</legend> 191 <a href="#" class="edit buttonLike">{'Edit shorcuts'|@translate}</a> 192 <table id="preview"></table> 193 </fieldset> 64 194 65 <fieldset> 66 <legend><span class="cluetip" title="smilies.txt|{'smilies_file_help'|@translate}">smilies.txt</legend> 67 <textarea rows="5" name="text">{$CONTENT_FILE}</textarea> 68 </fieldset> 69 70 <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p> 195 <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p> 196 71 197 </form> -
extensions/SmiliesSupport/template/smiliessupport_page.tpl
r23204 r23234 4 4 {/if} 5 5 6 {footer_script require='jquery'} 7 {literal} 6 {footer_script require='jquery'}{literal} 8 7 if (jQuery('.markItUp').length == 0) { 9 8 jQuery('#{/literal}{$SMILIES_ID}{literal}').markItUp({markupSet: []}); … … 28 27 return false; 29 28 }); 30 {/literal} 31 {/footer_script} 29 {/literal}{/footer_script} 30 31 {html_style}{literal} 32 #smiliesdiv table a { width:auto; height:auto; } 33 {/literal}{/html_style} 32 34 33 35 <ul style="display:none;"> 34 36 <li id="SmiliesSupport" class="markItUpButton markItUpDropMenu"> 35 <a id="allsmilies" style="background-image:url('{$ROOT_URL}{$REPRESENTANT}');" title="{' AllSmilies'|@translate}"></a>37 <a id="allsmilies" style="background-image:url('{$ROOT_URL}{$REPRESENTANT}');" title="{'Smilies'|@translate}"></a> 36 38 37 39 <ul id="smiliesdiv">
Note: See TracChangeset
for help on using the changeset viewer.