{combine_script id="jquery.ui.draggable"} {combine_script id="jquery.ui.droppable"} {combine_script id="farbtastic" require="jquery" path=$ROOT_URL|@cat:"plugins/typetags/admin/farbtastic/farbtastic.js"} {combine_css path=$ROOT_URL|@cat:"plugins/typetags/admin/farbtastic/farbtastic.css"} {combine_css path=$ROOT_URL|@cat:"plugins/typetags/admin/typetags_style.css"} {footer_script}{literal} // set all containers the same size function equilibrate() { var h=0; jQuery("#associations ul") .css('height', 'auto') .each(function() { h = Math.max(h, jQuery(this).height()); }) .promise().done(function() { jQuery("#associations ul").css({'height': h+'px'}); }); //jQuery("#tt-NULL").css('height', 'auto'); } // generate tag:typetag couples before submit the form function save_datas(form) { var out = ''; jQuery(".tt-container").each(function() { var section = jQuery(this).attr('id'); jQuery("> li", this).each(function() { out += jQuery(this).attr('id') + ':' + section + ';'; }); }); jQuery('#assoc-input').val(out); submit(form); } // colorpicker jQuery('#colorpicker').farbtastic('#hexval'); // move each tag in it's typetag container jQuery('ul#tt-NULL li').each(function() { var $target = jQuery('ul#' + jQuery(this).attr('data')); jQuery(this).appendTo($target).css('float', 'left'); if ($($target).attr('id') == 'tt-NULL') jQuery(this).css({'display':'inline-block','float':'none'}); }); equilibrate(); // init drag jQuery("li").draggable({ revert: "invalid", helper: "clone", cursor: "move" }); // init drop jQuery('.tt-container').droppable({ accept: "li", hoverClass: "active", drop: function(event, ui) { var $gallery = this; ui.draggable.fadeOut(function() { jQuery(this).appendTo($gallery).css('float', 'left').css('display','').fadeIn(); if ($($gallery).attr('id') == 'tt-NULL') jQuery(this).css({'display':'inline-block','float':'none'}); equilibrate(); }); } }); {/literal}{/footer_script}

TypeT@gs

{if isset($IN_EDIT)} {'Edit typetag'|@translate}

{'Edited TypeTag'|@translate} :

 

{'New name'|@translate} :

{'New color'|@translate} :

 

{else} {'Create a Typetag'|@translate}

{'New TypeTag'|@translate} :

{'Color TypeTag'|@translate} :

 

{/if}
{if !empty($typetags_selection) and !isset($IN_EDIT)}
{'Edit and associate TypeTags'|@translate}
{foreach from=$typetags_selection item=typetag}
    {'edit'|@translate} {'delete'|@translate}
    {$typetag.name}
{/foreach}

{/if} {if !isset($IN_EDIT)}
{'Configuration'|@translate} {'Display colored tags'|@translate}

{/if}