[Yanel-commits] rev 42373 - in public/yanel/trunk/src/resources/tinymce/htdocs: . js

simon at wyona.com simon at wyona.com
Tue Apr 14 17:31:03 CEST 2009


Author: simon
Date: 2009-04-14 17:31:03 +0200 (Tue, 14 Apr 2009)
New Revision: 42373

Removed:
   public/yanel/trunk/src/resources/tinymce/htdocs/js/ajaxlookup.js
Modified:
   public/yanel/trunk/src/resources/tinymce/htdocs/js/tinymceinit.js
   public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-fix.jelly
   public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-status.jelly
   public/yanel/trunk/src/resources/tinymce/htdocs/tinymce.jelly
Log:
lookup integrated

Deleted: public/yanel/trunk/src/resources/tinymce/htdocs/js/ajaxlookup.js
===================================================================
--- public/yanel/trunk/src/resources/tinymce/htdocs/js/ajaxlookup.js	2009-04-14 15:29:58 UTC (rev 42372)
+++ public/yanel/trunk/src/resources/tinymce/htdocs/js/ajaxlookup.js	2009-04-14 15:31:03 UTC (rev 42373)
@@ -1,3 +0,0 @@
-function ajaxlookup(lookin) {
-  new Ajax.Updater('lookup', '', { method: 'get', onLoading: createProgressBar('lookupfiles'), onComplete: sorttable.reinit, parameters: {lookup: 'true', 'yanel.resource.viewid': 'source', lookin: lookin} });
-}
\ No newline at end of file

Modified: public/yanel/trunk/src/resources/tinymce/htdocs/js/tinymceinit.js
===================================================================
--- public/yanel/trunk/src/resources/tinymce/htdocs/js/tinymceinit.js	2009-04-14 15:29:58 UTC (rev 42372)
+++ public/yanel/trunk/src/resources/tinymce/htdocs/js/tinymceinit.js	2009-04-14 15:31:03 UTC (rev 42373)
@@ -6,5 +6,44 @@
 	theme_advanced_toolbar_align : "left",
 	theme_advanced_statusbar_location : "bottom",
 	theme_advanced_resizing : true,
-	entity_encoding : "numeric"
-});
\ No newline at end of file
+	entity_encoding : "numeric",
+	file_browser_callback : 'yanelLookupResource',
+});
+
+function yanelLookupResource(field_name, url, type, win) {
+
+    // alert("Field_Name: " + field_name + "\nURL: " + url + "\nType: " + type + "\nWin: " + win); // debug/testing
+
+    /* If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
+       the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
+       These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
+
+    if (window.location.pathname.charAt(window.location.pathname.length) != "/") {
+        path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/") + 1) 
+    }
+    var cmsURL = path + BACK2REALM + "usecases/tinymce-lookup.html" // script URL
+    if (cmsURL.indexOf("?") < 0) {
+        //add the type as the only query parameter
+        cmsURL = cmsURL + "?type=" + type;
+    }
+    else {
+        //add the type as an additional query parameter
+        // (PHP session ID is now included if there is one at all)
+        cmsURL = cmsURL + "&type=" + type;
+    }
+    cmsURL = cmsURL + "&yanel.toolbar=suppress";
+
+    tinyMCE.activeEditor.windowManager.open({
+        file : cmsURL,
+        title : 'Lookup',
+        width : 420,  // Your dimensions may differ - toy around with them!
+        height : 400,
+        resizable : "yes",
+        inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
+        close_previous : "no"
+    }, {
+        window : win,
+        input : field_name
+    });
+    return false;
+}
\ No newline at end of file

Modified: public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-fix.jelly
===================================================================
--- public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-fix.jelly	2009-04-14 15:29:58 UTC (rev 42372)
+++ public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-fix.jelly	2009-04-14 15:31:03 UTC (rev 42373)
@@ -2,7 +2,7 @@
 <j:jelly xmlns:j="jelly:core">
   <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
-      <title>YUI Rich Text Editor</title>
+      <title>TinyMCE</title>
 
     </head>
     <body>

Modified: public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-status.jelly
===================================================================
--- public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-status.jelly	2009-04-14 15:29:58 UTC (rev 42372)
+++ public/yanel/trunk/src/resources/tinymce/htdocs/tinymce-status.jelly	2009-04-14 15:31:03 UTC (rev 42373)
@@ -2,7 +2,7 @@
 <j:jelly xmlns:j="jelly:core">
   <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
-    <title>YUI Rich Text Editor</title>
+    <title>TinyMCE</title>
     </head>
     <body>
       <p class="yanel-usecase-error">${resource.getErrorMessages()}</p>

Modified: public/yanel/trunk/src/resources/tinymce/htdocs/tinymce.jelly
===================================================================
--- public/yanel/trunk/src/resources/tinymce/htdocs/tinymce.jelly	2009-04-14 15:29:58 UTC (rev 42372)
+++ public/yanel/trunk/src/resources/tinymce/htdocs/tinymce.jelly	2009-04-14 15:31:03 UTC (rev 42373)
@@ -5,6 +5,9 @@
       <title>Edit ${resource.getEditPath()} with tinyMCE</title>
       <link rel="stylesheet" type="text/css" href="${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::tinymce/css/tinymce-resource.css"/>
       <script language="javascript" type="text/javascript" src="${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
+      <script language="javascript">
+        var BACK2REALM = '${yanel.back2realm}';
+      </script>        
       <script language="javascript" type="text/javascript" src="${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::tinymce/js/tinymceinit.js"></script>
     </head>
     <body>



More information about the Yanel-commits mailing list