This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/includes/tinymce/jscripts/tiny_mce/themes/advanced/link.htm
2008-11-26 14:50:40 -08:00

116 lines
4.2 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)
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCE.documentBasePath + "/" + url + '"></sc'+'ript>');
</script>
<script language="javascript">
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'));
// 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;
}
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">{$lang_insert_link_title}</td>
</tr>
<tr>
<td>{$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>{$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>{$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>