[Laszlo-checkins] r11044 - in openlaszlo/trunk/WEB-INF/lps/lfc/views: . platform

bargull@openlaszlo.org bargull at openlaszlo.org
Wed Sep 17 10:02:46 PDT 2008


Author: bargull
Date: 2008-09-17 10:02:41 -0700 (Wed, 17 Sep 2008)
New Revision: 11044

Removed:
   openlaszlo/trunk/WEB-INF/lps/lfc/views/platform/LzPlatform.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/views/platform/svg/
Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
Log:
Change 20080910-bargull-Y05 by bargull at dell--p4--2-53 on 2008-09-10 11:52:56
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: remove LzPlatformService

New Features: LPP-6773

Bugs Fixed:

Technical Reviewer: hminsky
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
"LzPlatformService" is no longer of any use. It was added at the early stage of legals, when we had no context-menus in dhtml. 
And the only purpose for this class, was to add the default context-menu to the canvas. But this can be done directly in LzCanvas.

    

Tests:
compile lfc for swf8-9, dhtml
default context menu still works



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2008-09-17 16:40:24 UTC (rev 11043)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2008-09-17 17:02:41 UTC (rev 11044)
@@ -123,8 +123,9 @@
       */
     var __LZmousemoveDel:LzDelegate;    
 
+    /** @access private */
+    var __LZDefaultCanvasMenu :LzContextMenu;
 
-
     /**
      * <p>
      * <varname>httpdataprovider</varname> is bound to the system default HTTP DataProvider.   
@@ -353,7 +354,11 @@
         // Create the default dataprovider
         this.defaultdataprovider = this.httpdataprovider = new LzHTTPDataProvider();
 
-        LzPlatform.initCanvas(this);
+        if ($svg) {
+            //not for svg
+        } else {
+            this.buildDefaultMenu();
+        }
 
         this.id = lz.Browser.getInitArg('id');
     }
@@ -730,6 +735,46 @@
 }
 
 /**
+  * Build the default righ-click menu object
+  * @access private
+  */
+function buildDefaultMenu () {
+    this.__LZDefaultCanvasMenu = new LzContextMenu();
+    this.__LZDefaultCanvasMenu.hideBuiltInItems();
+    
+    var defaultMenuItem:LzContextMenuItem = new LzContextMenuItem("About OpenLaszlo...",
+                                                new LzDelegate(this, '__LZdefaultMenuItemHandler'));
+    this.__LZDefaultCanvasMenu.addItem(defaultMenuItem);
+    
+    if (this.proxied) {
+        var viewSourceMenuItem:LzContextMenuItem = new LzContextMenuItem("View Source",
+                                                    new LzDelegate(this, '__LZviewSourceMenuItemHandler'));
+        this.__LZDefaultCanvasMenu.addItem(viewSourceMenuItem);
+    }
+    
+    // Install the default menu onto MovieClip, so it shows up everywhere by default
+    this.setDefaultContextMenu(this.__LZDefaultCanvasMenu);
+}
+
+/**
+  * @access private
+  */
+function __LZdefaultMenuItemHandler (item:LzContextMenuItem) {
+    // load a url 
+    lz.Browser.loadURL("http://www.openlaszlo.org", "lz_about");
+}
+
+/**
+  * @access private
+  */
+function __LZviewSourceMenuItemHandler (item:LzContextMenuItem) {
+    // view source for this app
+    // /examples/components/edittext_example.lzx
+    var url = lz.Browser.getBaseURL() + "?lzt=source";
+    lz.Browser.loadURL(url, "lz_source");
+}
+
+/**
   * Compute version info as a string
   * @access public
   */

Deleted: openlaszlo/trunk/WEB-INF/lps/lfc/views/platform/LzPlatform.lzs



More information about the Laszlo-checkins mailing list