]> Frank Brehm's Git Trees - books.git/commitdiff
ToolTip zu ForumCode eingebaut
authorFrank Brehm <frank@brehm-online.com>
Thu, 25 Jun 2009 22:32:21 +0000 (22:32 +0000)
committerFrank Brehm <frank@brehm-online.com>
Thu, 25 Jun 2009 22:32:21 +0000 (22:32 +0000)
root/src/autor/autor_form.tt2
root/src/autor/form.css
root/src/books/form.css
root/src/books/form.tt2
root/src/forumcode.css [new file with mode: 0644]
root/src/forumcode.tt2 [new file with mode: 0644]

index 2ea6f29c801d3e92f5be81bd3f8dbd3641261e46..fdc72562aa90448e25af92513a309166de8dc587 100644 (file)
@@ -9,6 +9,7 @@
 -%]
 
 Autoren-Formular -->
+[% PROCESS forumcode.tt2 %]
 
 <form method="post" name="autor_form" action="[% self_url %]">
 <input type="hidden" name="autor_form_sent" value="sent" />
@@ -37,7 +38,8 @@ Autoren-Formular -->
       <th>Zusätzliche Angaben:</th>
       <td><textarea name="autor_desc" cols="80" rows="3">[% autor_edit.descr | html %]</textarea></td>
     </tr><tr>
-      <th>Über den Autor:</th>
+      <th>Über den Autor:<br />
+          [% forumcode_snipped %]</th>
       <td><textarea name="autor_about" cols="80" rows="10">[% autor_edit.about | html %]</textarea></td>
     </tr><tr>
       <td colspan="2">&nbsp;</td>
index 675db1231d413c8ad979c9993e91bd9e4dc8759f..7c677e0eafcc53d65cbff9f51f34b2e26c435622 100644 (file)
@@ -8,4 +8,5 @@
 /*  Stylesheets Autoren-Formulare */
 
 [% PROCESS ftable.css %]
+[% PROCESS forumcode.css %]
 
index 7d08eda7b6f0ae343511436263e675e1a5a019ba..57067c4d08a962e24d77735225454b4d892ebcdf 100644 (file)
@@ -7,4 +7,5 @@
 -%]
 /*  Stylesheets Formulare */
 [% PROCESS ftable.css %]
+[% PROCESS forumcode.css %]
 
index 6e744e7566327b4ac46304b7d51db56920cf44a1..b6d72ba3252859835b0c8414f9247b4f908e8960 100644 (file)
@@ -9,6 +9,7 @@
 -%]
 
 <!-- Book form -->
+[% PROCESS forumcode.tt2 %]
 
 <script type="text/javascript">//<![CDATA[
 
