Changeset - r30:de0b00cc9fec
[Not reviewed]
v0.8 default
0 3 0
Wolfgang Scherer (ws) - 13 years ago 2012-04-02 17:07:31
wolfgang.scherer@gmx.de
index.php: show/hide export mode (jQuery).
3 files changed with 47 insertions and 3 deletions:
0 comments (0 inline, 0 general)
index.php
Show inline comments
 
@@ -106,15 +106,48 @@ hr.sep {
 
    text-align: center;
 
    font-size: 8pt;
 
}
 
h4._more, h4._less {
 
    cursor: pointer;
 
}
 
h4._more:after {
 
    content: "...";
 
    font-weight: bold;
 
    padding-left: 4px;
 
}
 
h4._less:before {
 
    content: "^";
 
    font-weight: bold;
 
    padding-right: 4px;
 
}
 
';
 

	
 
$headers = '<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>';
 

	
 
$script ='
 
jQuery(document).ready(function(){
 
    $("#expert-mode").click(function(ev) {
 
        ev.preventDefault();
 
        var jthis = $(this);
 
        var contents = jthis.next();
 
        if (contents.is(":visible")) {
 
            jthis.addClass("_more");
 
            jthis.removeClass("_less");
 
            contents.hide();
 
        } else {
 
            jthis.removeClass("_more");
 
            jthis.addClass("_less");
 
            contents.show();
 
        }
 
        return false;
 
    }).click();
 
});
 
';
 

	
 
echo substitute_elements(
 
    $HEAD, Array(
 
        'title' => trim($title),
 
        'css' => trim($css),
 
        'headers' => trim($headers),
 
        'script' => trim($script),
 
        ));
 
hl($title);
 
@@ -453,10 +486,14 @@ if ($x_wsv_raw || $EXPERT_ENABLED)
 
{
 
    if ( $x_wsv_raw ) {
 
        $text_rows = 15;
 
        $id = null;
 
    } else {
 
        $text_rows = 5;
 
        $id = 'expert-mode';
 
    }
 
    $form[] = sshl(get_text('expert_mode'));
 
    $form[] = sshl(get_text('expert_mode'), $id);
 
#    $form[] = sshl('<a href="#">'.get_text('expert_mode').'</a>', 'expert-mode-head');
 
    $form[] = '<div>';
 
    // raw message
 
    $form[] = sprintf('<span class="label">%s<sup>*</sup>:</span>', get_text('message'));
 
    $form[] = (
 
@@ -474,6 +511,7 @@ if ($x_wsv_raw || $EXPERT_ENABLED)
 
    $form[] = sprintf('<input type="submit" name="raw" value="%s" />', get_text('save'));
 
    //$form[] = ' ' . get_text('disable_encoding');
 
    $form[] = '<hr class="sep"/>';
 
    $form[] = '</div>';
 

	
 
}
 

	
lib/template.php
Show inline comments
 
@@ -82,6 +82,7 @@ a:focus {
 
}
 
@css@
 
      --></style>
 
@headers@
 
    <script type="text/javascript"><!--
 
@script@
 
      //--></script>
lib/util.php
Show inline comments
 
@@ -234,9 +234,14 @@ function shl($message)
 
    return sprintf('<h3>%s</h3>', $message);
 
}
 

	
 
function sshl($message)
 
function sshl($message, $id=null)
 
{
 
    return sprintf('<h4>%s</h4>', $message);
 
    if ( isset($id) ) {
 
        $id_fmt = sprintf(' id="%s"', $id);
 
    } else {
 
        $id_fmt = '';
 
    }
 
    return sprintf('<h4%s>%s</h4>', $id_fmt, $message);
 
}
 

	
 
function hl($message)
0 comments (0 inline, 0 general)