Changeset 12964

Show
Ignore:
Timestamp:
11/16/11 05:34:57 (2 years ago)
Author:
mbrevda
Message:

downstream changes to allow click events in menu items (i.e. codes in sip/iax settings)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.10/amp_conf/htdocs/admin/assets/js/pbxlib.js

    r12842 r12964  
    118118function freepbx_reload_error(txt){var box=$('<div></div>').html(txt).dialog({title:'Error!',resizable:false,modal:true,minWidth:600,position:['center',50],close:function(e){$(e.target).dialog("destroy").remove();},buttons:[{text:fpbx.msg.framework.retry,click:function(){$(this).dialog("destroy").remove();fpbx_reload();}},{text:fpbx.msg.framework.cancel,click:function(){$(this).dialog("destroy").remove();}}]});$('#error_more_info').click(function(){$(this).next('pre').show();$(this).hide();return false;})} 
    119119function toggle_reload_button(action){switch(action){case'show':$('#button_reload').show().css('display','inline-block');break;case'hide':$('#button_reload').hide();break;}} 
    120 $(document).ready(function(){bind_dests_double_selects();$("a.info").each(function(){$(this).after('<span class="help">?<span>'+$(this).find('span').html()+'</span></span>');$(this).find('span').remove();$(this).replaceWith($(this).text())}) 
     120$(document).ready(function(){bind_dests_double_selects();$("a.info").each(function(){$(this).after('<span class="help">?<span>'+$(this).find('span').html()+'</span></span>');$(this).find('span').remove();$(this).replaceWith($(this).html())}) 
    121121$(".help").live('mouseenter',function(){side=fpbx.conf.text_dir=='lrt'?'left':'right';var pos=$(this).offset();var offset=(200-pos.side)+"px";$(this).find("span").css(side,offset).stop(true,true).delay(500).animate({opacity:"show"},750);}).live('mouseleave',function(){$(this).find("span").stop(true,true).animate({opacity:"hide"},"fast");});$('.guielToggle').click(function(){var txt=$(this).find('.guielToggleBut');var el=$(this).data('toggle_class');switch(txt.text().replace(/ /g,'')){case'-':txt.text('+ ');$('.'+el).hide() 
    122122break;case'+':txt.text('-  ');$('.'+el).show();break;}}) 
    123123$('#fpbx_lang > li').click(function(){$.cookie('lang',$(this).data('lang'));window.location.reload();}) 
    124124$('.rnav > ul').menu();$('.radioset').buttonset();$('.menubar').show().menubar();$('.module_menu_button').hover(function(){$(this).click()},function(){});if(fpbx.conf.reload_needed){toggle_reload_button('show');} 
    125 $('.sortable').menu();$('.ui-menu-item').click(function(){go=$(this).find('a').attr('href');if(go&&!$(this).find('a').hasClass('ui-state-disabled')){document.location.href=go;}}) 
    126 $('#button_reload').click(function(){if(fpbx.conf.RELOADCONFIRM=='true'){fpbx_reload_confirm();}else{fpbx_reload();}});$('#BRAND_IMAGE_TANGO_LEFT').click(function(){window.open($(this).data('brand_image_freepbx_link_left'),'_newtab');});$('input[type=submit],input[type=button], button, input[type=reset]').each(function(){var prim=(typeof $(this).data('button-icon-primary')=='undefined')?'':($(this).data('button-icon-primary'));var sec=(typeof $(this).data('button-icon-secondary')=='undefined')?'':($(this).data('button-icon-secondary'));var txt=(typeof $(this).data('button-text')=='undefined')?'true':($(this).data('button-text'));var txt=(txt=='true')?true:false;$(this).button({icons:{primary:prim,secondary:sec},text:txt});});$(document).bind('keydown','meta+shift+a',function(){$('#modules_button').trigger('click');});$(document).bind('keydown','meta+shift+s',function(){});$(document).bind('keydown','meta+shift+x',function(){});$('#user_logout').click(function(){url=window.location.pathname;$.get(url+'?logout=true',function(){$.cookie('PHPSESSID',null);window.location=url;});});}); 
     125$('.sortable').menu().find('input[type="checkbox"]').click(function(event){event.stopPropagation();});$('.ui-menu-item').click(function(){go=$(this).find('a').attr('href');if(go&&!$(this).find('a').hasClass('ui-state-disabled')){document.location.href=go;}}) 
     126$('#button_reload').click(function(){if(fpbx.conf.RELOADCONFIRM=='true'){fpbx_reload_confirm();}else{fpbx_reload();}});$('#BRAND_IMAGE_TANGO_LEFT').click(function(){window.open($(this).data('brand_image_freepbx_link_left'),'_newtab');});$('input[type=submit],input[type=button], button, input[type=reset]').each(function(){var prim=(typeof $(this).data('button-icon-primary')=='undefined')?'':($(this).data('button-icon-primary'));var sec=(typeof $(this).data('button-icon-secondary')=='undefined')?'':($(this).data('button-icon-secondary'));var txt=(typeof $(this).data('button-text')=='undefined')?'true':($(this).data('button-text'));var txt=(txt=='true')?true:false;$(this).button({icons:{primary:prim,secondary:sec},text:txt});});$(document).bind('keydown','meta+shift+a',function(){$('#modules_button').trigger('click');});$(document).bind('keydown','ctrl+shift+s',function(){$('input[type=submit][name=Submit]').click();});$(document).bind('keydown','ctrl+shift+a',function(){fpbx_reload();});$('#user_logout').click(function(){url=window.location.pathname;$.get(url+'?logout=true',function(){$.cookie('PHPSESSID',null);window.location=url;});});}); 
    127127(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return;} 
    128128var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text")){return;} 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/assets/js/script.legacy.js

    r12941 r12964  
    762762   
    763763  //style all sortables as menu's 
    764   $('.sortable').menu(); 
     764  $('.sortable').menu().find('input[type="checkbox"]').click(function(event) {  
     765    event.stopPropagation();  
     766  }); 
    765767   
    766768  //Links are disabled in menu for now. Final release will remove that 
  • freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/utility.functions.php

    r12837 r12964  
    639639 * returns a hierarchical array representing the directory structure 
    640640 * 
    641  * @pram string 
     641 * @pram string - directory to scan 
     642 * @pram strin - retirn absolute paths 
    642643 * @returns array 
    643644 * 
    644645 * @author Moshe Brevda mbrevda => gmail ~ com 
    645  * @TODO: there is much that can be done to make this more useful 
    646  * for example, as option to return absolute paths 
    647  */ 
    648 function scandirr($dir) { 
     646 */ 
     647function scandirr($dir, $absolute = false) { 
    649648  $list = array(); 
     649  if ($absolute) { 
     650    global $list; 
     651  } 
     652   
    650653   
    651654  //get directory contents 
     
    659662    //if current file ($d) is a directory, call scandirr 
    660663    if (is_dir($dir . '/' . $d)) { 
    661       $list[$d] = scandirr($dir . '/' . $d); 
     664      if ($absolute) { 
     665        scandirr($dir . '/' . $d, $absolute); 
     666      } else { 
     667        $list[$d] = scandirr($dir . '/' . $d, $absolute); 
     668      } 
     669       
    662670     
    663671      //otherwise, add the file to the list 
    664672    } elseif (is_file($dir . '/' . $d) || is_link($dir . '/' . $d)) { 
    665       $list[] = $d; 
    666     } 
    667   } 
    668    
     673      if ($absolute) { 
     674        $list[] = $dir . '/' . $d; 
     675      } else { 
     676        $list[] = $d; 
     677      } 
     678       
     679    } 
     680  } 
     681 
    669682  return $list; 
    670683} 
  • modules/branches/2.10/sipsettings/assets/js/sipsettings.js

    r12445 r12964  
    11$(document).ready(function() { 
    2  $('.sortable').sortable( { 
     2 $('.sortable').sortable( { 
    33     update: function(event, ui) { 
    44      //console.log(ui.item.find('input').val(), ui.item.index()) 
    55      ui.item.find('input').val(ui.item.index()) 
    66    } 
    7   }) 
     7  }); 
     8   
    89});