From 900ec6f724e6441672dcb4fe7d02e126b90e1469 Mon Sep 17 00:00:00 2001 From: Drake Date: Tue, 7 Nov 2006 17:22:53 +0000 Subject: [PATCH] Fix problem with "Open link in new window" selection in WebGUI asset tree link popup plugin to TinyMCE. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Operation/FormHelpers.pm | 14 ++++++++------ .../tiny_mce/plugins/pagetree/editor_plugin.js | 9 ++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8ac0de499..7912e6d00 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -28,6 +28,7 @@ - fix: inability to create shortcuts to threads - fix: Style templates do not render metadata - fix: Survey duplication not working + - fix: "Open link in new window" with WebGUI asset tree link in TinyMCE 7.1.4 - Template variables in the main Survey Template were out of date in the diff --git a/lib/WebGUI/Operation/FormHelpers.pm b/lib/WebGUI/Operation/FormHelpers.pm index fe87ad708..a0d32fddb 100644 --- a/lib/WebGUI/Operation/FormHelpers.pm +++ b/lib/WebGUI/Operation/FormHelpers.pm @@ -167,25 +167,27 @@ sub www_richEditPageTree { -value=>$i18n->get('done'), -extras=>'onclick="createLink()"' ); - my $output = '
'.$i18n->get('insert a link').''.$f->print.'
+ my $output = '
'.$i18n->get('insert a link').''.$f->print.'
'.<<"JS" -
'.$i18n->get('pages').' '; +JS + .'
'.$i18n->get('pages').' '; $output .= '
'; my $base = WebGUI::Asset->newByUrl($session) || WebGUI::Asset->getRoot($session); my @crumb; diff --git a/www/extras/tinymce2/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js b/www/extras/tinymce2/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js index 953cbc026..55f40545c 100755 --- a/www/extras/tinymce2/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js +++ b/www/extras/tinymce2/jscripts/tiny_mce/plugins/pagetree/editor_plugin.js @@ -2,7 +2,7 @@ tinyMCE.importPluginLanguagePack('pagetree', 'en'); /** - * Returns the HTML contents of the emotions control. + * Returns the HTML contents of the pagetree control. */ function TinyMCE_pagetree_getControlHTML(control_name) { switch (control_name) { @@ -14,7 +14,7 @@ function TinyMCE_pagetree_getControlHTML(control_name) { } /** - * Executes the mceEmotion command. + * Executes the wgPageTree command. */ var tinyMceSelectedText = ''; function TinyMCE_pagetree_execCommand(editor_id, element, command, user_interface, value) { @@ -26,9 +26,8 @@ function TinyMCE_pagetree_execCommand(editor_id, element, command, user_interfac tinyMceSelectedText = inst.selection.getSelectedText(); var template = new Array(); //Check for proper get delimiter - var seperator = ''; - if (getWebguiProperty ("pageURL").match(/\?/)) { seperator = ';' } else { seperator = '?'} - template['file'] = "../../../../../.." + getWebguiProperty ("pageURL") + seperator + 'op=richEditPageTree'; + var separator = getWebguiProperty("pageURL").match(/\?/)? ';' : '?'; + template['file'] = "../../../../../.." + getWebguiProperty("pageURL") + separator + 'op=richEditPageTree'; template['width'] = 500; template['height'] = 500; tinyMCE.openWindow(template, {editor_id : editor_id, scrollbars : "yes"} );