Changeset 6891 for extensions/AMetaData/admin/amd_metadata_personnal.tpl
- Timestamp:
- Sep 13, 2010, 8:40:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/admin/amd_metadata_personnal.tpl
r6731 r6891 4 4 {known_script id="gpc.external.interface" src=$ROOT_URL|@cat:"plugins/GrumPluginClasses/js/external/interface/interface.js"} 5 5 {known_script id="gpc.external.inestedsortable" src=$ROOT_URL|@cat:"plugins/GrumPluginClasses/js/external/inestedsortable.pack.js"} 6 {known_script id="tagListSelector" src=$ROOT_URL|@cat:"plugins/AMetaData/js/tagListSelector.js"} 7 6 8 7 9 {literal} 8 10 <script type="text/javascript"> 9 10 /**11 * sorry, tagListSelector is coded like a pork, but I don't have the time to12 * code something better... ^^;13 */14 function tagListSelector(itemId)15 {16 options = {17 itemId:'',18 selectorId:'',19 width:'auto',20 height:'auto',21 maxHeight:250,22 selectedClass:'gcText3',23 selectorClass:'ruleTypeM gcTextInput gcBgInput gcBorderInput',24 selectorItems:'ruleTypeM',25 }26 27 this.init = function (itemId)28 {29 options.itemId=itemId;30 $('body').append("<div id='iTLSDiv' class='"+options.selectorClass+"' style='padding:0px;z-index:5000;overflow:auto;display:none;position:absolute;max-height:"+options.maxHeight+"px'></div>");31 $('#iTLSDiv')32 .prepend($('#'+itemId))33 .bind('mouseleave', function ()34 {35 $('#iTLSDiv').css('display', 'none');36 }37 );38 $('#'+itemId).css('display', 'block');39 $('#iTLSDiv li').bind('click', function ()40 {41 $('#'+options.selectorId).attr('value', $(this).attr('value'));42 $('#'+options.selectorId+' span.ruleContent').html($(this).html());43 $('#iTLSDiv').css('display', 'none');44 }45 );46 }47 48 this.display = function (fromId)49 {50 selectedItem=$('#'+fromId).attr('value');51 52 top=$('#'+fromId).offset().top+$('#'+fromId).outerHeight()-1;53 left=$('#'+fromId).offset().left;54 width=$('#'+fromId).innerWidth();55 $('#iTLSDiv li').removeClass(options.selectedClass);56 $('#iTagListItem'+selectedItem).addClass(options.selectedClass);57 $('#iTLSDiv').css(58 {59 top:top+'px',60 left:left+'px',61 width:width+'px',62 display:'block'63 }64 );65 options.selectorId=fromId;66 }67 68 this.init(itemId);69 }70 11 71 12 … … 75 16 numId:'', 76 17 newRuleId:1, 18 optimalHeight:0, 77 19 } 78 20 … … 107 49 } 108 50 ); 51 109 52 $('#iBDTagId').bind('keyup focusout', function (event) 110 53 { … … 158 101 } 159 102 160 $('#mdRulesArea').css('height', ($('#iDialogEdit').height()-$('#mdRulesArea').position().top)+'px' ); 103 options.optimalHeight=$('#iDialogEdit').height()-$('#mdRulesArea').position().top; 104 $('#mdRulesArea').css('height', options.optimalHeight+'px' ); 161 105 } 162 106 ) … … 309 253 } 310 254 ); 255 checkDialogHeight(); 311 256 }, 312 257 onHover: function (draggedItem) … … 381 326 } 382 327 applyNested(); 328 checkDialogHeight(); 383 329 } 384 330 … … 395 341 } 396 342 ); 343 checkDialogHeight(); 397 344 } 398 345 … … 423 370 $('#iBDRuleTypeC'+id).css('display', 'inline-block'); 424 371 } 372 checkDialogHeight(); 425 373 } 426 374 … … 439 387 $('#iBDRuleTypeCIfValue'+id).css('display', 'inline'); 440 388 } 389 checkDialogHeight(); 441 390 } 442 391 … … 456 405 { 457 406 $('#iBDRuleType'+value).get(0).disabled=false; 407 } 408 } 409 410 /** 411 * check if it necessary to calculate the height of the dialogbox 412 */ 413 var checkDialogHeight = function() 414 { 415 if($('#iBDRules').height() < options.optimalHeight && 416 $('#mdRulesArea').get(0).scrollHeight > options.optimalHeight) 417 { 418 $('#iDialogEdit').height(options.optimalHeight+$('#mdRulesArea').get(0).offsetTop); 419 $('#mdRulesArea').height(options.optimalHeight); 420 } 421 else if($('#mdRulesArea').get(0).scrollHeight > options.optimalHeight) 422 { 423 $('#iDialogEdit').height($('#mdRulesArea').get(0).scrollHeight+$('#mdRulesArea').get(0).offsetTop); 424 $('#mdRulesArea').height($('#mdRulesArea').get(0).scrollHeight); 458 425 } 459 426 } … … 749 716 <option value='%'>{'g003_typeCIfLike'|@translate}</option> 750 717 <option value='!%'>{'g003_typeCIfNotLike'|@translate}</option> 751 </select> 718 <option value='^%'>{'g003_typeCIfBeginWith'|@translate}</option> 719 <option value='!^%'>{'g003_typeCIfNotBeginWith'|@translate}</option> 720 <option value='$%'>{'g003_typeCIfEndWith'|@translate}</option> 721 <option value='!$%'>{'g003_typeCIfNotEndWith'|@translate}</option> </select> 752 722 <input type='text' id='iBDRuleTypeCIfValueZZZZZ' value='' maxlength=200 size=26 style='display:none;'> 753 723 </div> … … 770 740 </ul> 771 741 742 {literal} 772 743 <script type="text/javascript"> 773 744 var udm=new userDefManage(); 774 var tls=new tagListSelector( 'iTagList');745 var tls=new tagListSelector({itemId:'iTagList'}); 775 746 </script> 747 {/literal}
Note: See TracChangeset
for help on using the changeset viewer.