mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-18 14:03:19 +01:00
8b6404cbc2
see tinymce.moxiecode.com/ for more info
136 lines
4.8 KiB
HTML
136 lines
4.8 KiB
HTML
<html>
|
|
<head>
|
|
<title>{$lang_insert_link_title}</title>
|
|
<script language="javascript" src="../../tiny_mce_popup.js"></script>
|
|
<script language="javascript">
|
|
var url = tinyMCE.getParam("external_link_list_url");
|
|
if (url != null) {
|
|
// Fix relative
|
|
if (url.charAt(0) != '/')
|
|
url = tinyMCE.documentBasePath + "/" + url;
|
|
|
|
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '?rnd=' + new Date().getTime() + '"></sc'+'ript>');
|
|
}
|
|
</script>
|
|
<script language="javascript">
|
|
// Disable auto resize
|
|
tinyMCE.getWindowArg('mce_windowresize', false);
|
|
|
|
function init() {
|
|
for (var i=0; i<document.forms[0].target.options.length; i++) {
|
|
var option = document.forms[0].target.options[i];
|
|
|
|
if (option.value == tinyMCE.getWindowArg('target'))
|
|
option.selected = true;
|
|
}
|
|
|
|
document.forms[0].href.value = tinyMCE.getWindowArg('href');
|
|
document.forms[0].linktitle.value = tinyMCE.getWindowArg('title');
|
|
document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true);
|
|
|
|
// Handle file browser
|
|
if (tinyMCE.getParam("file_browser_callback") != null) {
|
|
document.getElementById('href').style.width = '180px';
|
|
|
|
var html = '';
|
|
|
|
html += '<img id="browserBtn" src="images/browse.gif"';
|
|
html += ' onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');"';
|
|
html += ' onmouseout="tinyMCE.restoreClass(this);"';
|
|
html += ' onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');"';
|
|
html += ' onclick="javascript:tinyMCE.openFileBrowser(\'href\',document.forms[0].href.value,\'file\',window);"';
|
|
html += ' width="20" height="18" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
|
|
html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" />';
|
|
|
|
document.getElementById('browser').innerHTML = html;
|
|
}
|
|
|
|
// Auto select link in list
|
|
if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
|
|
var formObj = document.forms[0];
|
|
|
|
for (var i=0; i<formObj.link_list.length; i++) {
|
|
if (formObj.link_list.options[i].value == tinyMCE.getWindowArg('href'))
|
|
formObj.link_list.options[i].selected = true;
|
|
}
|
|
}
|
|
|
|
// Autoresize and focus
|
|
TinyMCEPopup_autoResize();
|
|
window.focus();
|
|
}
|
|
|
|
function insertLink() {
|
|
if (window.opener) {
|
|
var href = document.forms[0].href.value;
|
|
var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value;
|
|
var title = document.forms[0].linktitle.value;
|
|
|
|
window.opener.tinyMCE.insertLink(href, target, title);
|
|
top.close();
|
|
}
|
|
}
|
|
|
|
function cancelAction() {
|
|
top.close();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="init();">
|
|
<form onsubmit="insertLink();return false;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100">
|
|
<tr>
|
|
<td align="center" valign="middle"><table border="0" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<td colspan="2" class="title" nowrap="nowrap">{$lang_insert_link_title}</td>
|
|
</tr>
|
|
<tr>
|
|
<td nowrap="nowrap">{$lang_insert_link_url}:</td>
|
|
<td> <table border="0" cellspacing="0" cellpadding="0">
|
|
<tr>
|
|
<td><input name="href" type="text" id="href" value="" style="width: 200px"></td>
|
|
<td id="browser"></td>
|
|
</tr>
|
|
</table></td>
|
|
</tr>
|
|
<!-- Link list -->
|
|
<script language="javascript">
|
|
if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
|
|
var html = "";
|
|
|
|
html += '<tr><td>{$lang_link_list}:</td>';
|
|
html += '<td><select name="link_list" style="width: 200px" onchange="this.form.href.value=this.options[this.selectedIndex].value;">';
|
|
html += '<option value="">---</option>';
|
|
|
|
for (var i=0; i<tinyMCELinkList.length; i++)
|
|
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
|
|
|
html += '</select></td></tr>';
|
|
|
|
document.write(html);
|
|
}
|
|
</script>
|
|
<!-- /Link list -->
|
|
<tr>
|
|
<td nowrap="nowrap">{$lang_insert_link_target}:</td>
|
|
<td><select name="target" style="width: 200px">
|
|
<option value="_self">{$lang_insert_link_target_same}</option>
|
|
<option value="_blank">{$lang_insert_link_target_blank}</option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td nowrap="nowrap">{$lang_theme_insert_link_titlefield}:</td>
|
|
<td><input name="linktitle" type="text" id="linktitle" value="" style="width: 200px"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertLink();">
|
|
</td>
|
|
<td align="right"><input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();"></td>
|
|
</tr>
|
|
</table></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</body>
|
|
</html>
|