Changeset 11056


Ignore:
Timestamp:
05/25/11 15:33:29 (8 years ago)
Author:
mistic100
Message:

bug:2278 fixed (merge r10970 r11008 r11039 from trunk) replace FCBKcomplete by TokenInput to avoid 3rd tag issue on autocomplete

Location:
branches/2.2
Files:
1 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/admin.php

    r10850 r11056  
    4444// | Direct actions                                                        | 
    4545// +-----------------------------------------------------------------------+ 
    46  
    47 // tags 
    48 if (isset($_GET['fckb_tags'])) 
    49 { 
    50   $query = ' 
    51 SELECT 
    52     id AS tag_id, 
    53     name AS tag_name 
    54   FROM '.TAGS_TABLE.' 
    55 ;'; 
    56   echo json_encode(get_fckb_taglist($query)); 
    57   exit(); 
    58 } 
    5946 
    6047// theme changer 
  • branches/2.2/admin/batch_manager.php

    r10381 r11056  
    362362 
    363363// +-----------------------------------------------------------------------+ 
     364// |                              tags                                     | 
     365// +-----------------------------------------------------------------------+ 
     366 
     367$query = ' 
     368SELECT 
     369    id AS tag_id, 
     370    name AS tag_name 
     371  FROM '.TAGS_TABLE.' 
     372;'; 
     373$template->assign('tags', get_taglist($query)); 
     374 
     375// +-----------------------------------------------------------------------+ 
    364376// |                         open specific mode                            | 
    365377// +-----------------------------------------------------------------------+ 
  • branches/2.2/admin/batch_manager_global.php

    r10381 r11056  
    124124    else 
    125125    { 
    126       $tag_ids = get_fckb_tag_ids($_POST['add_tags']); 
     126      $tag_ids = get_tag_ids($_POST['add_tags']); 
    127127      add_tags($tag_ids, $collection); 
    128128 
  • branches/2.2/admin/batch_manager_unit.php

    r10650 r11056  
    109109    if (isset($_POST[ 'tags-'.$row['id'] ])) 
    110110    { 
    111       $tag_ids = get_fckb_tag_ids($_POST[ 'tags-'.$row['id'] ]); 
     111      $tag_ids = get_tag_ids($_POST[ 'tags-'.$row['id'] ]); 
    112112      set_tags($tag_ids, $row['id']); 
    113113    } 
     
    257257  WHERE image_id = '.$row['id'].' 
    258258;'; 
    259     $tag_selection = get_fckb_taglist($query); 
     259    $tag_selection = get_taglist($query); 
    260260 
    261261    $template->append( 
  • branches/2.2/admin/include/functions.php

    r10111 r11056  
    21012101} 
    21022102 
    2103 function get_fckb_taglist($query) 
     2103function get_taglist($query) 
    21042104{ 
    21052105  $result = pwg_query($query); 
     2106   
    21062107  $taglist = array(); 
    21072108  while ($row = pwg_db_fetch_assoc($result)) 
     
    21102111      $taglist, 
    21112112      array( 
    2112         'key' => $row['tag_name'], 
    2113         'value' => '~~'.$row['tag_id'].'~~', 
     2113        'name' => $row['tag_name'], 
     2114        'id' => '~~'.$row['tag_id'].'~~', 
    21142115        ) 
    21152116      ); 
    21162117  } 
    2117  
     2118   
     2119  $cmp = create_function('$a,$b', 'return strcasecmp($a["name"], $b["name"]);'); 
     2120  usort($taglist, $cmp); 
     2121   
    21182122  return $taglist; 
    21192123} 
    21202124 
    2121 function get_fckb_tag_ids($raw_tags) 
     2125function get_tag_ids($raw_tags) 
    21222126{ 
    21232127  // In $raw_tags we receive something like array('~~6~~', '~~59~~', 'New 
     
    21272131 
    21282132  $tag_ids = array(); 
     2133  $raw_tags = explode(',',$raw_tags); 
    21292134 
    21302135  foreach ($raw_tags as $raw_tag) 
  • branches/2.2/admin/picture_modify.php

    r9943 r11056  
    167167  if (isset($_POST['tags'])) 
    168168  { 
    169     $tag_ids = get_fckb_tag_ids($_POST['tags']); 
     169    $tag_ids = get_tag_ids($_POST['tags']); 
    170170  } 
    171171  set_tags($tag_ids, $_GET['image_id']); 
     
    234234  WHERE image_id = '.$_GET['image_id'].' 
    235235;'; 
    236 $tags = get_fckb_taglist($query); 
     236$tag_selection = get_taglist($query); 
     237 
     238$query = ' 
     239SELECT 
     240    id AS tag_id, 
     241    name AS tag_name 
     242  FROM '.TAGS_TABLE.' 
     243;'; 
     244$tags = get_taglist($query); 
    237245 
    238246// retrieving direct information about picture 
     
    268276$template->assign( 
    269277  array( 
     278    'tag_selection' => $tag_selection, 
    270279    'tags' => $tags, 
    271280    'U_SYNC' => $admin_url_start.'&sync_metadata=1', 
  • branches/2.2/admin/themes/default/template/batch_manager_global.tpl

    r10421 r11056  
    66{/literal}{/footer_script} 
    77 
    8 {combine_script id='jquery.fcbkcomplete' load='footer' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'} 
    9  
    10 {footer_script require='jquery.fcbkcomplete'}{literal} 
    11 jQuery(document).ready(function() { 
    12   jQuery("#tags").fcbkcomplete({ 
    13     json_url: "admin.php?fckb_tags=1", 
    14     cache: false, 
    15     filter_case: false, 
    16     filter_hide: true, 
    17     firstselected: true, 
    18     filter_selected: true, 
    19     maxitems: 100, 
    20     newel: true 
    21   }); 
     8{combine_script id='jquery.tokeninput' load='footer' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 
     9 
     10{footer_script require='jquery.tokeninput'} 
     11jQuery(document).ready(function() {ldelim} 
     12  jQuery("#tags").tokenInput( 
     13    [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], 
     14    {ldelim} 
     15      hintText: '{'Type in a search term'|@translate}', 
     16      noResultsText: '{'No results'|@translate}', 
     17      searchingText: '{'Searching...'|@translate}', 
     18      newText: ' ({'new'|@translate})', 
     19      animateDropdown: false, 
     20      preventDuplicates: true, 
     21      allowCreation: true 
     22    } 
     23  ); 
    2224}); 
    23 {/literal}{/footer_script} 
     25{/footer_script} 
    2426 
    2527{footer_script} 
  • branches/2.2/admin/themes/default/template/batch_manager_unit.tpl

    r10650 r11056  
    33{include file='include/colorbox.inc.tpl'} 
    44 
    5 {combine_script id='jquery.fcbkcomplete' load='async' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'} 
    6 {footer_script require='jquery.fcbkcomplete'} 
     5{combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 
     6{footer_script require='jquery.tokeninput'} 
    77var tag_boxes_selector = ""; 
    88{foreach from=$elements item=element name=element} 
     
    1414        tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID}; 
    1515{/foreach} 
    16 {literal} 
    17 jQuery(document).ready(function() { 
    18         $(tag_boxes_selector).fcbkcomplete({ 
    19                 json_url: "admin.php?fckb_tags=1", 
    20                 cache: false, 
    21                 filter_case: false, 
    22                 filter_hide: true, 
    23                 firstselected: true, 
    24                 filter_selected: true, 
    25                 maxitems: 100, 
    26                 newel: true 
    27         }); 
    28    
    29   $("a.preview-box").colorbox(); 
     16 
     17jQuery(document).ready(function() {ldelim} 
     18  jQuery(tag_boxes_selector).tokenInput( 
     19    [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], 
     20    {ldelim} 
     21      hintText: '{'Type in a search term'|@translate}', 
     22      noResultsText: '{'No results'|@translate}', 
     23      searchingText: '{'Searching...'|@translate}', 
     24      newText: ' ({'new'|@translate})', 
     25      animateDropdown: false, 
     26      preventDuplicates: true, 
     27      allowCreation: true 
     28    } 
     29  ); 
     30 
     31  jQuery("a.preview-box").colorbox(); 
    3032}); 
    31 {/literal}{/footer_script} 
     33{/footer_script} 
    3234 
    3335<h2>{'Batch Manager'|@translate}</h2> 
     
    113115<select id="tags-{$element.ID}" name="tags-{$element.ID}"> 
    114116{foreach from=$element.TAGS item=tag} 
    115   <option value="{$tag.value}" class="selected">{$tag.key}</option> 
     117  <option value="{$tag.id}" class="selected">{$tag.name}</option> 
    116118{/foreach} 
    117119</select> 
  • branches/2.2/admin/themes/default/template/picture_modify.tpl

    r10421 r11056  
    33{include file='include/datepicker.inc.tpl'} 
    44 
    5 {combine_script id='jquery.fcbkcomplete' load='async' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'} 
    6 {footer_script require='jquery.fcbkcomplete'}{literal} 
    7 jQuery(document).ready(function() { 
    8         jQuery("#tags").fcbkcomplete({ 
    9                 json_url: "admin.php?fckb_tags=1", 
    10                 cache: false, 
    11                 filter_case: false, 
    12                 filter_hide: true, 
    13                 firstselected: true, 
    14                 filter_selected: true, 
    15                 maxitems: 100, 
    16                 newel: true 
    17         }); 
     5{combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 
     6{footer_script require='jquery.tokeninput'} 
     7jQuery(document).ready(function() {ldelim} 
     8  jQuery("#tags").tokenInput( 
     9    [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}], 
     10    {ldelim} 
     11      hintText: '{'Type in a search term'|@translate}', 
     12      noResultsText: '{'No results'|@translate}', 
     13      searchingText: '{'Searching...'|@translate}', 
     14      newText: ' ({'new'|@translate})', 
     15      animateDropdown: false, 
     16      preventDuplicates: true, 
     17      allowCreation: true 
     18    } 
     19  ); 
    1820}); 
    19 {/literal}{/footer_script} 
     21{/footer_script} 
    2022 
    2123{footer_script} 
     
    137139        <td> 
    138140<select id="tags" name="tags"> 
    139 {foreach from=$tags item=tag} 
    140   <option value="{$tag.value}" class="selected">{$tag.key}</option> 
     141{foreach from=$tag_selection item=tag} 
     142  <option value="{$tag.id}" class="selected">{$tag.name}</option> 
    141143{/foreach} 
    142144</select> 
  • branches/2.2/admin/themes/default/theme.css

    r10650 r11056  
    586586} 
    587587 
    588 /* jQuery FCBKcomplete */ 
    589 /* TextboxList sample CSS */ 
    590 ul.holder { margin: 0; border: 1px solid #999; overflow: hidden; height: auto !important; height: 1%; padding: 4px 5px 0; } 
    591 *:first-child+html ul.holder { padding-bottom: 2px; } * html ul.holder { padding-bottom: 2px; } /* ie7 and below */ 
    592 ul.holder li { float: left; list-style-type: none; margin: 0 5px 4px 0; white-space:nowrap;} 
    593 ul.holder li.bit-box, ul.holder li.bit-input input { font: 11px "Lucida Grande", "Verdana"; } 
    594 ul.holder li.bit-box { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; border: 1px solid #CAD8F3; background: #DEE7F8; padding: 1px 5px 2px; } 
    595 ul.holder li.bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; } 
    596 ul.holder li.bit-input input { width: auto; overflow:visible; margin: 0; border: 0px; outline: 0; padding: 3px 0px 2px; } /* no left/right padding here please */ 
    597 ul.holder li.bit-input input.smallinput { width: 20px; } 
    598  
    599 /* Facebook demo CSS */       
    600 #add { border: 1px solid #999; width: 550px; margin: 50px; padding: 20px 30px 10px; } 
    601 form ol li { list-style-type: none; } 
    602 form ol { font: 11px "Lucida Grande", "Verdana"; margin: 0; padding: 0; } 
    603 form ol li.input-text { margin-bottom: 10px; list-style-type: none; padding-bottom: 10px; } 
    604 form ol li.input-text label { font-weight: bold; cursor: pointer; display: block; font-size: 13px; margin-bottom: 10px; } 
    605 form ol li.input-text input { width: 500px; padding: 5px 5px 6px; font: 11px "Lucida Grande", "Verdana"; border: 1px solid #999; } 
    606 form ul.holder { width: 500px; } 
    607 form ul { margin: 0 !important } 
    608 ul.holder li.bit-box, #apple-list ul.holder li.bit-box { padding-right: 15px; position: relative; z-index:1000;} 
    609 #apple-list ul.holder li.bit-input { margin: 0; } 
    610 #apple-list ul.holder li.bit-input input.smallinput { width: 5px; } 
    611 ul.holder li.bit-hover { background: #BBCEF1; border: 1px solid #6D95E0; } 
    612 ul.holder li.bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; } 
    613 ul.holder li.bit-box a.closebutton { position: absolute; right: 4px; top: 5px; display: block; width: 7px; height: 7px; font-size: 1px; background: url(icon/fcbkcomplete_close.gif); } 
    614 ul.holder li.bit-box a.closebutton:hover { background-position: 7px; } 
    615 ul.holder li.bit-box-focus a.closebutton, ul.holder li.bit-box-focus a.closebutton:hover { background-position: bottom; } 
    616  
    617 /* Autocompleter */ 
    618  
    619 .facebook-auto { display: none; position: absolute; width: 512px; background: #eee; } 
    620 .facebook-auto .default { padding: 5px 7px; border: 1px solid #ccc; border-width: 0 1px 1px;font-family:"Lucida Grande","Verdana"; font-size:11px; } 
    621 .facebook-auto ul { display: none; margin: 0; padding: 0; overflow: auto; position:absolute; z-index:9999} 
    622 .facebook-auto ul li { padding: 5px 12px; z-index: 1000; cursor: pointer; margin: 0; list-style-type: none; border: 1px solid #ccc; border-width: 0 1px 1px; font: 11px "Lucida Grande", "Verdana"; background-color: #eee } 
    623 .facebook-auto ul li em { font-weight: bold; font-style: normal; background: #ccc; } 
    624 .facebook-auto ul li.auto-focus { background: #4173CC; color: #fff; } 
    625 .facebook-auto ul li.auto-focus em { background: none; } 
    626 .deleted { background-color:#4173CC !important; color:#ffffff !important;} 
    627 .hidden { display:none;} 
    628  
    629 #demo ul.holder li.bit-input input { padding: 2px 0 1px; border: 1px solid #999; } 
    630 .ie6fix {height:1px;width:1px; position:absolute;top:0px;left:0px;z-index:1;} 
    631  
    632588/* Add photos, direct mode */ 
    633589#uploadBoxes P { 
     
    10461002#batchManagerGlobal .useFilterCheckbox {display:none} 
    10471003 
     1004 
     1005/* TokenInput (with Facebook style) */ 
     1006ul.token-input-list {overflow: hidden; height: auto !important; height: 1%;width: 400px;border: 1px solid #8496ba;cursor: text;font-size: 12px;font-family: Verdana;min-height: 1px;z-index: 999;margin: 0;padding: 0;background-color: #fff;list-style-type: none;clear: left;} 
     1007ul.token-input-list li input {border: 0;width: 100px;padding: 3px 8px;background-color: white;margin: 2px 0;-webkit-appearance: caret;} 
     1008li.token-input-token {overflow: hidden; height: auto !important; height: 15px;margin: 3px;padding: 1px 3px;background-color: #eff2f7;color: #000;cursor: default;border: 1px solid #ccd5e4;font-size: 11px;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;float: left;white-space: nowrap;} 
     1009li.token-input-token p {display: inline;padding: 0;margin: 0;} 
     1010li.token-input-token span {color: #a6b3cf;margin-left: 5px;font-weight: bold;cursor: pointer;} 
     1011li.token-input-selected-token {background-color: #5670a6;border: 1px solid #3b5998;color: #fff;} 
     1012li.token-input-input-token {float: left;margin: 0;padding: 0;list-style-type: none;width:10px;} 
     1013div.token-input-dropdown {position: absolute;width: 400px;background-color: #fff;overflow: hidden;border-left: 1px solid #ccc;border-right: 1px solid #ccc;border-bottom: 1px solid #ccc;cursor: default;font-size: 11px;font-family: Verdana;z-index: 1;} 
     1014div.token-input-dropdown p {margin: 0;padding: 5px;font-weight: bold;color: #777;} 
     1015div.token-input-dropdown ul {margin: 0;padding: 0;} 
     1016div.token-input-dropdown ul li {background-color: #fff;padding: 3px;margin: 0;list-style-type: none;} 
     1017div.token-input-dropdown ul li.token-input-dropdown-item {background-color: #fff;} 
     1018div.token-input-dropdown ul li.token-input-dropdown-item2 {background-color: #fff;} 
     1019div.token-input-dropdown ul li em {font-weight: bold;font-style: normal;} 
     1020div.token-input-dropdown ul li.token-input-selected-dropdown-item {background-color: #3b5998;color: #fff;} 
     1021 
    10481022.warning { 
    10491023  background:url(icon/warning.png) no-repeat top left; 
  • branches/2.2/admin/themes/roma/theme.css

    r9815 r11056  
    246246#batchManagerGlobal #selectedMessage {background-color:#555; color:#ddd;} 
    247247 
     248/* TokenInput (with Facebook style for ROMA) */ 
     249ul.token-input-list {border-color:#666;background-color:#444;} 
     250ul.token-input-list li input {background-color:#444;} 
     251li.token-input-token span {color:#878787;} 
     252div.token-input-dropdown {background-color:#eee;border-color:#666;} 
     253div.token-input-dropdown ul li {background-color:#eee;} 
     254div.token-input-dropdown ul li.token-input-selected-dropdown-item {background-color:#FF7800;} 
  • branches/2.2/language/en_UK/admin.lang.php

    r10249 r11056  
    430430$lang['Move'] = "Move"; 
    431431$lang['Name'] = "Name"; 
     432$lang['new'] = "new"; 
    432433$lang['New name'] = "New name"; 
    433434$lang['New parent album'] = "New parent album"; 
     
    444445$lang['No photo selected, %d photos in current set'] = 'No photo selected, %d photos in current set'; 
    445446$lang['No photo selected, no action possible.'] = 'No photo selected, no action possible.'; 
     447$lang['No results'] = "No results"; 
    446448$lang['No user to send notifications by mail.'] = "No user to be notified by mail."; 
    447449$lang['no write access'] = "no write access"; 
     
    577579$lang['Save Settings'] = 'Save Settings'; 
    578580$lang['Save to permalink history'] = "Save to permalinks history"; 
     581$lang['Searching...'] = "Searching..."; 
    579582$lang['Search for new images in the directories'] = "Search for new images in the directories"; 
    580583$lang['Section'] = "Section"; 
     
    692695$lang['Type here the author name'] = 'Type here the author name'; 
    693696$lang['Type here the title'] = 'Type here the title'; 
     697$lang['Type in a search term'] = "Type in a search term"; 
    694698$lang['Unable to check for upgrade.'] = "Unable to check for upgrade."; 
    695699$lang['Uncheck all'] = "Uncheck all"; 
  • branches/2.2/language/fr_FR/admin.lang.php

    r11052 r11056  
    795795$lang['ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'] = 'ERREUR: CE PLUGIN EST MANQUANT MAIS TOUJOURS INSTALLÉ! DÉSINSTALLEZ-LE.'; 
    796796$lang['display'] = 'Afficher'; 
     797$lang['No results'] = "Pas de résultat"; 
     798$lang['Type in a search term'] = "Entrez un terme de recherche"; 
     799$lang['Searching...'] = "Recherche..."; 
     800$lang['new'] = "nouveau"; 
    797801?> 
Note: See TracChangeset for help on using the changeset viewer.