Ignore:
Timestamp:
03/05/2010 07:57:04 AM (2 years ago)
Author:
zhongzhen
Message:

version up of Help extention

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/omcollab_zhongzhen2/wiki/extensions/Help/Help_Guide.php

    r1399 r1402  
    3030        // Add javascript to Edit page 
    3131        $wgOut->addHTML("<script> 
    32                         function changeIcon(obj) { 
    33                                 var source = obj.src; 
    34                                 if (source.search('button_help') > -1) { 
    35                                         obj.src = 'extensions/Help/images/button_hide.gif'; 
    36                                         $('#shadow').css('display', 'block'); 
    37                                         $('#wpTextbox1').css('width', '60%'); 
    38                                 } 
    39                                 else { 
    40                                         obj.src = 'extensions/Help/images/button_help.gif'; 
    41                                         $('#shadow').css('display', 'none'); 
    42                                         $('#wpTextbox1').css('width', '92%'); 
    43                                 } 
     32            var textwidth = new Number(); 
     33                        function showHelp() { 
     34                textwidth = $('#editform').width() - $('#shadow').width() - 30; 
     35                $('.button_class').css('display', 'none'); 
     36                                $('#shadow').css('display', 'block'); 
     37                                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
    4438                        } 
     39             
     40            function hideHelp() { 
     41                textwidth = $('#editform').width() - $('.button_class').width() - 30; 
     42                $('.button_class').css('display', 'block'); 
     43                $('#shadow').css('display', 'none'); 
     44                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
     45            } 
     46             
     47            $(window).resize(function() { 
     48                if ($('#shadow').css('display') == 'block') 
     49                    textwidth = $('#editform').width() - $('#shadow').width() - 30; 
     50                else 
     51                    textwidth = $('#editform').width() - $('.button_class').width() - 30; 
     52                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
     53            }); 
     54             
     55            $(function() { 
     56                textwidth = $('#editform').width() - $('#shadow').width() - 30; 
     57                $('#wpTextbox1').css('display', 'block'); 
     58                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
     59            }); 
     60 
    4561        </script>"); 
    4662         
     
    7894         
    7995        //Help content area 
    80         $editPage->editFormTextBeforeContent .= '<div id="shadow"><div id="helpArea">' . $html . '</div></div>';  
     96        $editPage->editFormTextBeforeContent .= '<div id="shadow"><div id="helpArea"> 
     97        <div id="closeButton"><img src="extensions/Help/images/button_close.gif" style="cursor: pointer; border: 0;" onclick="hideHelp()"/></div>' . $html . '</div></div>';  
    8198        // Help button 
    82         $editPage->editFormTextBeforeContent .= '<div class="button_class"><img src="extensions/Help/images/button_hide.gif" style="cursor: pointer;" onclick="changeIcon(this)"/></div>';  
     99        $editPage->editFormTextBeforeContent .= '<div class="button_class"><img src="extensions/Help/images/button_help.gif" style="cursor: pointer;" onclick="showHelp()"/></div>';  
    83100 
    84101        return true; 
Note: See TracChangeset for help on using the changeset viewer.