Developers preview version
|
|
@ -0,0 +1,187 @@
|
|||
<?
|
||||
/* ===========================
|
||||
|
||||
gelato CMS development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under GPL (General public license)
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?
|
||||
require_once('../config.php');
|
||||
include("../classes/user.class.php");
|
||||
include("../classes/gelato.class.php");
|
||||
include("../classes/templates.class.php");
|
||||
require_once("../classes/configuration.class.php");
|
||||
|
||||
$user = new user();
|
||||
$tumble = new gelato();
|
||||
$conf = new configuration();
|
||||
$template = new plantillas("admin");
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
if(isset($_POST["btnAdd"])) {
|
||||
unset($_POST["btnAdd"]);
|
||||
|
||||
|
||||
if ($_POST["type"]=="2") { // is Photo type
|
||||
if (isset($_POST["url"]) && $_POST["url"]!="") {
|
||||
$photoName = getFileName($_POST["url"]);
|
||||
if (!$tumble->savePhoto($_POST["url"])) {
|
||||
header("Location: ".$this->conf->urlGelato."/admin/index.php?photo=false");
|
||||
die();
|
||||
}
|
||||
$_POST["url"] = $conf->urlGelato."/uploads/".$photoName;
|
||||
}
|
||||
|
||||
if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".$_FILES['photo']['name'] ) ) {
|
||||
$_POST["url"] = $conf->urlGelato."/uploads/".$_FILES['photo']['name'];
|
||||
}
|
||||
|
||||
unset($_POST["photo"]);
|
||||
unset($_POST["MAX_FILE_SIZE"]);
|
||||
}
|
||||
|
||||
if ($_POST["type"]=="7") { // is MP3 type
|
||||
set_time_limit(300);
|
||||
$mp3Name = getFileName($_POST["url"]);
|
||||
if (!$tumble->saveMP3($_POST["url"])) {
|
||||
header("Location: ".$this->conf->urlGelato."/admin/index.php?mp3=false");
|
||||
die();
|
||||
}
|
||||
$_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST["id_post"])) {
|
||||
//$tumble->modifyPost($_POST, $_POST["id_post"]);
|
||||
} else {
|
||||
if ($tumble->addPost($_POST)) {
|
||||
header("Location: ".$this->conf->urlGelato."/admin/index.php?added=true");
|
||||
die();
|
||||
} else {
|
||||
header("Location: ".$this->conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
|
||||
die();
|
||||
}
|
||||
}
|
||||
} elseif (isset($_GET["new"])) {
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>gelato</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
|
||||
<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/tiny_mce/tiny_mce.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/tools.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>
|
||||
<style type="text/css" media="screen">
|
||||
@import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="div-process" style="display:none;">Processing request...</div>
|
||||
<div id="titulo">
|
||||
<img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />
|
||||
</div>
|
||||
|
||||
<div id="menuContenedor">
|
||||
<ul>
|
||||
<li id="active"><a href="#" id="current">Posts</a></li>
|
||||
<ul>
|
||||
<li id="subactive"><a href="#" id="subcurrent">Add</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="index.php">Control Panel</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="contenido">
|
||||
<div class="center">
|
||||
<div class="ventana">
|
||||
<p class="titulo"><span class="handle">Add content</span></p>
|
||||
<div id="formulario">
|
||||
<form action="add.php" method="post" <?=($_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd">
|
||||
<fieldset>
|
||||
<?
|
||||
switch ($_GET["new"]) {
|
||||
case "post":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("1", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_post");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
case "photo":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("2", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_photo");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
case "quote":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("3", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_quote");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
case "url":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("4", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_link");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
case "conversation":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("5", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_conversation");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
case "video":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("6", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_video");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
case "mp3":
|
||||
$input = array("{type}", "{date}", "{id_user}");
|
||||
$output = array("7", time(), $_SESSION['user_id']);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_add_mp3");
|
||||
$template->mostrarPlantilla();
|
||||
break;
|
||||
default:
|
||||
echo "<div class=\"error\">The specified type is not valid.</div>";
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<p>
|
||||
<input class="submit" type="submit" name="btnAdd" value="Create post" />
|
||||
<a href="#" onclick="if (confirm('Cancel editing this post? All changes will be lost.'))
|
||||
{location.href='index.php';}; return false;">Cancel</a>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pie">
|
||||
<p>
|
||||
<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?
|
||||
}
|
||||
} else {
|
||||
header("Location: ".$conf->urlGelato."/login.php");
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
<?
|
||||
/* ===========================
|
||||
|
||||
gelato CMS development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under GPL (General public license)
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?
|
||||
require_once('../config.php');
|
||||
include("../classes/user.class.php");
|
||||
require_once("../classes/configuration.class.php");
|
||||
|
||||
$user = new user();
|
||||
$conf = new configuration();
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>gelato</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
|
||||
<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>
|
||||
<style type="text/css" media="screen">
|
||||
@import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="div-process" style="display:none;">Processing request...</div>
|
||||
<div id="titulo">
|
||||
<img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />
|
||||
</div>
|
||||
|
||||
<div id="menuContenedor">
|
||||
<ul>
|
||||
<li id="active"><a href="#" id="current">Users</a></li>
|
||||
<ul>
|
||||
<li><a href="user.php">Add</a></li>
|
||||
<li id="subactive"><a href="#" id="subcurrent">Manage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="index.php">Control Panel</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="contenido">
|
||||
<div class="center">
|
||||
<div class="ventana">
|
||||
<p class="titulo"><span class="handle">Manage the user information</span></p>
|
||||
<div id="formulario">
|
||||
<?
|
||||
if (isset($_GET["added"])) {
|
||||
if ($_GET["added"]=="true") {
|
||||
echo "<div class=\"exito\">The user has been added successfully.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["delete"])) {
|
||||
if ($_GET["delete"]=="true") {
|
||||
echo "<div class=\"exito\">The user has been eliminated successfully.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["modified"])) {
|
||||
if ($_GET["modified"]=="true") {
|
||||
echo "<div class=\"exito\">The user has been modified successfully.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["error"])) {
|
||||
if ($_GET["error"]==1) {
|
||||
echo "<div class=\"error\">The username is not available.</div>";
|
||||
} elseif ($_GET["error"]==2) {
|
||||
echo "<div class=\"error\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p>
|
||||
<table class="sortable" id="admin-tabla">
|
||||
<caption>Authors list.</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Login</th>
|
||||
<th scope="col">Name</th>
|
||||
<th colspan="2" scope="col" class="unsortable">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?
|
||||
$odd=false;
|
||||
$rs = $user->getUsers();
|
||||
if ($user->contarRegistros()>0) {
|
||||
while($register = mysql_fetch_array($rs)) {
|
||||
?>
|
||||
<tr <? if ($odd) { echo 'class="odd"'; } $odd=!$odd; ?>>
|
||||
<td>
|
||||
<? echo $register["login"]."\n"; ?>
|
||||
</td>
|
||||
<td>
|
||||
<? echo $register["name"]."\n"; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="user.php?edit=<?=$register["id_user"]; ?>">Edit</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="user.php?delete=<?=$register["id_user"]; ?>">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
}
|
||||
else {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="4"><div class="exito">No users available.</div></td>
|
||||
</tr>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<p> </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pie">
|
||||
<p>
|
||||
<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?
|
||||
} else {
|
||||
header("Location: ".$conf->urlGelato."/login.php");
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?
|
||||
/* ===========================
|
||||
|
||||
gelato CMS development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under GPL (General public license)
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?
|
||||
require_once('../config.php');
|
||||
include("../classes/user.class.php");
|
||||
$user = new user();
|
||||
if ($user->isAdmin()) {
|
||||
if ($_GET["action"]) {
|
||||
|
||||
if ($_GET["action"] == "close") {
|
||||
session_start();
|
||||
if ($user->closeSession()) {
|
||||
echo " ending session...";
|
||||
} else {
|
||||
echo " failure ending session...";
|
||||
}
|
||||
} // $_GET["action"] == "close"
|
||||
|
||||
if ($_GET["action"] == "verify") {
|
||||
if ($_GET["login"]=="") {
|
||||
echo "<div class=\"error\">Required field cannot be left blank.</div>";
|
||||
} else {
|
||||
if (!$user->userExist($_GET["login"])) {
|
||||
echo "<div class=\"exito\">Username available.</div>";
|
||||
} else {
|
||||
echo "<div class=\"error\">The username is not available.</div>";
|
||||
}
|
||||
}
|
||||
} // $_GET["action"] == "verify"
|
||||
} // $_GET["action"]
|
||||
} // $user->isAdmin()
|
||||
?>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<?
|
||||
/* ===========================
|
||||
|
||||
gelato CMS development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under GPL (General public license)
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?
|
||||
require_once('../config.php');
|
||||
include("../classes/user.class.php");
|
||||
|
||||
session_start();
|
||||
$user = new user();
|
||||
$user->closeSession()
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>gelato</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="../images/favicon.ico" />
|
||||
<meta http-equiv="Refresh" content="3;URL=../login.php" />
|
||||
<style type="text/css" media="screen">
|
||||
@import "css/style-codice.css";
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="titulo">
|
||||
<img src="../images/logo.jpg" alt="gelato CMS" title="gelato CMS" />
|
||||
</div>
|
||||
|
||||
<div id="contenido">
|
||||
<div class="piccola">
|
||||
<div class="ventana">
|
||||
<p class="titulo"><span class="handle" style="cursor:move;">Closing session</span></p>
|
||||
<p>
|
||||
<?
|
||||
if (@session_destroy()) {
|
||||
?>
|
||||
</p>
|
||||
<h3>Ending session...</h3>
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
<h3>Has happened an error when closing the session.</h3>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pie">
|
||||
<p>
|
||||
<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
/* Estructura */
|
||||
|
||||
*{ padding:0; margin:0;}
|
||||
|
||||
body {
|
||||
background-color: #F7F7F7;
|
||||
color: #333333;
|
||||
font-family: "Trebuchet MS", Vendana, Arial, sans-serif;
|
||||
font-size: 10pt;
|
||||
font-weight: normal;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#div-process {
|
||||
padding-left: 22px;
|
||||
font: normal 14.5px/17px georgia, "times new roman", serif;
|
||||
background: url(../../images/proceso.gif) no-repeat 0% 10%;
|
||||
float: right;
|
||||
height: 20px;
|
||||
width: 150px;
|
||||
border: 1px solid #000066;
|
||||
background-color:#FFFFCC;
|
||||
color:#011940;
|
||||
}
|
||||
|
||||
#titulo {
|
||||
background-color: #FcFcFc;
|
||||
border:1px solid #FcFcFc;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#contenido {
|
||||
background-color: #F7F7F7;
|
||||
border:1px solid #F7F7F7;
|
||||
}
|
||||
.piccola{ width:30%; margin: 0 auto;}
|
||||
.center{ width:60%; margin: 0 auto;}
|
||||
.right{ width:40%; float:right;}
|
||||
.left{ width: 60%; float:left; }
|
||||
.ventana{ margin:10px; padding:0 0 4px 0; border:1px solid #999; background-color:#DEDEDE;}
|
||||
.titulo{ background-color:#336699; color:#FFFFFF; font-weight:bold; text-align:center; border-bottom:2px solid #FFF;}
|
||||
|
||||
#contenido h3 {
|
||||
font: normal 17.5px/17px georgia, "times new roman", serif;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
#pie {
|
||||
clear: both;
|
||||
color: #808080;
|
||||
background: #FFF;
|
||||
font-size: 0.8em;
|
||||
text-align: right;
|
||||
padding: 9px 10px 9px 0;
|
||||
margin: 10px 5px 10px 5px;
|
||||
border: 1px solid #ccc;
|
||||
width:60%;
|
||||
margin: 0 auto;
|
||||
margin-top:50px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#pie a {
|
||||
text-decoration: underline;
|
||||
color: #3A6794;
|
||||
}
|
||||
|
||||
#pie a:hover {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* Mensajes para el usuario */
|
||||
|
||||
.error {
|
||||
width:80%;
|
||||
background: #FFF7F2 url('../../images/error.png') 15px center no-repeat;
|
||||
border-top: 2px solid #CC0000;
|
||||
border-bottom: 2px solid #CC0000;
|
||||
margin: 0 auto;
|
||||
padding: 5px 20px 5px 45px;
|
||||
}
|
||||
|
||||
.exito {
|
||||
width:80%;
|
||||
background: #F4FBF5 url('../../images/information.png') 15px center no-repeat;
|
||||
border-top: 2px solid #006600;
|
||||
border-bottom: 2px solid #006600;
|
||||
margin: 0 auto;
|
||||
padding: 5px 20px 5px 45px;
|
||||
}
|
||||
|
||||
.info {
|
||||
width:80%;
|
||||
background: #FFF6BF url('../../images/icon_info.gif') 15px center no-repeat;
|
||||
border-top: 2px solid #FFD324;
|
||||
border-bottom: 2px solid #FFD324;
|
||||
margin: 0 auto;
|
||||
padding: 5px 20px 5px 45px;
|
||||
}
|
||||
|
||||
/* Formularios */
|
||||
|
||||
#formulario {
|
||||
margin: 30px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
#formulario fieldset{ border: none;}
|
||||
#formulario label{ width:100px; text-align:left;}
|
||||
label.required { padding-left: 22px; background: url(../../images/required.gif) no-repeat 0% 50%; }
|
||||
label.problem { padding-left: 22px; background: url(../../images/caution.gif) no-repeat 0% 50%; }
|
||||
label.completed { padding-left: 22px; background: url(../../images/complete.gif) no-repeat 0% 50%; }
|
||||
#formulario p{margin: 8px 0 ;}
|
||||
.input-text{ width: 100%; border: 1px solid #7591B5; background-color:#fff; margin: 1px; padding: 3px; font: 14px Verdana, Arial, Helvetica, sans-serif;}
|
||||
.input-corto{ width: 200px; border: 1px solid #7591B5; background-color:#fff; padding: 1px 0;}
|
||||
.check { border: 1px solid #7591B5; background-color:#fff; }
|
||||
input:hover {
|
||||
background: #f5f5f5;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
input.submit
|
||||
{
|
||||
width: 200px;
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
text-align: center;
|
||||
cursor:pointer;
|
||||
border-bottom:solid 2px #000;
|
||||
border-right:solid 2px #000;
|
||||
border-top:solid 1px #336699;
|
||||
border-left:solid 1px #336699;
|
||||
background-color:#002255;
|
||||
color:#fff;
|
||||
font-size:105%;
|
||||
text-decoration:none;
|
||||
padding:.4em;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
input.submit:hover
|
||||
{
|
||||
text-decoration:none;
|
||||
background-color:#003366;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.submit_naranja {
|
||||
width: 200px;
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
text-align: center;
|
||||
cursor:pointer;
|
||||
border-bottom:solid 2px #E55C00;
|
||||
border-right:solid 2px #E55C00;
|
||||
border-top:solid 1px #FF751A;
|
||||
border-left:solid 1px #FF751A;
|
||||
background-color:#ff6600;
|
||||
color:#fff;
|
||||
font-size:105%;
|
||||
text-decoration:none;
|
||||
padding:.4em;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.submit_naranja:hover {
|
||||
text-decoration:none;
|
||||
background-color:#FF751A;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.submit_normal_azul {
|
||||
border-bottom:solid 2px #000;
|
||||
border-right:solid 2px #000;
|
||||
border-top:solid 1px #336699;
|
||||
border-left:solid 1px #336699;
|
||||
background-color:#002255;
|
||||
color:#fff;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
.submit_normal_azul:hover {
|
||||
text-decoration:none;
|
||||
background-color:#003366;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
|
||||
/* Menu */
|
||||
|
||||
#menuContenedor a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#menuContenedor ul
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#menuContenedor ul li {
|
||||
display: inline;
|
||||
margin: 0 0 0px;
|
||||
}
|
||||
|
||||
/*1st level elements*/
|
||||
#menuContenedor ul
|
||||
{
|
||||
border-top: 1px solid #FcFcFc;
|
||||
border-bottom: 1px solid #36c;
|
||||
background-color: #FcFcFc;
|
||||
padding: 2px 0;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
#menuContenedor ul a,
|
||||
#menuContenedor ul a:link,
|
||||
#menuContenedor ul a:visited
|
||||
{
|
||||
background: #900;
|
||||
border: 1px solid #FFF;
|
||||
bottom: 2px;
|
||||
color: #FFF;
|
||||
height: 1em;
|
||||
margin:0;
|
||||
margin-left: 15px;
|
||||
padding: 2px 4px 2px 4px;
|
||||
position: relative;
|
||||
right: 2px;
|
||||
text-decoration: none;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
#menuContenedor ul a:hover,
|
||||
#menuContenedor ul a:focus
|
||||
{
|
||||
background: #C00;
|
||||
bottom: 1px;
|
||||
color: #FFF;
|
||||
position: relative;
|
||||
right: 1px;
|
||||
}
|
||||
|
||||
/*current Link*/
|
||||
#menuContenedor ul a#current,
|
||||
#menuContenedor ul a#current:link,
|
||||
#menuContenedor ul a#current:visited {
|
||||
background: #369;
|
||||
border-bottom: none;
|
||||
border-left: 1px solid #9CC;
|
||||
border-right: 1px solid #9CC;
|
||||
border-top: 1px solid #9CC;
|
||||
bottom: 0;
|
||||
color: #FFF;
|
||||
cursor: text;
|
||||
margin: 0;
|
||||
margin-left: 15px;
|
||||
padding: 2px 5px 0 5px;
|
||||
position: relative;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/*Second and subsequent levels*/
|
||||
#menuContenedor ul ul
|
||||
{
|
||||
font-size: 80%;
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
border-top: none;
|
||||
background-color: #369;
|
||||
height: 2em;
|
||||
}
|
||||
|
||||
#menuContenedor ul ul li { display: inline; }
|
||||
|
||||
#menuContenedor ul ul a,
|
||||
#menuContenedor ul ul a:link,
|
||||
#menuContenedor ul ul a:visited
|
||||
{
|
||||
background-color: #95B1BB;
|
||||
border: 1px solid black;
|
||||
color: black;
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
#menuContenedor ul ul a:hover,
|
||||
#menuContenedor ul ul a:focus
|
||||
{
|
||||
background-color: #9CD4F7;
|
||||
border: 1px solid #000000;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/*current Link*/
|
||||
#menuContenedor ul ul a#subcurrent,
|
||||
#menuContenedor ul ul a#subcurrent:link,
|
||||
#menuContenedor ul ul a#subcurrent:visited {
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #F7F7F7;
|
||||
color: black;
|
||||
cursor: text;
|
||||
margin: 0;
|
||||
margin-left: 15px;
|
||||
position: relative;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#menu {
|
||||
display:block;
|
||||
top:50px;
|
||||
}
|
||||
|
||||
.opcion {
|
||||
float: left;
|
||||
margin-left: 15px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.opcion img {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
h2 {color: #9a4723; margin:0px;}
|
||||
|
||||
legend {color: #9a4723; margin:0px; font-size:large;}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
<?
|
||||
/* ===========================
|
||||
|
||||
gelato CMS development version
|
||||
http://www.gelatocms.com/
|
||||
|
||||
gelato CMS is a free software licensed under GPL (General public license)
|
||||
|
||||
=========================== */
|
||||
?>
|
||||
<?
|
||||
require_once('../config.php');
|
||||
include("../classes/user.class.php");
|
||||
|
||||
$user = new user();
|
||||
$conf = new configuration();
|
||||
if ($user->isAdmin()) {
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>gelato :: Control panel</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
|
||||
<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function exit(el, path) {
|
||||
el = $(el);
|
||||
el.style.display="block";
|
||||
el.setHTML('Processing request...');
|
||||
new Ajax(path, {
|
||||
onComplete:function(e) {
|
||||
el.setHTML(e).effect('opacity').custom(0,1);
|
||||
window.location='../login.php';
|
||||
}
|
||||
}).request();
|
||||
return false;
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
contenedor = new Fx.Style('divMessages', 'opacity', {duration: 5000, onComplete:
|
||||
function() {
|
||||
document.getElementById('divMessages').style.display="none";
|
||||
}
|
||||
});
|
||||
contenedor.custom(1,0);
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<style type="text/css" media="screen">
|
||||
@import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="div-process" style="display:none;"></div>
|
||||
<div id="titulo">
|
||||
<img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />
|
||||
</div>
|
||||
|
||||
<div id="menuContenedor">
|
||||
<ul>
|
||||
<li id="active"><a href="#" id="current">Posts</a></li>
|
||||
<ul>
|
||||
<li id="subactive"><a href="#" id="subcurrent">Manage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="admin.php">Manage users</a></li>
|
||||
<li><a href="close.php" onclick="return exit('div-process','<?=$conf->urlGelato;?>/admin/ajax.php?action=close');">Logoff</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="contenido">
|
||||
<div class="center">
|
||||
<div class="ventana">
|
||||
<p class="titulo"><span class="handle">Manage the posts</span></p>
|
||||
<div id="formulario">
|
||||
<?
|
||||
if (isset($_GET["deleted"])) {
|
||||
if ($_GET["deleted"]=="true") {
|
||||
echo "<div class=\"exito\" id=\"divMessages\">The article has been eliminated successfully.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["modified"])) {
|
||||
if ($_GET["modified"]=="true") {
|
||||
echo "<div class=\"exito\" id=\"divMessages\">The article has been modified successfully.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["added"])) {
|
||||
if ($_GET["added"]=="true") {
|
||||
echo "<div class=\"exito\" id=\"divMessages\">The article has been added successfully.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["error"])) {
|
||||
if ($_GET["error"]==2) {
|
||||
echo "<div class=\"error\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["mp3"])) {
|
||||
if ($_GET["mp3"]=="false") {
|
||||
echo "<div class=\"error\" id=\"divMessages\">Not an MP3 file or an upload problem.</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET["photo"])) {
|
||||
if ($_GET["photo"]=="false") {
|
||||
echo "<div class=\"error\" id=\"divMessages\">Not a photo file or an upload problem.</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="menu">
|
||||
<h2> </h2>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=post"><img alt="New regular post" src="../images/post.gif" /></a>
|
||||
</div>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=photo"><img alt="New photo" src="../images/foto.gif" /></a>
|
||||
</div>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=quote"><img alt="New quote" src="../images/cita.gif" /></a>
|
||||
</div>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=url"><img alt="New link" src="../images/enlace.gif" /></a>
|
||||
</div>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=conversation"><img alt="New conversation" src="../images/conversacion.gif" /></a>
|
||||
</div>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=video"><img alt="New video" src="../images/video.gif" /></a>
|
||||
</div>
|
||||
<div class="opcion">
|
||||
<a href="<?=$conf->urlGelato;?>/admin/add.php?new=mp3"><img alt="New MP3" src="../images/mp3.gif" /></a>
|
||||
</div>
|
||||
</div>
|
||||
<p> </p>
|
||||
<h2>Title 1</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas facilisis scelerisque ligula. Aliquam accumsan. In hac habitasse platea dictumst. Nulla ut urna eget felis tempor pellentesque. Fusce sollicitudin ultricies lacus. Duis felis. Mauris posuere enim ac tortor scelerisque tempus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Fusce porta. Integer odio purus, semper malesuada, eleifend in, volutpat non, quam. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Aliquam pellentesque aliquet turpis. Quisque non enim sed enim ullamcorper aliquet. Integer sit amet arcu.</p>
|
||||
<p> </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pie">
|
||||
<p>
|
||||
<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?
|
||||
} else {
|
||||
header("Location: ".$conf->urlGelato."/login.php");
|
||||
}
|
||||
?>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>blank_page</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body class="mceContentBody">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
bold_desc : 'Bold (Ctrl+B)',
|
||||
italic_desc : 'Italic (Ctrl+I)',
|
||||
underline_desc : 'Underline (Ctrl+U)',
|
||||
striketrough_desc : 'Strikethrough',
|
||||
justifyleft_desc : 'Align left',
|
||||
justifycenter_desc : 'Align center',
|
||||
justifyright_desc : 'Align right',
|
||||
justifyfull_desc : 'Align full',
|
||||
bullist_desc : 'Unordered list',
|
||||
numlist_desc : 'Ordered list',
|
||||
outdent_desc : 'Outdent',
|
||||
indent_desc : 'Indent',
|
||||
undo_desc : 'Undo (Ctrl+Z)',
|
||||
redo_desc : 'Redo (Ctrl+Y)',
|
||||
link_desc : 'Insert/edit link',
|
||||
unlink_desc : 'Unlink',
|
||||
image_desc : 'Insert/edit image',
|
||||
cleanup_desc : 'Cleanup messy code',
|
||||
focus_alert : 'A editor instance must be focused before using this command.',
|
||||
edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
|
||||
insert_link_title : 'Insert/edit link',
|
||||
insert : 'Insert',
|
||||
update : 'Update',
|
||||
cancel : 'Cancel',
|
||||
insert_link_url : 'Link URL',
|
||||
insert_link_target : 'Target',
|
||||
insert_link_target_same : 'Open link in the same window',
|
||||
insert_link_target_blank : 'Open link in a new window',
|
||||
insert_image_title : 'Insert/edit image',
|
||||
insert_image_src : 'Image URL',
|
||||
insert_image_alt : 'Image description',
|
||||
help_desc : 'Help',
|
||||
bold_img : "bold.gif",
|
||||
italic_img : "italic.gif",
|
||||
underline_img : "underline.gif",
|
||||
clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
|
||||
popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
|
||||
});
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
Beginning with version 2.0.5 the language packs are no
|
||||
longer included with the core distribution.
|
||||
Language packs can be downloaded from the TinyMCE website:
|
||||
http://tinymce.moxiecode.com/download.php
|
||||
|
||||
The language pack codes are based on ISO-639-1:
|
||||
http://www.loc.gov/standards/iso639-2/englangn.html
|
||||
|
||||
Plrease try using entities if possible. Like å etc for non a-z characters.
|
||||
|
|
@ -0,0 +1,504 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
input.radio {
|
||||
border: 1px none #000000;
|
||||
background-color: transparent;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.panel_wrapper div.current {
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
#width {
|
||||
width: 50px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#width2 {
|
||||
width: 50px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#size {
|
||||
width: 100px;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
tinyMCE.importPluginLanguagePack('advhr');var TinyMCE_AdvancedHRPlugin={getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"advhr":return tinyMCE.getButtonHTML(cn,'lang_insert_advhr_desc','{$pluginurl}/images/advhr.gif','mceAdvancedHr')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvancedHr":var template=new Array();template['file']='../../plugins/advhr/rule.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_advhr_delta_width',0);template['height']+=tinyMCE.getLang('lang_advhr_delta_height',0);var size="",width="",noshade="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="hr"){tinyMCE.hrElement=tinyMCE.selectedElement;if(tinyMCE.hrElement){size=tinyMCE.hrElement.getAttribute('size')?tinyMCE.hrElement.getAttribute('size'):"";width=tinyMCE.hrElement.getAttribute('width')?tinyMCE.hrElement.getAttribute('width'):"";noshade=tinyMCE.hrElement.getAttribute('noshade')?tinyMCE.hrElement.getAttribute('noshade'):""}tinyMCE.openWindow(template,{editor_id:editor_id,size:size,width:width,noshade:noshade,mceDo:'update'})}else{if(tinyMCE.isMSIE){tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,'<hr />')}else{tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",size:size,width:width,noshade:noshade,mceDo:'insert'})}}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="HR"){tinyMCE.switchClass(editor_id+'_advhr','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advhr','mceButtonNormal');return true}};tinyMCE.addPlugin("advhr",TinyMCE_AdvancedHRPlugin);
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('advhr');
|
||||
|
||||
var TinyMCE_AdvancedHRPlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced HR',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
}
|
||||
},
|
||||
|
||||
getControlHTML : function(cn) {
|
||||
switch (cn) {
|
||||
case "advhr":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
||||
/**
|
||||
* Executes the mceAdvanceHr command.
|
||||
*/
|
||||
execCommand : function(editor_id, element, command, user_interface, value) {
|
||||
// Handle commands
|
||||
switch (command) {
|
||||
case "mceAdvancedHr":
|
||||
var template = new Array();
|
||||
|
||||
template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
|
||||
template['width'] = 250;
|
||||
template['height'] = 160;
|
||||
|
||||
template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
|
||||
template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
|
||||
|
||||
var size = "", width = "", noshade = "";
|
||||
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {
|
||||
tinyMCE.hrElement = tinyMCE.selectedElement;
|
||||
|
||||
if (tinyMCE.hrElement) {
|
||||
size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
|
||||
width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
|
||||
noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
|
||||
}
|
||||
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
|
||||
} else {
|
||||
if (tinyMCE.isMSIE) {
|
||||
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
|
||||
} else {
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Pass to next handler in chain
|
||||
return false;
|
||||
},
|
||||
|
||||
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
||||
if (node == null)
|
||||
return;
|
||||
|
||||
do {
|
||||
if (node.nodeName == "HR") {
|
||||
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');
|
||||
return true;
|
||||
}
|
||||
} while ((node = node.parentNode));
|
||||
|
||||
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);
|
||||
|
Après Largeur: | Hauteur: | Taille: 153 B |
|
|
@ -0,0 +1,43 @@
|
|||
function init() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
var formObj = document.forms[0];
|
||||
formObj.width.value = tinyMCE.getWindowArg('width');
|
||||
formObj.size.value = tinyMCE.getWindowArg('size');
|
||||
formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true);
|
||||
if (tinyMCE.getWindowArg('noshade')) {
|
||||
formObj.noshade.checked = true;
|
||||
}
|
||||
if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
|
||||
formObj.width2.value = "%";
|
||||
formObj.width.value = formObj.width.value.substring(0,formObj.width.value.length-1);
|
||||
}
|
||||
}
|
||||
|
||||
function insertHR() {
|
||||
var formObj = document.forms[0];
|
||||
var width = formObj.width.value;
|
||||
var size = formObj.size.value;
|
||||
var html = '<hr';
|
||||
if (size!='' && size!=0) {
|
||||
html += ' size="' + size + '"';
|
||||
}
|
||||
if (width!='' && width!=0) {
|
||||
html += ' width="' + width;
|
||||
if (formObj.width2.value=='%') {
|
||||
html += '%';
|
||||
}
|
||||
html += '"';
|
||||
}
|
||||
if (formObj.noshade.checked==true) {
|
||||
html += ' noshade="noshade"';
|
||||
}
|
||||
html += ' />';
|
||||
|
||||
tinyMCEPopup.execCommand("mceInsertContent", true, html);
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function cancelAction() {
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
insert_advhr_desc : 'Horizontale rule',
|
||||
insert_advhr_width : 'Width',
|
||||
insert_advhr_size : 'Height',
|
||||
insert_advhr_noshade : 'No shadow'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_insert_advhr_desc}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/rule.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body onload="tinyMCEPopup.executeOnLoad('init();');">
|
||||
<form onsubmit="insertHR();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_advhr_desc}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td><label for="width">{$lang_insert_advhr_width}</label></td>
|
||||
<td nowrap="nowrap">
|
||||
<input id="width" name="width" type="text" value="" />
|
||||
<select name="width2" id="width2">
|
||||
<option value="">px</option>
|
||||
<option value="%">%</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="size">{$lang_insert_advhr_size}</label></td>
|
||||
<td><select id="size" name="size">
|
||||
<option value="">Normal</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="noshade">{$lang_insert_advhr_noshade}</label></td>
|
||||
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertHR();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/* CSS file for advimage plugin popup */
|
||||
|
||||
.mceImageList {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
.mceActionPanel {
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.alignPreview {
|
||||
border: 1px solid black;
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
overflow: hidden;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.panel_wrapper div.current {
|
||||
height: 305px;
|
||||
}
|
||||
|
||||
#prev {
|
||||
margin: 0;
|
||||
border: 1px
|
||||
solid black;
|
||||
width: 99%;
|
||||
height: 150px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#align, #classlist {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
#width, #height {
|
||||
vertical-align: middle;
|
||||
width: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#vspace, #hspace, #border {
|
||||
vertical-align: middle;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#classlist {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#constrain, #onmousemovecheck {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#id, #dir, #lang, #usemap, #longdesc {
|
||||
width: 200px;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
tinyMCE.importPluginLanguagePack('advimage');var TinyMCE_AdvancedImagePlugin={getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"image":return tinyMCE.getButtonHTML(cn,'lang_image_desc','{$themeurl}/images/image.gif','mceAdvImage')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvImage":var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_advimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_advimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1)return true;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":var imgs=content.getElementsByTagName("img"),src,i;for(i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseover',"this.src='"+src+"';")}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseout',"this.src='"+src+"';")}}break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseover',"this.src='"+src+"';")}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseout',"this.src='"+src+"';")}}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_advimage','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advimage','mceButtonNormal');return true},_getImageSrc:function(s){var sr,p=-1;if(!s)return"";if((p=s.indexOf('this.src='))!=-1){sr=s.substring(p+10);sr=sr.substring(0,sr.indexOf('\''));return sr}return""}};tinyMCE.addPlugin("advimage",TinyMCE_AdvancedImagePlugin);
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('advimage');
|
||||
|
||||
var TinyMCE_AdvancedImagePlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced image',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
getControlHTML : function(cn) {
|
||||
switch (cn) {
|
||||
case "image":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_image_desc', '{$themeurl}/images/image.gif', 'mceAdvImage');
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
||||
execCommand : function(editor_id, element, command, user_interface, value) {
|
||||
switch (command) {
|
||||
case "mceAdvImage":
|
||||
var template = new Array();
|
||||
|
||||
template['file'] = '../../plugins/advimage/image.htm';
|
||||
template['width'] = 480;
|
||||
template['height'] = 380;
|
||||
|
||||
// Language specific width and height addons
|
||||
template['width'] += tinyMCE.getLang('lang_advimage_delta_width', 0);
|
||||
template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0);
|
||||
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
var elm = inst.getFocusElement();
|
||||
|
||||
if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
|
||||
return true;
|
||||
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
cleanup : function(type, content) {
|
||||
switch (type) {
|
||||
case "insert_to_editor_dom":
|
||||
var imgs = content.getElementsByTagName("img"), src, i;
|
||||
for (i=0; i<imgs.length; i++) {
|
||||
var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
|
||||
var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
|
||||
|
||||
if ((src = this._getImageSrc(onmouseover)) != "") {
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
|
||||
|
||||
imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
|
||||
}
|
||||
|
||||
if ((src = this._getImageSrc(onmouseout)) != "") {
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
|
||||
|
||||
imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "get_from_editor_dom":
|
||||
var imgs = content.getElementsByTagName("img");
|
||||
for (var i=0; i<imgs.length; i++) {
|
||||
var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
|
||||
var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
|
||||
|
||||
if ((src = this._getImageSrc(onmouseover)) != "") {
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
|
||||
|
||||
imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
|
||||
}
|
||||
|
||||
if ((src = this._getImageSrc(onmouseout)) != "") {
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
|
||||
|
||||
imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return content;
|
||||
},
|
||||
|
||||
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
||||
if (node == null)
|
||||
return;
|
||||
|
||||
do {
|
||||
if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
||||
tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonSelected');
|
||||
return true;
|
||||
}
|
||||
} while ((node = node.parentNode));
|
||||
|
||||
tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonNormal');
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the image src from a scripted mouse over image str.
|
||||
*
|
||||
* @param {string} s String to get real src from.
|
||||
* @return Image src from a scripted mouse over image str.
|
||||
* @type string
|
||||
*/
|
||||
_getImageSrc : function(s) {
|
||||
var sr, p = -1;
|
||||
|
||||
if (!s)
|
||||
return "";
|
||||
|
||||
if ((p = s.indexOf('this.src=')) != -1) {
|
||||
sr = s.substring(p + 10);
|
||||
sr = sr.substring(0, sr.indexOf('\''));
|
||||
|
||||
return sr;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("advimage", TinyMCE_AdvancedImagePlugin);
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_insert_image_title}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
|
||||
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="advimage" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
||||
<form onsubmit="insertAction();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advimage_tab_general}</a></span></li>
|
||||
<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{$lang_advimage_tab_appearance}</a></span></li>
|
||||
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advimage_tab_advanced}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<fieldset>
|
||||
<legend>{$lang_advimage_general}</legend>
|
||||
|
||||
<table class="properties">
|
||||
<tr>
|
||||
<td class="column1"><label id="srclabel" for="src">{$lang_insert_image_src}</label></td>
|
||||
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input name="src" type="text" id="src" value="" onchange="showPreviewImage(this.value);" /></td>
|
||||
<td id="srcbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr id="imagelistsrcrow">
|
||||
<td class="column1"><label for="imagelistsrc">{$lang_image_list}</label></td>
|
||||
<td colspan="2" id="imagelistsrccontainer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label id="altlabel" for="alt">{$lang_insert_image_alt}</label></td>
|
||||
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label id="titlelabel" for="title">{$lang_advimage_title}</label></td>
|
||||
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{$lang_advimage_preview}</legend>
|
||||
<div id="prev"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="appearance_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_advimage_tab_appearance}</legend>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td class="column1"><label id="alignlabel" for="align">{$lang_insert_image_align}</label></td>
|
||||
<td><select id="align" name="align" onchange="changeAppearance();">
|
||||
<option value="">{$lang_insert_image_align_default}</option>
|
||||
<option value="baseline">{$lang_insert_image_align_baseline}</option>
|
||||
<option value="top">{$lang_insert_image_align_top}</option>
|
||||
<option value="middle">{$lang_insert_image_align_middle}</option>
|
||||
<option value="bottom">{$lang_insert_image_align_bottom}</option>
|
||||
<option value="texttop">{$lang_insert_image_align_texttop}</option>
|
||||
<option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
|
||||
<option value="absbottom">{$lang_insert_image_align_absbottom}</option>
|
||||
<option value="left">{$lang_insert_image_align_left}</option>
|
||||
<option value="right">{$lang_insert_image_align_right}</option>
|
||||
</select>
|
||||
</td>
|
||||
<td rowspan="6" valign="top">
|
||||
<div class="alignPreview">
|
||||
<img id="alignSampleImg" src="images/sample.gif" alt="{$lang_advimage_example_img}" />
|
||||
Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
|
||||
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
|
||||
edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
|
||||
erat volutpat.
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="widthlabel" for="width">{$lang_insert_image_dimensions}</label></td>
|
||||
<td nowrap="nowrap">
|
||||
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="changeHeight();" /> x
|
||||
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="changeWidth();" /> px
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
||||
<td><label id="constrainlabel" for="constrain">{$lang_advimage_constrain_proportions}</label></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="vspacelabel" for="vspace">{$lang_insert_image_vspace}</label></td>
|
||||
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="hspacelabel" for="hspace">{$lang_insert_image_hspace}</label></td>
|
||||
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="borderlabel" for="border">{$lang_insert_image_border}</label></td>
|
||||
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
|
||||
<td colspan="2">
|
||||
<select id="classlist" name="classlist">
|
||||
<option value="" selected>{$lang_not_set}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="stylelabel" for="style">{$lang_advimage_style}</label></td>
|
||||
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="styleUpdated();" /></td>
|
||||
</tr>
|
||||
|
||||
<!-- <tr>
|
||||
<td class="column1"><label id="classeslabel" for="classes">{$lang_advimage_classes}</label></td>
|
||||
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
||||
</tr> -->
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="advanced_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_advimage_swap_image}</legend>
|
||||
|
||||
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="changeMouseMove();" />
|
||||
<label id="onmousemovechecklabel" for="onmousemovecheck">{$lang_advimage_alt_image}</label>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{$lang_advimage_mouseover}</label></td>
|
||||
<td><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
||||
<td id="onmouseoversrccontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr id="imagelistoverrow">
|
||||
<td class="column1"><label for="imagelistover">{$lang_image_list}</label></td>
|
||||
<td id="imagelistovercontainer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{$lang_advimage_mouseout}</label></td>
|
||||
<td class="column2"><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
||||
<td id="onmouseoutsrccontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr id="imagelistoutrow">
|
||||
<td class="column1"><label for="imagelistout">{$lang_image_list}</label></td>
|
||||
<td id="imagelistoutcontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{$lang_advimage_misc}</legend>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td class="column1"><label id="idlabel" for="id">{$lang_advimage_id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="dirlabel" for="dir">{$lang_advimage_langdir}</label></td>
|
||||
<td>
|
||||
<select id="dir" name="dir" onchange="changeAppearance();">
|
||||
<option value="">{$lang_not_set}</option>
|
||||
<option value="ltr">{$lang_advimage_ltr}</option>
|
||||
<option value="rtl">{$lang_advimage_rtl}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="langlabel" for="lang">{$lang_advimage_langcode}</label></td>
|
||||
<td>
|
||||
<input id="lang" name="lang" type="text" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="usemaplabel" for="usemap">{$lang_advimage_image_map}</label></td>
|
||||
<td>
|
||||
<input id="usemap" name="usemap" type="text" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="longdesclabel" for="longdesc">{$lang_advimage_long_desc}</label></td>
|
||||
<td><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
||||
<td id="longdesccontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
Après Largeur: | Hauteur: | Taille: 1.6 KiB |
|
|
@ -0,0 +1,534 @@
|
|||
/* Functions for the advimage plugin popup */
|
||||
|
||||
var preloadImg = null;
|
||||
var orgImageWidth, orgImageHeight;
|
||||
|
||||
function preinit() {
|
||||
// Initialize
|
||||
tinyMCE.setWindowArg('mce_windowresize', false);
|
||||
|
||||
// Import external list url javascript
|
||||
var url = tinyMCE.getParam("external_image_list_url");
|
||||
if (url != null) {
|
||||
// Fix relative
|
||||
if (url.charAt(0) != '/' && url.indexOf('://') == -1)
|
||||
url = tinyMCE.documentBasePath + "/" + url;
|
||||
|
||||
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
|
||||
}
|
||||
}
|
||||
|
||||
function convertURL(url, node, on_save) {
|
||||
return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
|
||||
}
|
||||
|
||||
function getImageSrc(str) {
|
||||
var pos = -1;
|
||||
|
||||
if (!str)
|
||||
return "";
|
||||
|
||||
if ((pos = str.indexOf('this.src=')) != -1) {
|
||||
var src = str.substring(pos + 10);
|
||||
|
||||
src = src.substring(0, src.indexOf('\''));
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = convertURL(src, null, true);
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function init() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
var formObj = document.forms[0];
|
||||
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
||||
var elm = inst.getFocusElement();
|
||||
var action = "insert";
|
||||
var html = "";
|
||||
|
||||
// Image list src
|
||||
html = getImageListHTML('imagelistsrc','src','onSelectMainImage');
|
||||
if (html == "")
|
||||
document.getElementById("imagelistsrcrow").style.display = 'none';
|
||||
else
|
||||
document.getElementById("imagelistsrccontainer").innerHTML = html;
|
||||
|
||||
// Image list oversrc
|
||||
html = getImageListHTML('imagelistover','onmouseoversrc');
|
||||
if (html == "")
|
||||
document.getElementById("imagelistoverrow").style.display = 'none';
|
||||
else
|
||||
document.getElementById("imagelistovercontainer").innerHTML = html;
|
||||
|
||||
// Image list outsrc
|
||||
html = getImageListHTML('imagelistout','onmouseoutsrc');
|
||||
if (html == "")
|
||||
document.getElementById("imagelistoutrow").style.display = 'none';
|
||||
else
|
||||
document.getElementById("imagelistoutcontainer").innerHTML = html;
|
||||
|
||||
// Src browser
|
||||
html = getBrowserHTML('srcbrowser','src','image','advimage');
|
||||
document.getElementById("srcbrowsercontainer").innerHTML = html;
|
||||
|
||||
// Over browser
|
||||
html = getBrowserHTML('oversrcbrowser','onmouseoversrc','image','advimage');
|
||||
document.getElementById("onmouseoversrccontainer").innerHTML = html;
|
||||
|
||||
// Out browser
|
||||
html = getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','advimage');
|
||||
document.getElementById("onmouseoutsrccontainer").innerHTML = html;
|
||||
|
||||
// Longdesc browser
|
||||
html = getBrowserHTML('longdescbrowser','longdesc','file','advimage');
|
||||
document.getElementById("longdesccontainer").innerHTML = html;
|
||||
|
||||
// Resize some elements
|
||||
if (isVisible('srcbrowser'))
|
||||
document.getElementById('src').style.width = '260px';
|
||||
|
||||
if (isVisible('oversrcbrowser'))
|
||||
document.getElementById('onmouseoversrc').style.width = '260px';
|
||||
|
||||
if (isVisible('outsrcbrowser'))
|
||||
document.getElementById('onmouseoutsrc').style.width = '260px';
|
||||
|
||||
if (isVisible('longdescbrowser'))
|
||||
document.getElementById('longdesc').style.width = '180px';
|
||||
|
||||
// Check action
|
||||
if (elm != null && elm.nodeName == "IMG")
|
||||
action = "update";
|
||||
|
||||
formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
|
||||
|
||||
if (action == "update") {
|
||||
var src = tinyMCE.getAttrib(elm, 'src');
|
||||
var onmouseoversrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
|
||||
var onmouseoutsrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
|
||||
|
||||
src = convertURL(src, elm, true);
|
||||
|
||||
// Use mce_src if found
|
||||
var mceRealSrc = tinyMCE.getAttrib(elm, 'mce_src');
|
||||
if (mceRealSrc != "") {
|
||||
src = mceRealSrc;
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = convertURL(src, elm, true);
|
||||
}
|
||||
|
||||
if (onmouseoversrc != "" && tinyMCE.getParam('convert_urls'))
|
||||
onmouseoversrc = convertURL(onmouseoversrc, elm, true);
|
||||
|
||||
if (onmouseoutsrc != "" && tinyMCE.getParam('convert_urls'))
|
||||
onmouseoutsrc = convertURL(onmouseoutsrc, elm, true);
|
||||
|
||||
// Setup form data
|
||||
var style = tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"));
|
||||
|
||||
// Store away old size
|
||||
orgImageWidth = trimSize(getStyle(elm, 'width'))
|
||||
orgImageHeight = trimSize(getStyle(elm, 'height'));
|
||||
|
||||
formObj.src.value = src;
|
||||
formObj.alt.value = tinyMCE.getAttrib(elm, 'alt');
|
||||
formObj.title.value = tinyMCE.getAttrib(elm, 'title');
|
||||
formObj.border.value = trimSize(getStyle(elm, 'border', 'borderWidth'));
|
||||
formObj.vspace.value = tinyMCE.getAttrib(elm, 'vspace');
|
||||
formObj.hspace.value = tinyMCE.getAttrib(elm, 'hspace');
|
||||
formObj.width.value = orgImageWidth;
|
||||
formObj.height.value = orgImageHeight;
|
||||
formObj.onmouseoversrc.value = onmouseoversrc;
|
||||
formObj.onmouseoutsrc.value = onmouseoutsrc;
|
||||
formObj.id.value = tinyMCE.getAttrib(elm, 'id');
|
||||
formObj.dir.value = tinyMCE.getAttrib(elm, 'dir');
|
||||
formObj.lang.value = tinyMCE.getAttrib(elm, 'lang');
|
||||
formObj.longdesc.value = tinyMCE.getAttrib(elm, 'longdesc');
|
||||
formObj.usemap.value = tinyMCE.getAttrib(elm, 'usemap');
|
||||
formObj.style.value = tinyMCE.serializeStyle(style);
|
||||
|
||||
// Select by the values
|
||||
if (tinyMCE.isMSIE)
|
||||
selectByValue(formObj, 'align', getStyle(elm, 'align', 'styleFloat'));
|
||||
else
|
||||
selectByValue(formObj, 'align', getStyle(elm, 'align', 'cssFloat'));
|
||||
|
||||
addClassesToList('classlist', 'advimage_styles');
|
||||
|
||||
selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'));
|
||||
selectByValue(formObj, 'imagelistsrc', src);
|
||||
selectByValue(formObj, 'imagelistover', onmouseoversrc);
|
||||
selectByValue(formObj, 'imagelistout', onmouseoutsrc);
|
||||
|
||||
updateStyle();
|
||||
showPreviewImage(src, true);
|
||||
changeAppearance();
|
||||
|
||||
window.focus();
|
||||
} else
|
||||
addClassesToList('classlist', 'advimage_styles');
|
||||
|
||||
// If option enabled default contrain proportions to checked
|
||||
if (tinyMCE.getParam("advimage_constrain_proportions", true))
|
||||
formObj.constrain.checked = true;
|
||||
|
||||
// Check swap image if valid data
|
||||
if (formObj.onmouseoversrc.value != "" || formObj.onmouseoutsrc.value != "")
|
||||
setSwapImageDisabled(false);
|
||||
else
|
||||
setSwapImageDisabled(true);
|
||||
}
|
||||
|
||||
function setSwapImageDisabled(state) {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
formObj.onmousemovecheck.checked = !state;
|
||||
|
||||
setBrowserDisabled('overbrowser', state);
|
||||
setBrowserDisabled('outbrowser', state);
|
||||
|
||||
if (formObj.imagelistover)
|
||||
formObj.imagelistover.disabled = state;
|
||||
|
||||
if (formObj.imagelistout)
|
||||
formObj.imagelistout.disabled = state;
|
||||
|
||||
formObj.onmouseoversrc.disabled = state;
|
||||
formObj.onmouseoutsrc.disabled = state;
|
||||
}
|
||||
|
||||
function setAttrib(elm, attrib, value) {
|
||||
var formObj = document.forms[0];
|
||||
var valueElm = formObj.elements[attrib];
|
||||
|
||||
if (typeof(value) == "undefined" || value == null) {
|
||||
value = "";
|
||||
|
||||
if (valueElm)
|
||||
value = valueElm.value;
|
||||
}
|
||||
|
||||
if (value != "") {
|
||||
elm.setAttribute(attrib, value);
|
||||
|
||||
if (attrib == "style")
|
||||
attrib = "style.cssText";
|
||||
|
||||
if (attrib == "longdesc")
|
||||
attrib = "longDesc";
|
||||
|
||||
if (attrib == "width") {
|
||||
attrib = "style.width";
|
||||
value = value + "px";
|
||||
value = value.replace(/%px/g, 'px');
|
||||
}
|
||||
|
||||
if (attrib == "height") {
|
||||
attrib = "style.height";
|
||||
value = value + "px";
|
||||
value = value.replace(/%px/g, 'px');
|
||||
}
|
||||
|
||||
if (attrib == "class")
|
||||
attrib = "className";
|
||||
|
||||
eval('elm.' + attrib + "=value;");
|
||||
} else
|
||||
elm.removeAttribute(attrib);
|
||||
}
|
||||
|
||||
function makeAttrib(attrib, value) {
|
||||
var formObj = document.forms[0];
|
||||
var valueElm = formObj.elements[attrib];
|
||||
|
||||
if (typeof(value) == "undefined" || value == null) {
|
||||
value = "";
|
||||
|
||||
if (valueElm)
|
||||
value = valueElm.value;
|
||||
}
|
||||
|
||||
if (value == "")
|
||||
return "";
|
||||
|
||||
// XML encode it
|
||||
value = value.replace(/&/g, '&');
|
||||
value = value.replace(/\"/g, '"');
|
||||
value = value.replace(/</g, '<');
|
||||
value = value.replace(/>/g, '>');
|
||||
|
||||
return ' ' + attrib + '="' + value + '"';
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
||||
var elm = inst.getFocusElement();
|
||||
var formObj = document.forms[0];
|
||||
var src = formObj.src.value;
|
||||
var onmouseoversrc = formObj.onmouseoversrc.value;
|
||||
var onmouseoutsrc = formObj.onmouseoutsrc.value;
|
||||
|
||||
if (!AutoValidator.validate(formObj)) {
|
||||
alert(tinyMCE.getLang('lang_invalid_data'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tinyMCE.getParam("accessibility_warnings")) {
|
||||
if (formObj.alt.value == "" && !confirm(tinyMCE.getLang('lang_advimage_missing_alt', '', true)))
|
||||
return;
|
||||
}
|
||||
|
||||
if (onmouseoversrc && onmouseoversrc != "")
|
||||
onmouseoversrc = "this.src='" + convertURL(onmouseoversrc, tinyMCE.imgElement) + "';";
|
||||
|
||||
if (onmouseoutsrc && onmouseoutsrc != "")
|
||||
onmouseoutsrc = "this.src='" + convertURL(onmouseoutsrc, tinyMCE.imgElement) + "';";
|
||||
|
||||
if (elm != null && elm.nodeName == "IMG") {
|
||||
setAttrib(elm, 'src', convertURL(src, tinyMCE.imgElement));
|
||||
setAttrib(elm, 'mce_src', src);
|
||||
setAttrib(elm, 'alt');
|
||||
setAttrib(elm, 'title');
|
||||
setAttrib(elm, 'border');
|
||||
setAttrib(elm, 'vspace');
|
||||
setAttrib(elm, 'hspace');
|
||||
setAttrib(elm, 'width');
|
||||
setAttrib(elm, 'height');
|
||||
setAttrib(elm, 'onmouseover', onmouseoversrc);
|
||||
setAttrib(elm, 'onmouseout', onmouseoutsrc);
|
||||
setAttrib(elm, 'id');
|
||||
setAttrib(elm, 'dir');
|
||||
setAttrib(elm, 'lang');
|
||||
setAttrib(elm, 'longdesc');
|
||||
setAttrib(elm, 'usemap');
|
||||
setAttrib(elm, 'style');
|
||||
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
||||
setAttrib(elm, 'align', getSelectValue(formObj, 'align'));
|
||||
|
||||
//tinyMCEPopup.execCommand("mceRepaint");
|
||||
|
||||
// Repaint if dimensions changed
|
||||
if (formObj.width.value != orgImageWidth || formObj.height.value != orgImageHeight)
|
||||
inst.repaint();
|
||||
|
||||
// Refresh in old MSIE
|
||||
if (tinyMCE.isMSIE5)
|
||||
elm.outerHTML = elm.outerHTML;
|
||||
} else {
|
||||
var html = "<img";
|
||||
|
||||
html += makeAttrib('src', convertURL(src, tinyMCE.imgElement));
|
||||
html += makeAttrib('mce_src', src);
|
||||
html += makeAttrib('alt');
|
||||
html += makeAttrib('title');
|
||||
html += makeAttrib('border');
|
||||
html += makeAttrib('vspace');
|
||||
html += makeAttrib('hspace');
|
||||
html += makeAttrib('width');
|
||||
html += makeAttrib('height');
|
||||
html += makeAttrib('onmouseover', onmouseoversrc);
|
||||
html += makeAttrib('onmouseout', onmouseoutsrc);
|
||||
html += makeAttrib('id');
|
||||
html += makeAttrib('dir');
|
||||
html += makeAttrib('lang');
|
||||
html += makeAttrib('longdesc');
|
||||
html += makeAttrib('usemap');
|
||||
html += makeAttrib('style');
|
||||
html += makeAttrib('class', getSelectValue(formObj, 'classlist'));
|
||||
html += makeAttrib('align', getSelectValue(formObj, 'align'));
|
||||
html += " />";
|
||||
|
||||
tinyMCEPopup.execCommand("mceInsertContent", false, html);
|
||||
}
|
||||
|
||||
tinyMCE._setEventsEnabled(inst.getBody(), false);
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function cancelAction() {
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function changeAppearance() {
|
||||
var formObj = document.forms[0];
|
||||
var img = document.getElementById('alignSampleImg');
|
||||
|
||||
if (img) {
|
||||
img.align = formObj.align.value;
|
||||
img.border = formObj.border.value;
|
||||
img.hspace = formObj.hspace.value;
|
||||
img.vspace = formObj.vspace.value;
|
||||
}
|
||||
}
|
||||
|
||||
function changeMouseMove() {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
setSwapImageDisabled(!formObj.onmousemovecheck.checked);
|
||||
}
|
||||
|
||||
function updateStyle() {
|
||||
var formObj = document.forms[0];
|
||||
var st = tinyMCE.parseStyle(formObj.style.value);
|
||||
|
||||
if (tinyMCE.getParam('inline_styles', false)) {
|
||||
st['width'] = formObj.width.value == '' ? '' : formObj.width.value + "px";
|
||||
st['height'] = formObj.height.value == '' ? '' : formObj.height.value + "px";
|
||||
st['border-width'] = formObj.border.value == '' ? '' : formObj.border.value + "px";
|
||||
st['margin-top'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
|
||||
st['margin-bottom'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
|
||||
st['margin-left'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
|
||||
st['margin-right'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
|
||||
} else {
|
||||
st['width'] = st['height'] = st['border-width'] = null;
|
||||
|
||||
if (st['margin-top'] == st['margin-bottom'])
|
||||
st['margin-top'] = st['margin-bottom'] = null;
|
||||
|
||||
if (st['margin-left'] == st['margin-right'])
|
||||
st['margin-left'] = st['margin-right'] = null;
|
||||
}
|
||||
|
||||
formObj.style.value = tinyMCE.serializeStyle(st);
|
||||
}
|
||||
|
||||
function styleUpdated() {
|
||||
var formObj = document.forms[0];
|
||||
var st = tinyMCE.parseStyle(formObj.style.value);
|
||||
|
||||
if (st['width'])
|
||||
formObj.width.value = st['width'].replace('px', '');
|
||||
|
||||
if (st['height'])
|
||||
formObj.height.value = st['height'].replace('px', '');
|
||||
|
||||
if (st['margin-top'] && st['margin-top'] == st['margin-bottom'])
|
||||
formObj.vspace.value = st['margin-top'].replace('px', '');
|
||||
|
||||
if (st['margin-left'] && st['margin-left'] == st['margin-right'])
|
||||
formObj.hspace.value = st['margin-left'].replace('px', '');
|
||||
|
||||
if (st['border-width'])
|
||||
formObj.border.value = st['border-width'].replace('px', '');
|
||||
}
|
||||
|
||||
function changeHeight() {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
if (!formObj.constrain.checked || !preloadImg) {
|
||||
updateStyle();
|
||||
return;
|
||||
}
|
||||
|
||||
if (formObj.width.value == "" || formObj.height.value == "")
|
||||
return;
|
||||
|
||||
var temp = (parseInt(formObj.width.value) / parseInt(preloadImg.width)) * preloadImg.height;
|
||||
formObj.height.value = temp.toFixed(0);
|
||||
updateStyle();
|
||||
}
|
||||
|
||||
function changeWidth() {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
if (!formObj.constrain.checked || !preloadImg) {
|
||||
updateStyle();
|
||||
return;
|
||||
}
|
||||
|
||||
if (formObj.width.value == "" || formObj.height.value == "")
|
||||
return;
|
||||
|
||||
var temp = (parseInt(formObj.height.value) / parseInt(preloadImg.height)) * preloadImg.width;
|
||||
formObj.width.value = temp.toFixed(0);
|
||||
updateStyle();
|
||||
}
|
||||
|
||||
function onSelectMainImage(target_form_element, name, value) {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
formObj.alt.value = name;
|
||||
formObj.title.value = name;
|
||||
|
||||
resetImageData();
|
||||
showPreviewImage(formObj.elements[target_form_element].value, false);
|
||||
}
|
||||
|
||||
function showPreviewImage(src, start) {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
selectByValue(document.forms[0], 'imagelistsrc', src);
|
||||
|
||||
var elm = document.getElementById('prev');
|
||||
var src = src == "" ? src : tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
|
||||
|
||||
if (!start && tinyMCE.getParam("advimage_update_dimensions_onchange", true))
|
||||
resetImageData();
|
||||
|
||||
if (src == "")
|
||||
elm.innerHTML = "";
|
||||
else
|
||||
elm.innerHTML = '<img id="previewImg" src="' + src + '" border="0" onload="updateImageData();" onerror="resetImageData();" />'
|
||||
}
|
||||
|
||||
function updateImageData() {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
preloadImg = document.getElementById('previewImg');
|
||||
|
||||
if (formObj.width.value == "")
|
||||
formObj.width.value = preloadImg.width;
|
||||
|
||||
if (formObj.height.value == "")
|
||||
formObj.height.value = preloadImg.height;
|
||||
|
||||
updateStyle();
|
||||
}
|
||||
|
||||
function resetImageData() {
|
||||
var formObj = document.forms[0];
|
||||
formObj.width.value = formObj.height.value = "";
|
||||
}
|
||||
|
||||
function getSelectValue(form_obj, field_name) {
|
||||
var elm = form_obj.elements[field_name];
|
||||
|
||||
if (elm == null || elm.options == null)
|
||||
return "";
|
||||
|
||||
return elm.options[elm.selectedIndex].value;
|
||||
}
|
||||
|
||||
function getImageListHTML(elm_id, target_form_element, onchange_func) {
|
||||
if (typeof(tinyMCEImageList) == "undefined" || tinyMCEImageList.length == 0)
|
||||
return "";
|
||||
|
||||
var html = "";
|
||||
|
||||
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
||||
html += ' class="mceImageList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
|
||||
html += 'this.options[this.selectedIndex].value;';
|
||||
|
||||
if (typeof(onchange_func) != "undefined")
|
||||
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
||||
|
||||
html += '"><option value="">---</option>';
|
||||
|
||||
for (var i=0; i<tinyMCEImageList.length; i++)
|
||||
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
|
||||
|
||||
html += '</select>';
|
||||
|
||||
return html;
|
||||
|
||||
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('advimage',{
|
||||
tab_general : 'General',
|
||||
tab_appearance : 'Appearance',
|
||||
tab_advanced : 'Advanced',
|
||||
general : 'General',
|
||||
title : 'Title',
|
||||
preview : 'Preview',
|
||||
constrain_proportions : 'Constrain proportions',
|
||||
langdir : 'Language direction',
|
||||
langcode : 'Language code',
|
||||
long_desc : 'Long description link',
|
||||
style : 'Style',
|
||||
classes : 'Classes',
|
||||
ltr : 'Left to right',
|
||||
rtl : 'Right to left',
|
||||
id : 'Id',
|
||||
image_map : 'Image map',
|
||||
swap_image : 'Swap image',
|
||||
alt_image : 'Alternative image',
|
||||
mouseover : 'for mouse over',
|
||||
mouseout : 'for mouse out',
|
||||
misc : 'Miscellaneous',
|
||||
example_img : 'Appearance preview image',
|
||||
missing_alt : 'Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* CSS file for advimage plugin popup */
|
||||
|
||||
.mceLinkList, .mceAnchorList, #targetlist {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
.mceActionPanel {
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.panel_wrapper div.current {
|
||||
height: 320px;
|
||||
}
|
||||
|
||||
#classlist, #title, #href {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#popupurl, #popupname {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#popupwidth, #popupheight, #popupleft, #popuptop {
|
||||
width: 30px;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#events_panel input {
|
||||
width: 200px;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
tinyMCE.importPluginLanguagePack('advlink');var TinyMCE_AdvancedLinkPlugin={getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','k','lang_advlink_desc','mceAdvLink')},getControlHTML:function(cn){switch(cn){case"link":return tinyMCE.getButtonHTML(cn,'lang_link_desc','{$themeurl}/images/link.gif','mceAdvLink')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvLink":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var selectedText=inst.selection.getSelectedText();if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){var template=new Array();template['file']='../../plugins/advlink/link.htm';template['width']=480;template['height']=400;template['width']+=tinyMCE.getLang('lang_advlink_delta_width',0);template['height']+=tinyMCE.getLang('lang_advlink_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"})}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_advlink','mceButtonSelected');return true}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_advlink','mceButtonNormal');return true}tinyMCE.switchClass(editor_id+'_advlink','mceButtonDisabled');return true}};tinyMCE.addPlugin("advlink",TinyMCE_AdvancedLinkPlugin);
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('advlink');
|
||||
|
||||
var TinyMCE_AdvancedLinkPlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Advanced link',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
initInstance : function(inst) {
|
||||
inst.addShortcut('ctrl', 'k', 'lang_advlink_desc', 'mceAdvLink');
|
||||
},
|
||||
|
||||
getControlHTML : function(cn) {
|
||||
switch (cn) {
|
||||
case "link":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_link_desc', '{$themeurl}/images/link.gif', 'mceAdvLink');
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
||||
execCommand : function(editor_id, element, command, user_interface, value) {
|
||||
switch (command) {
|
||||
case "mceAdvLink":
|
||||
var anySelection = false;
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
var focusElm = inst.getFocusElement();
|
||||
var selectedText = inst.selection.getSelectedText();
|
||||
|
||||
if (tinyMCE.selectedElement)
|
||||
anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
|
||||
|
||||
if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
|
||||
var template = new Array();
|
||||
|
||||
template['file'] = '../../plugins/advlink/link.htm';
|
||||
template['width'] = 480;
|
||||
template['height'] = 400;
|
||||
|
||||
// Language specific width and height addons
|
||||
template['width'] += tinyMCE.getLang('lang_advlink_delta_width', 0);
|
||||
template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0);
|
||||
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
||||
if (node == null)
|
||||
return;
|
||||
|
||||
do {
|
||||
if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") {
|
||||
tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonSelected');
|
||||
return true;
|
||||
}
|
||||
} while ((node = node.parentNode));
|
||||
|
||||
if (any_selection) {
|
||||
tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonNormal');
|
||||
return true;
|
||||
}
|
||||
|
||||
tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonDisabled');
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("advlink", TinyMCE_AdvancedLinkPlugin);
|
||||
|
|
@ -0,0 +1,568 @@
|
|||
/* Functions for the advlink plugin popup */
|
||||
|
||||
var templates = {
|
||||
"window.open" : "window.open('${url}','${target}','${options}')"
|
||||
};
|
||||
|
||||
function preinit() {
|
||||
// Initialize
|
||||
tinyMCE.setWindowArg('mce_windowresize', false);
|
||||
|
||||
// Import external list url javascript
|
||||
var url = tinyMCE.getParam("external_link_list_url");
|
||||
if (url != null) {
|
||||
// Fix relative
|
||||
if (url.charAt(0) != '/' && url.indexOf('://') == -1)
|
||||
url = tinyMCE.documentBasePath + "/" + url;
|
||||
|
||||
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
|
||||
}
|
||||
}
|
||||
|
||||
function changeClass() {
|
||||
var formObj = document.forms[0];
|
||||
formObj.classes.value = getSelectValue(formObj, 'classlist');
|
||||
}
|
||||
|
||||
function init() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
var formObj = document.forms[0];
|
||||
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
||||
var elm = inst.getFocusElement();
|
||||
var action = "insert";
|
||||
var html;
|
||||
|
||||
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
|
||||
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
|
||||
document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
|
||||
document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
|
||||
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
||||
|
||||
// Link list
|
||||
html = getLinkListHTML('linklisthref','href');
|
||||
if (html == "")
|
||||
document.getElementById("linklisthrefrow").style.display = 'none';
|
||||
else
|
||||
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
||||
|
||||
// Resize some elements
|
||||
if (isVisible('hrefbrowser'))
|
||||
document.getElementById('href').style.width = '260px';
|
||||
|
||||
if (isVisible('popupurlbrowser'))
|
||||
document.getElementById('popupurl').style.width = '180px';
|
||||
|
||||
elm = tinyMCE.getParentElement(elm, "a");
|
||||
if (elm != null && elm.nodeName == "A")
|
||||
action = "update";
|
||||
|
||||
formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
|
||||
|
||||
setPopupControlsDisabled(true);
|
||||
|
||||
if (action == "update") {
|
||||
var href = tinyMCE.getAttrib(elm, 'href');
|
||||
|
||||
href = convertURL(href, elm, true);
|
||||
|
||||
// Use mce_href if found
|
||||
var mceRealHref = tinyMCE.getAttrib(elm, 'mce_href');
|
||||
if (mceRealHref != "") {
|
||||
href = mceRealHref;
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
href = convertURL(href, elm, true);
|
||||
}
|
||||
|
||||
var onclick = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onclick'));
|
||||
|
||||
// Setup form data
|
||||
setFormValue('href', href);
|
||||
setFormValue('title', tinyMCE.getAttrib(elm, 'title'));
|
||||
setFormValue('id', tinyMCE.getAttrib(elm, 'id'));
|
||||
setFormValue('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"))));
|
||||
setFormValue('rel', tinyMCE.getAttrib(elm, 'rel'));
|
||||
setFormValue('rev', tinyMCE.getAttrib(elm, 'rev'));
|
||||
setFormValue('charset', tinyMCE.getAttrib(elm, 'charset'));
|
||||
setFormValue('hreflang', tinyMCE.getAttrib(elm, 'hreflang'));
|
||||
setFormValue('dir', tinyMCE.getAttrib(elm, 'dir'));
|
||||
setFormValue('lang', tinyMCE.getAttrib(elm, 'lang'));
|
||||
setFormValue('tabindex', tinyMCE.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
||||
setFormValue('accesskey', tinyMCE.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
||||
setFormValue('type', tinyMCE.getAttrib(elm, 'type'));
|
||||
setFormValue('onfocus', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onfocus')));
|
||||
setFormValue('onblur', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onblur')));
|
||||
setFormValue('onclick', onclick);
|
||||
setFormValue('ondblclick', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'ondblclick')));
|
||||
setFormValue('onmousedown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousedown')));
|
||||
setFormValue('onmouseup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseup')));
|
||||
setFormValue('onmouseover', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
|
||||
setFormValue('onmousemove', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousemove')));
|
||||
setFormValue('onmouseout', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
|
||||
setFormValue('onkeypress', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeypress')));
|
||||
setFormValue('onkeydown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeydown')));
|
||||
setFormValue('onkeyup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeyup')));
|
||||
setFormValue('target', tinyMCE.getAttrib(elm, 'target'));
|
||||
setFormValue('classes', tinyMCE.getAttrib(elm, 'class'));
|
||||
|
||||
// Parse onclick data
|
||||
if (onclick != null && onclick.indexOf('window.open') != -1)
|
||||
parseWindowOpen(onclick);
|
||||
else
|
||||
parseFunction(onclick);
|
||||
|
||||
// Select by the values
|
||||
selectByValue(formObj, 'dir', tinyMCE.getAttrib(elm, 'dir'));
|
||||
selectByValue(formObj, 'rel', tinyMCE.getAttrib(elm, 'rel'));
|
||||
selectByValue(formObj, 'rev', tinyMCE.getAttrib(elm, 'rev'));
|
||||
selectByValue(formObj, 'linklisthref', href);
|
||||
|
||||
if (href.charAt(0) == '#')
|
||||
selectByValue(formObj, 'anchorlist', href);
|
||||
|
||||
addClassesToList('classlist', 'advlink_styles');
|
||||
|
||||
selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'), true);
|
||||
selectByValue(formObj, 'targetlist', tinyMCE.getAttrib(elm, 'target'), true);
|
||||
} else
|
||||
addClassesToList('classlist', 'advlink_styles');
|
||||
|
||||
window.focus();
|
||||
}
|
||||
|
||||
function setFormValue(name, value) {
|
||||
document.forms[0].elements[name].value = value;
|
||||
}
|
||||
|
||||
function convertURL(url, node, on_save) {
|
||||
return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
|
||||
}
|
||||
|
||||
function parseWindowOpen(onclick) {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
// Preprocess center code
|
||||
if (onclick.indexOf('return false;') != -1) {
|
||||
formObj.popupreturn.checked = true;
|
||||
onclick = onclick.replace('return false;', '');
|
||||
} else
|
||||
formObj.popupreturn.checked = false;
|
||||
|
||||
var onClickData = parseLink(onclick);
|
||||
|
||||
if (onClickData != null) {
|
||||
formObj.ispopup.checked = true;
|
||||
setPopupControlsDisabled(false);
|
||||
|
||||
var onClickWindowOptions = parseOptions(onClickData['options']);
|
||||
var url = onClickData['url'];
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
url = convertURL(url, null, true);
|
||||
|
||||
formObj.popupname.value = onClickData['target'];
|
||||
formObj.popupurl.value = url;
|
||||
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
||||
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
||||
|
||||
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
||||
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
||||
|
||||
if (formObj.popupleft.value.indexOf('screen') != -1)
|
||||
formObj.popupleft.value = "c";
|
||||
|
||||
if (formObj.popuptop.value.indexOf('screen') != -1)
|
||||
formObj.popuptop.value = "c";
|
||||
|
||||
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
||||
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
||||
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
||||
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
||||
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
||||
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
||||
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
||||
|
||||
buildOnClick();
|
||||
}
|
||||
}
|
||||
|
||||
function parseFunction(onclick) {
|
||||
var formObj = document.forms[0];
|
||||
var onClickData = parseLink(onclick);
|
||||
|
||||
// TODO: Add stuff here
|
||||
}
|
||||
|
||||
function getOption(opts, name) {
|
||||
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
||||
}
|
||||
|
||||
function setPopupControlsDisabled(state) {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
formObj.popupname.disabled = state;
|
||||
formObj.popupurl.disabled = state;
|
||||
formObj.popupwidth.disabled = state;
|
||||
formObj.popupheight.disabled = state;
|
||||
formObj.popupleft.disabled = state;
|
||||
formObj.popuptop.disabled = state;
|
||||
formObj.popuplocation.disabled = state;
|
||||
formObj.popupscrollbars.disabled = state;
|
||||
formObj.popupmenubar.disabled = state;
|
||||
formObj.popupresizable.disabled = state;
|
||||
formObj.popuptoolbar.disabled = state;
|
||||
formObj.popupstatus.disabled = state;
|
||||
formObj.popupreturn.disabled = state;
|
||||
formObj.popupdependent.disabled = state;
|
||||
|
||||
setBrowserDisabled('popupurlbrowser', state);
|
||||
}
|
||||
|
||||
function parseLink(link) {
|
||||
link = link.replace(new RegExp(''', 'g'), "'");
|
||||
|
||||
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
||||
|
||||
// Is function name a template function
|
||||
var template = templates[fnName];
|
||||
if (template) {
|
||||
// Build regexp
|
||||
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
||||
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
||||
var replaceStr = "";
|
||||
for (var i=0; i<variableNames.length; i++) {
|
||||
// Is string value
|
||||
if (variableNames[i].indexOf("'${") != -1)
|
||||
regExp += "'(.*)'";
|
||||
else // Number value
|
||||
regExp += "([0-9]*)";
|
||||
|
||||
replaceStr += "$" + (i+1);
|
||||
|
||||
// Cleanup variable name
|
||||
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
||||
|
||||
if (i != variableNames.length-1) {
|
||||
regExp += "\\s*,\\s*";
|
||||
replaceStr += "<delim>";
|
||||
} else
|
||||
regExp += ".*";
|
||||
}
|
||||
|
||||
regExp += "\\);?";
|
||||
|
||||
// Build variable array
|
||||
var variables = new Array();
|
||||
variables["_function"] = fnName;
|
||||
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
||||
for (var i=0; i<variableNames.length; i++)
|
||||
variables[variableNames[i]] = variableValues[i];
|
||||
|
||||
return variables;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function parseOptions(opts) {
|
||||
if (opts == null || opts == "")
|
||||
return new Array();
|
||||
|
||||
// Cleanup the options
|
||||
opts = opts.toLowerCase();
|
||||
opts = opts.replace(/;/g, ",");
|
||||
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
||||
|
||||
var optionChunks = opts.split(',');
|
||||
var options = new Array();
|
||||
|
||||
for (var i=0; i<optionChunks.length; i++) {
|
||||
var parts = optionChunks[i].split('=');
|
||||
|
||||
if (parts.length == 2)
|
||||
options[parts[0]] = parts[1];
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
function buildOnClick() {
|
||||
var formObj = document.forms[0];
|
||||
|
||||
if (!formObj.ispopup.checked) {
|
||||
formObj.onclick.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
var onclick = "window.open('";
|
||||
var url = formObj.popupurl.value;
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
url = convertURL(url, null, true);
|
||||
|
||||
onclick += url + "','";
|
||||
onclick += formObj.popupname.value + "','";
|
||||
|
||||
if (formObj.popuplocation.checked)
|
||||
onclick += "location=yes,";
|
||||
|
||||
if (formObj.popupscrollbars.checked)
|
||||
onclick += "scrollbars=yes,";
|
||||
|
||||
if (formObj.popupmenubar.checked)
|
||||
onclick += "menubar=yes,";
|
||||
|
||||
if (formObj.popupresizable.checked)
|
||||
onclick += "resizable=yes,";
|
||||
|
||||
if (formObj.popuptoolbar.checked)
|
||||
onclick += "toolbar=yes,";
|
||||
|
||||
if (formObj.popupstatus.checked)
|
||||
onclick += "status=yes,";
|
||||
|
||||
if (formObj.popupdependent.checked)
|
||||
onclick += "dependent=yes,";
|
||||
|
||||
if (formObj.popupwidth.value != "")
|
||||
onclick += "width=" + formObj.popupwidth.value + ",";
|
||||
|
||||
if (formObj.popupheight.value != "")
|
||||
onclick += "height=" + formObj.popupheight.value + ",";
|
||||
|
||||
if (formObj.popupleft.value != "") {
|
||||
if (formObj.popupleft.value != "c")
|
||||
onclick += "left=" + formObj.popupleft.value + ",";
|
||||
else
|
||||
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
||||
}
|
||||
|
||||
if (formObj.popuptop.value != "") {
|
||||
if (formObj.popuptop.value != "c")
|
||||
onclick += "top=" + formObj.popuptop.value + ",";
|
||||
else
|
||||
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
||||
}
|
||||
|
||||
if (onclick.charAt(onclick.length-1) == ',')
|
||||
onclick = onclick.substring(0, onclick.length-1);
|
||||
|
||||
onclick += "');";
|
||||
|
||||
if (formObj.popupreturn.checked)
|
||||
onclick += "return false;";
|
||||
|
||||
// tinyMCE.debug(onclick);
|
||||
|
||||
formObj.onclick.value = onclick;
|
||||
|
||||
if (formObj.href.value == "")
|
||||
formObj.href.value = url;
|
||||
}
|
||||
|
||||
function setAttrib(elm, attrib, value) {
|
||||
var formObj = document.forms[0];
|
||||
var valueElm = formObj.elements[attrib.toLowerCase()];
|
||||
|
||||
if (typeof(value) == "undefined" || value == null) {
|
||||
value = "";
|
||||
|
||||
if (valueElm)
|
||||
value = valueElm.value;
|
||||
}
|
||||
|
||||
if (value != "") {
|
||||
elm.setAttribute(attrib.toLowerCase(), value);
|
||||
|
||||
if (attrib == "style")
|
||||
attrib = "style.cssText";
|
||||
|
||||
if (attrib.substring(0, 2) == 'on')
|
||||
value = 'return true;' + value;
|
||||
|
||||
if (attrib == "class")
|
||||
attrib = "className";
|
||||
|
||||
eval('elm.' + attrib + "=value;");
|
||||
} else
|
||||
elm.removeAttribute(attrib);
|
||||
}
|
||||
|
||||
function getAnchorListHTML(id, target) {
|
||||
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
||||
var nodes = inst.getBody().getElementsByTagName("a");
|
||||
|
||||
var html = "";
|
||||
|
||||
html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
|
||||
html += 'this.options[this.selectedIndex].value;">';
|
||||
html += '<option value="">---</option>';
|
||||
|
||||
for (var i=0; i<nodes.length; i++) {
|
||||
if ((name = tinyMCE.getAttrib(nodes[i], "name")) != "")
|
||||
html += '<option value="#' + name + '">' + name + '</option>';
|
||||
}
|
||||
|
||||
html += '</select>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function insertAction() {
|
||||
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
||||
var elm = inst.getFocusElement();
|
||||
|
||||
elm = tinyMCE.getParentElement(elm, "a");
|
||||
|
||||
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
||||
|
||||
// Create new anchor elements
|
||||
if (elm == null) {
|
||||
if (tinyMCE.isSafari)
|
||||
tinyMCEPopup.execCommand("mceInsertContent", false, '<a href="#mce_temp_url#">' + inst.selection.getSelectedHTML() + '</a>');
|
||||
else
|
||||
tinyMCEPopup.execCommand("createlink", false, "#mce_temp_url#");
|
||||
|
||||
var elementArray = tinyMCE.getElementsByAttributeValue(inst.getBody(), "a", "href", "#mce_temp_url#");
|
||||
for (var i=0; i<elementArray.length; i++) {
|
||||
var elm = elementArray[i];
|
||||
|
||||
// Move cursor behind the new anchor
|
||||
if (tinyMCE.isGecko) {
|
||||
var sp = inst.getDoc().createTextNode(" ");
|
||||
|
||||
if (elm.nextSibling)
|
||||
elm.parentNode.insertBefore(sp, elm.nextSibling);
|
||||
else
|
||||
elm.parentNode.appendChild(sp);
|
||||
|
||||
// Set range after link
|
||||
var rng = inst.getDoc().createRange();
|
||||
rng.setStartAfter(elm);
|
||||
rng.setEndAfter(elm);
|
||||
|
||||
// Update selection
|
||||
var sel = inst.getSel();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(rng);
|
||||
}
|
||||
|
||||
setAllAttribs(elm);
|
||||
}
|
||||
} else
|
||||
setAllAttribs(elm);
|
||||
|
||||
tinyMCE._setEventsEnabled(inst.getBody(), false);
|
||||
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function setAllAttribs(elm) {
|
||||
var formObj = document.forms[0];
|
||||
var href = formObj.href.value;
|
||||
var target = getSelectValue(formObj, 'targetlist');
|
||||
|
||||
// Make anchors absolute
|
||||
if (href.charAt(0) != '#')
|
||||
href = convertURL(href, elm);
|
||||
|
||||
setAttrib(elm, 'href', href);
|
||||
setAttrib(elm, 'mce_href', href);
|
||||
setAttrib(elm, 'title');
|
||||
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
||||
setAttrib(elm, 'id');
|
||||
setAttrib(elm, 'style');
|
||||
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
||||
setAttrib(elm, 'rel');
|
||||
setAttrib(elm, 'rev');
|
||||
setAttrib(elm, 'charset');
|
||||
setAttrib(elm, 'hreflang');
|
||||
setAttrib(elm, 'dir');
|
||||
setAttrib(elm, 'lang');
|
||||
setAttrib(elm, 'tabindex');
|
||||
setAttrib(elm, 'accesskey');
|
||||
setAttrib(elm, 'type');
|
||||
setAttrib(elm, 'onfocus');
|
||||
setAttrib(elm, 'onblur');
|
||||
setAttrib(elm, 'onclick');
|
||||
setAttrib(elm, 'ondblclick');
|
||||
setAttrib(elm, 'onmousedown');
|
||||
setAttrib(elm, 'onmouseup');
|
||||
setAttrib(elm, 'onmouseover');
|
||||
setAttrib(elm, 'onmousemove');
|
||||
setAttrib(elm, 'onmouseout');
|
||||
setAttrib(elm, 'onkeypress');
|
||||
setAttrib(elm, 'onkeydown');
|
||||
setAttrib(elm, 'onkeyup');
|
||||
|
||||
// Refresh in old MSIE
|
||||
if (tinyMCE.isMSIE5)
|
||||
elm.outerHTML = elm.outerHTML;
|
||||
}
|
||||
|
||||
function getSelectValue(form_obj, field_name) {
|
||||
var elm = form_obj.elements[field_name];
|
||||
|
||||
if (elm == null || elm.options == null)
|
||||
return "";
|
||||
|
||||
return elm.options[elm.selectedIndex].value;
|
||||
}
|
||||
|
||||
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
||||
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
||||
return "";
|
||||
|
||||
var html = "";
|
||||
|
||||
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
||||
html += ' class="mceLinkList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
|
||||
html += 'this.options[this.selectedIndex].value;';
|
||||
|
||||
if (typeof(onchange_func) != "undefined")
|
||||
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,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>';
|
||||
|
||||
return html;
|
||||
|
||||
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
||||
}
|
||||
|
||||
function getTargetListHTML(elm_id, target_form_element) {
|
||||
var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
|
||||
var html = '';
|
||||
|
||||
html += '<select id="' + elm_id + '" name="' + elm_id + '" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
|
||||
html += 'this.options[this.selectedIndex].value;">';
|
||||
|
||||
html += '<option value="_self">' + tinyMCE.getLang('lang_advlink_target_same') + '</option>';
|
||||
html += '<option value="_blank">' + tinyMCE.getLang('lang_advlink_target_blank') + ' (_blank)</option>';
|
||||
html += '<option value="_parent">' + tinyMCE.getLang('lang_advlink_target_parent') + ' (_parent)</option>';
|
||||
html += '<option value="_top">' + tinyMCE.getLang('lang_advlink_target_top') + ' (_top)</option>';
|
||||
|
||||
for (var i=0; i<targets.length; i++) {
|
||||
var key, value;
|
||||
|
||||
if (targets[i] == "")
|
||||
continue;
|
||||
|
||||
key = targets[i].split('=')[0];
|
||||
value = targets[i].split('=')[1];
|
||||
|
||||
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
||||
}
|
||||
|
||||
html += '</select>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
// While loading
|
||||
preinit();
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('advlink',{
|
||||
general_tab : 'General',
|
||||
popup_tab : 'Popup',
|
||||
events_tab : 'Events',
|
||||
advanced_tab : 'Advanced',
|
||||
general_props : 'General properties',
|
||||
popup_props : 'Popup properties',
|
||||
event_props : 'Events',
|
||||
advanced_props : 'Advanced properties',
|
||||
popup_opts : 'Options',
|
||||
anchor_names : 'Anchors',
|
||||
target_same : 'Open in this window / frame',
|
||||
target_parent : 'Open in parent window / frame',
|
||||
target_top : 'Open in top frame (replaces all frames)',
|
||||
target_blank : 'Open in new window',
|
||||
popup : 'Javascript popup',
|
||||
popup_url : 'Popup URL',
|
||||
popup_name : 'Window name',
|
||||
popup_return : 'Insert \'return false\'',
|
||||
popup_scrollbars : 'Show scrollbars',
|
||||
popup_statusbar : 'Show status bar',
|
||||
popup_toolbar : 'Show toolbars',
|
||||
popup_menubar : 'Show menu bar',
|
||||
popup_location : 'Show location bar',
|
||||
popup_resizable : 'Make window resizable',
|
||||
popup_dependent : 'Dependent (Mozilla/Firefox only)',
|
||||
popup_size : 'Size',
|
||||
popup_position : 'Position (X/Y)',
|
||||
id : 'Id',
|
||||
style: 'Style',
|
||||
classes : 'Classes',
|
||||
target_name : 'Target name',
|
||||
langdir : 'Language direction',
|
||||
target_langcode : 'Target language',
|
||||
langcode : 'Language code',
|
||||
encoding : 'Target character encoding',
|
||||
mime : 'Target MIME type',
|
||||
rel : 'Relationship page to target',
|
||||
rev : 'Relationship target to page',
|
||||
tabindex : 'Tabindex',
|
||||
accesskey : 'Accesskey',
|
||||
ltr : 'Left to right',
|
||||
rtl : 'Right to left'
|
||||
});
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_insert_link_title}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
|
||||
<link href="css/advlink.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="advlink" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
||||
<form onsubmit="insertAction();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advlink_general_tab}</a></span></li>
|
||||
<li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{$lang_advlink_popup_tab}</a></span></li>
|
||||
<li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_advlink_events_tab}</a></span></li>
|
||||
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advlink_advanced_tab}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<fieldset>
|
||||
<legend>{$lang_advlink_general_props}</legend>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label id="hreflabel" for="href">{$lang_insert_link_url}</label></td>
|
||||
<td><table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="href" name="href" type="text" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
|
||||
<td id="hrefbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr id="linklisthrefrow">
|
||||
<td class="column1"><label for="linklisthref">{$lang_link_list}</label></td>
|
||||
<td colspan="2" id="linklisthrefcontainer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="column1"><label for="anchorlist">{$lang_advlink_anchor_names}</label></td>
|
||||
<td colspan="2" id="anchorlistcontainer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="targetlistlabel" for="targetlist">{$lang_insert_link_target}</label></td>
|
||||
<td id="targetlistcontainer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label id="titlelabel" for="title">{$lang_theme_insert_link_titlefield}</label></td>
|
||||
<td><input id="title" name="title" type="text" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
|
||||
<td>
|
||||
<select id="classlist" name="classlist" onchange="changeClass();">
|
||||
<option value="" selected>{$lang_not_set}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="popup_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_advlink_popup_props}</legend>
|
||||
|
||||
<input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
|
||||
<label id="ispopuplabel" for="ispopup">{$lang_advlink_popup}</label>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="popupurl">{$lang_advlink_popup_url}</label> </td>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
|
||||
<td id="popupurlbrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="popupname">{$lang_advlink_popup_name}</label> </td>
|
||||
<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label>{$lang_advlink_popup_size}</label> </td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
|
||||
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap" id="labelleft"><label>{$lang_advlink_popup_position}</label> </td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
|
||||
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<fieldset>
|
||||
<legend>{$lang_advlink_popup_opts}</legend>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{$lang_advlink_popup_location}</label></td>
|
||||
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{$lang_advlink_popup_scrollbars}</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{$lang_advlink_popup_menubar}</label></td>
|
||||
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{$lang_advlink_popup_resizable}</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{$lang_advlink_popup_toolbar}</label></td>
|
||||
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{$lang_advlink_popup_dependent}</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
|
||||
<td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{$lang_advlink_popup_statusbar}</label></td>
|
||||
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
|
||||
<td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{$lang_advlink_popup_return}</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="advanced_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_advlink_advanced_props}</legend>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td class="column1"><label id="idlabel" for="id">{$lang_advlink_id}</label></td>
|
||||
<td><input id="id" name="id" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="stylelabel" for="style">{$lang_advlink_style}</label></td>
|
||||
<td><input type="text" id="style" name="style" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="classeslabel" for="classes">{$lang_advlink_classes}</label></td>
|
||||
<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="targetlabel" for="target">{$lang_advlink_target_name}</label></td>
|
||||
<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="dirlabel" for="dir">{$lang_advlink_langdir}</label></td>
|
||||
<td>
|
||||
<select id="dir" name="dir">
|
||||
<option value="">{$lang_not_set}</option>
|
||||
<option value="ltr">{$lang_advlink_ltr}</option>
|
||||
<option value="rtl">{$lang_advlink_rtl}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="hreflanglabel" for="hreflang">{$lang_advlink_target_langcode}</label></td>
|
||||
<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label id="langlabel" for="lang">{$lang_advlink_langcode}</label></td>
|
||||
<td>
|
||||
<input id="lang" name="lang" type="text" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="charsetlabel" for="charset">{$lang_advlink_encoding}</label></td>
|
||||
<td><input type="text" id="charset" name="charset" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="typelabel" for="type">{$lang_advlink_mime}</label></td>
|
||||
<td><input type="text" id="type" name="type" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="rellabel" for="rel">{$lang_advlink_rel}</label></td>
|
||||
<td><select id="rel" name="rel">
|
||||
<option value="">{$lang_not_set}</option>
|
||||
<option value="lightbox">Lightbox</option>
|
||||
<option value="alternate">Alternate</option>
|
||||
<option value="designates">Designates</option>
|
||||
<option value="stylesheet">Stylesheet</option>
|
||||
<option value="start">Start</option>
|
||||
<option value="next">Next</option>
|
||||
<option value="prev">Prev</option>
|
||||
<option value="contents">Contents</option>
|
||||
<option value="index">Index</option>
|
||||
<option value="glossary">Glossary</option>
|
||||
<option value="copyright">Copyright</option>
|
||||
<option value="chapter">Chapter</option>
|
||||
<option value="subsection">Subsection</option>
|
||||
<option value="appendix">Appendix</option>
|
||||
<option value="help">Help</option>
|
||||
<option value="bookmark">Bookmark</option>
|
||||
<option value="nofollow">No Follow</option>
|
||||
<option value="tag">Tag</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="revlabel" for="rev">{$lang_advlink_rev}</label></td>
|
||||
<td><select id="rev" name="rev">
|
||||
<option value="">{$lang_not_set}</option>
|
||||
<option value="alternate">Alternate</option>
|
||||
<option value="designates">Designates</option>
|
||||
<option value="stylesheet">Stylesheet</option>
|
||||
<option value="start">Start</option>
|
||||
<option value="next">Next</option>
|
||||
<option value="prev">Prev</option>
|
||||
<option value="contents">Contents</option>
|
||||
<option value="index">Index</option>
|
||||
<option value="glossary">Glossary</option>
|
||||
<option value="copyright">Copyright</option>
|
||||
<option value="chapter">Chapter</option>
|
||||
<option value="subsection">Subsection</option>
|
||||
<option value="appendix">Appendix</option>
|
||||
<option value="help">Help</option>
|
||||
<option value="bookmark">Bookmark</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="tabindexlabel" for="tabindex">{$lang_advlink_tabindex}</label></td>
|
||||
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label id="accesskeylabel" for="accesskey">{$lang_advlink_accesskey}</label></td>
|
||||
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="events_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_advlink_event_props}</legend>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="4">
|
||||
<tr>
|
||||
<td class="column1"><label for="onfocus">onfocus</label></td>
|
||||
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onblur">onblur</label></td>
|
||||
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onclick">onclick</label></td>
|
||||
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="ondblclick">ondblclick</label></td>
|
||||
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onmousedown">onmousedown</label></td>
|
||||
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onmouseup">onmouseup</label></td>
|
||||
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onmouseover">onmouseover</label></td>
|
||||
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onmousemove">onmousemove</label></td>
|
||||
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onmouseout">onmouseout</label></td>
|
||||
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onkeypress">onkeypress</label></td>
|
||||
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onkeydown">onkeydown</label></td>
|
||||
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="column1"><label for="onkeyup">onkeyup</label></td>
|
||||
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1 @@
|
|||
tinyMCE.importPluginLanguagePack('autosave');var TinyMCE_AutoSavePlugin={getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},_beforeUnloadHandler:function(){var n,inst,anyDirty=false,msg=tinyMCE.getLang("lang_autosave_unload_msg");if(tinyMCE.getParam("fullscreen_is_enabled"))return;for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.isDirty())return msg}return}};window.onbeforeunload=TinyMCE_AutoSavePlugin._beforeUnloadHandler;tinyMCE.addPlugin("autosave",TinyMCE_AutoSavePlugin);
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('autosave');
|
||||
|
||||
var TinyMCE_AutoSavePlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Auto save',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
// Private plugin internal methods
|
||||
|
||||
_beforeUnloadHandler : function() {
|
||||
var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg");
|
||||
|
||||
if (tinyMCE.getParam("fullscreen_is_enabled"))
|
||||
return;
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
if (inst.isDirty())
|
||||
return msg;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler;
|
||||
|
||||
tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin);
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
// EN lang variables
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
autosave_unload_msg : 'The changes you made will be lost if you navigate away from this page.'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1 @@
|
|||
var TinyMCE_BBCodePlugin={getInfo:function(){return{longname:'BBCode Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},cleanup:function(type,content){var dialect=tinyMCE.getParam('bbcode_dialect','punbb').toLowerCase();switch(type){case"insert_to_editor":content=this['_'+dialect+'_bbcode2html'](content);break;case"get_from_editor":content=this['_'+dialect+'_html2bbcode'](content);break}return content},_punbb_html2bbcode:function(s){s=tinyMCE.trim(s);function rep(re,str){s=s.replace(re,str)};rep(/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url]$1[/url]");rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");rep(/<font>(.*?)<\/font>/gi,"$1");rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");rep(/<\/(strong|b)>/gi,"[/b]");rep(/<(strong|b)>/gi,"[b]");rep(/<\/(em|i)>/gi,"[/i]");rep(/<(em|i)>/gi,"[i]");rep(/<\/u>/gi,"[/u]");rep(/<u>/gi,"[u]");rep(/<br \/>/gi,"\n");rep(/<br\/>/gi,"\n");rep(/<br>/gi,"\n");rep(/<p>/gi,"");rep(/<\/p>/gi,"\n");rep(/ /gi," ");rep(/"/gi,"\"");rep(/</gi,"<");rep(/>/gi,">");rep(/&/gi,"&");rep(/&undefined;/gi,"'");return s},_punbb_bbcode2html:function(s){s=tinyMCE.trim(s);function rep(re,str){s=s.replace(re,str)};rep(/\n/gi,"<br />");rep(/\[b\]/gi,"<strong>");rep(/\[\/b\]/gi,"</strong>");rep(/\[i\]/gi,"<em>");rep(/\[\/i\]/gi,"</em>");rep(/\[u\]/gi,"<u>");rep(/\[\/u\]/gi,"</u>");rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");return s}};tinyMCE.addPlugin("bbcode",TinyMCE_BBCodePlugin);
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
var TinyMCE_BBCodePlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'BBCode Plugin',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
cleanup : function(type, content) {
|
||||
var dialect = tinyMCE.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
||||
|
||||
switch (type) {
|
||||
case "insert_to_editor":
|
||||
content = this['_' + dialect + '_bbcode2html'](content);
|
||||
break;
|
||||
|
||||
case "get_from_editor":
|
||||
content = this['_' + dialect + '_html2bbcode'](content);
|
||||
break;
|
||||
}
|
||||
|
||||
return content;
|
||||
},
|
||||
|
||||
// Private methods
|
||||
|
||||
// HTML -> BBCode in PunBB dialect
|
||||
_punbb_html2bbcode : function(s) {
|
||||
s = tinyMCE.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
// example: <strong> to [b]
|
||||
rep(/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url]$1[/url]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
||||
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
||||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
||||
rep(/<font>(.*?)<\/font>/gi,"$1");
|
||||
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
||||
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
|
||||
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
|
||||
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
|
||||
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
|
||||
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
|
||||
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
|
||||
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
|
||||
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
|
||||
rep(/<\/(strong|b)>/gi,"[/b]");
|
||||
rep(/<(strong|b)>/gi,"[b]");
|
||||
rep(/<\/(em|i)>/gi,"[/i]");
|
||||
rep(/<(em|i)>/gi,"[i]");
|
||||
rep(/<\/u>/gi,"[/u]");
|
||||
rep(/<u>/gi,"[u]");
|
||||
rep(/<br \/>/gi,"\n");
|
||||
rep(/<br\/>/gi,"\n");
|
||||
rep(/<br>/gi,"\n");
|
||||
rep(/<p>/gi,"");
|
||||
rep(/<\/p>/gi,"\n");
|
||||
rep(/ /gi," ");
|
||||
rep(/"/gi,"\"");
|
||||
rep(/</gi,"<");
|
||||
rep(/>/gi,">");
|
||||
rep(/&/gi,"&");
|
||||
rep(/&undefined;/gi,"'"); // quickfix
|
||||
|
||||
return s;
|
||||
},
|
||||
|
||||
// BBCode -> HTML from PunBB dialect
|
||||
_punbb_bbcode2html : function(s) {
|
||||
s = tinyMCE.trim(s);
|
||||
|
||||
function rep(re, str) {
|
||||
s = s.replace(re, str);
|
||||
};
|
||||
|
||||
// example: [b] to <strong>
|
||||
rep(/\n/gi,"<br />");
|
||||
rep(/\[b\]/gi,"<strong>");
|
||||
rep(/\[\/b\]/gi,"</strong>");
|
||||
rep(/\[i\]/gi,"<em>");
|
||||
rep(/\[\/i\]/gi,"</em>");
|
||||
rep(/\[u\]/gi,"<u>");
|
||||
rep(/\[\/u\]/gi,"</u>");
|
||||
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
||||
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
||||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
||||
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");
|
||||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");
|
||||
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("bbcode", TinyMCE_BBCodePlugin);
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 162 2007-01-03 16:16:52Z spocke $
|
||||
*
|
||||
* Experimental plugin for new Cleanup routine, this logic will be moved into the core ones it's stable enougth.
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Dummy file since cleanup is now moved to core */
|
||||
|
|
@ -0,0 +1 @@
|
|||
Dummy plugin since cleanup is now moved into core.
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
.contextMenuIEPopup {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.contextMenu {
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
z-index: 1000;
|
||||
border: 1px solid #D4D0C8;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.contextMenuItem, .contextMenuItemOver {
|
||||
}
|
||||
|
||||
.contextMenuSeparator {
|
||||
width: 100%;
|
||||
background-color: #D4D0C8;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.contextMenuImage, .contextMenuItemDisabled {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.contextMenuIcon {
|
||||
background-color: #F0F0EE;
|
||||
}
|
||||
|
||||
.contextMenuItemOver .contextMenuIcon {
|
||||
background-color: #B6BDD2;
|
||||
}
|
||||
|
||||
.contextMenuIcon {
|
||||
background-color: #F0F0EE;
|
||||
}
|
||||
|
||||
.contextMenuItemDisabled img {
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
|
||||
-moz-opacity:0.3;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.contextMenuText {
|
||||
font-family: Tahoma, Verdana, Arial, Helvetica;
|
||||
font-size: 11px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.contextMenuItemDisabled {
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
.contextMenuText a {
|
||||
display: block;
|
||||
line-height: 20px;
|
||||
width: 100%;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.contextMenuText a:hover {
|
||||
background-color: #B6BDD2;
|
||||
text-decoration: none !important;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,357 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
if (!tinyMCE.settings['contextmenu_skip_plugin_css']) {
|
||||
tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css");
|
||||
}
|
||||
|
||||
var TinyMCE_ContextMenuPlugin = {
|
||||
// Private fields
|
||||
_contextMenu : null,
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Context menus',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
initInstance : function(inst) {
|
||||
// Is not working on MSIE 5.0 or Opera no contextmenu event
|
||||
if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera)
|
||||
return;
|
||||
|
||||
TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({
|
||||
commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler",
|
||||
spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif"
|
||||
});
|
||||
|
||||
// Add hide event handles
|
||||
tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
||||
tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
||||
tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
||||
tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
||||
tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
||||
tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
||||
|
||||
// Attach contextmenu event
|
||||
if (tinyMCE.isGecko) {
|
||||
tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);});
|
||||
} else
|
||||
tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu);
|
||||
},
|
||||
|
||||
// Private plugin internal methods
|
||||
|
||||
_onContextMenu : function(e) {
|
||||
var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
|
||||
var targetInst, body;
|
||||
|
||||
// Find instance
|
||||
if ((body = tinyMCE.getParentElement(elm, "body")) != null) {
|
||||
for (var n in tinyMCE.instances) {
|
||||
var inst = tinyMCE.instances[n];
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
if (body == inst.getBody()) {
|
||||
targetInst = inst;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst);
|
||||
}
|
||||
},
|
||||
|
||||
_showContextMenu : function(e, inst) {
|
||||
function getAttrib(elm, name) {
|
||||
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
|
||||
}
|
||||
|
||||
var x, y, elm, contextMenu;
|
||||
var pos = tinyMCE.getAbsPosition(inst.iframeElement);
|
||||
|
||||
x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft);
|
||||
y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop);
|
||||
elm = tinyMCE.isMSIE ? e.srcElement : e.target;
|
||||
|
||||
contextMenu = this._contextMenu;
|
||||
contextMenu.inst = inst;
|
||||
|
||||
// Mozilla needs some time
|
||||
window.setTimeout(function () {
|
||||
var theme = tinyMCE.getParam("theme");
|
||||
|
||||
contextMenu.clearAll();
|
||||
var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG";
|
||||
|
||||
// Default items
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel);
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel);
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false);
|
||||
|
||||
if (sel || (elm ? (elm.nodeName == 'A' && tinyMCE.getAttrib(elm, 'name') == '') || (elm.nodeName == 'IMG') : false)) {
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true));
|
||||
}
|
||||
|
||||
// Get element
|
||||
elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : ''));
|
||||
if (elm) {
|
||||
switch (elm.nodeName) {
|
||||
case "IMG":
|
||||
contextMenu.addSeparator();
|
||||
|
||||
// If flash
|
||||
if (tinyMCE.hasPlugin('flash') && tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1)
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash");
|
||||
else if (tinyMCE.hasPlugin('media') && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm, 'class')))
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_media_title", "mceMedia");
|
||||
else
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage");
|
||||
break;
|
||||
|
||||
case "HR":
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr");
|
||||
break;
|
||||
|
||||
case "TABLE":
|
||||
case "TD":
|
||||
// Is table plugin loaded
|
||||
if (inst.hasPlugin("table")) {
|
||||
var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan");
|
||||
var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan");
|
||||
|
||||
colspan = colspan == "" ? "1" : colspan;
|
||||
rowspan = rowspan == "" ? "1" : rowspan;
|
||||
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null);
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null);
|
||||
|
||||
/* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false);
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false);
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false);
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete");
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow");
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter");
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol");
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1"));
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Add table specific
|
||||
if (inst.hasPlugin("table")) {
|
||||
contextMenu.addSeparator();
|
||||
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
|
||||
}
|
||||
}
|
||||
|
||||
contextMenu.show(x, y);
|
||||
}, 10);
|
||||
|
||||
// Cancel default handeling
|
||||
tinyMCE.cancelEvent(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
_hideContextMenu : function() {
|
||||
if (TinyMCE_ContextMenuPlugin._contextMenu)
|
||||
TinyMCE_ContextMenuPlugin._contextMenu.hide();
|
||||
},
|
||||
|
||||
_commandHandler : function(command, value) {
|
||||
var cm = TinyMCE_ContextMenuPlugin._contextMenu;
|
||||
|
||||
cm.hide();
|
||||
|
||||
// UI must be true on these
|
||||
var ui = false;
|
||||
if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells")
|
||||
ui = true;
|
||||
|
||||
if (command == "Paste")
|
||||
value = null;
|
||||
|
||||
if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) {
|
||||
// Cell properties will generate access denied error is this isn't done?!
|
||||
window.setTimeout(function() {
|
||||
cm.inst.execCommand(command, ui, value);
|
||||
}, 100);
|
||||
} else
|
||||
cm.inst.execCommand(command, ui, value);
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin);
|
||||
|
||||
// Context menu class
|
||||
|
||||
function TinyMCE_ContextMenu(settings) {
|
||||
var doc, self = this;
|
||||
|
||||
// Default value function
|
||||
function defParam(key, def_val) {
|
||||
settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val;
|
||||
}
|
||||
|
||||
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
|
||||
|
||||
// Setup contextmenu div
|
||||
this.contextMenuDiv = document.createElement("div");
|
||||
this.contextMenuDiv.className = "contextMenu";
|
||||
this.contextMenuDiv.setAttribute("class", "contextMenu");
|
||||
this.contextMenuDiv.style.display = "none";
|
||||
this.contextMenuDiv.style.position = 'absolute';
|
||||
this.contextMenuDiv.style.zindex = 1000;
|
||||
this.contextMenuDiv.style.left = '0';
|
||||
this.contextMenuDiv.style.top = '0';
|
||||
this.contextMenuDiv.unselectable = "on";
|
||||
|
||||
document.body.appendChild(this.contextMenuDiv);
|
||||
|
||||
// Setup default values
|
||||
defParam("commandhandler", "");
|
||||
defParam("spacer_image", "images/spacer.gif");
|
||||
|
||||
this.items = new Array();
|
||||
this.settings = settings;
|
||||
this.html = "";
|
||||
|
||||
// IE Popup
|
||||
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
|
||||
this.pop = window.createPopup();
|
||||
doc = this.pop.document;
|
||||
doc.open();
|
||||
doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');
|
||||
doc.close();
|
||||
}
|
||||
};
|
||||
|
||||
TinyMCE_ContextMenu.prototype = {
|
||||
clearAll : function() {
|
||||
this.html = "";
|
||||
this.contextMenuDiv.innerHTML = "";
|
||||
},
|
||||
|
||||
addSeparator : function() {
|
||||
this.html += '<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="' + this.settings['spacer_image'] + '" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="' + this.settings['spacer_image'] + '" /></td></tr>';
|
||||
},
|
||||
|
||||
addItem : function(icon, title, command, value, disabled) {
|
||||
if (title.charAt(0) == '$')
|
||||
title = tinyMCE.getLang(title.substring(1));
|
||||
|
||||
var onMouseDown = '';
|
||||
var html = '';
|
||||
|
||||
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0)
|
||||
onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;';
|
||||
else
|
||||
onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;';
|
||||
|
||||
if (icon == "")
|
||||
icon = this.settings['spacer_image'];
|
||||
|
||||
if (!disabled)
|
||||
html += '<tr class="contextMenuItem">';
|
||||
else
|
||||
html += '<tr class="contextMenuItemDisabled">';
|
||||
|
||||
html += '<td class="contextMenuIcon"><img src="' + icon + '" width="20" height="20" class="contextMenuImage" /></td>';
|
||||
html += '<td><div class="contextMenuText">';
|
||||
html += '<a href="javascript:void(0);" onclick="' + onMouseDown + '" onmousedown="return false;"> ';
|
||||
|
||||
// Add text
|
||||
html += title;
|
||||
|
||||
html += ' </a>';
|
||||
html += '</div></td>';
|
||||
html += '</tr>';
|
||||
|
||||
// Add to main
|
||||
this.html += html;
|
||||
},
|
||||
|
||||
show : function(x, y) {
|
||||
var vp, width, height, yo;
|
||||
|
||||
if (this.html == "")
|
||||
return;
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';
|
||||
html += this.html;
|
||||
html += '</table>';
|
||||
|
||||
this.contextMenuDiv.innerHTML = html;
|
||||
|
||||
// Get dimensions
|
||||
this.contextMenuDiv.style.display = "block";
|
||||
width = this.contextMenuDiv.offsetWidth;
|
||||
height = this.contextMenuDiv.offsetHeight;
|
||||
this.contextMenuDiv.style.display = "none";
|
||||
|
||||
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
|
||||
// Setup popup and show
|
||||
this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>";
|
||||
this.pop.document.tinyMCE = tinyMCE;
|
||||
this.pop.document.contextMenu = this;
|
||||
this.pop.show(x, y, width, height);
|
||||
} else {
|
||||
vp = this.getViewPort();
|
||||
yo = tinyMCE.isMSIE5_0 ? document.body.scrollTop : self.pageYOffset;
|
||||
this.contextMenuDiv.style.left = (x > vp.left + vp.width - width ? vp.left + vp.width - width : x) + 'px';
|
||||
this.contextMenuDiv.style.top = (y > vp.top + vp.height - height ? vp.top + vp.height - height : y) + 'px';
|
||||
this.contextMenuDiv.style.display = "block";
|
||||
}
|
||||
},
|
||||
|
||||
getViewPort : function() {
|
||||
return {
|
||||
left : self.pageXOffset || self.document.documentElement.scrollLeft || self.document.body.scrollLeft,
|
||||
top: self.pageYOffset || self.document.documentElement.scrollTop || self.document.body.scrollTop,
|
||||
width : document.documentElement.offsetWidth || document.body.offsetWidth,
|
||||
height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
||||
};
|
||||
},
|
||||
|
||||
hide : function() {
|
||||
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera)
|
||||
this.pop.hide();
|
||||
else
|
||||
this.contextMenuDiv.style.display = "none";
|
||||
},
|
||||
|
||||
execCommand : function(command, value) {
|
||||
eval(this.settings['commandhandler'] + "(command, value);");
|
||||
}
|
||||
};
|
||||
|
Après Largeur: | Hauteur: | Taille: 43 B |
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 14px;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 12px;
|
||||
margin: 3px 0 3px 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 11px;
|
||||
margin: 3px 0 3px 0;
|
||||
}
|
||||
|
||||
#log {
|
||||
font-family: Verdana;
|
||||
border: 1px solid gray;
|
||||
width: 100%; height: 240px;
|
||||
overflow: scroll;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#log span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#log span.msg {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#log span.time {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#log br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#logfilter {
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
#logenabled {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#settings_panel span, #info_panel span, #content_panel span, #command_states_panel span, #undo_redo_panel span {
|
||||
display: block;
|
||||
margin: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
div.data {
|
||||
width: 100%; height: 240px;
|
||||
overflow: scroll;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
#misc_panel div.data {
|
||||
height: 270px;
|
||||
}
|
||||
|
||||
.data input {
|
||||
width: 265px;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.data h2 {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.data h3 {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.data div {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.data table {
|
||||
margin: 0 0 15px 15px;
|
||||
}
|
||||
|
||||
.data p {
|
||||
margin: 0; padding: 0;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
table, td {
|
||||
border: 1px solid gray;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#flip {
|
||||
position: absolute;
|
||||
left: 295; top: 384px;
|
||||
}
|
||||
|
||||
.bspec {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.dep {
|
||||
color: #880000;
|
||||
}
|
||||
|
||||
.col1 {
|
||||
width: 265px;
|
||||
}
|
||||
|
||||
div.undodata {
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#devkit {
|
||||
position: absolute;
|
||||
top: -385px; right: 0;
|
||||
width: 640px; height: 390px;
|
||||
border: 1px solid black;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.devkitup {
|
||||
top: -385px !important;
|
||||
}
|
||||
|
||||
.devkitdown {
|
||||
top: 0 !important;
|
||||
}
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_devkit_title}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/devkit.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/diff.js"></script>
|
||||
<link href="css/devkit.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body id="devkit" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
||||
<form action="#">
|
||||
<h1>{$lang_devkit_title}</h1>
|
||||
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="log_tab" class="current"><span><a href="javascript:mcTabs.displayTab('log_tab','log_panel');" onmousedown="return false;">{$lang_devkit_log_tab}</a></span></li>
|
||||
<li id="info_tab"><span><a href="javascript:mcTabs.displayTab('info_tab','info_panel');" onmousedown="return false;">{$lang_devkit_info_tab}</a></span></li>
|
||||
<li id="settings_tab"><span><a href="javascript:mcTabs.displayTab('settings_tab','settings_panel');" onmousedown="return false;">{$lang_devkit_settings_tab}</a></span></li>
|
||||
<li id="content_tab"><span><a href="javascript:mcTabs.displayTab('content_tab','content_panel');" onmousedown="return false;">{$lang_devkit_content_tab}</a></span></li>
|
||||
<!-- <li id="command_states_tab"><span><a href="javascript:mcTabs.displayTab('command_states_tab','command_states_panel');" onmousedown="return false;">{$lang_devkit_command_states_tab}</a></span></li> -->
|
||||
<li id="undo_redo_tab"><span><a href="javascript:mcTabs.displayTab('undo_redo_tab','undo_redo_panel');" onmousedown="return false;">{$lang_devkit_undo_redo_tab}</a></span></li>
|
||||
<li id="misc_tab"><span><a href="javascript:mcTabs.displayTab('misc_tab','misc_panel');" onmousedown="return false;">{$lang_devkit_misc_tab}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="log_panel" class="panel current">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_log_tab}</legend>
|
||||
|
||||
<div style="float: left">
|
||||
<label>{$lang_devkit_filter} </label><input type="text" id="logfilter" name="logfilter" value="" onchange="changeFilter(this.value);" />
|
||||
</div>
|
||||
|
||||
<div style="float: left">
|
||||
<input type="checkbox" id="logenabled" name="logenabled" value="true" checked="checked" onclick="toggleLog(this.checked);" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<a href="javascript:clearLog();">[{$lang_devkit_clear_log}]</a>
|
||||
</div>
|
||||
|
||||
<br style="clear: both" />
|
||||
|
||||
<div id="log">
|
||||
</div>
|
||||
|
||||
<input type="checkbox" id="debug_events" name="debug_events" class="checkbox" onclick="toggleDebugEvents(this.checked);" /><label for="debug_events" onclick="toggleDebugEvents(this.form.debug_events.checked);">{$lang_devkit_debug_events}</label>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="info_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_info_tab}</legend>
|
||||
|
||||
<span><a href="javascript:renderInfo();">[{$lang_devkit_refresh}]</a></span>
|
||||
|
||||
<div id="info" class="data">
|
||||
<p>{$lang_devkit_info_help}</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="settings_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_settings_tab}</legend>
|
||||
|
||||
<span><a href="javascript:renderSettings();">[{$lang_devkit_refresh}]</a></span>
|
||||
|
||||
<div id="settings" class="data">
|
||||
<p>{$lang_devkit_settings_help}</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="content_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_content_tab}</legend>
|
||||
|
||||
<span><a href="javascript:renderContent();">[{$lang_devkit_refresh}]</a></span>
|
||||
|
||||
<div id="content" class="data">
|
||||
<p>{$lang_devkit_content_help}</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="command_states_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_command_states_tab}</legend>
|
||||
|
||||
<span><a href="javascript:renderCommandStates();">[{$lang_devkit_refresh}]</a></span>
|
||||
|
||||
<div id="command_states" class="data">
|
||||
<p>{$lang_devkit_command_states_help}</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="undo_redo_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_undo_redo_tab}</legend>
|
||||
|
||||
<span><a href="javascript:renderUndoRedo();">[{$lang_devkit_refresh}]</a></span>
|
||||
|
||||
<div id="undo_redo" class="data">
|
||||
<p>{$lang_devkit_undo_redo_help}</p>
|
||||
</div>
|
||||
|
||||
<input type="checkbox" id="undo_diff" name="undo_diff" class="checkbox" /><label for="undo_diff">{$lang_devkit_undo_diff}</label>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="misc_panel" class="panel">
|
||||
<fieldset>
|
||||
<legend>{$lang_devkit_misc_tab}</legend>
|
||||
|
||||
<div class="data">
|
||||
<p>{$lang_devkit_misc_help}</p>
|
||||
<hr />
|
||||
<p>Selection: <a href="#" onmousedown="return storeSelection();">[Store selection]</a> <a href="#" onmousedown="return restoreSelection();">[Restore selection]</a></p>
|
||||
<hr />
|
||||
<div><strong>Insert custom HTML content</strong></div>
|
||||
<div><textarea id="htmlcont" name="htmlcont" style="width: 90%" rows="5"></textarea></div>
|
||||
<div><a href="#" onclick="return tinyMCE.execCommand('mceInsertContent',false,document.getElementById('htmlcont').value);">[Insert content]</a></div>
|
||||
<hr />
|
||||
<div><strong>Eval JS:</strong></div>
|
||||
<div><textarea id="jscont" name="jscont" style="width: 90%" rows="5">tinyMCE.execCommand('Bold',false,null);</textarea></div>
|
||||
<div><a href="#" onclick="return parent.window.eval(document.getElementById('jscont').value);">[Evaluate]</a></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="flip"><a href="javascript:toggleFlip();" onmousedown="return false;"><img id="flipbtn" src="images/flip_down.gif" border="0" /></a></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,325 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
tinyMCE.importPluginLanguagePack('devkit');
|
||||
|
||||
var TinyMCE_DevKitPlugin = {
|
||||
_logFilter : '\\[(importCSS|execCommand|execInstanceCommand|debug)\\]',
|
||||
_logPadding : '',
|
||||
_startTime : null,
|
||||
_benchMark : false,
|
||||
_winLoaded : false,
|
||||
_isDebugEvents : false,
|
||||
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Development Kit',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/devkit',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
initInstance : function(inst) {
|
||||
this._setup();
|
||||
},
|
||||
|
||||
_setup : function() {
|
||||
if (this._loaded)
|
||||
return;
|
||||
|
||||
this._loaded = true;
|
||||
|
||||
// Register a document reference for more easy access in the FF DOM inspector
|
||||
document.___TinyMCE = tinyMCE;
|
||||
|
||||
// Setup devkit by settings
|
||||
this._logFilter = tinyMCE.getParam('devkit_log_filter', this._logFilter);
|
||||
this._benchMark = tinyMCE.getParam('devkit_bench_mark', false);
|
||||
|
||||
var ifr = document.createElement('iframe');
|
||||
|
||||
ifr.setAttribute("id", "devkit");
|
||||
ifr.setAttribute("frameBorder", "0");
|
||||
ifr.setAttribute("src", tinyMCE.baseURL + '/plugins/devkit/devkit.htm');
|
||||
|
||||
document.body.appendChild(ifr);
|
||||
|
||||
// Workaround for strange IE reload bug
|
||||
//if (tinyMCE.isRealIE)
|
||||
// document.getElementById('devkit').outerHTML = document.getElementById('devkit').outerHTML;
|
||||
|
||||
tinyMCE.importCSS(document, tinyMCE.baseURL + '/plugins/devkit/css/devkit_ui.css');
|
||||
},
|
||||
|
||||
_start : function() {
|
||||
this._logPadding += '\u00a0';
|
||||
|
||||
return new Date().getTime();
|
||||
},
|
||||
|
||||
_end : function(st) {
|
||||
if (this._logPadding.length > 0)
|
||||
this._logPadding = this._logPadding.substring(0, this._logPadding.length - 1);
|
||||
|
||||
if (this._benchMark)
|
||||
this._log("benchmark", "Execution time: " + (new Date().getTime() - st));
|
||||
},
|
||||
|
||||
_log : function(t) {
|
||||
var m, a, i, e = document.getElementById('devkit'), now = new Date().getTime();
|
||||
|
||||
if (!this._startTime)
|
||||
this._startTime = now;
|
||||
|
||||
m = (this._logPadding.length > 1 ? this._logPadding : '') + '[' + (now - this._startTime) + '] [' + t + '] ';
|
||||
|
||||
a = this._log.arguments;
|
||||
for (i=1; i<a.length; i++) {
|
||||
if (typeof(a[i]) == 'undefined')
|
||||
continue;
|
||||
|
||||
if (i > 1)
|
||||
m += ', ';
|
||||
|
||||
m += a[i];
|
||||
}
|
||||
|
||||
if (!new RegExp(this._logFilter, 'gi').test(m)) {
|
||||
if (this._logPadding.length > 0)
|
||||
this._logPadding = this._logPadding.substring(0, this._logPadding.length - 1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this._winLoaded)
|
||||
tinyMCE.log[tinyMCE.log.length] = m;
|
||||
else
|
||||
e.contentWindow.debug(m);
|
||||
},
|
||||
|
||||
_debugEvents : function(s) {
|
||||
var i, ld, inst, n, ev = ['CheckboxStateChange','DOMAttrModified','DOMMenuItemActive',
|
||||
'DOMMenuItemInactive','DOMMouseScroll','DOMNodeInserted','DOMNodeRemoved',
|
||||
'RadioStateChange','blur','broadcast','change','click','close','command',
|
||||
'commandupdate','contextmenu','dblclick','dragdrop','dragenter','dragexit',
|
||||
'draggesture','dragover','focus','input','keydown','keypress','keyup','load',
|
||||
'mousedown','mouseout','mouseover','mouseup','overflow','overflowchanged','popuphidden',
|
||||
'popuphiding','popupshowing','popupshown','select','syncfrompreference','synctopreference',
|
||||
'underflow','unload','abort','activate','afterprint','afterupdate','beforeactivate',
|
||||
'beforecopy','beforecut','beforedeactivate','beforeeditfocus','beforepaste','beforeprint',
|
||||
'beforeunload','beforeupdate','bounce','cellchange','controlselect','copy','cut',
|
||||
'dataavailable','datasetchanged','datasetcomplete','deactivate','dragend','dragleave',
|
||||
'dragstart','drop','error','errorupdate','filterchange','finish','focusin','focusout',
|
||||
'help','layoutcomplete','losecapture','mouseenter','mouseleave','mousewheel',
|
||||
'move','moveend','movestart','paste','propertychange','readystatechange','reset','resize',
|
||||
'resizeend','resizestart','rowenter','rowexit','rowsdelete','rowsinserted','scroll',
|
||||
'selectionchange','selectstart','start','stop','submit'];
|
||||
// mousemove
|
||||
|
||||
if (TinyMCE_DevKitPlugin._isDebugEvents == s)
|
||||
return;
|
||||
|
||||
TinyMCE_DevKitPlugin._isDebugEvents = s;
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst) || inst.getDoc() == ld)
|
||||
continue;
|
||||
|
||||
ld = inst.getDoc();
|
||||
|
||||
for (i=0; i<ev.length; i++) {
|
||||
if (s)
|
||||
tinyMCE.addEvent(ld, ev[i], TinyMCE_DevKitPlugin._debugEvent);
|
||||
else
|
||||
tinyMCE.removeEvent(ld, ev[i], TinyMCE_DevKitPlugin._debugEvent);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_debugEvent : function(e) {
|
||||
var t;
|
||||
|
||||
e = e ? e : tinyMCE.selectedInstance.getWin().event;
|
||||
t = e.srcElement ? e.srcElement : e.target;
|
||||
|
||||
tinyMCE.debug(e.type, t ? t.nodeName : '');
|
||||
},
|
||||
|
||||
_serialize : function(o) {
|
||||
var i, v, s = TinyMCE_DevKitPlugin._serialize;
|
||||
|
||||
if (o == null)
|
||||
return 'null';
|
||||
|
||||
switch (typeof o) {
|
||||
case 'string':
|
||||
v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
|
||||
|
||||
return '"' + o.replace(new RegExp('([\u0080-\uFFFF\\x00-\\x1f\\"])', 'g'), function(a, b) {
|
||||
i = v.indexOf(b);
|
||||
|
||||
if (i+1)
|
||||
return '\\' + v.charAt(i + 1);
|
||||
|
||||
a = b.charCodeAt().toString(16);
|
||||
|
||||
return '\\u' + '0000'.substring(a.length) + a;
|
||||
}) + '"';
|
||||
|
||||
case 'object':
|
||||
if (o instanceof Array) {
|
||||
for (i=0, v = '['; i<o.length; i++)
|
||||
v += (i > 0 ? ',' : '') + s(o[i]);
|
||||
|
||||
return v + ']';
|
||||
}
|
||||
|
||||
v = '{';
|
||||
|
||||
for (i in o)
|
||||
v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';
|
||||
|
||||
return v + '}';
|
||||
}
|
||||
|
||||
return '' + o;
|
||||
}
|
||||
};
|
||||
|
||||
// Patch and piggy back functions
|
||||
tinyMCE.__debug = tinyMCE.debug;
|
||||
tinyMCE.debug = function() {
|
||||
var a, i, m = '', now = new Date().getTime(), start = TinyMCE_DevKitPlugin._startTime;
|
||||
|
||||
if (!start)
|
||||
TinyMCE_DevKitPlugin._startTime = start = now;
|
||||
|
||||
a = this.debug.arguments;
|
||||
for (i=0; i<a.length; i++) {
|
||||
if (typeof(a[i]) == 'undefined')
|
||||
continue;
|
||||
|
||||
if (i > 0)
|
||||
m += ', ';
|
||||
|
||||
m += a[i];
|
||||
}
|
||||
|
||||
TinyMCE_DevKitPlugin._log('debug', m);
|
||||
};
|
||||
|
||||
tinyMCE.dump = function(o) {
|
||||
tinyMCE.debug(TinyMCE_DevKitPlugin._serialize(o));
|
||||
};
|
||||
|
||||
tinyMCE.sleep = function(t) {
|
||||
var s = new Date().getTime(), b;
|
||||
|
||||
while (new Date().getTime() - s < t) b=1;
|
||||
};
|
||||
|
||||
tinyMCE.__execCommand = tinyMCE.execCommand;
|
||||
tinyMCE.execCommand = function(command, user_interface, value) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('execCommand', command, user_interface, value);
|
||||
r = tinyMCE.__execCommand(command, user_interface, value);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.__execInstanceCommand = tinyMCE.execInstanceCommand;
|
||||
tinyMCE.execInstanceCommand = function(editor_id, command, user_interface, value, focus) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('execInstanceCommand', editor_id, command, user_interface, value);
|
||||
r = tinyMCE.__execInstanceCommand(editor_id, command, user_interface, value);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
TinyMCE_Engine.prototype.__handleEvent = TinyMCE_Engine.prototype.handleEvent;
|
||||
TinyMCE_Engine.prototype.handleEvent = function(e) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('handleEvent', e.type);
|
||||
r = tinyMCE.__handleEvent(e);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.__importCSS = tinyMCE.importCSS;
|
||||
tinyMCE.importCSS = function(doc, css) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('importCSS', doc, css);
|
||||
r = tinyMCE.__importCSS(doc, css);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.__triggerNodeChange = tinyMCE.triggerNodeChange;
|
||||
tinyMCE.triggerNodeChange = function(focus, setup_content) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('triggerNodeChange', focus, setup_content);
|
||||
r = tinyMCE.__triggerNodeChange(focus, setup_content);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.__dispatchCallback = tinyMCE.dispatchCallback;
|
||||
tinyMCE.dispatchCallback = function(i, p, n) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('dispatchCallback', i, p, n);
|
||||
r = tinyMCE.__dispatchCallback(i, p, n);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.__executeCallback = tinyMCE.executeCallback;
|
||||
tinyMCE.executeCallback = function(i, p, n) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('executeCallback', i, p, n);
|
||||
r = tinyMCE.__executeCallback(i, p, n);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.__execCommandCallback = tinyMCE.execCommandCallback;
|
||||
tinyMCE.execCommandCallback = function(i, p, n) {
|
||||
var r, st, dk = TinyMCE_DevKitPlugin;
|
||||
|
||||
st = dk._start();
|
||||
dk._log('execCommandCallback', i, p, n);
|
||||
r = tinyMCE.__execCommandCallback(i, p, n);
|
||||
dk._end(st);
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("devkit", TinyMCE_DevKitPlugin);
|
||||
|
Après Largeur: | Hauteur: | Taille: 179 B |
|
Après Largeur: | Hauteur: | Taille: 193 B |
|
|
@ -0,0 +1,331 @@
|
|||
var devkit = parent.tinyMCE.plugins['devkit'], logEnabled = true, flip = false, book = null;
|
||||
|
||||
function init() {
|
||||
var log, i, f = document.forms[0];
|
||||
|
||||
devkit._winLoaded = true;
|
||||
|
||||
log = tinyMCE.log;
|
||||
|
||||
for (i=0; i<log.length; i++)
|
||||
debug(log[i]);
|
||||
|
||||
f.logfilter.value = devkit._logFilter;
|
||||
}
|
||||
|
||||
function changeFilter(f) {
|
||||
devkit._logFilter = f;
|
||||
}
|
||||
|
||||
function toggleLog(s) {
|
||||
logEnabled = s;
|
||||
}
|
||||
|
||||
function toggleFlip() {
|
||||
document.getElementById('flipbtn').src = flip ? 'images/flip_down.gif' : 'images/flip_up.gif';
|
||||
|
||||
if (flip)
|
||||
parent.document.getElementById('devkit').className = 'devkitup';
|
||||
else
|
||||
parent.document.getElementById('devkit').className = 'devkitdown';
|
||||
|
||||
flip = !flip;
|
||||
}
|
||||
|
||||
function debug(s) {
|
||||
var d, l, n;
|
||||
|
||||
if (!logEnabled || !new RegExp(devkit._logFilter, 'gi').test(s))
|
||||
return;
|
||||
|
||||
d = document;
|
||||
l = d.getElementById('log');
|
||||
n = d.createElement('span');
|
||||
|
||||
n.innerHTML = tinyMCE.xmlEncode(s);
|
||||
|
||||
l.appendChild(n);
|
||||
l.scrollTop = l.scrollHeight;
|
||||
}
|
||||
|
||||
function renderInfo() {
|
||||
var se = document.getElementById('info'), n, sn, inst, h = '', sel, rng, instCount = 0, rc;
|
||||
|
||||
h += '<h2>Browser info:</h2>';
|
||||
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
|
||||
h += addRenderInfo('navigator.userAgent', navigator.userAgent);
|
||||
h += addRenderInfo('navigator.appName', navigator.appName);
|
||||
h += addRenderInfo('navigator.platform', navigator.platform);
|
||||
h += addRenderInfo('navigator.language', navigator.language, 'bspec');
|
||||
h += addRenderInfo('navigator.browserLanguage', navigator.browserLanguage, 'bspec');
|
||||
h += addRenderInfo('navigator.systemLanguage', navigator.systemLanguage, 'bspec');
|
||||
h += addRenderInfo('navigator.userLanguage', navigator.userLanguage, 'bspec');
|
||||
h += addRenderInfo('opera.buildNumber("inconspicuous")', typeof(opera) != 'undefined' && opera.buildNumber ? opera.buildNumber('inconspicuous') : null, 'bspec');
|
||||
h += addRenderInfo('window.innerWidth', parent.window.innerWidth, 'bspec');
|
||||
h += addRenderInfo('window.innerHeight', parent.window.innerHeight, 'bspec');
|
||||
h += addRenderInfo('document.body.offsetWidth', parent.document.body.offsetWidth);
|
||||
h += addRenderInfo('document.body.offsetHeight', parent.document.body.offsetHeight);
|
||||
h += addRenderInfo('screen.width', screen.width);
|
||||
h += addRenderInfo('screen.height', screen.height);
|
||||
h += addRenderInfo('screen.availWidth', screen.availWidth);
|
||||
h += addRenderInfo('screen.availHeight', screen.availHeight);
|
||||
h += addRenderInfo('screen.colorDepth', screen.colorDepth);
|
||||
h += addRenderInfo('screen.pixelDepth', screen.pixelDepth, 'bspec');
|
||||
h += addRenderInfo('document.contentType', document.contentType, 'bspec');
|
||||
h += '</table>';
|
||||
|
||||
h += '<h2>TinyMCE_Engine info:</h2>';
|
||||
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
|
||||
h += addRenderInfo('baseURL', tinyMCE.baseURL);
|
||||
h += addRenderInfo('selectedInstance.editorId', tinyMCE.selectedInstance ? tinyMCE.selectedInstance.editorId : null);
|
||||
h += addRenderInfo('selectedElement.nodeName', tinyMCE.selectedElement ? tinyMCE.selectedElement.nodeName : null, 'dep');
|
||||
h += addRenderInfo('loadedFiles',tinyMCE.loadedFiles.join(','));
|
||||
h += addRenderInfo('isMSIE', tinyMCE.isMSIE);
|
||||
h += addRenderInfo('isMSIE5', tinyMCE.isMSIE5);
|
||||
h += addRenderInfo('isMSIE5_0', tinyMCE.isMSIE5_0);
|
||||
h += addRenderInfo('isMSIE7', tinyMCE.isMSIE7);
|
||||
h += addRenderInfo('isGecko', tinyMCE.isGecko);
|
||||
h += addRenderInfo('isSafari', tinyMCE.isSafari);
|
||||
h += addRenderInfo('isOpera', tinyMCE.isOpera);
|
||||
h += addRenderInfo('isMac', tinyMCE.isMac);
|
||||
h += addRenderInfo('isNS7', tinyMCE.isNS7);
|
||||
h += addRenderInfo('isNS71', tinyMCE.isNS71);
|
||||
h += addRenderInfo('idCounter', tinyMCE.idCounter);
|
||||
h += addRenderInfo('currentConfig', tinyMCE.currentConfig);
|
||||
h += addRenderInfo('majorVersion', tinyMCE.majorVersion);
|
||||
h += addRenderInfo('minorVersion', tinyMCE.minorVersion);
|
||||
h += addRenderInfo('releaseDate', tinyMCE.releaseDate);
|
||||
h += addRenderInfo('documentBasePath', tinyMCE.documentBasePath);
|
||||
h += addRenderInfo('documentURL', tinyMCE.documentURL);
|
||||
h += '</table>';
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
sel = inst.selection.getSel();
|
||||
rng = inst.selection.getRng();
|
||||
|
||||
h += '<h2>TinyMCE_Control(' + (instCount++) + ') id: ' + inst.editorId + '</h2>';
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
|
||||
|
||||
h += addRenderInfo('editorId', inst.editorId);
|
||||
h += addRenderInfo('visualAid', inst.visualAid);
|
||||
h += addRenderInfo('foreColor', inst.foreColor);
|
||||
h += addRenderInfo('backColor', inst.backColor);
|
||||
h += addRenderInfo('formTargetElementId', inst.formTargetElementId);
|
||||
h += addRenderInfo('formElement', inst.formElement ? inst.formElement.nodeName : null);
|
||||
h += addRenderInfo('oldTargetElement', inst.oldTargetElement ? inst.oldTargetElement.nodeName : null);
|
||||
h += addRenderInfo('linkElement', inst.linkElement ? inst.linkElement.nodeName : null, 'dep');
|
||||
h += addRenderInfo('imgElement', inst.imgElement ? inst.imgElement.nodeName : null, 'dep');
|
||||
h += addRenderInfo('selectedNode', inst.selectedNode ? inst.selectedNode.nodeName : null, 'dep');
|
||||
h += addRenderInfo('targetElement', inst.targetElement ? inst.targetElement.nodeName : null);
|
||||
h += addRenderInfo('getBody().nodeName', inst.getBody() ? inst.getBody().nodeName : null);
|
||||
h += addRenderInfo('getBody().getAttribute("id")', inst.getBody() ? inst.getBody().getAttribute("id") : null);
|
||||
h += addRenderInfo('getDoc().location', inst.getDoc() ? inst.getDoc().location : null);
|
||||
h += addRenderInfo('startContent', inst.startContent);
|
||||
h += addRenderInfo('isHidden()', inst.isHidden());
|
||||
h += addRenderInfo('isDirty()', inst.isDirty());
|
||||
h += addRenderInfo('undoRedo.undoLevels.length', inst.undoRedo.undoLevels.length);
|
||||
h += addRenderInfo('undoRedo.undoIndex', inst.undoRedo.undoIndex);
|
||||
h += addRenderInfo('selection.getSelectedHTML()', inst.selection.getSelectedHTML());
|
||||
h += addRenderInfo('selection.isCollapsed()', inst.selection.isCollapsed() || 'false');
|
||||
h += addRenderInfo('selection.getSelectedText()', inst.selection.getSelectedText());
|
||||
h += addRenderInfo('selection.getFocusElement().nodeName', inst.selection.getFocusElement().nodeName);
|
||||
h += addRenderInfo('selection.getFocusElement().outerHTML', tinyMCE.getOuterHTML(inst.selection.getFocusElement()));
|
||||
|
||||
if ((tinyMCE.isGecko || tinyMCE.isOpera) && sel && rng) {
|
||||
h += addRenderInfo('selection.getSel().anchorNode.nodeName', sel.anchorNode ? sel.anchorNode.nodeName : null, 'bspec');
|
||||
h += addRenderInfo('selection.getSel().anchorOffset', sel.anchorOffset, 'bspec');
|
||||
h += addRenderInfo('selection.getSel().focusNode.nodeName', sel.focusNode ? sel.focusNode.nodeName : null, 'bspec');
|
||||
h += addRenderInfo('selection.getSel().focusOffset', sel.focusOffset, 'bspec');
|
||||
h += addRenderInfo('selection.getRng().startContainer.nodeName', rng.startContainer ? rng.startContainer.nodeName : null, 'bspec');
|
||||
h += addRenderInfo('selection.getRng().startOffset', rng.startOffset, 'bspec');
|
||||
h += addRenderInfo('selection.getRng().endContainer.nodeName', rng.endContainer ? rng.endContainer.nodeName : null, 'bspec');
|
||||
h += addRenderInfo('selection.getRng().endOffset', rng.endOffset, 'bspec');
|
||||
}
|
||||
|
||||
if (typeof(rng.item) != 'undefined' || typeof(rng.htmlText) != 'undefined') {
|
||||
if (!rng.item) {
|
||||
h += addRenderInfo('selection.getSel().type', sel.type, 'bspec');
|
||||
h += addRenderInfo('selection.getRng().htmlText', rng.htmlText, 'bspec');
|
||||
h += addRenderInfo('selection.getRng().text', rng.text, 'bspec');
|
||||
} else
|
||||
h += addRenderInfo('selection.getRng().item(0).nodeName', rng.item(0).nodeName, 'bspec');
|
||||
}
|
||||
|
||||
h += '</table>';
|
||||
}
|
||||
|
||||
h += '<p>Fields marked in <strong class="bspec">gray</strong> is not cross browser and should be used with care.</p>';
|
||||
h += '<p>Fields marked <strong class="dep">red</strong> are marked deprecated and will be removed in the future.</p><br />';
|
||||
|
||||
se.innerHTML = h;
|
||||
}
|
||||
|
||||
function addRenderInfo(n, v, c) {
|
||||
return '<tr><td' + (c ? ' class="' + c + '"' : '')+ '>' + n + '</td><td><input type="text" value="' + tinyMCE.xmlEncode(v != null ? ('' + v).replace(/[\r\n]/g, '') : 'null') + '" /></td></tr>';
|
||||
}
|
||||
|
||||
function renderSettings() {
|
||||
var se = document.getElementById('settings'), n, sn, inst, h = '', v;
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
h += '<h2>Instance id: ' + inst.editorId + '</h2>';
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
|
||||
|
||||
for (sn in inst.settings) {
|
||||
v = inst.settings[sn];
|
||||
|
||||
h += '<tr><td class="col1">' + tinyMCE.xmlEncode(sn) + '</td><td><input type="text" value="' + tinyMCE.xmlEncode(v) + '" /></td></tr>';
|
||||
}
|
||||
|
||||
h += '</table>';
|
||||
}
|
||||
|
||||
se.innerHTML = h;
|
||||
}
|
||||
|
||||
function renderContent() {
|
||||
var se = document.getElementById('content'), n, inst, h = '';
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
h += '<h2>Instance id: ' + inst.editorId + '</h2>';
|
||||
|
||||
h += '<h3>Start content - inst.startContent:</h3>';
|
||||
h += '<div>' + tinyMCE.xmlEncode(inst.startContent) + '</div>';
|
||||
|
||||
h += '<h3>Raw content - inst.getBody().innerHTML or inst.getHTML(true):</h3>';
|
||||
h += '<div>' + tinyMCE.xmlEncode(inst.getHTML(true)) + '</div>';
|
||||
|
||||
h += '<h3>Cleaned content - inst.getHTML():</h3>';
|
||||
h += '<div>' + tinyMCE.xmlEncode(inst.getHTML()) + '</div>';
|
||||
|
||||
if (inst.serializedHTML) {
|
||||
h += '<h3>Serialized HTML content - inst.serializedHTML:</h3>';
|
||||
h += '<div>' + tinyMCE.xmlEncode(inst.serializedHTML) + '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
se.innerHTML = h;
|
||||
}
|
||||
|
||||
function renderCommandStates() {
|
||||
var se = document.getElementById('command_states'), n, inst, h = '', v, ex;
|
||||
var cmds = new Array('2D-Position','AbsolutePosition','BackColor','BlockDirLTR','BlockDirRTL','Bold','BrowseMode','Copy','CreateBookmark','CreateLink','Cut','Delete','DirLTR','DirRTL','EditMode','enableInlineTableEditing','enableObjectResizing','FontName','FontSize','ForeColor','FormatBlock','Indent','InsertButton','InsertFieldset','InsertHorizontalRule','InsertIFrame','InsertImage','InsertInputButton','InsertInputCheckbox','InsertInputFileUpload','InsertInputHidden','InsertInputImage','InsertInputPassword','InsertInputRadio','InsertInputReset','InsertInputSubmit','InsertInputText','InsertMarquee','InsertOrderedList','InsertParagraph','InsertSelectDropdown','InsertSelectListbox','InsertTextArea','InsertUnorderedList','Italic','JustifyCenter','JustifyFull','JustifyLeft','JustifyNone','JustifyRight','LiveResize','MultipleSelection','Open','Outdent','OverWrite','Paste','PlayImage','Redo','Refresh','RemoveFormat','SaveAs','SelectAll','SizeToControl','SizeToControlHeight','SizeToControlWidth','Stop','StopImage','StrikeThrough','styleWithCSS','Subscript','Superscript','UnBookmark','Underline','Undo','Unlink','Unselect'), i;
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
h += '<h2>Instance id: ' + inst.editorId + '</h2>';
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" class="data">';
|
||||
|
||||
for (i=0; i<cmds.length; i++) {
|
||||
v = null;
|
||||
|
||||
try {
|
||||
v = tinyMCE.isGecko || inst.getDoc().queryCommandSupported(cmds[i]);
|
||||
v = v ? inst.queryCommandState(cmds[i]) : 'Not supported';
|
||||
} catch (ex) {
|
||||
v = 'Not supported';
|
||||
}
|
||||
|
||||
h += '<tr><td><input type="text" value="' + tinyMCE.xmlEncode(cmds[i]) + '" /></td><td><input type="text" value="' + tinyMCE.xmlEncode(v) + '" /></td></tr>';
|
||||
}
|
||||
|
||||
h += '</table>';
|
||||
}
|
||||
|
||||
se.innerHTML = h;
|
||||
}
|
||||
|
||||
function renderUndoRedo() {
|
||||
var se = document.getElementById('undo_redo'), inst, n, h = '', i, le, id, d, ur;
|
||||
var f = document.forms[0];
|
||||
|
||||
if (tinyMCE.undoLevels) {
|
||||
le = tinyMCE.undoLevels;
|
||||
|
||||
h += '<h2>Global undo/redo</h2>';
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" width="50%" class="data">';
|
||||
h += '<tr><td>undoLevels.length</td><td>' + le.length + '</td></tr>';
|
||||
h += '<tr><td>undoIndex</td><td>' + tinyMCE.undoIndex + '</td></tr>';
|
||||
h += '</table>';
|
||||
|
||||
for (i=0; i<le.length; i++)
|
||||
h += '<h3>Level: ' + i + ', Instance: ' + (le[i] ? le[i].editorId : 'null') + '</h3>';
|
||||
}
|
||||
|
||||
for (n in tinyMCE.instances) {
|
||||
inst = tinyMCE.instances[n];
|
||||
|
||||
if (!tinyMCE.isInstance(inst))
|
||||
continue;
|
||||
|
||||
ur = inst.undoRedo;
|
||||
le = ur.undoLevels;
|
||||
|
||||
h += '<hr /><h2>Instance id: ' + inst.editorId + '</h2>';
|
||||
h += '<table border="0" cellpadding="0" cellspacing="0" width="50%" class="data">';
|
||||
h += '<tr><td>undoLevels.length</td><td>' + le.length + '</td></tr>';
|
||||
h += '<tr><td>undoIndex</td><td>' + ur.undoIndex + '</td></tr>';
|
||||
h += '<tr><td>typingUndoIndex</td><td>' + ur.typingUndoIndex + '</td></tr>';
|
||||
h += '<tr><td>undoRedo</td><td>' + ur.undoRedo + '</td></tr>';
|
||||
h += '</table>';
|
||||
|
||||
for (i=0; i<le.length; i++) {
|
||||
h += '<h3>Level: ' + i + (!le[i].bookmark ? "" : " [bookmark]") + '</h3>';
|
||||
h += '<div class="undodata">' + tinyMCE.xmlEncode(le[i].content) + '</div>';
|
||||
|
||||
if (i > 0 && f.undo_diff.checked) {
|
||||
d = diff_main(i > 0 ? le[i-1].content.replace(/[\r\n]+/g, '') : null, le[i].content.replace(/[\r\n]+/g, ''), false);
|
||||
diff_cleanup_semantic(d);
|
||||
h += '<h3>Diff ' + (i-1) + ',' + i + '</h3><div class="undodata">' + diff_prettyhtml(d) + '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
se.innerHTML = h;
|
||||
}
|
||||
|
||||
function clearLog() {
|
||||
document.getElementById('log').innerHTML = '';
|
||||
devkit._startTime = null;
|
||||
}
|
||||
|
||||
function cancelAction() {
|
||||
parent.document.getElementById('devkit').style.display = 'none';
|
||||
}
|
||||
|
||||
function toggleDebugEvents(s) {
|
||||
devkit._debugEvents(s);
|
||||
}
|
||||
|
||||
function storeSelection() {
|
||||
book = tinyMCE.selectedInstance.selection.getBookmark();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function restoreSelection() {
|
||||
tinyMCE.selectedInstance.selection.moveToBookmark(book);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('devkit',{
|
||||
title : 'TinyMCE Development Kit',
|
||||
info_tab : 'Info',
|
||||
settings_tab : 'Settings',
|
||||
log_tab : 'Log',
|
||||
content_tab : 'Content',
|
||||
command_states_tab : 'Commands',
|
||||
undo_redo_tab : 'Undo/Redo',
|
||||
misc_tab : 'Misc',
|
||||
filter : 'Filter:',
|
||||
clear_log : 'Clear log',
|
||||
refresh : 'Refresh',
|
||||
info_help : 'Press Refresh to view info.',
|
||||
settings_help : 'Press Refresh to display the settings array for each TinyMCE_Control instance.',
|
||||
content_help : 'Press Refresh to display the raw and cleaned HTML content for each TinyMCE_Control instance.',
|
||||
command_states_help : 'Press Refresh to display the current command states from inst.queryCommandState. This list will also mark unsupported commands.',
|
||||
undo_redo_help : 'Press Refresh to display the global and instance undo/redo levels.',
|
||||
misc_help : 'Here are various tools for debugging and development purposes.',
|
||||
debug_events : 'Debug events',
|
||||
undo_diff : 'Diff undo levels'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
tinyMCE.importPluginLanguagePack('directionality');var TinyMCE_DirectionalityPlugin={getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"ltr":return tinyMCE.getButtonHTML(cn,'lang_directionality_ltr_desc','{$pluginurl}/images/ltr.gif','mceDirectionLTR');case"rtl":return tinyMCE.getButtonHTML(cn,'lang_directionality_rtl_desc','{$pluginurl}/images/rtl.gif','mceDirectionRTL')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case"mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClass(editor_id+'_ltr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_rtl','mceButtonDisabled');return true}tinyMCE.switchClass(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_rtl','mceButtonNormal');var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClass(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClass(editor_id+'_rtl','mceButtonSelected');return true}};tinyMCE.addPlugin("directionality",TinyMCE_DirectionalityPlugin);
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('directionality');
|
||||
|
||||
var TinyMCE_DirectionalityPlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Directionality',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
getControlHTML : function(cn) {
|
||||
switch (cn) {
|
||||
case "ltr":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
|
||||
|
||||
case "rtl":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
||||
execCommand : function(editor_id, element, command, user_interface, value) {
|
||||
// Handle commands
|
||||
switch (command) {
|
||||
case "mceDirectionLTR":
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
|
||||
|
||||
if (elm)
|
||||
elm.setAttribute("dir", "ltr");
|
||||
|
||||
tinyMCE.triggerNodeChange(false);
|
||||
return true;
|
||||
|
||||
case "mceDirectionRTL":
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
|
||||
|
||||
if (elm)
|
||||
elm.setAttribute("dir", "rtl");
|
||||
|
||||
tinyMCE.triggerNodeChange(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Pass to next handler in chain
|
||||
return false;
|
||||
},
|
||||
|
||||
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
||||
function getAttrib(elm, name) {
|
||||
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
|
||||
}
|
||||
|
||||
if (node == null)
|
||||
return;
|
||||
|
||||
var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
|
||||
if (!elm) {
|
||||
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
|
||||
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
|
||||
return true;
|
||||
}
|
||||
|
||||
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
|
||||
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
|
||||
|
||||
var dir = getAttrib(elm, "dir");
|
||||
if (dir == "ltr" || dir == "")
|
||||
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
|
||||
else
|
||||
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);
|
||||
|
Après Largeur: | Hauteur: | Taille: 155 B |
|
Après Largeur: | Hauteur: | Taille: 153 B |
|
|
@ -0,0 +1,6 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('',{
|
||||
directionality_ltr_desc : 'Direction left to right',
|
||||
directionality_rtl_desc : 'Direction right to left'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1 @@
|
|||
tinyMCE.importPluginLanguagePack('emotions');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('emotions');
|
||||
|
||||
// Plucin static class
|
||||
var TinyMCE_EmotionsPlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Emotions',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the HTML contents of the emotions control.
|
||||
*/
|
||||
getControlHTML : function(cn) {
|
||||
switch (cn) {
|
||||
case "emotions":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
||||
/**
|
||||
* Executes the mceEmotion command.
|
||||
*/
|
||||
execCommand : function(editor_id, element, command, user_interface, value) {
|
||||
// Handle commands
|
||||
switch (command) {
|
||||
case "mceEmotion":
|
||||
var template = new Array();
|
||||
|
||||
template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
|
||||
template['width'] = 250;
|
||||
template['height'] = 160;
|
||||
|
||||
// Language specific width and height addons
|
||||
template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
|
||||
template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
|
||||
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Pass to next handler in chain
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Register plugin
|
||||
tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_emotions_title}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
||||
<div align="center">
|
||||
<div class="title">{$lang_emotions_title}:<br /><br /></div>
|
||||
|
||||
<table border="0" cellspacing="0" cellpadding="4">
|
||||
<tr>
|
||||
<td><a href="javascript:insertEmotion('smiley-cool.gif','lang_emotions_cool');"><img src="images/smiley-cool.gif" width="18" height="18" border="0" alt="{$lang_emotions_cool}" title="{$lang_emotions_cool}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-cry.gif','lang_emotions_cry');"><img src="images/smiley-cry.gif" width="18" height="18" border="0" alt="{$lang_emotions_cry}" title="{$lang_emotions_cry}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-embarassed.gif','lang_emotions_embarassed');"><img src="images/smiley-embarassed.gif" width="18" height="18" border="0" alt="{$lang_emotions_embarassed}" title="{$lang_emotions_embarassed}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-foot-in-mouth.gif','lang_emotions_foot_in_mouth');"><img src="images/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_foot_in_mouth}" title="{$lang_emotions_foot_in_mouth}" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="javascript:insertEmotion('smiley-frown.gif','lang_emotions_frown');"><img src="images/smiley-frown.gif" width="18" height="18" border="0" alt="{$lang_emotions_frown}" title="{$lang_emotions_frown}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-innocent.gif','lang_emotions_innocent');"><img src="images/smiley-innocent.gif" width="18" height="18" border="0" alt="{$lang_emotions_innocent}" title="{$lang_emotions_innocent}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-kiss.gif','lang_emotions_kiss');"><img src="images/smiley-kiss.gif" width="18" height="18" border="0" alt="{$lang_emotions_kiss}" title="{$lang_emotions_kiss}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-laughing.gif','lang_emotions_laughing');"><img src="images/smiley-laughing.gif" width="18" height="18" border="0" alt="{$lang_emotions_laughing}" title="{$lang_emotions_laughing}" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="javascript:insertEmotion('smiley-money-mouth.gif','lang_emotions_money_mouth');"><img src="images/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_money_mouth}" title="{$lang_emotions_money_mouth}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-sealed.gif','lang_emotions_sealed');"><img src="images/smiley-sealed.gif" width="18" height="18" border="0" alt="{$lang_emotions_sealed}" title="{$lang_emotions_sealed}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-smile.gif','lang_emotions_smile');"><img src="images/smiley-smile.gif" width="18" height="18" border="0" alt="{$lang_emotions_smile}" title="{$lang_emotions_smile}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-surprised.gif','lang_emotions_surprised');"><img src="images/smiley-surprised.gif" width="18" height="18" border="0" alt="{$lang_emotions_surprised}" title="{$lang_emotions_surprised}" /></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="javascript:insertEmotion('smiley-tongue-out.gif','lang_emotions_tongue_out');"><img src="images/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{$lang_emotions_tongue-out}" title="{$lang_emotions_tongue_out}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-undecided.gif','lang_emotions_undecided');"><img src="images/smiley-undecided.gif" width="18" height="18" border="0" alt="{$lang_emotions_undecided}" title="{$lang_emotions_undecided}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-wink.gif','lang_emotions_wink');"><img src="images/smiley-wink.gif" width="18" height="18" border="0" alt="{$lang_emotions_wink}" title="{$lang_emotions_wink}" /></a></td>
|
||||
<td><a href="javascript:insertEmotion('smiley-yell.gif','lang_emotions_yell');"><img src="images/smiley-yell.gif" width="18" height="18" border="0" alt="{$lang_emotions_yell}" title="{$lang_emotions_yell}" /></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Après Largeur: | Hauteur: | Taille: 319 B |
|
|
@ -0,0 +1,2 @@
|
|||
These emotions where taken from Mozilla Thunderbird.
|
||||
I hope they don't get angry if I use them here after all this is a open source project aswell.
|
||||
|
Après Largeur: | Hauteur: | Taille: 354 B |
|
Après Largeur: | Hauteur: | Taille: 329 B |
|
Après Largeur: | Hauteur: | Taille: 331 B |
|
Après Largeur: | Hauteur: | Taille: 344 B |
|
Après Largeur: | Hauteur: | Taille: 340 B |
|
Après Largeur: | Hauteur: | Taille: 336 B |
|
Après Largeur: | Hauteur: | Taille: 338 B |
|
Après Largeur: | Hauteur: | Taille: 344 B |
|
Après Largeur: | Hauteur: | Taille: 321 B |
|
Après Largeur: | Hauteur: | Taille: 325 B |
|
Après Largeur: | Hauteur: | Taille: 345 B |
|
Après Largeur: | Hauteur: | Taille: 342 B |
|
Après Largeur: | Hauteur: | Taille: 328 B |
|
Après Largeur: | Hauteur: | Taille: 337 B |
|
Après Largeur: | Hauteur: | Taille: 351 B |
|
Après Largeur: | Hauteur: | Taille: 336 B |
|
|
@ -0,0 +1,21 @@
|
|||
function init() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
}
|
||||
|
||||
function insertEmotion(file_name, title) {
|
||||
title = tinyMCE.getLang(title);
|
||||
|
||||
if (title == null)
|
||||
title = "";
|
||||
|
||||
// XML encode
|
||||
title = title.replace(/&/g, '&');
|
||||
title = title.replace(/\"/g, '"');
|
||||
title = title.replace(/</g, '<');
|
||||
title = title.replace(/>/g, '>');
|
||||
|
||||
var html = '<img src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" mce_src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" border="0" alt="' + title + '" title="' + title + '" />';
|
||||
|
||||
tinyMCE.execCommand('mceInsertContent', false, html);
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('emotions',{
|
||||
title : 'Insert emotion',
|
||||
desc : 'Emotions',
|
||||
cool : 'Cool',
|
||||
cry : 'Cry',
|
||||
embarassed : 'Embarassed',
|
||||
foot_in_mouth : 'Foot in mouth',
|
||||
frown : 'Frown',
|
||||
innocent : 'Innocent',
|
||||
kiss : 'Kiss',
|
||||
laughing : 'Laughing',
|
||||
money_mouth : 'Money mouth',
|
||||
sealed : 'Sealed',
|
||||
smile : 'Smile',
|
||||
surprised : 'Surprised',
|
||||
tongue_out : 'Tongue out',
|
||||
undecided : 'Undecided',
|
||||
wink : 'Wink',
|
||||
yell : 'Yell'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
.mceItemFlash {
|
||||
border: 1px dotted #cc0000;
|
||||
background-image: url('../images/flash.gif');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-color: #ffffcc;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
.panel_wrapper div.current {
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#width, #height {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#file {
|
||||
width: 250px;
|
||||
}
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
/**
|
||||
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
||||
*
|
||||
* @author Moxiecode
|
||||
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
|
||||
*/
|
||||
|
||||
/* Import plugin specific language pack */
|
||||
tinyMCE.importPluginLanguagePack('flash');
|
||||
|
||||
var TinyMCE_FlashPlugin = {
|
||||
getInfo : function() {
|
||||
return {
|
||||
longname : 'Flash',
|
||||
author : 'Moxiecode Systems AB',
|
||||
authorurl : 'http://tinymce.moxiecode.com',
|
||||
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash',
|
||||
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
||||
};
|
||||
},
|
||||
|
||||
initInstance : function(inst) {
|
||||
if (!tinyMCE.settings['flash_skip_plugin_css'])
|
||||
tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/flash/css/content.css");
|
||||
},
|
||||
|
||||
getControlHTML : function(cn) {
|
||||
switch (cn) {
|
||||
case "flash":
|
||||
return tinyMCE.getButtonHTML(cn, 'lang_flash_desc', '{$pluginurl}/images/flash.gif', 'mceFlash');
|
||||
}
|
||||
|
||||
return "";
|
||||
},
|
||||
|
||||
execCommand : function(editor_id, element, command, user_interface, value) {
|
||||
// Handle commands
|
||||
switch (command) {
|
||||
case "mceFlash":
|
||||
var name = "", swffile = "", swfwidth = "", swfheight = "", action = "insert";
|
||||
var template = new Array();
|
||||
var inst = tinyMCE.getInstanceById(editor_id);
|
||||
var focusElm = inst.getFocusElement();
|
||||
|
||||
template['file'] = '../../plugins/flash/flash.htm'; // Relative to theme
|
||||
template['width'] = 430;
|
||||
template['height'] = 175;
|
||||
|
||||
template['width'] += tinyMCE.getLang('lang_flash_delta_width', 0);
|
||||
template['height'] += tinyMCE.getLang('lang_flash_delta_height', 0);
|
||||
|
||||
// Is selection a image
|
||||
if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
|
||||
name = tinyMCE.getAttrib(focusElm, 'class');
|
||||
|
||||
if (name.indexOf('mceItemFlash') == -1) // Not a Flash
|
||||
return true;
|
||||
|
||||
// Get rest of Flash items
|
||||
swffile = tinyMCE.getAttrib(focusElm, 'alt');
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
swffile = eval(tinyMCE.settings['urlconverter_callback'] + "(swffile, null, true);");
|
||||
|
||||
swfwidth = tinyMCE.getAttrib(focusElm, 'width');
|
||||
swfheight = tinyMCE.getAttrib(focusElm, 'height');
|
||||
action = "update";
|
||||
}
|
||||
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", swffile : swffile, swfwidth : swfwidth, swfheight : swfheight, action : action});
|
||||
return true;
|
||||
}
|
||||
|
||||
// Pass to next handler in chain
|
||||
return false;
|
||||
},
|
||||
|
||||
cleanup : function(type, content) {
|
||||
switch (type) {
|
||||
case "insert_to_editor_dom":
|
||||
// Force relative/absolute
|
||||
if (tinyMCE.getParam('convert_urls')) {
|
||||
var imgs = content.getElementsByTagName("img");
|
||||
for (var i=0; i<imgs.length; i++) {
|
||||
if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
|
||||
var src = tinyMCE.getAttrib(imgs[i], "alt");
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
|
||||
|
||||
imgs[i].setAttribute('alt', src);
|
||||
imgs[i].setAttribute('title', src);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "get_from_editor_dom":
|
||||
var imgs = content.getElementsByTagName("img");
|
||||
for (var i=0; i<imgs.length; i++) {
|
||||
if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
|
||||
var src = tinyMCE.getAttrib(imgs[i], "alt");
|
||||
|
||||
if (tinyMCE.getParam('convert_urls'))
|
||||
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
|
||||
|
||||
imgs[i].setAttribute('alt', src);
|
||||
imgs[i].setAttribute('title', src);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "insert_to_editor":
|
||||
var startPos = 0;
|
||||
var embedList = new Array();
|
||||
|
||||
// Fix the embed and object elements
|
||||
content = content.replace(new RegExp('<[ ]*embed','gi'),'<embed');
|
||||
content = content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');
|
||||
content = content.replace(new RegExp('<[ ]*object','gi'),'<object');
|
||||
content = content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');
|
||||
|
||||
// Parse all embed tags
|
||||
while ((startPos = content.indexOf('<embed', startPos+1)) != -1) {
|
||||
var endPos = content.indexOf('>', startPos);
|
||||
var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 6, endPos));
|
||||
embedList[embedList.length] = attribs;
|
||||
}
|
||||
|
||||
// Parse all object tags and replace them with images from the embed data
|
||||
var index = 0;
|
||||
while ((startPos = content.indexOf('<object', startPos)) != -1) {
|
||||
if (index >= embedList.length)
|
||||
break;
|
||||
|
||||
var attribs = embedList[index];
|
||||
|
||||
// Find end of object
|
||||
endPos = content.indexOf('</object>', startPos);
|
||||
endPos += 9;
|
||||
|
||||
// Insert image
|
||||
var contentAfter = content.substring(endPos);
|
||||
content = content.substring(0, startPos);
|
||||
content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
|
||||
content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
|
||||
content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
|
||||
content += contentAfter;
|
||||
index++;
|
||||
|
||||
startPos++;
|
||||
}
|
||||
|
||||
// Parse all embed tags and replace them with images from the embed data
|
||||
var index = 0;
|
||||
while ((startPos = content.indexOf('<embed', startPos)) != -1) {
|
||||
if (index >= embedList.length)
|
||||
break;
|
||||
|
||||
var attribs = embedList[index];
|
||||
|
||||
// Find end of embed
|
||||
endPos = content.indexOf('>', startPos);
|
||||
endPos += 9;
|
||||
|
||||
// Insert image
|
||||
var contentAfter = content.substring(endPos);
|
||||
content = content.substring(0, startPos);
|
||||
content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
|
||||
content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
|
||||
content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
|
||||
content += contentAfter;
|
||||
index++;
|
||||
|
||||
startPos++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "get_from_editor":
|
||||
// Parse all img tags and replace them with object+embed
|
||||
var startPos = -1;
|
||||
|
||||
while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
|
||||
var endPos = content.indexOf('/>', startPos);
|
||||
var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos));
|
||||
|
||||
// Is not flash, skip it
|
||||
if (attribs['class'] != "mceItemFlash")
|
||||
continue;
|
||||
|
||||
endPos += 2;
|
||||
|
||||
var embedHTML = '';
|
||||
var wmode = tinyMCE.getParam("flash_wmode", "");
|
||||
var quality = tinyMCE.getParam("flash_quality", "high");
|
||||
var menu = tinyMCE.getParam("flash_menu", "false");
|
||||
|
||||
// Insert object + embed
|
||||
embedHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
|
||||
embedHTML += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
|
||||
embedHTML += ' width="' + attribs["width"] + '" height="' + attribs["height"] + '">';
|
||||
embedHTML += '<param name="movie" value="' + attribs["title"] + '" />';
|
||||
embedHTML += '<param name="quality" value="' + quality + '" />';
|
||||
embedHTML += '<param name="menu" value="' + menu + '" />';
|
||||
embedHTML += '<param name="wmode" value="' + wmode + '" />';
|
||||
embedHTML += '<embed src="' + attribs["title"] + '" wmode="' + wmode + '" quality="' + quality + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + attribs["width"] + '" height="' + attribs["height"] + '"></embed></object>';
|
||||
|
||||
// Insert embed/object chunk
|
||||
chunkBefore = content.substring(0, startPos);
|
||||
chunkAfter = content.substring(endPos);
|
||||
content = chunkBefore + embedHTML + chunkAfter;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Pass through to next handler in chain
|
||||
return content;
|
||||
},
|
||||
|
||||
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
||||
if (node == null)
|
||||
return;
|
||||
|
||||
do {
|
||||
if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) {
|
||||
tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected');
|
||||
return true;
|
||||
}
|
||||
} while ((node = node.parentNode));
|
||||
|
||||
tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal');
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
// Private plugin internal functions
|
||||
|
||||
_parseAttributes : function(attribute_string) {
|
||||
var attributeName = "";
|
||||
var attributeValue = "";
|
||||
var withInName;
|
||||
var withInValue;
|
||||
var attributes = new Array();
|
||||
var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
|
||||
|
||||
if (attribute_string == null || attribute_string.length < 2)
|
||||
return null;
|
||||
|
||||
withInName = withInValue = false;
|
||||
|
||||
for (var i=0; i<attribute_string.length; i++) {
|
||||
var chr = attribute_string.charAt(i);
|
||||
|
||||
if ((chr == '"' || chr == "'") && !withInValue)
|
||||
withInValue = true;
|
||||
else if ((chr == '"' || chr == "'") && withInValue) {
|
||||
withInValue = false;
|
||||
|
||||
var pos = attributeName.lastIndexOf(' ');
|
||||
if (pos != -1)
|
||||
attributeName = attributeName.substring(pos+1);
|
||||
|
||||
attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
|
||||
|
||||
attributeName = "";
|
||||
attributeValue = "";
|
||||
} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
|
||||
withInName = true;
|
||||
|
||||
if (chr == '=' && withInName)
|
||||
withInName = false;
|
||||
|
||||
if (withInName)
|
||||
attributeName += chr;
|
||||
|
||||
if (withInValue)
|
||||
attributeValue += chr;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.addPlugin("flash", TinyMCE_FlashPlugin);
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{$lang_flash_title}</title>
|
||||
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="jscripts/flash.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
||||
<link href="css/flash.css" rel="stylesheet" type="text/css" />
|
||||
<base target="_self" />
|
||||
</head>
|
||||
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
||||
<form onsubmit="insertFlash();return false;" action="#">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_flash_general}</a></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel_wrapper">
|
||||
<div id="general_panel" class="panel current">
|
||||
<fieldset>
|
||||
<legend>{$lang_flash_general}</legend>
|
||||
|
||||
<table border="0" cellpadding="4" cellspacing="0">
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label for="file">{$lang_flash_file}</label></td>
|
||||
<td nowrap="nowrap">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><input id="file" name="file" type="text" value="" onfocus="this.select();" /></td>
|
||||
<td id="filebrowsercontainer"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="linklistrow">
|
||||
<td><label for="linklist">{$lang_flash_list}</label></td>
|
||||
<td id="linklistcontainer"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><label>{$lang_flash_size}</label></td>
|
||||
<td nowrap="nowrap">
|
||||
<input type="text" id="width" name="width" value="" onfocus="this.select();" />
|
||||
<select name="width2" id="width2" style="width: 50px">
|
||||
<option value="">px</option>
|
||||
<option value="%">%</option>
|
||||
</select> x <input id="height" name="height" type="text" value="" onfocus="this.select();" />
|
||||
<select name="height2" id="height2" style="width: 50px">
|
||||
<option value="">px</option>
|
||||
<option value="%">%</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertFlash();" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
Après Largeur: | Hauteur: | Taille: 241 B |
|
|
@ -0,0 +1,107 @@
|
|||
var url = tinyMCE.getParam("flash_external_list_url");
|
||||
if (url != null) {
|
||||
// Fix relative
|
||||
if (url.charAt(0) != '/' && url.indexOf('://') == -1)
|
||||
url = tinyMCE.documentBasePath + "/" + url;
|
||||
|
||||
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
|
||||
}
|
||||
|
||||
function init() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
document.getElementById("filebrowsercontainer").innerHTML = getBrowserHTML('filebrowser','file','flash','flash');
|
||||
|
||||
// Image list outsrc
|
||||
var html = getFlashListHTML('filebrowser','file','flash','flash');
|
||||
if (html == "")
|
||||
document.getElementById("linklistrow").style.display = 'none';
|
||||
else
|
||||
document.getElementById("linklistcontainer").innerHTML = html;
|
||||
|
||||
var formObj = document.forms[0];
|
||||
var swffile = tinyMCE.getWindowArg('swffile');
|
||||
var swfwidth = '' + tinyMCE.getWindowArg('swfwidth');
|
||||
var swfheight = '' + tinyMCE.getWindowArg('swfheight');
|
||||
|
||||
if (swfwidth.indexOf('%')!=-1) {
|
||||
formObj.width2.value = "%";
|
||||
formObj.width.value = swfwidth.substring(0,swfwidth.length-1);
|
||||
} else {
|
||||
formObj.width2.value = "px";
|
||||
formObj.width.value = swfwidth;
|
||||
}
|
||||
|
||||
if (swfheight.indexOf('%')!=-1) {
|
||||
formObj.height2.value = "%";
|
||||
formObj.height.value = swfheight.substring(0,swfheight.length-1);
|
||||
} else {
|
||||
formObj.height2.value = "px";
|
||||
formObj.height.value = swfheight;
|
||||
}
|
||||
|
||||
formObj.file.value = swffile;
|
||||
formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true);
|
||||
|
||||
selectByValue(formObj, 'linklist', swffile);
|
||||
|
||||
// Handle file browser
|
||||
if (isVisible('filebrowser'))
|
||||
document.getElementById('file').style.width = '230px';
|
||||
|
||||
// Auto select flash in list
|
||||
if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
|
||||
for (var i=0; i<formObj.linklist.length; i++) {
|
||||
if (formObj.linklist.options[i].value == tinyMCE.getWindowArg('swffile'))
|
||||
formObj.linklist.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getFlashListHTML() {
|
||||
if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
|
||||
var html = "";
|
||||
|
||||
html += '<select id="linklist" name="linklist" style="width: 250px" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.file.value=this.options[this.selectedIndex].value;">';
|
||||
html += '<option value="">---</option>';
|
||||
|
||||
for (var i=0; i<tinyMCEFlashList.length; i++)
|
||||
html += '<option value="' + tinyMCEFlashList[i][1] + '">' + tinyMCEFlashList[i][0] + '</option>';
|
||||
|
||||
html += '</select>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function insertFlash() {
|
||||
var formObj = document.forms[0];
|
||||
var html = '';
|
||||
var file = formObj.file.value;
|
||||
var width = formObj.width.value;
|
||||
var height = formObj.height.value;
|
||||
if (formObj.width2.value=='%') {
|
||||
width = width + '%';
|
||||
}
|
||||
if (formObj.height2.value=='%') {
|
||||
height = height + '%';
|
||||
}
|
||||
|
||||
if (width == "")
|
||||
width = 100;
|
||||
|
||||
if (height == "")
|
||||
height = 100;
|
||||
|
||||
html += ''
|
||||
+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" mce_src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
|
||||
+ 'width="' + width + '" height="' + height + '" '
|
||||
+ 'border="0" alt="' + file + '" title="' + file + '" class="mceItemFlash" />';
|
||||
|
||||
tinyMCEPopup.execCommand("mceInsertContent", true, html);
|
||||
tinyMCE.selectedInstance.repaint();
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCE.addToLang('flash',{
|
||||
title : 'Insert / edit Flash Movie',
|
||||
desc : 'Insert / edit Flash Movie',
|
||||
file : 'Flash-File (.swf)',
|
||||
size : 'Size',
|
||||
list : 'Flash files',
|
||||
props : 'Flash properties',
|
||||
general : 'General'
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
Check the TinyMCE documentation for details on this plugin.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>blank_page</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body onload="parent.setupIframe(document);">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
/* Hide the advanced tab */
|
||||
#advanced_tab {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
#doctype, #docencoding {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
#langcode {
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
#bgimage {
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
#fontface {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
#leftmargin, #rightmargin, #topmargin, #bottommargin {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.panel_wrapper div.current {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
#stylesheet, #style {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
/* Head list classes */
|
||||
|
||||
.headlistwrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.addbutton, .removebutton, .moveupbutton, .movedownbutton {
|
||||
border-top: 1px solid;
|
||||
border-left: 1px solid;
|
||||
border-bottom: 1px solid;
|
||||
border-right: 1px solid;
|
||||
border-color: #F0F0EE;
|
||||
cursor: default;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {
|
||||
border: 1px solid #0A246A;
|
||||
background-color: #B6BDD2;
|
||||
}
|
||||
|
||||
.addbutton {
|
||||
background-image: url('../images/add.gif');
|
||||
float: left;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.removebutton {
|
||||
background-image: url('../images/remove.gif');
|
||||
float: left;
|
||||
}
|
||||
|
||||
.moveupbutton {
|
||||
background-image: url('../images/move_up.gif');
|
||||
float: left;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.movedownbutton {
|
||||
background-image: url('../images/move_down.gif');
|
||||
float: left;
|
||||
}
|
||||
|
||||
.selected {
|
||||
border: 1px solid #0A246A;
|
||||
background-color: #B6BDD2;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#headlist {
|
||||
width: 100%;
|
||||
margin-top: 3px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#addmenu {
|
||||
position: absolute;
|
||||
border: 1px solid gray;
|
||||
display: none;
|
||||
z-index: 100;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#addmenu a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
line-height: 20px;
|
||||
text-decoration: none;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#addmenu a:hover {
|
||||
background-color: #B6BDD2;
|
||||
color: black;
|
||||
}
|
||||
|
||||
#addmenu span {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#updateElementPanel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#script_element .panel_wrapper div.current {
|
||||
height: 108px;
|
||||
}
|
||||
|
||||
#style_element .panel_wrapper div.current {
|
||||
height: 108px;
|
||||
}
|
||||
|
||||
#link_element .panel_wrapper div.current {
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
#element_script_value {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#element_comment_value {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
#element_style_value {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.updateElementButton {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* MSIE specific styles */
|
||||
|
||||
* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||