Ignore:
Timestamp:
03/05/2010 10:50:31 AM (2 years ago)
Author:
Xiping.Wang
Message:

[trunk] merged from omcollab_zhongzhen2

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/wiki

  • trunk/wiki/extensions/Help/Help_Guide.php

    r1400 r1405  
    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'); 
     38                $('#wpTextbox1___Frame').css('width', textwidth.toString() + 'px'); 
    4439                        } 
     40             
     41            function hideHelp() { 
     42                textwidth = $('#editform').width() - $('.button_class').width() - 30; 
     43                $('.button_class').css('display', 'block'); 
     44                $('#shadow').css('display', 'none'); 
     45                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
     46                $('#wpTextbox1___Frame').css('width', textwidth.toString() + 'px'); 
     47            } 
     48             
     49            $(window).resize(function() { 
     50                if ($('#shadow').css('display') == 'block') 
     51                    textwidth = $('#editform').width() - $('#shadow').width() - 30; 
     52                else 
     53                    textwidth = $('#editform').width() - $('.button_class').width() - 30; 
     54                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
     55                $('#wpTextbox1___Frame').css('width', textwidth.toString() + 'px'); 
     56            }); 
     57             
     58            $(function() { 
     59                textwidth = $('#editform').width() - $('#shadow').width() - 30; 
     60                $('#wpTextbox1').css('display', 'block'); 
     61                $('#wpTextbox1').css('width', textwidth.toString() + 'px'); 
     62                $('#wpTextbox1___Frame').css('width', textwidth.toString() + 'px'); 
     63            }); 
     64 
    4565        </script>"); 
    4666         
     
    7898         
    7999        //Help content area 
    80         $editPage->editFormTextBeforeContent .= '<div id="shadow"><div id="helpArea">' . $html . '</div></div>';  
     100        $editPage->editFormTextBeforeContent .= '<div id="shadow"><div id="helpArea"> 
     101        <div id="closeButton"><img src="extensions/Help/images/button_close.gif" style="cursor: pointer; border: 0;" onclick="hideHelp()"/></div>' . $html . '</div></div>';  
    81102        // Help button 
    82         $editPage->editFormTextBeforeContent .= '<div class="button_class"><img src="extensions/Help/images/button_hide.gif" style="cursor: pointer;" onclick="changeIcon(this)"/></div>';  
    83  
     103        $editPage->editFormTextBeforeContent .= '<div class="button_class"><img src="extensions/Help/images/button_help.gif" style="cursor: pointer;" onclick="showHelp()"/></div>';  
    84104        return true; 
    85105} 
Note: See TracChangeset for help on using the changeset viewer.