[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kupu-checkins
Subject:    [kupu-checkins] r55333 - kupu/trunk/kupu/widgeteer
From:       guido () codespeak ! net
Date:       2008-05-28 10:56:37
Message-ID: 20080528105637.6084B698070 () codespeak ! net
[Download RAW message or body]

Author: guido
Date: Wed May 28 12:56:35 2008
New Revision: 55333

Added:
   kupu/trunk/kupu/widgeteer/popups.kupu
Modified:
   kupu/trunk/kupu/widgeteer/include.kupu
   kupu/trunk/kupu/widgeteer/kupuinit.js
   kupu/trunk/kupu/widgeteer/wire.kupu
Log:
Made the add link and add image popups available from buttons in Widgeteer, to
at least have some way to add links and images without the whole DAV browsers
in widgeteer-kupu.


Modified: kupu/trunk/kupu/widgeteer/include.kupu
==============================================================================
--- kupu/trunk/kupu/widgeteer/include.kupu	(original)
+++ kupu/trunk/kupu/widgeteer/include.kupu	Wed May 28 12:56:35 2008
@@ -10,5 +10,6 @@
   <xi:include href="body.kupu" />
   <xi:include href="xmlconfig.kupu" />
   <xi:include href="browser.kupu" />
+  <xi:include href="popups.kupu" />
 
 </kupu:include>

Modified: kupu/trunk/kupu/widgeteer/kupuinit.js
==============================================================================
--- kupu/trunk/kupu/widgeteer/kupuinit.js	(original)
+++ kupu/trunk/kupu/widgeteer/kupuinit.js	Wed May 28 12:56:35 2008
@@ -259,7 +259,36 @@
         b.parentNode.removeChild(b);
     };
 
+    if (!tools || !tools.length || tools.contains('link')) {
+        var linktool = new LinkTool();
+        kupu.registerTool('link', linktool);
+        var handler = function(e) {
+            linktool.createLinkHandler(e);
+        };
+        addEventHandler(document.getElementById('kupu-popup-intlink-button'),
+                        'click', handler);
+    } else {
+        var b = document.getElementById('kupu-popup-intlink-button');
+        b.parentNode.removeChild(b);
+    };
+
+    if (!tools || !tools.length || tools.contains('image')) {
+        var imagetool = new ImageTool();
+        kupu.registerTool('image', imagetool);
+        var handler = function(e) {
+            imagetool.createImageHandler(e);
+        };
+        addEventHandler(document.getElementById('kupu-popup-image-button'),
+                        'click', handler);
+    } else {
+        var b = document.getElementById('kupu-popup-image-button');
+        b.parentNode.removeChild(b);
+    };
+
     if (!tools || !tools.length || tools.contains('browser')) {
+        parent.browser_manager.widgeteerpath =
+            parentiframe.textarea.getAttribute('widget:widgeteerpath') ||
+            '../../';
         var linktool = new LinkTool();
         kupu.registerTool('linktool', linktool);
         var handler = function() {

Added: kupu/trunk/kupu/widgeteer/popups.kupu
==============================================================================
--- (empty file)
+++ kupu/trunk/kupu/widgeteer/popups.kupu	Wed May 28 12:56:35 2008
@@ -0,0 +1,23 @@
+<?xml version="1.0" ?>
+<kupu:feature
+    name="popups"
+    implementation="widgeteer"
+    xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:kupu="http://kupu.oscom.org/namespaces/dist"
+    xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+    i18n:domain="kupu"
+    >
+    <kupu:id>$Id: body.kupu 9779 2005-03-15 11:34:47Z duncan $</kupu:id>
+
+  <kupu:part name="buttons">
+    <span class="kupu-tb-buttongroup" id="kupu-bg-popups">
+      <button type="button" class="kupu-image" id="kupu-popup-image-button" 
+                title="image: alt-m"
+                i18n:attributes="title title_image;" accesskey="m">&#160;</button>
+      <button type="button" class="kupu-inthyperlink" id="kupu-popup-intlink-button" 
+                title="link: alt-a"
+                i18n:attributes="title title_link;" accesskey="a">&#160;</button>
+    </span>
+  </kupu:part>
+
+</kupu:feature>

Modified: kupu/trunk/kupu/widgeteer/wire.kupu
==============================================================================
--- kupu/trunk/kupu/widgeteer/wire.kupu	(original)
+++ kupu/trunk/kupu/widgeteer/wire.kupu	Wed May 28 12:56:35 2008
@@ -43,6 +43,7 @@
     <kupu:insert-part feature="toolbar" part="buttongroup-subsuper" />
     <kupu:insert-part feature="colorchooser" part="buttons" />
     <kupu:insert-part feature="browser" part="buttons" />
+    <kupu:insert-part feature="popups" part="buttons" />
     <kupu:insert-part feature="toolbar" part="buttongroup-justify" />
     <kupu:insert-part feature="toolbar" part="buttongroup-list" />
     <kupu:insert-part feature="toolbar" part="buttongroup-definitionlist" />
_______________________________________________
kupu-checkins mailing list
kupu-checkins@codespeak.net
http://codespeak.net/mailman/listinfo/kupu-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic