[Checkins] SVN: zope3org/trunk/src/zorg/wikification/browser/ Added minimal support for mime types that are not wikifiable

Uwe Oestermeier uwe_oestermeier at iwm-kmrc.de
Tue Jun 13 09:20:45 EDT 2006


Log message for revision 68614:
  Added minimal support for mime types that are not wikifiable

Changed:
  U   zope3org/trunk/src/zorg/wikification/browser/scripts/link.js
  U   zope3org/trunk/src/zorg/wikification/browser/templates/noindex.pt
  A   zope3org/trunk/src/zorg/wikification/browser/templates/unwikifiable.pt
  U   zope3org/trunk/src/zorg/wikification/browser/wikipage.py

-=-
Modified: zope3org/trunk/src/zorg/wikification/browser/scripts/link.js
===================================================================
--- zope3org/trunk/src/zorg/wikification/browser/scripts/link.js	2006-06-13 12:38:31 UTC (rev 68613)
+++ zope3org/trunk/src/zorg/wikification/browser/scripts/link.js	2006-06-13 13:20:44 UTC (rev 68614)
@@ -4,15 +4,20 @@
     linkID : -1,
     extraInfo : "",
     caller : null,
+    x : -1,
     
     dropDown : function(obj, e, dropmenuID, extra) {
     
         if (WikiMenu.linkID != -1) return
         
         WikiMenu.extraInfo = extra;
-        WikiMenu.caller = obj;
+        if (WikiMenu.caller != obj) {
+            WikiMenu.caller = obj
+            WikiMenu.x = (document.all) ? window.event.x + document.body.scrollLeft  : e.pageX;
+            }
+      
         target = $(dropmenuID);
-        
+            
         if (window.event) 
             event.cancelBubble=true
         else if (e.stopPropagation) 
@@ -28,9 +33,12 @@
                     dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
                 dropmenuobj.onmouseover=clearhidemenu
                 dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
+                                
                 showhide(dropmenuobj.style, e, "visible", "hidden")
-                dropmenuobj.x=getposOffset(obj, "left")
-                dropmenuobj.y=getposOffset(obj, "top")
+              
+                dropmenuobj.x= (WikiMenu.x != -1) ? WikiMenu.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"
                 }

Modified: zope3org/trunk/src/zorg/wikification/browser/templates/noindex.pt
===================================================================
--- zope3org/trunk/src/zorg/wikification/browser/templates/noindex.pt	2006-06-13 12:38:31 UTC (rev 68613)
+++ zope3org/trunk/src/zorg/wikification/browser/templates/noindex.pt	2006-06-13 13:20:44 UTC (rev 68614)
@@ -1,5 +1,6 @@
 <div id="main">
-     <p class="intro">This Wiki allows you to create pages and upload files by clicking placeholders.
+     <p class="intro">This Wiki allows you to create pages and upload files 
+        by clicking placeholders.
         Such placeholders are marked by red dotted borders.
         If you click a placeholder you will be led to
         a page editor and other edit options.

Added: zope3org/trunk/src/zorg/wikification/browser/templates/unwikifiable.pt
===================================================================
--- zope3org/trunk/src/zorg/wikification/browser/templates/unwikifiable.pt	2006-06-13 12:38:31 UTC (rev 68613)
+++ zope3org/trunk/src/zorg/wikification/browser/templates/unwikifiable.pt	2006-06-13 13:20:44 UTC (rev 68614)
@@ -0,0 +1,9 @@
+<div id="main">
+     <p class="intro">This document type cannot be displayed as a wiki page.</p>
+     
+     <p>Download 
+        <a href="#" tal:attributes="href view/getURL"
+            tal:content="context/__name__"
+            >Title</a>   
+      </p>
+</div>

Modified: zope3org/trunk/src/zorg/wikification/browser/wikipage.py
===================================================================
--- zope3org/trunk/src/zorg/wikification/browser/wikipage.py	2006-06-13 12:38:31 UTC (rev 68613)
+++ zope3org/trunk/src/zorg/wikification/browser/wikipage.py	2006-06-13 13:20:44 UTC (rev 68614)
@@ -294,6 +294,8 @@
     
     untitled = u"Untitled Document"
     
+    _unwikifiable = ViewPageTemplateFile("./templates/unwikifiable.pt")
+    
     def isEmpty(self) :
         return False
         
@@ -315,7 +317,7 @@
             wikified = self.wikify(body)
             return unicode(wikified, encoding='utf-8', errors='replace')
   
-        return u"Sorry, not wikifiable at the moment."
+        return self._unwikifiable()
             
 
 



More information about the Checkins mailing list