Changeset 4388

Show
Ignore:
Timestamp:
07/13/07 10:01:23 (1 year ago)
Author:
gregmac
Message:

Add freepbx_modal_show(), freepbx_modal_close(), freepbx_modal_hide() javascript functions;
Add CSS for module admin modal dialog;
Refactor css/javascript from AJAX reload so it also supports module admin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.3/amp_conf/htdocs/admin/common/mainstyle.css

    r4378 r4388  
    4848        border:1px solid #ccc; 
    4949} 
    50  
    51 body {  
    52         background-image: url('../images/shadow-side-background.png'); 
    53         background-repeat: repeat-y; 
    54         background-position: left; 
    55 } 
    56  
    5750 
    5851.attention { 
     
    541534} 
    542535#reloadBox { 
     536        border:2px solid #333; 
    543537        background:#8c0000; 
    544538        padding:15px; 
     
    556550#reload_reloading { 
    557551        text-align:center; 
     552        cursor:wait; 
    558553} 
    559554#reload_reloading h2 { 
     
    563558#reload_reloading img { 
    564559        align:center; 
     560} 
     561 
     562 
     563#moduleBox { 
     564        border:2px solid #333; 
     565        background:white; 
     566        padding:15px; 
     567        z-index:1000; 
     568        position:fixed; 
     569        width:500px; 
     570        height:400px; 
     571} 
     572#moduleBox iframe { 
     573        width:490px; 
     574        height:390px; 
     575        border:0; 
    565576} 
    566577 
  • freepbx/branches/2.3/amp_conf/htdocs/admin/views/freepbx.php

    r4378 r4388  
    3333        <meta http-equiv="Content-Type" content="text/html" /> 
    3434        <link href="common/mainstyle.css" rel="stylesheet" type="text/css" /> 
     35        <link href="common/freepbx.css" rel="stylesheet" type="text/css" /> 
    3536        <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="favicon.ico" /> 
    3637        <!--[if IE]> 
     
    7172        <script type="text/javascript" src="common/jquery.dimensions.js"></script> <!-- used by reload/module admin --> 
    7273        <script type="text/javascript" src="common/jquery.interface.js"></script> <!-- used to fade colors --> 
     74        <script type="text/javascript" src="common/interface.dim.js"></script> <!-- used for interface blocking (reload, modadmin) --> 
    7375        <link href="common/jquery.tabs.css" rel="stylesheet" type="text/css" /> 
    7476         
  • freepbx/branches/2.3/amp_conf/htdocs/admin/views/freepbx_reload.php

    r4378 r4388  
    11<script type="text/javascript"> 
    2         var realHeight; 
    3          
    42        function freepbx_show_reload() { 
    53                //$.blockUI($('#reloadBox')[0], { width: '400px' }); 
     
    108                $("#reload_response").hide(); 
    119                 
    12                 // hack: find the "real" height 
    13                 navHeight = $('#nav').height(); 
    14                 wrapperHeight = $('#wrapper').height() 
    15                 realHeight = $('#header').height() + (wrapperHeight > navHeight ? wrapperHeight : navHeight); 
    16                  
    17                 // center the box 
    18                 $('#reloadBox').css({ 
    19                         top: ( Math.floor( $(window).height()/2 - ($('#reloadBox').height()/2) ) ), 
    20                         left: ( Math.floor( $(window).width()/2 - ($('#reloadBox').width()/2) ) ) 
    21                 }); 
    22                 // dim screen 
    23                 $.dimScreen(300, 0.7, function() { 
    24                         // show reload box 
    25                         $('#reloadBox').fadeIn(300); 
    26                 }); 
     10                freepbx_modal_show('reloadBox'); 
    2711        } 
    2812        function freepbx_stop_reload() { 
    29                 $('#reloadBox').fadeOut(300, function() { 
    30                         $.dimScreenStop(300); 
    31                 }); 
     13                freepbx_modal_close('reloadBox'); 
    3214        } 
     15         
    3316        function run_reload() { 
    3417                 
     
    7255        } 
    7356 
    74 //dimScreen() 
    75 //by Brandon Goldman 
    76 jQuery.extend({ 
    77     //dims the screen 
    78     dimScreen: function(speed, opacity, callback) { 
    79         if(jQuery('#__dimScreen').size() > 0) return; 
    80          
    81         if(typeof speed == 'function') { 
    82             callback = speed; 
    83             speed = null; 
    84         } 
    85  
    86         if(typeof opacity == 'function') { 
    87             callback = opacity; 
    88             opacity = null; 
    89         } 
    90  
    91         if(speed < 1) { 
    92             var placeholder = opacity; 
    93             opacity = speed; 
    94             speed = placeholder; 
    95         } 
    96          
    97         if(opacity >= 1) { 
    98             var placeholder = speed; 
    99             speed = opacity; 
    100             opacity = placeholder; 
    101         } 
    102                  
    103                 /* freepbx hack to get "real" height */ 
    104                 dimHeight = (realHeight > 0) ? realHeight : $(window).height(); 
    105  
    106         speed = (speed > 0) ? speed : 500; 
    107         opacity = (opacity > 0) ? opacity : 0.5; 
    108         return jQuery('<div></div>').attr({ 
    109                 id: '__dimScreen' 
    110                 ,fade_opacity: opacity 
    111                 ,speed: speed 
    112             }).css({ 
    113             background: '#000' 
    114             ,height: dimHeight + 'px' 
    115             ,left: '0px' 
    116             ,opacity: 0 
    117             ,position: 'absolute' 
    118             ,top: '0px' 
    119             ,width: $(window).width() + 'px' 
    120             ,zIndex: 999 
    121         }).appendTo(document.body).fadeTo(speed, 0.7, callback); 
    122     }, 
    123      
    124     //stops current dimming of the screen 
    125     dimScreenStop: function(callback) { 
    126         var x = jQuery('#__dimScreen'); 
    127         var opacity = x.attr('fade_opacity'); 
    128         var speed = x.attr('speed'); 
    129         x.fadeOut(speed, function() { 
    130             x.remove(); 
    131             if(typeof callback == 'function') callback(); 
    132         }); 
    133     } 
    134 }); 
    135  
    13657 
    13758</script> 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads