Author: spikebrehm
Date: 2010-05-18 19:26:33 +0200 (Tue, 18 May 2010)
New Revision: 29505

Added:
   plugins/srPageChooserPlugin/trunk/web/js/fckeditor/
   plugins/srPageChooserPlugin/trunk/web/js/fckeditor/editor/
   plugins/srPageChooserPlugin/trunk/web/js/fckeditor/editor/dialog/
   
plugins/srPageChooserPlugin/trunk/web/js/fckeditor/editor/dialog/fck_link.html
Modified:
   plugins/srPageChooserPlugin/trunk/README
Log:
Adding support for page chooser in FCKEditor

Modified: plugins/srPageChooserPlugin/trunk/README
===================================================================
--- plugins/srPageChooserPlugin/trunk/README    2010-05-18 16:01:31 UTC (rev 
29504)
+++ plugins/srPageChooserPlugin/trunk/README    2010-05-18 17:26:33 UTC (rev 
29505)
@@ -133,8 +133,42 @@
 
 ## Using with FCKEditor and aRichTextSlot
 
-TODO
+Having the ability to graphically insert links using the Rich Text slot, 
without ever having to type a URL, is one of the most useful features of this 
plugin.  Luckily, it's super easy to implement once the plugin is installed.  
You just need to replace one FCKEditor HTML file with the version included in 
this plugin.
 
+By default, `asandbox` is setup to use the `fckeditor` files bundled with 
`apostrophePlugin`, which are located at:
+
+    SF_WEB_DIR/apostrophePlugin/js/fckeditor/
+    
+The file we are particularly interested in is:
+
+    SF_WEB_DIR/apostrophePlugin/js/fckeditor/editor/dialog/fck_link.html
+    
+Replace this with the version included with this plugin, located at:
+
+    web/js/fckeditor/editor/dialog/fck_link.html
+    
+If you would like to keep the FCKEditor files bundled with `apostrophePlugin` 
intact (recommended), copy the FCKEditor files it bundles into your own web 
directory, like:
+
+    $ cp -R web/apostrophePlugin/js/fckeditor web/js/
+    
+You'll also want to delete the SVN stubs in this new folder if you plan to 
commit it to your repo:
+
+    $ cd web/js/fckeditor/
+    $ find . -name .svn | xargs rm -rf
+    
+Now, if you haven't already, copy in the `srPageChooserPlugin` version of 
`fck_link.html` into this new directory:
+
+    $ cp 
plugins/srPageChooserPlugin/web/js/fckeditor/editor/dialog/fck_link.html 
web/js/fckeditor/editor/dialog/
+    
+Finally, to tell Apostrophe to use our custom FCKEditor files, change the 
`rich_text_fck_js_dir` setting in `apps/frontend/config/settings.yml` to 
reflect the new location:
+
+    rich_text_fck_js_dir:   web/js/fckeditor
+    
+Clear your cache, and that's it!
+
+    $ ./symfony cc
+
+
 Contact the developer at ocelot [a] gmail.
 
 Copyright (c) 2010 SunRun Inc.

Added: 
plugins/srPageChooserPlugin/trunk/web/js/fckeditor/editor/dialog/fck_link.html
===================================================================
--- 
plugins/srPageChooserPlugin/trunk/web/js/fckeditor/editor/dialog/fck_link.html  
                            (rev 0)
+++ 
plugins/srPageChooserPlugin/trunk/web/js/fckeditor/editor/dialog/fck_link.html  
    2010-05-18 17:26:33 UTC (rev 29505)
@@ -0,0 +1,372 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2009 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Link dialog window.
+-->
+<html>
+       <head>
+               <title>Link Properties</title>
+               <meta http-equiv="Content-Type" content="text/html; 
charset=utf-8" />
+               <meta name="robots" content="noindex, nofollow" />
+               <script src="common/fck_dialog_common.js" 
type="text/javascript"></script>
+               <script src="fck_link/fck_link.js" 
type="text/javascript"></script>
+<!-- start srPageChooserPlugin -->
+    <script src="/sfJqueryReloadedPlugin/js/jquery-1.3.2.min.js" 
type="text/javascript"></script>
+<!-- end srPageChooserPlugin -->
+       </head>
+       <body scroll="no" style="OVERFLOW: hidden">
+               <div id="divInfo" style="DISPLAY: none">
+                       <span fckLang="DlgLnkType">Link Type</span><br />
+                       <select id="cmbLinkType" 
onchange="SetLinkType(this.value);">
+                               <option value="url" 
fckLang="DlgLnkTypeURL">URL</option>
+                               <option value="anchor" 
fckLang="DlgLnkTypeAnchor">Anchor in this page</option>
+                               <option value="email" 
fckLang="DlgLnkTypeEMail">E-Mail</option>
+                       </select>
+<!-- start srPageChooserPlugin -->
+                       <button id="btnChooseCMSPage">Select a Link</button>
+                       <div id="divPageChooserWrapper" style="display:none">
+                         <label for="txtUrlTmp">URL:</label>
+             <input type="text" id="txtUrlTmp" />
+                         <button id="btnPageChooserOk" 
onclick="javascript:PageChooserParent.onButtonOk();">Ok</button>
+                         <iframe id="ifrmPageChooser" name="PageChooser" 
frameborder="0" src="/index.php/admin/PageChooser/choose" 
style="display:none"></iframe>
+                 </div>
+<!-- end srPageChooserPlugin -->
+                       <br />
+                       <br />
+                       <div id="divLinkTypeUrl">
+                               <table cellspacing="0" cellpadding="0" 
width="100%" border="0" dir="ltr">
+                                       <tr>
+                                               <td nowrap="nowrap">
+                                                       <span 
fckLang="DlgLnkProto">Protocol</span><br />
+                                                       <select 
id="cmbLinkProtocol">
+                                                               <option 
value="http://"; selected="selected">http://</option>
+                                                               <option 
value="https://";>https://</option>
+                                                               <option 
value="ftp://";>ftp://</option>
+                                                               <option 
value="news://";>news://</option>
+                                                               <option 
value="" fckLang="DlgLnkProtoOther">&lt;other&gt;</option>
+                                                       </select>
+                                               </td>
+                                               <td nowrap="nowrap">&nbsp;</td>
+                                               <td nowrap="nowrap" 
width="100%">
+                                                       <span 
fckLang="DlgLnkURL">URL</span><br />
+                                                       <input id="txtUrl" 
style="WIDTH: 100%" type="text" onkeyup="OnUrlChange();" 
onchange="OnUrlChange();" />
+                                               </td>
+                                       </tr>
+                               </table>
+                               <br />
+                               <div id="divBrowseServer">
+                               <input type="button" value="Browse Server" 
fckLang="DlgBtnBrowseServer" onclick="BrowseServer();" />
+                               </div>
+                       </div>
+                       <div id="divLinkTypeAnchor" style="DISPLAY: none" 
align="center">
+                               <div id="divSelAnchor" style="DISPLAY: none">
+                                       <table cellspacing="0" cellpadding="0" 
border="0" width="70%">
+                                               <tr>
+                                                       <td colspan="3">
+                                                               <span 
fckLang="DlgLnkAnchorSel">Select an Anchor</span>
+                                                       </td>
+                                               </tr>
+                                               <tr>
+                                                       <td width="50%">
+                                                               <span 
fckLang="DlgLnkAnchorByName">By Anchor Name</span><br />
+                                                               <select 
id="cmbAnchorName" onchange="GetE('cmbAnchorId').value='';" style="WIDTH: 100%">
+                                                                       <option 
value="" selected="selected"></option>
+                                                               </select>
+                                                       </td>
+                                                       
<td>&nbsp;&nbsp;&nbsp;</td>
+                                                       <td width="50%">
+                                                               <span 
fckLang="DlgLnkAnchorById">By Element Id</span><br />
+                                                               <select 
id="cmbAnchorId" onchange="GetE('cmbAnchorName').value='';" style="WIDTH: 100%">
+                                                                       <option 
value="" selected="selected"></option>
+                                                               </select>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </div>
+                               <div id="divNoAnchor" style="DISPLAY: none">
+                                       <span fckLang="DlgLnkNoAnchors">&lt;No 
anchors available in the document&gt;</span>
+                               </div>
+                       </div>
+                       <div id="divLinkTypeEMail" style="DISPLAY: none">
+                               <span fckLang="DlgLnkEMail">E-Mail 
Address</span><br />
+                               <input id="txtEMailAddress" style="WIDTH: 100%" 
type="text" /><br />
+                               <span fckLang="DlgLnkEMailSubject">Message 
Subject</span><br />
+                               <input id="txtEMailSubject" style="WIDTH: 100%" 
type="text" /><br />
+                               <span fckLang="DlgLnkEMailBody">Message 
Body</span><br />
+                               <textarea id="txtEMailBody" style="WIDTH: 100%" 
rows="3" cols="20"></textarea>
+                       </div>
+               </div>
+               <div id="divUpload" style="DISPLAY: none">
+                       <form id="frmUpload" method="post" 
target="UploadWindow" enctype="multipart/form-data" action="" onsubmit="return 
CheckUpload();">
+                               <span fckLang="DlgLnkUpload">Upload</span><br />
+                               <input id="txtUploadFile" style="WIDTH: 100%" 
type="file" size="40" name="NewFile" /><br />
+                               <br />
+                               <input id="btnUpload" type="submit" value="Send 
it to the Server" fckLang="DlgLnkBtnUpload" />
+                               <script type="text/javascript">
+                                       document.write( '<iframe 
name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + 
'"><\/iframe>' ) ;
+                               </script>
+                       </form>
+               </div>
+               <div id="divTarget" style="DISPLAY: none">
+                       <table cellspacing="0" cellpadding="0" width="100%" 
border="0">
+                               <tr>
+                                       <td nowrap="nowrap">
+                                               <span 
fckLang="DlgLnkTarget">Target</span><br />
+                                               <select id="cmbTarget" 
onchange="SetTarget(this.value);">
+                                                       <option value="" 
fckLang="DlgGenNotSet" selected="selected">&lt;not set&gt;</option>
+                                                       <option value="frame" 
fckLang="DlgLnkTargetFrame">&lt;frame&gt;</option>
+                                                       <option value="popup" 
fckLang="DlgLnkTargetPopup">&lt;popup window&gt;</option>
+                                                       <option value="_blank" 
fckLang="DlgLnkTargetBlank">New Window (_blank)</option>
+                                                       <option value="_top" 
fckLang="DlgLnkTargetTop">Topmost Window (_top)</option>
+                                                       <option value="_self" 
fckLang="DlgLnkTargetSelf">Same Window (_self)</option>
+                                                       <option value="_parent" 
fckLang="DlgLnkTargetParent">Parent Window (_parent)</option>
+                                               </select>
+                                       </td>
+                                       <td>&nbsp;</td>
+                                       <td id="tdTargetFrame" nowrap="nowrap" 
width="100%">
+                                               <span 
fckLang="DlgLnkTargetFrameName">Target Frame Name</span><br />
+                                               <input id="txtTargetFrame" 
style="WIDTH: 100%" type="text" onkeyup="OnTargetNameChange();"
+                                                       
onchange="OnTargetNameChange();" />
+                                       </td>
+                                       <td id="tdPopupName" style="DISPLAY: 
none" nowrap="nowrap" width="100%">
+                                               <span 
fckLang="DlgLnkPopWinName">Popup Window Name</span><br />
+                                               <input id="txtPopupName" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                       </table>
+                       <br />
+                       <table id="tablePopupFeatures" style="DISPLAY: none" 
cellspacing="0" cellpadding="0" align="center"
+                               border="0">
+                               <tr>
+                                       <td>
+                                               <span 
fckLang="DlgLnkPopWinFeat">Popup Window Features</span><br />
+                                               <table cellspacing="0" 
cellpadding="0" border="0">
+                                                       <tr>
+                                                               <td 
valign="top" nowrap="nowrap" width="50%">
+                                                                       <input 
id="chkPopupResizable" name="chkFeature" value="resizable" type="checkbox" 
/><label for="chkPopupResizable" fckLang="DlgLnkPopResize">Resizable</label><br 
/>
+                                                                       <input 
id="chkPopupLocationBar" name="chkFeature" value="location" type="checkbox" 
/><label for="chkPopupLocationBar" fckLang="DlgLnkPopLocation">Location
+                                                                               
Bar</label><br />
+                                                                       <input 
id="chkPopupManuBar" name="chkFeature" value="menubar" type="checkbox" /><label 
for="chkPopupManuBar" fckLang="DlgLnkPopMenu">Menu
+                                                                               
Bar</label><br />
+                                                                       <input 
id="chkPopupScrollBars" name="chkFeature" value="scrollbars" type="checkbox" 
/><label for="chkPopupScrollBars" fckLang="DlgLnkPopScroll">Scroll
+                                                                               
Bars</label>
+                                                               </td>
+                                                               <td></td>
+                                                               <td 
valign="top" nowrap="nowrap" width="50%">
+                                                                       <input 
id="chkPopupStatusBar" name="chkFeature" value="status" type="checkbox" 
/><label for="chkPopupStatusBar" fckLang="DlgLnkPopStatus">Status
+                                                                               
Bar</label><br />
+                                                                       <input 
id="chkPopupToolbar" name="chkFeature" value="toolbar" type="checkbox" /><label 
for="chkPopupToolbar" fckLang="DlgLnkPopToolbar">Toolbar</label><br />
+                                                                       <input 
id="chkPopupFullScreen" name="chkFeature" value="fullscreen" type="checkbox" 
/><label for="chkPopupFullScreen" fckLang="DlgLnkPopFullScrn">Full
+                                                                               
Screen (IE)</label><br />
+                                                                       <input 
id="chkPopupDependent" name="chkFeature" value="dependent" type="checkbox" 
/><label for="chkPopupDependent" fckLang="DlgLnkPopDependent">Dependent
+                                                                               
(Netscape)</label>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td 
valign="top" nowrap="nowrap" width="50%">&nbsp;</td>
+                                                               <td></td>
+                                                               <td 
valign="top" nowrap="nowrap" width="50%"></td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td 
valign="top">
+                                                                       <table 
cellspacing="0" cellpadding="0" border="0">
+                                                                               
<tr>
+                                                                               
        <td nowrap="nowrap"><span fckLang="DlgLnkPopWidth">Width</span></td>
+                                                                               
        <td>&nbsp;<input id="txtPopupWidth" type="text" maxlength="4" size="4" 
/></td>
+                                                                               
</tr>
+                                                                               
<tr>
+                                                                               
        <td nowrap="nowrap"><span fckLang="DlgLnkPopHeight">Height</span></td>
+                                                                               
        <td>&nbsp;<input id="txtPopupHeight" type="text" maxlength="4" size="4" 
/></td>
+                                                                               
</tr>
+                                                                       </table>
+                                                               </td>
+                                                               
<td>&nbsp;&nbsp;</td>
+                                                               <td 
valign="top">
+                                                                       <table 
cellspacing="0" cellpadding="0" border="0">
+                                                                               
<tr>
+                                                                               
        <td nowrap="nowrap"><span fckLang="DlgLnkPopLeft">Left 
Position</span></td>
+                                                                               
        <td>&nbsp;<input id="txtPopupLeft" type="text" maxlength="4" size="4" 
/></td>
+                                                                               
</tr>
+                                                                               
<tr>
+                                                                               
        <td nowrap="nowrap"><span fckLang="DlgLnkPopTop">Top 
Position</span></td>
+                                                                               
        <td>&nbsp;<input id="txtPopupTop" type="text" maxlength="4" size="4" 
