Files
alfresco-community-repo/source/web/scripts/ajax/tiny_mce_wcm_extensions.js
Derek Hulley ac03bb5f8c Merged V2.1 to HEAD
6636: Temporary hack to fix build.  
   6637: Better handling of binary string bufs, disable link validation when poll interval is <= 0
   6638: Forgotten files for TXT to PDF transformer.
   6639: Fix for AWC-1541
   6641: Fix for WCM-792.
   6642: A little extra PropertyValue support for createNode, too.
   6643: Fix for WCM-791
   6644: Closure of AR-1528: Check concurrency handling of DuplicateChildNodeNameException
   6647: Fix WCM-794
   6648: WCM-656
   6650: Applied user supplied patch to fix AWC-1546 - Cannot mount AVM using CIFS on new alfresco installation.
   6651: Index tidy ups
   6654: Various minor updates for passthru authentication debugging and error handling.
   6657: Fix for WCM-799 (Some items selected for submission were not present)
   6659: Updated installers.
   6660: Partial fix to AWC-1524
   6661: Fix WCM-803
   6664: Including  hibernate-3.2.1.jar in $VIRTUAL_TOMCAT_HOME/server/lib/ 
   6665: adding an automated unit test for output path patterns.
   6668: Fixed to add shale-test-1.0.4.jar to Eclipse classpath (PHH oked)
   6681: Fixes WCM-811 - Lookup.getIndirectionPath() had a bit of a howler in it.
   6684: UncategorizedSQLException with the word 'deadlock' in the message is now cause for retrying a transaction.
   6691: Fix for WCM-813 (lock not removed when expiration date set and no workflow on web project)
   6696: Imporved SSO filters for SiteMinder etc + test filter
   6697: Support for scheduled import
   6699: Fix for the compliation target:  compile-benchmarkframework 
   6701: Fix for 1.6 JVMs (1.5 gets by with lucky ordering)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2007-09-11 04:18:53 +00:00

90 lines
3.9 KiB
JavaScript

/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
////////////////////////////////////////////////////////////////////////////////
// TinyMCE extensions for wcm
//
// This script provides callbacks used for overriding the default image and
// link dialogs for presenting a file picker to browse the repository.
//
// This script requires tiny_mce.js, and some alfresco.constants to be
// loaded in advance.
////////////////////////////////////////////////////////////////////////////////
function alfresco_TinyMCE_urlconverter_callback(href, element, onsave)
{
var result = null;
if (onsave)
{
result = (href && href.startsWith(alfresco.constants.AVM_WEBAPP_URL)
? href.substring(alfresco.constants.AVM_WEBAPP_URL.length)
: href);
}
else
{
result = (href && href.startsWith("/")
? alfresco.constants.AVM_WEBAPP_URL + href
: href);
}
if (href && href.startsWith(document.location.href))
{
result = href.substring(document.location.href.length);
}
// dojo.debug("alfresco_TinyMCE_urlconverter_callback('" + href + "', ... , " + onsave + ") = " + result);
return result;
}
function alfresco_TinyMCE_file_browser_callback(field_name, url, type, win)
{
tinyMCE.importCSS(win.document, alfresco.constants.WEBAPP_CONTEXT + "/css/xforms.css");
var div = win.document.createElement("div");
div.style.width = "100%";
div.style.height = "100%";
div.style.backgroundColor = "white";
div.style.position = "absolute";
div.style.top = "0px";
div.style.left = "0px";
win.document.body.appendChild(div);
var pickerDiv = win.document.createElement("div");
pickerDiv.style.height = "100%";
pickerDiv.style.position = "relative";
div.appendChild(pickerDiv);
var picker = new alfresco.FilePickerWidget("alfFilePicker",
pickerDiv,
url,
false,
function(picker)
{
win.document.getElementById(field_name).value = picker.getValue();
picker.destroy();
div.parentNode.removeChild(div);
},
function()
{
picker.destroy();
div.parentNode.removeChild(div);
},
function(picker)
{
picker.node.style.height = div.offsetHeight + "px";
picker.node.style.width = div.offsetWidth + "px";
},
type == "image" ? ["wcm:avmcontent"] : [],
type == "image" ? ["image/*"] : []);
picker._navigateToNode(url);
}