[Yulup-commits] rev 21640 - in public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor: . findreplace

andi at wyona.com andi at wyona.com
Thu Jan 11 14:33:09 CET 2007


Author: andi
Date: 2007-01-11 14:33:08 +0100 (Thu, 11 Jan 2007)
New Revision: 21640

Modified:
   public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/controller.js
   public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/editor.js
   public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/findreplace/findreplace.js
Log:
Activated "find".


Modified: public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/controller.js
===================================================================
--- public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/controller.js	2007-01-11 11:21:51 UTC (rev 21639)
+++ public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/controller.js	2007-01-11 13:33:08 UTC (rev 21640)
@@ -893,14 +893,6 @@
 
                 break;
             case "cmd_yulup_find":
-                if (this.__editStateController.isCurrentState(this.__editStateController.STATE_SUPERIOR_DOCUMENTOK) &&
-                    this.__editorController.activeView) {
-                    retval = true;
-                }
-
-                // don't activate for now (merge with "cmd_yulup_replace" later)
-                retval = false;
-                break;
             case "cmd_yulup_replace":
                 if (this.__editStateController.isCurrentState(this.__editStateController.STATE_SUPERIOR_DOCUMENTOK) &&
                     this.__editorController.activeView) {

Modified: public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/editor.js
===================================================================
--- public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/editor.js	2007-01-11 11:21:51 UTC (rev 21639)
+++ public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/editor.js	2007-01-11 13:33:08 UTC (rev 21640)
@@ -38,6 +38,8 @@
 var gControlledShutdown = false;
 
 var Editor = {
+    __findWindow   : null,
+    __replaceWindow: null,
     /**
      * Main entry point for editor creation. Creates a new
      * editor and installs various listeners.
@@ -695,13 +697,21 @@
     findString: function () {
         /* DEBUG */ dump("Yulup:editor.js:Editor.findString() invoked\n");
 
-        /* DEBUG */ dump("Yulup:editor.js:Editor.findString: not implemented yet\n");
+        if (!Editor.__findWindow || (Editor.__findWindow && Editor.__findWindow.closed)) {
+            Editor.__findWindow = window.openDialog(YULUP_REPLACE_CHROME_URI, "yulupReplaceDialog", "chrome,resizable=yes,centerscreen", false, gEditorController);
+        } else {
+            Editor.__findWindow.focus();
+        }
     },
 
     replaceString: function () {
         /* DEBUG */ dump("Yulup:editor.js:Editor.replaceString() invoked\n");
 
-        window.openDialog(YULUP_REPLACE_CHROME_URI, "yulupReplaceDialog", "chrome,resizable=yes,centerscreen", gEditorController);
+        if (!Editor.__replaceWindow || (Editor.__replaceWindow && Editor.__replaceWindow.closed)) {
+            Editor.__replaceWindow = window.openDialog(YULUP_REPLACE_CHROME_URI, "yulupReplaceDialog", "chrome,resizable=yes,centerscreen", true, gEditorController);
+        } else {
+            Editor.__replaceWindow.focus();
+        }
     },
 
     updateToolboxContextMenu: function () {

Modified: public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/findreplace/findreplace.js
===================================================================
--- public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/findreplace/findreplace.js	2007-01-11 11:21:51 UTC (rev 21639)
+++ public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/editor/findreplace/findreplace.js	2007-01-11 13:33:08 UTC (rev 21640)
@@ -27,6 +27,7 @@
  */
 
 const FindReplace = {
+    __findAndReplace        : null,
     __editorController      : null,
     __view                  : null,
     __findService           : null,
@@ -39,7 +40,8 @@
     onLoadListener: function () {
         /* DEBUG */ dump("Yulup:findreplace.js:FindReplace.onLoadListener() invoked\n");
 
-        FindReplace.__editorController = window.arguments[0];
+        FindReplace.__findAndReplace   = window.arguments[0];
+        FindReplace.__editorController = window.arguments[1];
 
         /* DEBUG */ dump("Yulup:findreplace.js:FindReplace.onLoadListener: FindReplace.__editorController = \"" + FindReplace.__editorController + "\"\n");
 




More information about the Phoenix-commits mailing list