/></td>
+                                                                               
</tr>
+                                                                       </table>
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+               <div id="divAttribs" style="DISPLAY: none">
+                       <table cellspacing="0" cellpadding="0" width="100%" 
align="center" border="0">
+                               <tr>
+                                       <td valign="top" width="50%">
+                                               <span 
fckLang="DlgGenId">Id</span><br />
+                                               <input id="txtAttId" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td width="1"></td>
+                                       <td valign="top">
+                                               <table cellspacing="0" 
cellpadding="0" width="100%" align="center" border="0">
+                                                       <tr>
+                                                               <td width="60%">
+                                                                       <span 
fckLang="DlgGenLangDir">Language Direction</span><br />
+                                                                       <select 
id="cmbAttLangDir" style="WIDTH: 100%">
+                                                                               
<option value="" fckLang="DlgGenNotSet" selected>&lt;not set&gt;</option>
+                                                                               
<option value="ltr" fckLang="DlgGenLangDirLtr">Left to Right (LTR)</option>
+                                                                               
<option value="rtl" fckLang="DlgGenLangDirRtl">Right to Left (RTL)</option>
+                                                                       
</select>
+                                                               </td>
+                                                               <td 
width="1%">&nbsp;&nbsp;&nbsp;</td>
+                                                               <td 
nowrap="nowrap"><span fckLang="DlgGenAccessKey">Access Key</span><br />
+                                                                       <input 
id="txtAttAccessKey" style="WIDTH: 100%" type="text" maxlength="1" size="1" />
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top" width="50%">
+                                               <span 
fckLang="DlgGenName">Name</span><br />
+                                               <input id="txtAttName" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td width="1"></td>
+                                       <td valign="top">
+                                               <table cellspacing="0" 
cellpadding="0" width="100%" align="center" border="0">
+                                                       <tr>
+                                                               <td width="60%">
+                                                                       <span 
fckLang="DlgGenLangCode">Language Code</span><br />
+                                                                       <input 
id="txtAttLangCode" style="WIDTH: 100%" type="text" />
+                                                               </td>
+                                                               <td 
width="1%">&nbsp;&nbsp;&nbsp;</td>
+                                                               <td 
nowrap="nowrap">
+                                                                       <span 
fckLang="DlgGenTabIndex">Tab Index</span><br />
+                                                                       <input 
id="txtAttTabIndex" style="WIDTH: 100%" type="text" maxlength="5" size="5" />
+                                                               </td>
+                                                       </tr>
+                                               </table>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top" width="50%">&nbsp;</td>
+                                       <td width="1"></td>
+                                       <td valign="top"></td>
+                               </tr>
+                               <tr>
+                                       <td valign="top" width="50%">
+                                               <span 
fckLang="DlgGenTitle">Advisory Title</span><br />
+                                               <input id="txtAttTitle" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td width="1">&nbsp;&nbsp;&nbsp;</td>
+                                       <td valign="top">
+                                               <span 
fckLang="DlgGenContType">Advisory Content Type</span><br />
+                                               <input id="txtAttContentType" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td valign="top">
+                                               <span 
fckLang="DlgGenClass">Stylesheet Classes</span><br />
+                                               <input id="txtAttClasses" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                                       <td></td>
+                                       <td valign="top">
+                                               <span 
fckLang="DlgGenLinkCharset">Linked Resource Charset</span><br />
+                                               <input id="txtAttCharSet" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                       </table>
+                       <table cellspacing="0" cellpadding="0" width="100%" 
align="center" border="0">
+                               <tr>
+                                       <td>
+                                               <span 
fckLang="DlgGenStyle">Style</span><br />
+                                               <input id="txtAttStyle" 
style="WIDTH: 100%" type="text" />
+                                       </td>
+                               </tr>
+                       </table>
+               </div>
+<!-- start srPageChooserPlugin -->
+               <script type="text/javascript">
+               (function($){
+                 $cmbLinkType      = $('#cmbLinkType');
+      $btnChooseCMSPage = $('#btnChooseCMSPage');
+      $txtUrlTmp        = $('#txtUrlTmp');
+      $txtUrl           = $('#txtUrl');
+      $elsHideOnChooser = $('#divInfo *');
+      $elsShowOnChooser = $('#divPageChooserWrapper, #divPageChooserWrapper *, 
#ifrmPageChooser');
+      $elsAlwaysHide    = $('#divLinkTypeAnchor, #divLinkTypeEMail, 
#divBrowseServer, script, style, #divLinkTypeUrl table td:first-child');
+      $cmbLinkProtocolOptionOther  = $('#cmbLinkProtocol option[value=""]');
+
+      // hide protocol dropdown and select "other"
+      $('#divLinkTypeUrl table td:first-child').hide();
+      
$cmbLinkProtocolOptionOther.attr('selected','selected').siblings().attr('selected','');
+      
+      $btnChooseCMSPage.click(function(){
+        PageChooserParent.showChooser();
+      })
+
+                 $cmbLinkType.change(function(){
+                   if ($cmbLinkType.val() == 'url') {
+                     $btnChooseCMSPage.show()
+                   } else {
+                     $btnChooseCMSPage.hide()
+                   }
+                 })
+               })(jQuery);
+
+               PageChooserParent = {
+                 showChooser: function() {
+                   $elsHideOnChooser.hide();
+                   $elsShowOnChooser.show();
+                 },
+
+                 onPageSelect: function(pageInfo, baseUrl) {
+                   $txtUrlTmp.val(pageInfo.slug)
+                   $txtUrl.val(pageInfo.slug)
+                 },
+
+                 onButtonOk: function() {
+                   $elsHideOnChooser.show();
+                   $elsShowOnChooser.hide();
+                   $elsAlwaysHide.hide();
+
+                   $txtUrl.val($txtUrlTmp.val())
+                 },
+
+                 baseUrl: ''
+               }
+               </script>
+               <style type="text/css">
+               #ifrmPageChooser {
+      width: 100%;
+      height: auto;
+      overflow-x: hidden;
+               }
+               #txtUrlTmp {
+                 width: 260px;
+               }
+               #btnPageChooserOk {
+
+               }
+               </style>
+<!-- end srPageChooserPlugin -->
+       </body>
+</html>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to