@@ -165,7 +166,8 @@ function goto_new_ort() {
             <option value="[% waehrungsid %]"[% IF book_edit.waehrungs_id == waehrungsid %] selected[% END %]>[% waehrungsliste.$waehrungsid.kuerzel %]</option>[% END %]
           </select>&nbsp;<input type="button" name="neue_waehrung" value="*" class="shift_button" title="Neue Währung" /></td>
     </tr><tr>
-      <th>Kurzinhalt:</th>
+      <th>Kurzinhalt:<br />
+          [% forumcode_snipped %]</th>
       <td><textarea name="book_kurzinhalt" cols="80" rows="10">[% book_edit.kurzinhalt | html %]</textarea></td>
     </tr><tr>
       <td colspan="2" class="empty"></td>
diff --git a/root/src/forumcode.css b/root/src/forumcode.css
new file mode 100644 (file)
index 0000000..2cfd477
--- /dev/null
@@ -0,0 +1,27 @@
+/* [%#
+   # Template fuer Stylesheets zu Forumcode
+   #
+   # vim: noai : ts=4 fenc=utf-8 filetype=css 
+   #
+   # $Id$
+   # $URL$
+   #
+-%]
+  Stylesheets zu Forumcode */
+
+SPAN.forumcode {
+       font-weight:    normal;
+       font-style:             italic;
+       border-bottom:  1px dashed black;
+}
+
+#fixedtipdiv{
+       position:               absolute;
+       padding:                2px;
+       border:                 1px solid black;
+       margin-top:             5px;
+       font:                   normal 12px Verdana;
+       line-height:    18px;
+       z-index:                100;
+}
+
diff --git a/root/src/forumcode.tt2 b/root/src/forumcode.tt2
new file mode 100644 (file)
index 0000000..797727d
--- /dev/null
@@ -0,0 +1,146 @@
+<!-- [%#
+
+     Template fuer ForumCode-Darstellung
+
+     vim: noai : ts=4 fenc=utf-8 filetype=html expandtab :
+
+     $Id$
+     $URL$
+
+-%]
+
+ForumCode-Darstellung -->
+
+<script type="text/javascript">
+
+    /***********************************************
+    * Fixed ToolTip script- © Dynamic Drive (www.dynamicdrive.com)
+    * This notice MUST stay intact for legal use
+    * Visit http://www.dynamicdrive.com/ for full source code
+    ***********************************************/
+        
+    var tipwidth          = '150px'        //default tooltip width
+    var tipbgcolor        = 'lightyellow'  //tooltip bgcolor
+    var disappeardelay    = 250            //tooltip disappear speed onMouseout (in miliseconds)
+    var vertical_offset   = "0px"          //horizontal offset of tooltip from anchor link
+    var horizontal_offset = "-3px"         //horizontal offset of tooltip from anchor link
+
+    /////No further editting needed
+
+    var ie4 = document.all
+    var ns6 = document.getElementById && !document.all
+
+    if ( ie4 || ns6 )
+        document.write( '<div id="fixedtipdiv" style="visibility:hidden;width:' + tipwidth + ';background-color:' + tipbgcolor + '" ></div>' )
+
+    // ------------
+    function getposOffset( what, offsettype ) {
+        var totaloffset = ( offsettype == "left" ) ? what.offsetLeft : what.offsetTop;
+        var parentEl = what.offsetParent;
+        while ( parentEl != null ) {
+            totaloffset = ( offsettype == "left" ) ? totaloffset+parentEl.offsetLeft : totaloffset + parentEl.offsetTop;
+            parentEl = parentEl.offsetParent;
+        }
+        return totaloffset;
+    }
+
+    // ------------
+    function showhide( obj, e, visible, hidden, tipwidth ) {
+        if ( ie4 || ns6 )
+            dropmenuobj.style.left=dropmenuobj.style.top = -500
+        if ( tipwidth != "" ) {
+            dropmenuobj.widthobj = dropmenuobj.style
+            dropmenuobj.widthobj.width = tipwidth
+        }
+        if ( e.type == "click" && obj.visibility == hidden || e.type == "mouseover" )
+            obj.visibility = visible
+        else if ( e.type == "click" )
+            obj.visibility = hidden
+    }
+
+    // ------------
+    function iecompattest() {
+        return ( document.compatMode && document.compatMode != "BackCompat" ) ? document.documentElement : document.body
+    }
+
+    // ------------
+    function clearbrowseredge( obj, whichedge ) {
+        var edgeoffset = ( whichedge == "rightedge" ) ? parseInt( horizontal_offset ) * -1 : parseInt( vertical_offset ) * -1
+        if ( whichedge == "rightedge" ) {
+            var windowedge = ie4 && !window.opera ? iecompattest().scrollLeft + iecompattest().clientWidth - 15 : window.pageXOffset + window.innerWidth - 15
+            dropmenuobj.contentmeasure = dropmenuobj.offsetWidth
+            if ( windowedge-dropmenuobj.x < dropmenuobj.contentmeasure )
+                edgeoffset = dropmenuobj.contentmeasure - obj.offsetWidth
+        }
+        else {
+            var windowedge = ie4 && !window.opera ? iecompattest().scrollTop + iecompattest().clientHeight - 15 : window.pageYOffset + window.innerHeight - 18
+            dropmenuobj.contentmeasure = dropmenuobj.offsetHeight
+            if ( windowedge - dropmenuobj.y < dropmenuobj.contentmeasure )
+                edgeoffset = dropmenuobj.contentmeasure + obj.offsetHeight
+        }
+        return edgeoffset
+    }
+
+    // ------------
+    function fixedtooltip( menucontents, obj, e, tipwidth ) {
+
+        if ( window.event )
+            event.cancelBubble = true
+        else if ( e.stopPropagation )
+            e.stopPropagation()
+
+        clearhidetip()
+        dropmenuobj = document.getElementById ? document.getElementById( "fixedtipdiv" ) : fixedtipdiv
+        dropmenuobj.innerHTML = menucontents
+
+        if ( ie4 || ns6 ) {
+                showhide( dropmenuobj.style, e, "visible", "hidden", tipwidth )
+                dropmenuobj.x = getposOffset( obj, "left" )
+                dropmenuobj.y = getposOffset( obj, "top" )
+                dropmenuobj.style.left = dropmenuobj.x - clearbrowseredge( obj, "rightedge"  ) + "px"
+                dropmenuobj.style.top  = dropmenuobj.y - clearbrowseredge( obj, "bottomedge" ) + obj.offsetHeight + "px"
+        }
+    }
+
+    // ------------
+    function hidetip( e ){
+        if ( typeof dropmenuobj != "undefined" ) {
+            if ( ie4 || ns6 )
+                dropmenuobj.style.visibility = "hidden"
+        }
+    }
+
+    // ------------
+    function delayhidetip() {
+        if ( ie4 || ns6 )
+            delayhide = setTimeout( "hidetip()", disappeardelay )
+    }
+
+    // ------------
+    function clearhidetip() {
+        if ( typeof delayhide != "undefined" )
+            clearTimeout(delayhide)
+    }
+
+    // ------------
+    function forumcode_tooltip( obj, e ) {
+        var forumcode_descr = "<i>Folgende Markierungen sind m&ouml;glich:</i><br /><dl>";
+        forumcode_descr += "<dt><b>[b]</b>...<b>[/b]</b> oder <b>**</b>...<b>**</b></dt>";
+        forumcode_descr += "<dd>Markiert den dazwischenliegenden Text <i>fett</i>.</dd>";
+        forumcode_descr += "<dt><b>[u]</b>...<b>[/u]</b> oder <b>__</b>...<b>__</b></dt>";
+        forumcode_descr += "<dd>Markiert den dazwischenliegenden Text <i>unterstrichen</i>.</dd>";
+        forumcode_descr += "<dt><b>[i]</b>...<b>[/i]</b></dt>";
+        forumcode_descr += "<dd>Markiert den dazwischenliegenden Text <i>kursiv</i>.</dd>";
+        forumcode_descr += "<dt><b>[url]</b>http://...<b>[/url]</b> oder <b>[url=\"http://...\"]</b>Verkn&uuml;pfungstext<b>[/url]</b></dt>";
+        forumcode_descr += "<dd>Macht aus dem Text zwischen den Markierungen eine <i>HTML-Verkn&uuml;pfung.</i></dd>";
+        forumcode_descr += "<dt><b>[img]</b>http://...<b>[/img]</b></dt>";
+        forumcode_descr += "<dd>F&uuml;gt ein <i>Bild</i> ein, wobei dessen URL zwischen den Markierungen angegeben wird.<br />";
+        forumcode_descr += "Es k&ouml;nnen auch alle Attribute eines HTML-&lt;IMG&gt;-Tags angegeben werden.</dd>";
+        forumcode_descr += "</dl>";
+        fixedtooltip( forumcode_descr, obj, e, "500px" )
+    }
+
+</script>
+
+[% forumcode_snipped = '<a href="#" onMouseover="forumcode_tooltip(  this, event )" onMouseout="delayhidetip()"><span class="forumcode">Formatiert als ForumCode</span></a>' %]
+