Project

General

Profile

Bug #21051 ยป browse_links_htmlarea.diff.txt

Administrator Admin, 2009-09-14 09:15

 
Index: typo3/class.browse_links.php
===================================================================
--- typo3/class.browse_links.php (Revision 5914)
+++ typo3/class.browse_links.php (Arbeitskopie)
@@ -887,19 +887,19 @@
var cur_class = "'.($this->setClass ? $this->setClass : '-').'";
var cur_title="'.($this->setTitle?$this->setTitle:'').'";
- function browse_links_setTarget(target) { //
- cur_target=target;
- add_target="&curUrl[target]="+escape(target);
+ function setTarget(value) {
+ cur_target=value;
+ add_target="&curUrl[target]="+encodeURIComponent(value);
}
- function browse_links_setClass(cssClass) { //
- cur_class = cssClass;
- add_class = "&curUrl[class]=" + escape(cssClass);
+ function setClass(value) {
+ cur_class=value;
+ add_class="&curUrl[class]="+encodeURIComponent(value);
}
- function browse_links_setTitle(title) { //
- cur_title=title;
- add_title="&curUrl[title]="+escape(title);
+ function setTitle(value) {
+ cur_title=value;
+ add_title="&curUrl[title]="+encodeURIComponent(value);
}
- function browse_links_setValue(value) { //
+ function setValue(value) {
cur_href=value;
add_href="&curUrl[href]="+value;
}
@@ -976,23 +976,35 @@
';
} else { // Functions used, if the link selector is in RTE mode:
$JScode.='
- function link_typo3Page(id,anchor) { //
+ function link_typo3Page(id,anchor) {
var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"");
- self.parent.parent.renderPopup_addLink(theLink, cur_target, cur_class, cur_title);
+ if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+ if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+ if (document.ltargetform.ltarget) setTarget(document.ltargetform.ltarget.value);
+ plugin.createLink(theLink,cur_target,cur_class,cur_title);
return false;
}
function link_folder(folder) { //
var theLink = \''.$this->siteURL.'\'+folder;
- self.parent.parent.renderPopup_addLink(theLink, cur_target, cur_class, cur_title);
+ if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+ if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+ if (document.ltargetform.ltarget) setTarget(document.ltargetform.ltarget.value);
+ plugin.createLink(theLink,cur_target,cur_class,cur_title);
return false;
}
function link_spec(theLink) { //
- self.parent.parent.renderPopup_addLink(theLink, cur_target, cur_class, cur_title);
+ if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+ if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+ if (document.ltargetform.ltarget) setTarget(document.ltargetform.ltarget.value);
+ plugin.createLink(theLink,cur_target,cur_class,cur_title);
return false;
}
function link_current() { //
+ if (document.ltargetform.anchor_title) setTitle(document.ltargetform.anchor_title.value);
+ if (document.ltargetform.anchor_class) setClass(document.ltargetform.anchor_class.value);
+ if (document.ltargetform.ltarget) setTarget(document.ltargetform.ltarget.value);
if (cur_href!="http://" && cur_href!="mailto:") {
- self.parent.parent.renderPopup_addLink(cur_href, cur_target, cur_class, cur_title);
+ plugin.createLink(cur_href,cur_target,cur_class,cur_title);
}
return false;
}
@@ -1219,7 +1231,7 @@
$menuDef['removeLink']['isActive'] = $this->act=='removeLink';
$menuDef['removeLink']['label'] = $LANG->getLL('removeLink',1);
$menuDef['removeLink']['url'] = '#';
- $menuDef['removeLink']['addParams'] = 'onclick="self.parent.parent.renderPopup_unLink();return false;"';
+ $menuDef['removeLink']['addParams'] = 'onclick="plugin.unLink();return false;"';
}
if (in_array('page',$allowedItems)) {
$menuDef['page']['isActive'] = $this->act=='page';
@@ -1281,7 +1293,7 @@
<tr>
<td style="width: 96px;">' . $GLOBALS['LANG']->getLL('emailAddress', 1) . ':</td>
<td><input type="text" name="lemail"'.$this->doc->formWidth(20).' value="'.htmlspecialchars($this->curUrlInfo['act']=='mail'?$this->curUrlInfo['info']:'').'" /> '.
- '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', 1) . '" onclick="browse_links_setTarget(\'\');browse_links_setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
+ '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', 1) . '" onclick="setTarget(\'\');setValue(\'mailto:\'+document.lurlform.lemail.value); return link_current();" /></td>
</tr>
</table>
</form>';
@@ -1298,7 +1310,7 @@
<tr>
<td style="width: 96px;">URL:</td>
<td><input type="text" name="lurl"'.$this->doc->formWidth(30).' value="'.htmlspecialchars($this->curUrlInfo['act']=='url'?$this->curUrlInfo['info']:'http://').'" /> '.
- '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', 1) . '" onclick="browse_links_setValue(document.lurlform.lurl.value); return link_current();" /></td>
+ '<input type="submit" value="' . $GLOBALS['LANG']->getLL('setLink', 1) . '" onclick="setValue(document.lurlform.lurl.value); return link_current();" /></td>
</tr>
</table>
</form>';
@@ -1363,7 +1375,7 @@
// URL + onclick event:
$onClickEvent='';
- if (isset($v[$k2i.'.']['target'])) $onClickEvent.="browse_links_setTarget('".$v[$k2i.'.']['target']."');";
+ if (isset($v[$k2i.'.']['target'])) $onClickEvent.="setTarget('".$v[$k2i.'.']['target']."');";
$v[$k2i.'.']['url'] = str_replace('###_URL###',$this->siteURL,$v[$k2i.'.']['url']);
if (substr($v[$k2i.'.']['url'],0,7)=='http://' || substr($v[$k2i.'.']['url'],0,7)=='mailto:') {
$onClickEvent.="cur_href=unescape('".rawurlencode($v[$k2i.'.']['url'])."');link_current();";
@@ -1435,7 +1447,7 @@
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
<tr>
<td style="width: 96px;">' . $GLOBALS['LANG']->getLL('class', 1) . '</td>
- <td><input type="text" name="lclass" onchange="browse_links_setClass(this.value);" value="' . htmlspecialchars($this->setClass) . '"' . $this->doc->formWidth(10) . ' /></td>
+ <td><input type="text" name="lclass" onchange="setClass(this.value);" value="' . htmlspecialchars($this->setClass) . '"' . $this->doc->formWidth(10) . ' /></td>
</tr>
</table>
</form>
@@ -1447,7 +1459,7 @@
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
<tr>
<td style="width: 96px;">' . $GLOBALS['LANG']->getLL('title', 1) . '</td>
- <td><input type="text" name="ltitle" onchange="browse_links_setTitle(this.value);" value="' . htmlspecialchars($this->setTitle) . '"' . $this->doc->formWidth(10) . ' /></td>
+ <td><input type="text" name="ltitle" onchange="setTitle(this.value);" value="' . htmlspecialchars($this->setTitle) . '"' . $this->doc->formWidth(10) . ' /></td>
</tr>
</table>
</form>
@@ -1466,9 +1478,9 @@
<table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
<tr>
<td>'.$GLOBALS['LANG']->getLL('target',1).':</td>
- <td><input type="text" name="ltarget" onchange="browse_links_setTarget(this.value);" value="' . htmlspecialchars($this->setTarget) . '"' . $this->doc->formWidth(10) . ' /></td>
+ <td><input type="text" name="ltarget" onchange="setTarget(this.value);" value="' . htmlspecialchars($this->setTarget) . '"' . $this->doc->formWidth(10) . ' /></td>
<td>
- <select name="ltarget_type" onchange="browse_links_setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
+ <select name="ltarget_type" onchange="setTarget(this.options[this.selectedIndex].value);document.ltargetform.ltarget.value=this.options[this.selectedIndex].value;this.selectedIndex=0;">
<option></option>
<option value="_top">'.$GLOBALS['LANG']->getLL('top',1).'</option>
<option value="_blank">'.$GLOBALS['LANG']->getLL('newWindow',1).'</option>
@@ -1483,9 +1495,9 @@
$selectJS = '
if (document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value>0 && document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value>0) {
document.ltargetform.ltarget.value = document.ltargetform.popup_width.options[document.ltargetform.popup_width.selectedIndex].value+"x"+document.ltargetform.popup_height.options[document.ltargetform.popup_height.selectedIndex].value;
- browse_links_setTarget(document.ltargetform.ltarget.value);
- browse_links_setClass(document.lclassform.lclass.value);
- browse_links_setTitle(document.ltitleform.ltitle.value);
+ setTarget(document.ltargetform.ltarget.value);
+ setClass(document.lclassform.lclass.value);
+ setTitle(document.ltitleform.ltitle.value);
document.ltargetform.popup_width.selectedIndex=0;
document.ltargetform.popup_height.selectedIndex=0;
}
    (1-1/1)