Changeset 26075
- Timestamp:
- Dec 21, 2013, 11:02:21 PM (10 years ago)
- Location:
- extensions/SmiliesSupport
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmiliesSupport/admin.php
r23236 r26075 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('SMILIES_ID') or die('Hacking attempt!'); 3 3 4 4 include_once(SMILIES_PATH.'include/functions.inc.php'); … … 9 9 $sets = array(); 10 10 $handle = opendir(SMILIES_DIR); 11 while ( false !== ($folder = readdir($handle)))11 while ($folder = readdir($handle)) 12 12 { 13 if ( $folder != '.' && $folder != '..' && is_dir(SMILIES_DIR.$folder))13 if ($folder != '.' && $folder != '..' && is_dir(SMILIES_DIR.$folder)) 14 14 { 15 if (file_exists(SMILIES_DIR .$folder.'/representant.txt'))15 if (file_exists(SMILIES_DIR . $folder . '/representant.txt')) 16 16 { 17 $sets[$folder] = file_get_contents(SMILIES_DIR .$folder.'/representant.txt');17 $sets[$folder] = file_get_contents(SMILIES_DIR . $folder . '/representant.txt'); 18 18 } 19 19 else 20 20 { 21 $sets[$folder] = get_first_file(SMILIES_DIR .$folder, $conf['smiliessupport']['ext']);21 $sets[$folder] = get_first_file(SMILIES_DIR . $folder, $conf['smiliessupport_ext']); 22 22 } 23 23 } … … 37 37 38 38 conf_update_param('smiliessupport', serialize($conf['smiliessupport'])); 39 array_push($page['infos'], l10n('Information data registered in database'));39 $page['infos'][] = l10n('Information data registered in database'); 40 40 41 41 // shortcuts file … … 52 52 if (array_key_exists($short, $used)) 53 53 { 54 $page['errors'][] = sprintf(55 l10n('<i>%s</i>, shortcut « %s » already used for <i>%s</i>'),56 57 58 59 54 $page['errors'][] = l10n( 55 '<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 60 } 61 61 else … … 80 80 'SETS' => $sets, 81 81 'SMILIES_PATH' => SMILIES_PATH, 82 ));82 )); 83 83 84 84 85 $template->set_filename('smiliessupport_conf', dirname(__FILE__).'/template/smiliessupport_admin.tpl');85 $template->set_filename('smiliessupport_conf', realpath(SMILIES_PATH . 'template/smiliessupport_admin.tpl')); 86 86 $template->assign_var_from_handle('ADMIN_CONTENT', 'smiliessupport_conf'); 87 88 ?> -
extensions/SmiliesSupport/include/events.inc.php
r24342 r26075 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('SMILIES_ID') or die('Hacking attempt!'); 3 3 4 // add smilies button to the comment field 5 function set_smiliessupport($prefilter='picture', $textarea_id='contentid') 4 function smiliessupport_admin_menu($menu) 6 5 { 7 global $conf, $template; 6 $menu[] = array( 7 'NAME' => 'Smilies Support', 8 'URL' => SMILIES_ADMIN, 9 ); 10 return $menu; 11 } 12 13 function add_smiliessupport() 14 { 15 global $page, $pwg_loaded_plugins, $template, $conf; 16 17 if (script_basename() == 'picture') 18 { 19 $prefilter = 'picture'; 20 $textarea_id = 'contentid'; 21 } 22 else if (isset($page['section'])) 23 { 24 if ( 25 script_basename() == 'index' and isset($pwg_loaded_plugins['Comments_on_Albums']) 26 and $page['section'] == 'categories' and isset($page['category']) 27 ) 28 { 29 $prefilter = 'comments_on_albums'; 30 $textarea_id = 'contentid'; 31 } 32 else if ($page['section'] == 'guestbook') 33 { 34 $prefilter = 'guestbook'; 35 $textarea_id = 'contentid'; 36 } 37 else if ($page['section'] == 'contact') 38 { 39 $prefilter = 'contactform'; 40 $textarea_id = 'cf_content'; 41 } 42 } 43 44 if (!isset($prefilter)) 45 { 46 return; 47 } 8 48 9 49 $template->assign(array( 10 50 'SMILIES_PATH' => SMILIES_PATH, 11 'SMILIES_ID' => $textarea_id, 12 'REPRESENTANT' => SMILIES_DIR.$conf['smiliessupport']['folder'].'/'.$conf['smiliessupport']['representant'], 13 'smiliesfiles' => get_smilies(), 14 )); 15 16 $template->set_prefilter($prefilter, 'set_smiliessupport_prefilter'); 17 } 18 19 function set_smiliessupport_prefilter($content, &$smarty) 20 { 21 $search = '#(<div id="guestbookAdd">|<div id="commentAdd">|<div class="contact">)#'; 22 $replace = file_get_contents(SMILIES_PATH.'/template/smiliessupport_page.tpl').'$1'; 23 return preg_replace($search, $replace, $content); 24 } 25 26 // return an array with available smilies (name and path) 27 function get_smilies() 28 { 29 global $conf; 30 31 if ($handle = opendir(SMILIES_DIR.$conf['smiliessupport']['folder'])) 32 { 33 $i = 1; 34 while (false !== ($file = readdir($handle))) 35 { 36 if ($file != '.' and $file != '..' and in_array(get_extension($file), $conf['smiliessupport']['ext'])) 37 { 38 $smilies[] = array( 39 'PATH' => SMILIES_DIR.$conf['smiliessupport']['folder'].'/'.$file, 40 'TITLE' => ':'.get_filename_wo_extension($file).':', 41 'TR' => ($i>0 and $i%$conf['smiliessupport']['cols'] == 0) ? '</tr><tr>' : null, 42 ); 43 $i++; 44 } 45 } 51 'SMILIES' => array( 52 'textarea_id' => $textarea_id, 53 'representant' => SMILIES_DIR . $conf['smiliessupport']['folder'] . '/' . $conf['smiliessupport']['representant'], 54 'files' => get_smilies(), 55 ), 56 )); 46 57 47 closedir($handle); 48 return $smilies; 49 } 50 else 51 { 52 return false; 53 } 58 $template->set_filename('smiliessupport', realpath(SMILIES_PATH . 'template/smiliessupport_page.tpl')); 59 $template->parse('smiliessupport'); 54 60 } 55 61 … … 67 73 while (false !== ($file = readdir($handle))) 68 74 { 69 if ($file != "." && $file != ".." && in_array(get_extension($file), $conf['smiliessupport ']['ext']))75 if ($file != "." && $file != ".." && in_array(get_extension($file), $conf['smiliessupport_ext'])) 70 76 { 71 77 $filename = get_filename_wo_extension($file); … … 105 111 } 106 112 107 ?> 113 function smiliessupport_action() 114 { 115 if (!isset($_GET['action'])) return; 116 if (strpos($_GET['action'], 'ss_') !== 0) return; 117 118 global $conf; 119 120 $folder = SMILIES_DIR . ltrim($_GET['folder'], '/') . '/'; 121 122 if ($_GET['action'] == 'ss_reset') 123 { 124 @unlink($folder.'smilies-custom.txt'); 125 $_GET['action'] = 'ss_list'; 126 } 127 else if ($_GET['action'] == 'ss_list') 128 { 129 $short = array(); 130 if (file_exists($folder.'smilies-custom.txt')) 131 { 132 $file = file($folder.'smilies-custom.txt', FILE_IGNORE_NEW_LINES); 133 } 134 else if (file_exists($folder.'smilies.txt')) 135 { 136 $file = file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES); 137 } 138 if (!empty($file)) 139 { 140 foreach ($file as $v) 141 { 142 if (preg_match('#^([^\s]+)[\s]+(.+)$#', trim($v), $matches)) 143 { 144 $short[ $matches[2] ][] = $matches[1]; 145 } 146 } 147 } 148 149 $smilies = array(); 150 $handle = opendir($folder); 151 while (false !== ($file = readdir($handle))) 152 { 153 if ( $file != '.' && $file != '..' && in_array(get_extension($file), $conf['smiliessupport_ext']) ) 154 { 155 $smilies[$file] = array('title'=>':'.get_filename_wo_extension($file).':', 'file'=>$file, 'short'=>@$short[$file]); 156 } 157 } 158 closedir($handle); 159 160 echo json_encode(array('path'=>$folder, 'smilies'=>$smilies)); 161 } 162 163 exit; 164 } -
extensions/SmiliesSupport/include/functions.inc.php
r23236 r26075 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 2 defined('SMILIES_ID') or die('Hacking attempt!'); 3 4 // return an array with available smilies (name and path) 5 function get_smilies() 6 { 7 global $conf; 8 9 if ($handle = opendir(SMILIES_DIR.$conf['smiliessupport']['folder'])) 10 { 11 $i = 1; 12 while (false !== ($file = readdir($handle))) 13 { 14 if ($file != '.' and $file != '..' and 15 in_array(get_extension($file), $conf['smiliessupport_ext']) 16 ) 17 { 18 $smilies[] = array( 19 'PATH' => SMILIES_DIR.$conf['smiliessupport']['folder'].'/'.$file, 20 'TITLE' => ':'.get_filename_wo_extension($file).':', 21 'TR' => ($i>0 and $i%$conf['smiliessupport']['cols'] == 0) ? '</tr><tr>' : null, 22 ); 23 $i++; 24 } 25 } 26 27 closedir($handle); 28 return $smilies; 29 } 30 else 31 { 32 return false; 33 } 34 } 3 35 4 36 function get_first_file($path, $ext=null) … … 7 39 $handle = opendir($path); 8 40 9 while ( false !== ($file=readdir($handle)))41 while (false !== ($file=readdir($handle))) 10 42 { 11 if ( $file!='.' && $file!='..' && is_file($path.$file) && (!is_array($ext) || in_array(get_extension($file), $ext)) ) 43 if ($file!='.' and $file!='..' and is_file($path.$file) and 44 (!is_array($ext) or in_array(get_extension($file), $ext)) 45 ) 12 46 { 13 47 closedir($handle); … … 19 53 return null; 20 54 } 21 22 function smiliessupport_action()23 {24 if (!isset($_GET['action'])) return;25 if (strpos($_GET['action'], 'ss_') !== 0) return;26 27 global $conf;28 29 $folder = SMILIES_DIR . ltrim($_GET['folder'], '/') . '/';30 31 if ($_GET['action'] == 'ss_reset')32 {33 @unlink($folder.'smilies-custom.txt');34 $_GET['action'] = 'ss_list';35 }36 37 if ($_GET['action'] == 'ss_list')38 {39 $short = array();40 if (file_exists($folder.'smilies-custom.txt'))41 {42 $file = file($folder.'smilies-custom.txt', FILE_IGNORE_NEW_LINES);43 }44 else if (file_exists($folder.'smilies.txt'))45 {46 $file = file($folder.'smilies.txt', FILE_IGNORE_NEW_LINES);47 }48 if (!empty($file))49 {50 foreach ($file as $v)51 {52 if (preg_match('#^([^\s]+)[\s]+(.+)$#', trim($v), $matches))53 {54 $short[ $matches[2] ][] = $matches[1];55 }56 }57 }58 59 $smilies = array();60 $handle = opendir($folder);61 while (false !== ($file = readdir($handle)))62 {63 if ( $file != '.' && $file != '..' && in_array(get_extension($file), $conf['smiliessupport']['ext']) )64 {65 $smilies[$file] = array('title'=>':'.get_filename_wo_extension($file).':', 'file'=>$file, 'short'=>@$short[$file]);66 }67 }68 closedir($handle);69 70 echo json_encode(array('path'=>$folder, 'smilies'=>$smilies));71 }72 73 exit;74 }75 76 ?> -
extensions/SmiliesSupport/main.inc.php
r23236 r26075 8 8 */ 9 9 10 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');10 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 11 11 12 define('SMILIES_ID', basename(dirname(__FILE__))); 13 define('SMILIES_PATH', PHPWG_PLUGINS_PATH . SMILIES_ID . '/'); 14 define('SMILIES_DIR', SMILIES_PATH . 'smilies/'); 12 define('SMILIES_ID', basename(dirname(__FILE__))); 13 define('SMILIES_PATH', PHPWG_PLUGINS_PATH . SMILIES_ID . '/'); 14 define('SMILIES_DIR', SMILIES_PATH . 'smilies/'); 15 define('SMILIES_ADMIN', get_root_url() . 'admin.php?page=plugin-' . SMILIES_ID); 16 define('SMILIES_VERSION', 'auto'); 17 15 18 16 19 include_once(SMILIES_PATH.'include/functions.inc.php'); 17 include_once(SMILIES_PATH.'include/smiliessupport.inc.php'); 20 include_once(SMILIES_PATH.'include/events.inc.php'); 21 18 22 19 23 add_event_handler('init', 'init_smiliessupport'); 20 add_event_handler('render_comment_content', 'SmiliesParse', 60); 24 25 if (defined('IN_ADMIN')) 26 { 27 add_event_handler('init', 'smiliessupport_action'); 28 add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu'); 29 } 30 else 31 { 32 add_event_handler('loc_after_page_header', 'add_smiliessupport', EVENT_HANDLER_PRIORITY_NEUTRAL+2); 33 } 34 35 add_event_handler('render_comment_content', 'SmiliesParse', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 21 36 add_event_handler('render_contact_content', 'SmiliesParse'); 22 add_event_handler('loc_after_page_header', 'add_smiliessupport');23 37 24 38 … … 27 41 global $conf; 28 42 43 include_once(SMILIES_PATH . 'maintain.inc.php'); 44 $maintain = new SmiliesSupport_maintain(SMILIES_ID); 45 $maintain->autoUpdate(SMILIES_VERSION, 'install'); 46 29 47 $conf['smiliessupport'] = unserialize($conf['smiliessupport']); 30 $conf['smiliessupport ']['ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG');48 $conf['smiliessupport_ext'] = array('gif', 'jpg', 'png', 'GIF', 'JPG', 'PNG'); 31 49 32 50 load_language('plugin.lang', SMILIES_PATH); 33 51 } 34 35 function add_smiliessupport()36 {37 global $page, $pwg_loaded_plugins;38 39 // if BBCodeBar is installed let him manage smilies40 if (isset($pwg_loaded_plugins['bbcode_bar'])) return;41 42 if (isset($page['body_id']) AND $page['body_id'] == 'thePicturePage')43 {44 $prefilter = 'picture';45 $textarea_id = 'contentid';46 }47 else if (48 script_basename() == 'index' and isset($pwg_loaded_plugins['Comments_on_Albums'])49 and isset($page['section']) and $page['section'] == 'categories' and isset($page['category'])50 )51 {52 $prefilter = 'comments_on_albums';53 $textarea_id = 'contentid';54 }55 else if (isset($page['section']) and $page['section'] == 'guestbook')56 {57 $prefilter = 'index';58 $textarea_id = 'contentid';59 }60 else if (isset($page['section']) and $page['section'] == 'contact')61 {62 $prefilter = 'index';63 $textarea_id = 'cf_content';64 }65 66 if (isset($prefilter))67 {68 set_smiliessupport($prefilter, $textarea_id);69 }70 }71 72 if (script_basename() == 'admin')73 {74 add_event_handler('get_admin_plugin_menu_links', 'smiliessupport_admin_menu');75 add_event_handler('init', 'smiliessupport_action');76 77 function smiliessupport_admin_menu($menu)78 {79 array_push($menu, array(80 'NAME' => 'Smilies Support',81 'URL' => get_root_url().'admin.php?page=plugin-' . SMILIES_ID82 ));83 return $menu;84 }85 }86 87 ?> -
extensions/SmiliesSupport/maintain.inc.php
r23234 r26075 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 function plugin_install() 4 class SmiliesSupport_maintain extends PluginMaintain 5 5 { 6 $new_smiliessupport = array( 6 private $installed = false; 7 8 private $default_conf = array( 7 9 'folder' => 'crystal', 8 10 'cols' => '6', 9 11 'representant' => 'smile.png', 10 ); 11 12 conf_update_param('smiliessupport', serialize($new_smiliessupport)); 13 } 12 ); 14 13 15 function plugin_activate() 16 { 17 global $conf; 18 19 if (strpos($conf['smiliessupport'],',') !== false) 14 function install($plugin_version, &$errors=array()) 20 15 { 21 $conf_smiliessupport = explode(',', $conf['smiliessupport']);16 global $conf; 22 17 23 switch ($conf_smiliessupport[0])18 if (isset($conf['smiliessupport'])) 24 19 { 25 case 'plugins/SmiliesSupport/smilies': $conf_smiliessupport[0] = 'ipb'; break;26 case 'plugins/SmiliesSupport/smilies_2': $conf_smiliessupport[0] = 'sylvia'; break; 27 default: $conf_smiliessupport[0] = 'crystal'; break;20 $conf['smiliessupport'] = serialize($this->default_conf); 21 22 conf_update_param('smiliessupport', $conf['smiliessupport']); 28 23 } 29 24 30 $new_smiliessupport = array( 31 'folder' => $conf_smiliessupport[0], 32 'cols' => $conf_smiliessupport[1], 33 'representant' => $conf_smiliessupport[2], 34 ); 35 36 conf_update_param('smiliessupport', serialize($new_smiliessupport)); 25 $this->installed = true; 26 } 27 28 function activate($plugin_version, &$errors=array()) 29 { 30 if (!$this->installed) 31 { 32 $this->install($plugin_version, $errors); 33 } 34 } 35 36 function deactivate() 37 { 38 } 39 40 function uninstall() 41 { 42 conf_delete_param('smiliessupport'); 37 43 } 38 44 } 39 40 function plugin_uninstall()41 {42 pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param="smiliessupport" LIMIT 1;');43 }44 45 ?> -
extensions/SmiliesSupport/template/smiliessupport_admin.tpl
r23252 r26075 1 {combine_css path='themes/default/js/plugins/jquery.tokeninput.css'} 1 2 {combine_script id='jquery.tokeninput' load='footer' path='themes/default/js/plugins/jquery.tokeninput.js'} 3 2 4 {combine_css path=$SMILIES_PATH|cat:'template/style.css'} 3 5 4 6 5 {footer_script}{literal} 6 var data = {}; 7 var edit = false; 8 var edited = false; 7 {footer_script} 8 (function(){ 9 var data = {ldelim}}, 10 edit = false, 11 edited = false; 9 12 10 13 // set changed 11 jQuery( "select[name='folder']").change(function() {14 jQuery('select[name="folder"]').change(function() { 12 15 if (edited) { 13 var ok = confirm( "{/literal}{'If you change current set you will lost every shortcuts changes.'|@translate}{literal}");16 var ok = confirm('{'If you change current set you will lost every shortcuts changes.'|translate|escape:javascript}'); 14 17 if (!ok) { 15 jQuery(this).val(jQuery(this).data( "selected"));18 jQuery(this).val(jQuery(this).data('selected')); 16 19 return false; 17 20 } 18 21 } 19 22 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 var image = jQuery(this).find(':selected').css('background-image'); 24 jQuery(this).css('background-image', image); 25 jQuery(this).data('selected', jQuery(this).val()); 23 26 24 27 fetch(); … … 26 29 27 30 // size changed 28 jQuery( "input[name='cols']").change(function() {31 jQuery('input[name="cols"]').change(function() { 29 32 update(); 30 33 }); 31 34 32 35 // switch preview/edit 33 jQuery( ".edit").click(function() {36 jQuery('.edit').click(function() { 34 37 if (edit) { 35 $(this).html( "{/literal}{'Edit shorcuts'|@translate}{literal}");38 $(this).html('{'Edit shorcuts'|translate|escape:javascript}'); 36 39 } 37 40 else { 38 $(this).html( "{/literal}{'Preview'|@translate}{literal}");41 $(this).html('{'Preview'|translate|escape:javascript}'); 39 42 } 40 43 … … 45 48 46 49 // reset defaults 47 jQuery(".reset").click(function() { 48 var ok = confirm("{/literal}{'Are you sure?'|@translate}{literal}"); 49 if (!ok) return false; 50 jQuery('.reset').click(function() { 51 if (!confirm('{'Are you sure?'|translate|escape:javascript}')) { 52 return false; 53 } 50 54 51 55 jQuery.ajax({ … … 55 59 data: { 56 60 action: 'ss_reset', 57 folder: jQuery( "select[name='folder']").val(),61 folder: jQuery('select[name="folder"]').val(), 58 62 }, 59 63 success: function(result) { … … 68 72 69 73 // display edit form before submit 70 jQuery("#smiliesupport").submit(function() { 71 if (!edit) jQuery(".edit").click(); 74 jQuery('#smiliesupport').submit(function() { 75 if (!edit) { 76 jQuery('.edit').click(); 77 } 72 78 return true; 73 79 }); … … 81 87 data: { 82 88 action: 'ss_list', 83 folder: jQuery( "select[name='folder']").val(),89 folder: jQuery('select[name="folder"]').val(), 84 90 }, 85 91 success: function(result) { … … 93 99 /* update preview/edit table */ 94 100 function update() { 95 var html = '' ;101 var html = '', i=0; 96 102 97 103 if (!edit) { 98 104 html+= '<tr>'; 99 105 100 var cols = parseInt(jQuery("input[name='cols']").val()); 101 var i=0; 106 var cols = parseInt(jQuery('input[name="cols"]').val()); 102 107 103 108 for (var file in data.smilies) { … … 110 115 html+= '</tr>'; 111 116 112 jQuery( ".reset").hide();117 jQuery('.reset').hide(); 113 118 } 114 119 else { 115 {/literal}116 120 html+= '<tr>' 117 121 +'<th></th>' 118 +'<th>{'Name'| @translate}</th>'119 +'<th>{'Shortcuts'| @translate}</th>'122 +'<th>{'Name'|translate}</th>' 123 +'<th>{'Shortcuts'|translate}</th>' 120 124 +'<th class="spacer"></th>' 121 125 +'<th></th>' 122 +'<th>{'Name'| @translate}</th>'123 +'<th>{'Shortcuts'| @translate}</th>'126 +'<th>{'Name'|translate}</th>' 127 +'<th>{'Shortcuts'|translate}</th>' 124 128 +'</tr>' 125 129 126 130 +'<tr>'; 127 {literal}128 129 var i=0;130 131 131 132 for (var file in data.smilies) { … … 152 153 html+= '</tr>'; 153 154 154 jQuery( ".reset").show();155 } 156 157 jQuery( "#preview").html(html);155 jQuery('.reset').show(); 156 } 157 158 jQuery('#preview').html(html); 158 159 159 160 // init tokeninput 160 jQuery( ".shortcuts").tokenInput([], {161 hintText: '{ /literal}{'Type in a new shortcut'|@translate}{literal}',161 jQuery('.shortcuts').tokenInput([], { 162 hintText: '{'Type in a new shortcut'|translate|escape:javascript}', 162 163 newText: '', 163 164 animateDropdown: false, 164 165 preventDuplicates: true, 165 caseSensitive: true, 166 allowCreation: true, 166 allowFreeTagging: true, 167 167 minChars: 2, 168 168 searchDelay: 10, … … 170 170 onAdd: function(item) { 171 171 edited = true; 172 var file = $(this).parent( "td").data("file");172 var file = $(this).parent('td').data("file"); 173 173 174 174 if (data.smilies[file].short == null) { … … 181 181 onDelete: function(item) { 182 182 edited = true; 183 var file = $(this).parent( "td").data("file");183 var file = $(this).parent('td').data("file"); 184 184 185 185 for (var i in data.smilies[file].short) { … … 192 192 193 193 // prevent spaces 194 jQuery( ".token-input-input-token input").keydown(function(e) {194 jQuery('.token-input-input-token input').keydown(function(e) { 195 195 if (e.keyCode == 32) { 196 196 return false; … … 201 201 // init 202 202 fetch(); 203 {/literal}{/footer_script}203 }());{/footer_script} 204 204 205 205 … … 211 211 212 212 <fieldset> 213 <legend>{'Configuration'| @translate}</legend>213 <legend>{'Configuration'|translate}</legend> 214 214 215 215 <ul> 216 216 <li> 217 <b>{'Smilies set'| @translate}</b>217 <b>{'Smilies set'|translate}</b> 218 218 <select name="folder" style="background-image:url('{$SMILIES_PATH}smilies/{$FOLDER}/{$SETS[$FOLDER]}');" data-selected="{$FOLDER}"> 219 219 {foreach from=$SETS item=rep key=set} … … 223 223 </li> 224 224 <li> 225 <b>{'Columns'| @translate}</b>225 <b>{'Columns'|translate}</b> 226 226 <input type="text" size="2" name="cols" value="{$COLS}"> 227 227 </li> … … 230 230 231 231 <fieldset> 232 <legend>{'Preview'| @translate}</legend>233 <a href="#" class="edit buttonLike">{'Edit shortcuts'| @translate}</a>232 <legend>{'Preview'|translate}</legend> 233 <a href="#" class="edit buttonLike">{'Edit shortcuts'|translate}</a> 234 234 <table id="preview"></table> 235 <a href="#" class="reset buttonLike" style="display:none;">{'Reset defaults'| @translate}</a>235 <a href="#" class="reset buttonLike" style="display:none;">{'Reset defaults'|translate}</a> 236 236 </fieldset> 237 237 238 <p class="formButtons"><input class="submit" type="submit" value="{'Submit'| @translate}" name="submit" /></p>238 <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|translate}" name="submit" /></p> 239 239 240 240 </form> -
extensions/SmiliesSupport/template/smiliessupport_page.tpl
r23279 r26075 1 {if not isset($BBCODE_PATH)} 2 {combine_script id="markitup" require='jquery' path=$SMILIES_PATH|@cat:"template/markitup/jquery.markitup.js"} 3 {combine_css path=$SMILIES_PATH|@cat:"template/markitup/style.markitup.css"} 4 {/if} 1 {combine_script id='markitup' require='jquery' load='footer' path=$SMILIES_PATH|cat:'template/markitup/jquery.markitup.js'} 2 {combine_css id='markitup' order=10 path=$SMILIES_PATH|cat:'template/markitup/style.markitup.css'} 5 3 6 {footer_script require=' jquery'}{literal}4 {footer_script require='markitup'} 7 5 if (jQuery('.markItUp').length == 0) { 8 jQuery('#{/literal}{$SMILIES_ID}{literal}').markItUp({markupSet: []}); 6 jQuery('#{$SMILIES.textarea_id}').markItUp({ 7 markupSet: [] 8 }); 9 9 jQuery('.markItUpHeader>ul').css('width', '22'); 10 10 } … … 16 16 17 17 jQuery('#allsmilies').hover(function(){ 18 jQuery('#{ /literal}{$SMILIES_ID}{literal}').focus();19 jQuery('#smiliesdiv').css('display', '');18 jQuery('#{$SMILIES.textarea_id}').focus(); 19 jQuery('#smiliesdiv').css('display', ''); 20 20 }); 21 21 22 22 jQuery('#smiliesdiv img').click(function() { 23 emoticon = jQuery(this).attr("title"); 24 jQuery.markItUp({ replaceWith:emoticon }); 25 jQuery('#smiliesdiv').css('display','none'); 23 var emoticon = jQuery(this).attr('title'); 24 jQuery.markItUp({ 25 replaceWith: emoticon 26 }); 27 jQuery('#smiliesdiv').css('display', 'none'); 26 28 return false; 27 29 }); 28 {/ literal}{/footer_script}30 {/footer_script} 29 31 30 {html_style} {literal}32 {html_style} 31 33 #SmiliesSupport table img:hover { 32 34 border:1px solid #08e; … … 35 37 cursor:pointer; 36 38 } 37 #allsmilies { background-size:contain; 38 {/literal} 39 background-image:url('{$ROOT_URL}{$REPRESENTANT}'); } 39 #allsmilies { 40 background-size:contain; 41 background-image:url('{$ROOT_URL}{$SMILIES.representant}'); 42 } 40 43 {/html_style} 41 44 42 45 <ul style="display:none;"> 43 46 <li id="SmiliesSupport" class="markItUpButton markItUpDropMenu"> 44 <a id="allsmilies" title="{'Smilies'| @translate}"></a>47 <a id="allsmilies" title="{'Smilies'|translate}"></a> 45 48 46 <ul id="smiliesdiv"> 47 < li><table><tr>{strip}48 {foreach from=$ smiliesfiles item=smileyfile}49 <ul id="smiliesdiv"><li> 50 <table><tr>{strip} 51 {foreach from=$SMILIES.files item=smileyfile} 49 52 <td><img src="{$ROOT_URL}{$smileyfile.PATH}" title="{$smileyfile.TITLE}"/></td> 50 53 {$smileyfile.TR} 51 54 {/foreach} 52 {/strip}</tr></table> </li>53 </ ul>55 {/strip}</tr></table> 56 </li></ul> 54 57 </li> 55 58 </ul>
Note: See TracChangeset
for help on using the changeset viewer.