Changeset 1402


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

version up of Help extention

Location:
branches/omcollab_zhongzhen2/wiki/extensions/Help
Files:
1 added
1 deleted
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/omcollab_zhongzhen2/wiki/extensions/Help/HelpExtention.css

    r1396 r1402  
    77 
    88#wpTextbox1 { 
    9     width: 60%; 
    109        float: left; 
    1110        clear: none; 
     11    display: none; 
    1212} 
    1313 
     
    2222} 
    2323 
     24#closeButton { 
     25    width: 15px; 
     26    height: 15px;  
     27    position: absolute; 
     28    top: -7px; 
     29    right: -7px; 
     30    font-size: 11px; 
     31} 
     32 
    2433#shadow { 
    2534    background-color: #EFEFEF; 
    2635    float: right;  
    2736    margin: 5px; 
    28     width: 30%; 
     37    width: 280px; 
    2938} 
    3039 
     
    3847.tab_normal {color: #FFF; cursor: pointer; background-color: #AEAEAE;} 
    3948 
    40 .button_class {float: right; text-align: center; width: 7%;} 
     49.button_class {float: right; text-align: center; padding-right: 2px; display: none;} 
    4150.help_content {padding: 10px; display: none; color:#444;} 
    4251 
  • 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.