--- /dev/null
+
+ mtweb 0.4.1
+
+copyright dj3c1t 2011
+programme en GNU/GPLv3
+
+
+mtweb est une base de programmation pour application web.
+
+
+ce programme utilise, dans le dossier libs :
+
+ - TinyMCE
+ http://tinymce.moxiecode.com/
+
+ - une classe Php sxml, tres utile, et trouvee ici :
+ http://www.shop24-7.info/32-0-simplexml-alternative-php4.html
+
+ - Ptitcaptcha, une classe Php pour un captcha (anti-spam)
+ http://www.jpfox.fr/?post/2007/10/24/190-un-petit-captcha-en-php
+
+ - InputFilter, une class Php pour filtrer les balises et les attributs
+ HTML dangereux dans les description des sources
+ http://www.phpclasses.org/inputfilter
+
+installation :
+--------------
+
+installation rapide :
+
+ - l'archive mtweb<version>.tar.gz contient un dossier "web"
+ - uploadez le contenu de ce dossier a la racine de votre site
+ - assurez-vous que Php a le droit d'ecrire dans le dossier "content"
+ (et dans ses fichiers et sous-dossiers)
+
+Par defaut, mtweb stocke ses donnees dans des fichiers XML.
+
+pour utilisez le stockage des donnees avec MySql :
+
+ - importez les tables fournies dans le fichier "content/data/sql/mysql/mtweb.sql"
+ - puis dans le fichier "config.php" :
+ - commentez la partie relative aux donnees XML
+ - decommentez la partie relative aux donnees MySql
+ - adaptez les informations pour MySql avec vos parametres de connexion
+
+pour une premiere utilisation, vous pouvez vous identifier avec :
+
+login: admin
+pass: adminpass
+
+pensez a changer le mot de passe
+
+
+documentation :
+---------------
+
+Plus d'infos en ligne :
+http://mtweb.dj3c1t.com
+
+
+historique des modifications :
+------------------------------
+
+0.4.1 :
+-------
+
+3 Janv 2012
+
+la version 0.4, qui introduit les plugins, en contient trois
+dans son repertoire "plugins".
+
+dans cette version, seule l'application principale est fournie.
+
+les plugins restent disponibles, mais via leur propre archive.
+
+
+0.4 :
+-----
+
+30 Dec 2011
+
+version extraite de sourceML.0.13
+
+ajout d'un systeme de plugins
+l'appli gere aussi maintenant une arborescence de liens
+
+changement de methode pour les surcharges. le dossier "app/local"
+disparait et le contenu du dossier "app/core" descent dans "app/"
+les surcharges se font maintenant avec les plugins.
+
+
+0.3.2 :
+-------
+
+Utilisation d'un cache en RAM pour les donnees gerees en XML.
+
+0.3.1 :
+-------
+
+Ajout d'un exemple d'application, pour un agenda en ligne.
+
+0.3 :
+-----
+
+Cette version a ete extraite de la dernier version de sourceML (sourceML.0.10)
+
+marche avec Mysql ou XML
--- /dev/null
+# ------------------------------------------------------------------------------------
+# le template par defaut de mtweb utilise les "short tags" php pour l'affichage, dans
+# les fichiers php du dossier "out". Si ces "short tags" ne sont pas disponibles par
+# defaut sur votre hebergement, essayez en decommentant la ligne suivante.
+# ------------------------------------------------------------------------------------
+
+# php_value short_open_tag On
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+
+ <bdd>
+ <table_prefix_code>#--</table_prefix_code>
+ </bdd>
+
+ <config>
+ <default_allow>1</default_allow>
+ </config>
+
+ <params>
+ <e>e</e>
+ <id>id</id>
+ <user>user</user>
+ <status>status</status>
+ <from>from</from>
+ <start>start</start>
+ <alpha>alpha</alpha>
+ <form>form</form>
+ </params>
+
+</config>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_mysql
+ {
+ var $link;
+
+ var $host;
+ var $base;
+ var $user;
+ var $password;
+
+ var $EXTENTION_OK;
+
+ function extention_ok(&$env) { return $this->EXTENTION_OK; }
+
+ function mw_mysql($host, $base, $user, $password)
+ { $this->host = $host;
+ $this->base = $base;
+ $this->user = $user;
+ $this->password = $password;
+ $this->EXTENTION_OK = function_exists("mysql_connect");
+ }
+
+ function connect($host, $base, $user, $password)
+ { $this->link = @mysql_connect($host, $user, $password);
+ if(!$this->link) return null;
+ @mysql_query("SET NAMES 'utf8'");
+ if($base)
+ { $connected = @mysql_select_db($base, $this->link);
+ if(!$connected) return null;
+ }
+ return true;
+ }
+
+ function select_db($db_name)
+ { $this->base = $db_name;
+ if(!$this->link)
+ { if(!$this->connect($this->host, $this->base, $this->user, $this->password)) return null;
+ }
+ return $this->query("USE ".$db_name);
+ }
+
+ function table_exists($table_name)
+ { $sql = "SHOW TABLES LIKE '".$table_name."'";
+ $rst = $this->query($sql);
+ if(isset($rst))
+ { $exists = false;
+ $v_rst = $this->fetch_assoc($rst);
+ if($v_rst) $exists = true;
+ $this->free_result($rst);
+ return $exists;
+ }
+ return null;
+ }
+
+ function query($query_string)
+ { if(!$this->link)
+ { if(!$this->connect($this->host, $this->base, $this->user, $this->password)) return null;
+ }
+ $result = @mysql_query($query_string, $this->link);
+ if(!$result) return null;
+ return $result;
+ }
+
+ function fetch_assoc($rst)
+ { if($rst && $this->link) return mysql_fetch_assoc($rst);
+ return null;
+ }
+
+ function insert_id()
+ { if($this->link) return mysql_insert_id($this->link);
+ return null;
+ }
+
+ function free_result($rst)
+ { if($rst && $this->link) return mysql_free_result($rst);
+ return null;
+ }
+
+ function close()
+ { if($this->link) return mysql_close($this->link);
+ return null;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_xml
+ {
+
+ var $host;
+ var $base;
+ var $user;
+ var $password;
+
+ var $EXTENTION_OK;
+
+ var $xml_data;
+
+ var $data_handlers;
+ var $last_data_handler;
+
+ function mw_xml($host, $base, $user, $password)
+ { $this->init_xml_env($host, $base, $user, $password);
+ $this->EXTENTION_OK = true;
+ }
+
+ function extention_ok(&$env)
+ { if($this->EXTENTION_OK)
+ { if
+ ( file_exists($env->app_file("data/impl/xml/mw_xml_data.php"))
+ && file_exists($env->app_file("data/impl/xml/mw_xml_data_handler.php"))
+ )
+ { require $env->app_file("data/impl/xml/mw_xml_data.php");
+ require $env->app_file("data/impl/xml/mw_xml_data_handler.php");
+ if
+ ( class_exists("mw_xml_data")
+ && class_exists("mw_xml_data_handler")
+ )
+ { $this->xml_data = new mw_xml_data($this->host, $this->base);
+ }
+ else $this->EXTENTION_OK = false;
+ }
+ else $this->EXTENTION_OK = false;
+ }
+ return $this->EXTENTION_OK;
+ }
+
+ function init_xml_env($host, $base, $user, $password)
+ { $this->host = $host.($host && substr($host, -1) != "/" ? "/" : "");
+ $this->base = $base.($base && substr($base, -1) != "/" ? "/" : "");
+ $this->user = $user;
+ $this->password = $password;
+ $this->data_handlers = array();
+ $this->last_data_handler = 0;
+ }
+
+ function connect($host, $base, $user, $password)
+ { if($host.$base && is_dir($host.$base) && is_writable($host.$base))
+ { $this->init_xml_env($host, $base, $user, $password);
+ $this->xml_data = new mw_xml_data($this->host, $this->base);
+ return true;
+ }
+ return null;
+ }
+
+ function select_db($base)
+ { $this->base = $base.($base && substr($base, -1) != "/" ? "/" : "");
+ return $this->connect($this->host, $this->base, $this->user, $this->password);
+ }
+
+ function data_exists($data_path)
+ { return is_dir($this->host.$this->base.$data_path);
+ }
+
+ function create_data($data_path)
+ { if(!is_dir($this->host.$this->base.$data_path)) @mkdir($this->host.$this->base.$data_path);
+ if(is_dir($this->host.$this->base.$data_path))
+ { if($dh = $this->open_data($data_path, false))
+ { $this->close_data($dh);
+ return true;
+ }
+ }
+ return null;
+ }
+
+ function get_data($data_path, $data_id)
+ { $dh = ++$this->last_data_handler;
+ $this->data_handlers[$dh] = new mw_xml_data_handler($this->xml_data, $data_path);
+ if($this->data_handlers[$dh]->open_data(false))
+ { $res = $this->data_handlers[$dh]->get_data($data_id);
+ $this->close_data($dh);
+ return $res;
+ }
+ return null;
+ }
+
+ function open_data($data_path, $FETCH = true)
+ { $dh = ++$this->last_data_handler;
+ $this->data_handlers[$dh] = new mw_xml_data_handler($this->xml_data, $data_path);
+ if($this->data_handlers[$dh]->open_data($FETCH))
+ { return $dh;
+ }
+ $this->close_data($dh);
+ return null;
+ }
+
+ function fetch_data($dh)
+ { if(isset($this->data_handlers[$dh]))
+ { return $this->data_handlers[$dh]->fetch_assoc();
+ }
+ return false;
+ }
+
+ function add_data($data_path, $data)
+ { $dh = ++$this->last_data_handler;
+ $this->data_handlers[$dh] = new mw_xml_data_handler($this->xml_data, $data_path);
+ if($this->data_handlers[$dh]->open_data(false))
+ { $res = $this->data_handlers[$dh]->add_data($data);
+ if($res) $res = $this->last_index($dh);
+ $this->close_data($dh);
+ return $res;
+ }
+ return null;
+ }
+
+ function last_index($dh)
+ { if(isset($this->data_handlers[$dh]))
+ { return $this->data_handlers[$dh]->last_index;
+ }
+ return null;
+ }
+
+ function set_data($data_path, $data_id, $data)
+ { $dh = ++$this->last_data_handler;
+ $this->data_handlers[$dh] = new mw_xml_data_handler($this->xml_data, $data_path);
+ if($this->data_handlers[$dh]->open_data(false))
+ { $res = $this->data_handlers[$dh]->set_data($data_id.".xml", $data);
+ $this->close_data($dh);
+ return $res;
+ }
+ return null;
+ }
+
+ function del_data($data_path, $data_id)
+ { $dh = ++$this->last_data_handler;
+ $this->data_handlers[$dh] = new mw_xml_data_handler($this->xml_data, $data_path);
+ if($this->data_handlers[$dh]->open_data(false))
+ { $res = $this->data_handlers[$dh]->del_data($data_id.".xml");
+ $this->close_data($dh);
+ return $res;
+ }
+ return null;
+ }
+
+ function close_data($dh)
+ { if(isset($this->data_handlers[$dh]))
+ { $this->data_handlers[$dh]->close_data();
+ unset($this->data_handlers[$dh]);
+ }
+ }
+
+ function remove_data($data_path)
+ { $OK = strlen($data_path) > 0;
+ if($OK && is_dir($this->host.$this->base.$data_path) && is_writable($this->host.$this->base.$data_path))
+ { $data_path .= substr($data_path, -1) == "/" ? "" : "/";
+ if($dh = opendir($this->host.$this->base.$data_path))
+ { while($OK && ($file = readdir($dh)) !== false)
+ { if(is_dir($this->host.$this->base.$data_path.$file))
+ { if($file != "." && $file != "..") $OK = $this->remove_data($data_path.$file);
+ }
+ else $OK = @unlink($this->host.$this->base.$data_path.$file);
+ }
+ closedir($dh);
+ }
+ else $OK = null;
+ }
+ else $OK = null;
+ if($OK) @rmdir($this->host.$this->base.$data_path);
+ return $OK;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_xml_data
+ {
+ var $host;
+ var $base;
+
+ var $sxml;
+
+ var $cache;
+ var $buffer;
+
+ function mw_xml_data($host, $base)
+ { $this->host = $host.(substr($host, -1) != "/" ? "/" : "");
+ $this->base = $base.(substr($base, -1) != "/" ? "/" : "");
+ $this->cache = array();
+ }
+
+ function host() { return $this->host; }
+ function base() { return $this->base; }
+
+ function use_cache() { return true; }
+
+ function set_cache($data_name, $data, $data_id)
+ { if($this->use_cache())
+ { $this->cache[$data_name] = $data;
+ $this->cache[$data_name]["id"] = $data_id;
+ }
+ }
+
+ function get_data($data_path, $data_id)
+ { $data_name = $this->data_name($data_path, $data_id);
+ if(isset($this->cache[$data_name])) return $this->cache[$data_name];
+ if($this->buffer = @file_get_contents($data_name))
+ { if(($data = $this->parse_data()) !== false)
+ { $this->set_cache($data_name, $data, $data_id);
+ $data["id"] = $data_id;
+ return $data;
+ }
+ }
+ return false;
+ }
+
+ function add_data($data_path, $data_id, $data)
+ { return $this->_set_data($data_path, $data_id, $data);
+ }
+
+ function set_data($data_path, $data_id, $data)
+ { return $this->_set_data($data_path, $data_id, $data);
+ }
+
+ function _set_data($data_path, $data_id, $data)
+ { if($fh = @fopen($this->data_name($data_path, $data_id), "w"))
+ { $this->buffer = $this->serialize_data($data);
+ if(@fwrite($fh, $this->buffer) !== false)
+ { @fclose($fh);
+ $this->buffer = null;
+ $data_name = $this->data_name($data_path, $data_id);
+ $this->set_cache($data_name, $data, $data_id);
+ return $data_id;
+ }
+ else
+ { @fclose($fh);
+ $this->buffer = null;
+ }
+ }
+ return null;
+ }
+
+ function del_data($data_path, $data_id)
+ { $data_name = $this->data_name($data_path, $data_id);
+ if(isset($this->cache[$data_name])) unset($this->cache[$data_name]);
+ return @unlink($this->data_name($data_path, $data_id));
+ }
+
+ function data_name($data_path, $data_id)
+ { return $this->host.$this->base.$data_path.$data_id.".xml";
+ }
+
+ function parse_data()
+ { if(!isset($this->sxml)) $this->sxml = new sxml();
+ $this->sxml->parse($this->buffer);
+ if(isset($this->sxml->data["tuple"][0]))
+ { $this->buffer = $this->sxml->data["tuple"][0];
+ $v_rst = array();
+ foreach($this->buffer["subs"] as $key => $value)
+ { $v_rst[$key] = $value[0]["data"];
+ }
+ return $v_rst;
+ }
+ return false;
+ }
+
+ function serialize_data($data)
+ { $this->buffer = "<tuple>\n";
+ foreach($data as $key => $value)
+ { if(isset($value)) $this->buffer .= " <".$key."><![CDATA[".$value."]]></".$key.">\n";
+ }
+ $this->buffer .= "</tuple>\n";
+ return $this->buffer;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_xml_data_handler
+ {
+ var $xml_data;
+ var $data_path;
+ var $data_path_handler;
+ var $last_index;
+
+ function mw_xml_data_handler($xml_data, $data_path)
+ { $this->xml_data = $xml_data;
+ $this->data_path = $data_path.(substr($data_path, -1) != "/" ? "/" : "");
+ }
+
+ function get_data($data_id)
+ { if(file_exists($this->xml_data->host().$this->xml_data->base().$this->data_path.$data_id.".xml"))
+ { return $this->xml_data->get_data($this->data_path, $data_id);
+ }
+ return false;
+ }
+
+ function open_data($FETCH = true)
+ { clearstatcache();
+ $INDEX_OK = false;
+ if($this->xml_data->host() && $this->xml_data->base() && $this->data_path)
+ { if(is_dir($this->xml_data->host().$this->xml_data->base().$this->data_path) && is_writable($this->xml_data->host().$this->xml_data->base().$this->data_path))
+ { if(!file_exists($this->xml_data->host().$this->xml_data->base().$this->data_path.".index"))
+ { if($fh = @fopen($this->xml_data->host().$this->xml_data->base().$this->data_path.".index", "w+"))
+ { if(@fwrite($fh, "0"))
+ { $this->last_index = 0;
+ @fclose($fh);
+ $INDEX_OK = true;
+ }
+ else @fclose($fh);
+ }
+ }
+ else
+ { if(($this->buffer = @file_get_contents($this->xml_data->host().$this->xml_data->base().$this->data_path.".index")) !== false)
+ { if(preg_match("/^[0-9]+$/", $this->buffer))
+ { $this->last_index = (int)$this->buffer;
+ $INDEX_OK = true;
+ }
+ }
+ }
+ }
+ }
+ if($INDEX_OK)
+ { if($FETCH)
+ { if($this->data_path_handler = @opendir($this->xml_data->host().$this->xml_data->base().$this->data_path))
+ { return true;
+ }
+ else
+ { $this->close_data();
+ return null;
+ }
+ }
+ else return true;
+ }
+ else
+ { $this->close_data();
+ return null;
+ }
+ }
+
+ function fetch_assoc()
+ { if($this->data_path_handler)
+ { $FORMAT_OK = false;
+ while(!$FORMAT_OK && ($data_file = @readdir($this->data_path_handler)) !== false)
+ { if(substr($data_file, 0, 1) != "." && substr($data_file, -4) == ".xml") $FORMAT_OK = true;
+ }
+ if($FORMAT_OK) return $this->xml_data->get_data($this->data_path, substr($data_file, 0, -4));
+ }
+ return false;
+ }
+
+ function add_data($data)
+ { $index = $this->inc_index();
+ if(isset($index))
+ { if(is_array($data)) return $this->xml_data->add_data($this->data_path, $index, $data);
+ }
+ return null;
+ }
+
+ function inc_index()
+ { clearstatcache();
+ if(isset($this->last_index))
+ { $index = $this->last_index + 1;
+ if($fh = @fopen($this->xml_data->host().$this->xml_data->base().$this->data_path.".index", "w+"))
+ { if(@fwrite($fh, (string)$index))
+ { $this->last_index = $index;
+ @fclose($fh);
+ return $index;
+ }
+ else @fclose($fh);
+ }
+ }
+ return null;
+ }
+
+ function set_data($data_file, $data)
+ { if(preg_match("/^[0-9]+\.xml$/", $data_file))
+ { if(is_writable($this->xml_data->host().$this->xml_data->base().$this->data_path.$data_file))
+ { if(is_array($data))
+ { return $this->xml_data->set_data($this->data_path, substr($data_file, 0, -4), $data);
+ }
+ }
+ }
+ return null;
+ }
+
+ function del_data($data_file)
+ { if(preg_match("/^[0-9]+\.xml$/", $data_file))
+ { if(is_file($this->xml_data->host().$this->xml_data->base().$this->data_path.$data_file))
+ { return $this->xml_data->del_data($this->data_path, substr($data_file, 0, -4));
+ }
+ }
+ return null;
+ }
+
+ function close_data()
+ { $this->data_path= null;
+ if($this->data_path_handler) @closedir($this->data_path_handler);
+ $this->last_index = null;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_check_instance extends mw_data
+ {
+
+ function check_instance()
+ { return true;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_images extends mw_data
+ {
+
+ function img_size($file, $max_width, $max_height)
+ { $img_infos = getimagesize($file);
+ $img_size = array();
+ if($img_infos)
+ { if($img_infos[0] > $max_width || $img_infos[1] > $max_height)
+ { $r = $max_width / $img_infos[0];
+ if($r * $img_infos[1] > $max_height) $r = $max_height / $img_infos[1];
+ return array
+ ( "width" => floor($r * $img_infos[0]),
+ "height" => floor($r * $img_infos[1])
+ );
+ }
+ return array
+ ( "width" => $img_infos[0],
+ "height" => $img_infos[1]
+ );
+ }
+ return false;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_init extends mw_data
+ {
+ var $env;
+ var $sgbd;
+
+ function env() { return $this->env; }
+ function sgbd() { return $this->sgbd; }
+
+ function set_env(&$env) { $this->env = &$env; }
+ function set_sgbd(&$sgbd) { $this->sgbd = &$sgbd; }
+
+ function table_prefix() { return false; }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_links extends mw_data
+ {
+ var $links;
+
+ function init_links()
+ { $this->links = array();
+ return true;
+ }
+
+ function load_link(&$links, $v_path, $url, $intitule = "", $position = 0)
+ { if($path_item = array_shift($v_path))
+ { if(!isset($links[$path_item])) $links[$path_item] = array
+ ( "nom" => $path_item,
+ "url" => $v_path ? null : $url,
+ "intitule" => $v_path ? null : $intitule,
+ "subs" => array(),
+ "position" => 0
+ );
+ if($v_path) $this->load_link($links[$path_item]["subs"], $v_path, $url, $intitule, $position);
+ else
+ { $links[$path_item]["nom"] = $path_item;
+ $links[$path_item]["url"] = $url;
+ $links[$path_item]["intitule"] = $intitule;
+ $links[$path_item]["position"] = $position;
+ }
+ }
+ }
+
+ function valid_link_path($path)
+ { $v_path = explode("/", $path);
+ $SYNTAX_OK = true;
+ foreach($v_path as $i => $path_item)
+ { if($path_item)
+ { if(!preg_match("/^[a-zA-Z]+[a-zA-Z0-9\-_\.]*$/", $path_item))
+ { $SYNTAX_OK = false;
+ break;
+ }
+ }
+ else unset($v_path[$i]);
+ }
+ return $v_path && $SYNTAX_OK ? $v_path : false;
+ }
+
+ function get_link($path = null)
+ { if(!isset($this->links)) $this->init_links();
+ if($this->links !== false)
+ { if(!isset($path)) return $this->links;
+ if($v_path = $this->valid_link_path($path))
+ { return $this->_get_link($this->links, $v_path);
+ }
+ }
+ return false;
+ }
+
+ function _get_link($links, $v_path)
+ { if($path_item = array_shift($v_path))
+ { if(isset($links[$path_item]))
+ { if($v_path) return $this->_get_link($links[$path_item]["subs"], $v_path);
+ else return $links[$path_item];
+ }
+ else return false;
+ }
+ }
+
+ function set_link($path, $url, $intitule = "", $position = 0)
+ { if(!isset($this->links)) $this->init_links();
+ if($v_path = $this->valid_link_path($path))
+ { $this->load_link($this->links, $v_path, $url, $intitule, $position);
+ $this->links = $this->ordonne_links($this->links);
+ }
+ }
+
+ function ordonne_links($links)
+ { if(!is_array($links)) return false;
+ $values = array_values($links);
+ $maximum = count($values);
+ while($maximum > 0)
+ { $maximumTemporaire = 0;
+ for($i = 0; $i < $maximum - 1; $i++)
+ { if($values[$i]["position"] > $values[$i + 1]["position"])
+ { $tmp = $values[$i];
+ $values[$i] = $values[$i + 1];
+ $values[$i + 1] = $tmp;
+ $maximumTemporaire = $i + 1;
+ }
+ }
+ $maximum = $maximumTemporaire;
+ }
+ $res = array();
+ foreach($values as $value) { if($value["nom"]) $res[$value["nom"]] = $value; }
+ foreach($res as $nom => $sub) { if($sub["subs"]) $res[$nom]["subs"] = $this->ordonne_links($res[$nom]["subs"]); }
+ return $res;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_out_config extends mw_data
+ {
+
+ function out_config()
+ { $env = $this->env();
+ $config = array();
+ if($env->out_file_exists("config.xml"))
+ { if($this->buffer = file_get_contents($env->out_file("config.xml")))
+ { if(!isset($this->sxml)) $this->sxml = new sxml();
+ $this->sxml->parse($this->buffer);
+ $this->buffer = $this->sxml->data["config"][0];
+ if($this->buffer["subs"]) foreach($this->buffer["subs"] as $key => $value)
+ { $config[$key] = array
+ ( "type" => $value[0]["attrs"]["type"],
+ "default" => $value[0]["attrs"]["default"],
+ "text" => $value[0]["data"]
+ );
+ }
+ }
+ else $config = false;
+ }
+ return $config;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_utils extends mw_data
+ {
+
+ function eq($content) { return (isset($content) ? "'".str_replace("'", "\'", $content)."'" : "NULL"); }
+
+ /*
+ fonction pour ordonner les resultats des requetes sur
+ les donnees XML (pour faire l'equivalent d'un ORDER BY en SQL)
+ */
+ /*
+ function ordonne($list, $key)
+ { $values = array_values($list);
+ $maximum = count($values);
+ while($maximum > 0)
+ { $maximumTemporaire = 0;
+ for($i = 0; $i < $maximum; $i++)
+ { if($values[$i][$key] > $values[$i + 1][$key])
+ { $tmp = $values[$i];
+ $values[$i] = $values[$i + 1];
+ $values[$i + 1] = $tmp;
+ $maximumTemporaire = $i + 1;
+ }
+ }
+ $maximum = $maximumTemporaire;
+ }
+ $res = array();
+ foreach($values as $value) if($value["id"]) $res[$value["id"]] = $value;
+ return $res;
+ }
+ */
+
+ function ordonne($list, $key, $order = "ASC")
+ { $values = array_values($list);
+ $maximum = count($values);
+ while($maximum > 0)
+ { $maximumTemporaire = 0;
+ for($i = 0; $i < $maximum; $i++)
+ { if
+ ( ($order == "ASC" && $values[$i][$key] > $values[$i + 1][$key])
+ || ($order == "DESC" && $values[$i][$key] < $values[$i + 1][$key])
+ )
+ { $tmp = $values[$i];
+ $values[$i] = $values[$i + 1];
+ $values[$i + 1] = $tmp;
+ $maximumTemporaire = $i + 1;
+ }
+ }
+ $maximum = $maximumTemporaire;
+ }
+ $res = array();
+ foreach($values as $value) if($value["id"]) $res[$value["id"]] = $value;
+ return $res;
+ }
+
+ function upload($image, $upload_dir)
+ { $file = "";
+ $upload_dir .= $upload_dir && (substr($upload_dir, -1) != "/") ? "/" : "";
+ if($_FILES)
+ { if(isset($_FILES[$image]))
+ { if($_FILES[$image]["error"] == UPLOAD_ERR_OK)
+ { if(move_uploaded_file($_FILES[$image]["tmp_name"], $upload_dir.$_FILES[$image]["name"]))
+ { $file = $_FILES[$image]["name"];
+ }
+ else $file = false;
+ }
+ else if($_FILES[$image]["error"] != UPLOAD_ERR_NO_FILE) $file = false;
+ }
+ else $file = false;
+ }
+ return $file;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_config extends mw_data
+ {
+
+ function config($key = null)
+ { $sgbd = $this->sgbd();
+ $value = false;
+ if(isset($key))
+ { $sql =
+ "SELECT `value` FROM #--config"
+ ." WHERE `key`=".$this->eq($key);
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $value = $v_rst["value"];
+ else $value = "";
+ $sgbd->free_result($rst);
+ }
+ else
+ { $value = array();
+ $sql =
+ "SELECT * FROM #--config";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ while($v_rst = $sgbd->fetch_assoc($rst)) $value[$v_rst["key"]] = $v_rst["value"];
+ $sgbd->free_result($rst);
+ }
+ return $value;
+ }
+
+ function config_exists($key)
+ { $sgbd = $this->sgbd();
+ $exists = false;
+ $sql = "SELECT count(*) as n FROM #--config"
+ ." WHERE `key`=".$this->eq($key);
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $exists = $v_rst["n"];
+ $sgbd->free_result($rst);
+ return $exists;
+ }
+
+ function set_config($key, $value)
+ { $sgbd = $this->sgbd();
+ if($this->config_exists($key)) $sql =
+ "UPDATE #--config"
+ ." SET `value`=".$this->eq($value)
+ ." WHERE `key`=".$this->eq($key);
+ else $sql =
+ "INSERT INTO #--config"
+ ." VALUES(NULL, ".$this->eq($key).", ".$this->eq($value).")";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ return true;
+ }
+
+ function del_config($key)
+ { $sgbd = $this->sgbd();
+ return $sgbd->query("DELETE FROM #--config WHERE `key`=".$this->eq($key)) ? true : false;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_users extends mw_data
+ {
+
+ var $users;
+ var $_user;
+ var $user_status;
+ var $action_status;
+
+ # ----------------------------------------------------------------------------------------
+ # users
+ #
+
+ function users($start = 0, $alpha = null, $status = null)
+ { $sgbd = $this->sgbd();
+ $env = $this->env();
+ $users = array("list" => array(), "total" => 0);
+ $SELECT = "SELECT *";
+ $FROM = " FROM #--users";
+ $WHERE = "";
+ $WHERE .= (isset($alpha) ? ($WHERE ? " AND" : " WHERE")." LEFT(login, 1)=".$this->eq($alpha) : "");
+ $WHERE .= (isset($status) ? ($WHERE ? " AND" : " WHERE")." status=".$this->eq($status) : "");
+ $LIMIT = ($env->config("max_list") ? " LIMIT ".$env->config("max_list")." OFFSET ".$start : "");
+ $sql = "SELECT count(*) as n FROM(".$SELECT.$FROM.$WHERE.") res";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $users["total"] = $v_rst["n"];
+ $sgbd->free_result($rst);
+ if($users["total"] > 0)
+ { $sql = "SELECT * FROM(".$SELECT.$FROM.$WHERE.$LIMIT.") res";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ while($v_rst = $sgbd->fetch_assoc($rst)) $users["list"][$v_rst["id"]] = $v_rst;
+ $sgbd->free_result($rst);
+ }
+ return $users;
+ }
+
+ function user_by_id($id)
+ { $sgbd = $this->sgbd();
+ $user = array();
+ $sql = "SELECT * from #--users WHERE id=".$this->eq($id);
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $user = $v_rst;
+ $sgbd->free_result($rst);
+ return $user;
+ }
+
+ function user($login)
+ { $sgbd = $this->sgbd();
+ $user = array();
+ $sql = "SELECT * from #--users WHERE login=".$this->eq($login);
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $user = $v_rst;
+ $sgbd->free_result($rst);
+ return $user;
+ }
+
+ function user_exists($login)
+ { $sgbd = $this->sgbd();
+ $EXISTS = 0;
+ $sql = "SELECT count(*) as n from #--users WHERE login=".$this->eq($login);
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $EXISTS = $v_rst["n"];
+ $sgbd->free_result($rst);
+ return $EXISTS;
+ }
+
+ function add_user($login, $password, $email, $status)
+ { $sgbd = $this->sgbd();
+ $sql =
+ "INSERT INTO #--users(login, password, email, status) VALUES"
+ ."( ".$this->eq($login)
+ .", ".$this->eq($password)
+ .", ".$this->eq($email)
+ .", ".$status
+ .")";
+ return $sgbd->query($sql);
+ }
+
+ function set_user($id, $login, $password, $email, $status)
+ { $sgbd = $this->sgbd();
+ $sql =
+ "UPDATE #--users SET"
+ ." login=".$this->eq($login)
+ .", password=".$this->eq($password)
+ .", email=".$this->eq($email)
+ .", status=".$status
+ ." WHERE id=".$id;
+ return $sgbd->query($sql);
+ }
+
+ function del_user($login)
+ { $sgbd = $this->sgbd();
+ $sql = "DELETE FROM #--users WHERE login=".$this->eq($login);
+ return $sgbd->query($sql);
+ }
+
+ # ----------------------------------------------------------------------------------------
+ # status
+ #
+
+ function status()
+ { if(!isset($this->user_status)) return false;
+ return $this->user_status;
+ }
+
+ function init_user_status($status = array())
+ { $sgbd = $this->sgbd();
+ $this->user_status = array();
+ $sql = "SELECT * FROM #--user_status";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ while($v_rst = $sgbd->fetch_assoc($rst)) $this->user_status[$v_rst["id"]] = $v_rst;
+ $sgbd->free_result($rst);
+ return $this->user_status;
+ }
+
+ function init_action_status($status = array())
+ { if(!isset($this->user_status)) return false;
+ $sgbd = $this->sgbd();
+ $this->action_status = array();
+ $sql = "SELECT * FROM #--action_status";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ while($v_rst = $sgbd->fetch_assoc($rst)) $this->action_status[$v_rst["id"]] = $v_rst;
+ $sgbd->free_result($rst);
+ return $this->action_status;
+ }
+
+ function get_user_status()
+ { $user = $this->get_session_user();
+ if($user && isset($user["status"])) return $user["status"];
+ return 0;
+ }
+
+ function get_action_status($mod, $controller = "index", $action = "index", $set_status = array())
+ { $sgbd = $this->sgbd();
+ $status = array();
+ $sql =
+ "SELECT action, id_status"
+ ." FROM #--action_status"
+ ." WHERE action=".$this->eq($mod)
+ ." OR action=".$this->eq($mod."/".$controller)
+ ." OR action=".$this->eq($mod."/".$controller."/".$action);
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ while($v_rst = $sgbd->fetch_assoc($rst))
+ { if(!isset($status[$v_rst["action"]])) $status[$v_rst["action"]] = array();
+ $status[$v_rst["action"]][$v_rst["id_status"]] = true;
+ }
+ $sgbd->free_result($rst);
+ return $status;
+ }
+
+ function creation_default_status()
+ { $sgbd = $this->sgbd();
+ $default_status = 0;
+ $sql = "SELECT id FROM #--user_status WHERE creation_default=1 LIMIT 0,1";
+ $rst = $sgbd->query($sql);
+ if(!isset($rst)) return false;
+ if($v_rst = $sgbd->fetch_assoc($rst)) $default_status = $v_rst["id"];
+ $sgbd->free_result($rst);
+ return $default_status;
+ }
+
+ # ----------------------------------------------------------------------------------------
+ # log in / out
+ #
+
+ function login($login, $password)
+ { if(($user = $this->user($login)) !== false)
+ { if($this->password_ok($user, $password))
+ { if(!$this->set_session($user)) $user = false;
+ }
+ else
+ { $this->clear_session();
+ $user = array();
+ }
+ }
+ return $user;
+ }
+
+ function logout()
+ { return $this->clear_session();
+ }
+
+ function user_ok($user)
+ { return
+ strcmp(md5($user["password"].$_SESSION["id"]), $_SESSION["pass"]) == 0
+ && $_SESSION["ip"] == $_SERVER["REMOTE_ADDR"];
+ }
+
+ function password_ok($user, $password)
+ { return
+ strcmp(md5($user["password"].$_SESSION["id"]), $password) == 0
+ && $_SESSION["ip"] == $_SERVER["REMOTE_ADDR"];
+ }
+
+ # ----------------------------------------------------------------------------------------
+ # session
+ #
+
+ function load_session()
+ { session_start();
+ if(!isset($_SESSION["id"])) $this->clear_session();
+ if
+ ( $user =
+ ( isset($_COOKIE["user"]) || isset($_SESSION["user"]) ?
+ $this->user(isset($_COOKIE["user"]) ? $_COOKIE["user"] : $_SESSION["user"])
+ : array()
+ )
+ )
+ { if(isset($_COOKIE["user"])) $this->set_session($user);
+ if(!$this->user_ok($user))
+ { $this->clear_session();
+ $user = array();
+ }
+ }
+ $this->_user = $user;
+ return $user;
+ }
+
+ function set_session($user)
+ { $_SESSION["user"] = $user["login"];
+ $_SESSION["pass"] = md5($user["password"].$_SESSION["id"]);
+ $env = $this->env();
+ return setcookie("user", $user["login"], time() + (60 * 60 * 24 * 7), $env->path("web"));
+ }
+
+ function clear_session()
+ { unset($_SESSION["user"]);
+ unset($_SESSION["pass"]);
+ $_SESSION["ip"] = $_SERVER["REMOTE_ADDR"];
+ $_SESSION["id"] = md5(rand());
+ $env = $this->env();
+ return setcookie("user", "", 0, $env->path("web"));
+ }
+
+ function get_session_user() { return $this->_user; }
+
+ # ----------------------------------------------------------------------------------------
+ # uploads
+ #
+
+ function check_user_uploads_dir($user = null)
+ { $env = $this->env();
+ $user_dir = $env->path("content")."uploads/".(isset($user) ? $user : $this->_user["id"]);
+ if(!file_exists($user_dir)) @mkdir($user_dir);
+ return file_exists($user_dir);
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_config extends mw_data
+ {
+
+ function config($key = null)
+ { $sgbd = $this->sgbd();
+ $value = false;
+ if($rst = $sgbd->open_data("config"))
+ { if(isset($key))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if($v_rst["key"] == $key)
+ { $value = $v_rst["value"];
+ }
+ }
+ else $value = null;
+ }
+ }
+ else
+ { $value = array();
+ while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(is_array($v_rst)) foreach($v_rst as $key => $_value)
+ { $value[$key] = $_value;
+ break;
+ }
+ }
+ else $value = null;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ if(!isset($value)) return false;
+ return $value;
+ }
+
+ function config_exists($key)
+ { $sgbd = $this->sgbd();
+ $exists = 0;
+ if($rst = $sgbd->open_data("config"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(isset($v_rst[$key])) $exists++;
+ }
+ else
+ { $exists = false;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ else $exists = false;
+ return $exists;
+ }
+
+ function set_config($key, $value)
+ { $sgbd = $this->sgbd();
+ $FOUND = false;
+ if($rst = $sgbd->open_data("config"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(array_key_exists($key, $v_rst))
+ { $FOUND = $sgbd->set_data("config", $v_rst["id"], array($key => $value));
+ break;
+ }
+ }
+ else
+ { $FOUND = null;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ else $FOUND = null;
+ if(isset($FOUND))
+ { if($FOUND) return true;
+ else
+ { if($sgbd->add_data("config", array($key => $value))) return true;
+ }
+ }
+ return false;
+ }
+
+ function del_config($key)
+ { $ids = array();
+ $sgbd = $this->sgbd();
+ if($rst = $sgbd->open_data("config"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(isset($v_rst[$key]) && isset($v_rst["id"]))
+ { $ids[] = $v_rst["id"];
+ }
+ }
+ else $ids = false;
+ }
+ $sgbd->close_data($rst);
+ }
+ if($ids === false) return false;
+ foreach($ids as $id) if(!$sgbd->del_data("config", $id)) return false;
+ return true;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data_users extends mw_data
+ {
+
+ var $users;
+ var $_user;
+ var $user_status;
+ var $action_status;
+
+ # ----------------------------------------------------------------------------------------
+ # users
+ #
+
+ function users($start = 0, $alpha = null, $status = null)
+ { $sgbd = $this->sgbd();
+ $env = $this->env();
+ $users = array("list" => array(), "total" => 0);
+ $res = array();
+ if($rst = $sgbd->open_data("users"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(!isset($alpha) || (isset($v_rst["login"]) && strtolower(substr($v_rst["login"], 0, 1)) == strtolower($alpha)))
+ { if(!isset($status) || (isset($v_rst["status"]) && $v_rst["status"] == $status))
+ { $res[$v_rst["id"]] = $v_rst;
+ $users["total"]++;
+ }
+ }
+ }
+ else
+ { $res = false;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ if($res !== false)
+ { $n = 0;
+ foreach($res as $id_user => $user)
+ { $n++;
+ if(!$env->config("max_list") || ($n > $start && $n <= ($start + $env->config("max_list"))))
+ { $users["list"][$user["id"]] = $user;
+ if(!isset($this->users)) $this->users = array();
+ $this->users[$user["id"]] = $user;
+ }
+ }
+ }
+ else $users = false;
+ }
+ else $users = false;
+ return $users;
+ }
+
+ function user_by_id($id)
+ { if(!isset($this->users)) $this->users = array();
+ if(isset($this->users[$id])) return $this->users[$id];
+ $sgbd = $this->sgbd();
+ if(($user = $sgbd->get_data("users", $id)) !== false)
+ { $this->users[$id] = $user;
+ }
+ return $user;
+ }
+
+ function user($login)
+ { $sgbd = $this->sgbd();
+ $user = array();
+ if($rst = $sgbd->open_data("users"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(isset($v_rst["login"]) && $v_rst["login"] == $login)
+ { $user = $v_rst;
+ break;
+ }
+ }
+ else $user = false;
+ }
+ $sgbd->close_data($rst);
+ }
+ else $user = false;
+ if($user !== false)
+ { if(!isset($this->users)) $this->users = array();
+ $this->users[$user["id"]] = $user;
+ }
+ return $user;
+ }
+
+ function user_exists($login)
+ { $sgbd = $this->sgbd();
+ $EXISTS = 0;
+ if($rst = $sgbd->open_data("users"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(isset($v_rst["login"]) && $v_rst["login"] == $login)
+ { $EXISTS++;
+ }
+ }
+ else
+ { $EXISTS = false;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ else $EXISTS = false;
+ return $EXISTS;
+ }
+
+ function add_user($login, $password, $email, $status)
+ { $sgbd = $this->sgbd();
+ return $sgbd->add_data
+ ( "users",
+ array
+ ( "login" => $login,
+ "password" => $password,
+ "email" => $email,
+ "status" => $status
+ )
+ );
+ }
+
+ function set_user($id, $login, $password, $email, $status)
+ { $sgbd = $this->sgbd();
+ return $sgbd->set_data
+ ( "users",
+ $id,
+ array
+ ( "login" => $login,
+ "password" => $password,
+ "email" => $email,
+ "status" => $status
+ )
+ );
+ }
+
+ function del_user($login)
+ { if(($user = $this->user($login)) !== false)
+ { $sgbd = $this->sgbd();
+ return $sgbd->del_data("users", $user["id"]);
+ }
+ return false;
+ }
+
+ # ----------------------------------------------------------------------------------------
+ # status
+ #
+
+ function status()
+ { if(!isset($this->user_status)) return false;
+ return $this->user_status;
+ }
+
+ function init_user_status($status = array())
+ { $sgbd = $this->sgbd();
+ $this->user_status = array();
+ if($rst = $sgbd->open_data("user_status"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { $this->user_status[$v_rst["id"]] = $v_rst;
+ }
+ else
+ { $this->user_status = false;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ else $this->user_status = false;
+ if($status && $this->user_status !== false)
+ { foreach($status as $new_user_status)
+ { $id_status = false;
+ foreach($this->user_status as $user_status) if($new_user_status["nom"] == $user_status["nom"])
+ { $id_status = $user_status["id"];
+ break;
+ }
+ if($id_status)
+ { $SAME = true;
+ foreach($new_user_status as $status_key => $status_value)
+ { if(!isset($this->user_status[$id_status][$status_key]) || $this->user_status[$id_status][$status_key] != $status_value)
+ { $SAME = false; break;
+ }
+ }
+ if(!$SAME)
+ { if($sgbd->set_data("user_status", $id_status, $new_user_status)) $this->user_status[$id_status] = $new_user_status;
+ else { $this->user_status = false; break; }
+ }
+ }
+ else
+ { if($id_status = $sgbd->add_data("user_status", $new_user_status)) $this->user_status[$id_status] = $new_user_status;
+ else { $this->user_status = false; break; }
+ }
+ }
+ }
+ return $this->user_status;
+ }
+
+ function init_action_status($status = array())
+ { if(!isset($this->user_status)) return false;
+ $sgbd = $this->sgbd();
+ $this->action_status = array();
+ if($rst = $sgbd->open_data("action_status"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { $this->action_status[$v_rst["id"]] = $v_rst;
+ }
+ else
+ { $this->action_status = false;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ else $this->action_status = false;
+ if($status && $this->action_status !== false)
+ { $STATUS_OK = true;
+ foreach($status as $id_new_action_status => $new_action_status)
+ { $FOUND = $new_action_status["id_status"] == "0";
+ if(!$FOUND) foreach($this->user_status as $user_status)
+ { if($new_action_status["id_status"] == $user_status["nom"])
+ { $FOUND = true;
+ $status[$id_new_action_status]["id_status"] = $user_status["id"];
+ }
+ }
+ if(!$FOUND)
+ { $STATUS_OK = false;
+ break;
+ }
+ }
+ if($STATUS_OK)
+ { foreach($status as $new_action_status)
+ { $id_status = false;
+ foreach($this->action_status as $action_status)
+ { if
+ ( $new_action_status["action"] == $action_status["action"]
+ && $new_action_status["id_status"] == $action_status["id_status"]
+ )
+ { $id_status = $action_status["id"];
+ break;
+ }
+ }
+ if($id_status)
+ { $SAME = true;
+ foreach($new_action_status as $status_key => $status_value)
+ { if(!isset($this->action_status[$id_status][$status_key]) || $this->action_status[$id_status][$status_key] != $status_value)
+ { $SAME = false; break;
+ }
+ }
+ if(!$SAME)
+ { if($id_status = $sgbd->add_data("action_status", $new_action_status)) $this->action_status[$id_status] = $new_action_status;
+ else { $this->action_status = false; break; }
+ }
+ }
+ else
+ { if($id_status = $sgbd->add_data("action_status", $new_action_status)) $this->action_status[$id_status] = $new_action_status;
+ else { $this->action_status = false; break; }
+ }
+ }
+ }
+ else $this->action_status = false;
+ }
+ return $this->action_status;
+ }
+
+ function get_user_status()
+ { $user = $this->get_session_user();
+ if($user && isset($user["status"])) return $user["status"];
+ return 0;
+ }
+
+ function get_action_status($mod, $controller = "index", $action = "index", $set_status = array())
+ { $sgbd = $this->sgbd();
+ if($rst = $sgbd->open_data("action_status"))
+ { while($status !==false && $v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst) && isset($v_rst["action"]) && isset($v_rst["id_status"]))
+ { if
+ ( $v_rst["action"] == $mod
+ || $v_rst["action"] == $mod."/".$controller
+ || $v_rst["action"] == $mod."/".$controller."/".$action
+ )
+ { if(!isset($status[$v_rst["action"]])) $status[$v_rst["action"]] = array();
+ $status[$v_rst["action"]][$v_rst["id_status"]] = true;
+ }
+ }
+ else $status = false;
+ }
+ $sgbd->close_data($rst);
+ }
+ else $status = false;
+ if($status !== false)
+ { if($set_status)
+ { foreach($set_status as $new_action_status)
+ { $id_status = false;
+ foreach($status as $user_status) if($new_user_status["nom"] == $user_status["nom"])
+ { $id_status = $user_status["id"];
+ break;
+ }
+ if($id_status)
+ { $SAME = true;
+ foreach($new_user_status as $status_key => $status_value)
+ { if(!isset($status[$id_status][$status_key]) || $status[$id_status][$status_key] != $status_value)
+ { $SAME = false; break;
+ }
+ }
+ if(!$SAME)
+ { if($sgbd->set_data("user_status", $id_status, $new_user_status)) $status[$id_status] = $new_user_status;
+ else { $status = false; break; }
+ }
+ }
+ else
+ { if($id_status = $sgbd->add_data("user_status", $new_user_status)) $status[$id_status] = $new_user_status;
+ else { $status = false; break; }
+ }
+ }
+ }
+ }
+ return $status;
+ }
+
+ function creation_default_status()
+ { $sgbd = $this->sgbd();
+ $default_status = 0;
+ if($rst = $sgbd->open_data("user_status"))
+ { while($v_rst = $sgbd->fetch_data($rst))
+ { if(isset($v_rst))
+ { if(isset($v_rst["creation_default"]) && $v_rst["creation_default"] == 1)
+ { $default_status = $v_rst["id"];
+ break;
+ }
+ }
+ else
+ { $default_status = false;
+ break;
+ }
+ }
+ $sgbd->close_data($rst);
+ }
+ else $default_status = false;
+ return $default_status;
+ }
+
+ # ----------------------------------------------------------------------------------------
+ # log in / out
+ #
+
+ function login($login, $password)
+ { if(($user = $this->user($login)) !== false)
+ { if($this->password_ok($user, $password))
+ { if(!$this->set_session($user)) $user = false;
+ }
+ else
+ { $this->clear_session();
+ $user = array();
+ }
+ }
+ return $user;
+ }
+
+ function logout()
+ { return $this->clear_session();
+ }
+
+ function user_ok($user)
+ { return
+ strcmp(md5($user["password"].$_SESSION["id"]), $_SESSION["pass"]) == 0
+ && $_SESSION["ip"] == $_SERVER["REMOTE_ADDR"];
+ }
+
+ function password_ok($user, $password)
+ { return
+ strcmp(md5($user["password"].$_SESSION["id"]), $password) == 0
+ && $_SESSION["ip"] == $_SERVER["REMOTE_ADDR"];
+ }
+
+ # ----------------------------------------------------------------------------------------
+ # session
+ #
+
+ function load_session()
+ { session_start();
+ if(!isset($_SESSION["id"])) $this->clear_session();
+ if
+ ( $user =
+ ( isset($_COOKIE["user"]) || isset($_SESSION["user"]) ?
+ $this->user(isset($_COOKIE["user"]) ? $_COOKIE["user"] : $_SESSION["user"])
+ : array()
+ )
+ )
+ { if(isset($_COOKIE["user"])) $this->set_session($user);
+ if(!$this->user_ok($user))
+ { $this->clear_session();
+ $user = array();
+ }
+ }
+ $this->_user = $user;
+ return $user;
+ }
+
+ function set_session($user)
+ { $_SESSION["user"] = $user["login"];
+ $_SESSION["pass"] = md5($user["password"].$_SESSION["id"]);
+ $env = $this->env();
+ return setcookie("user", $user["login"], time() + (60 * 60 * 24 * 7), $env->path("web"));
+ }
+
+ function clear_session()
+ { unset($_SESSION["user"]);
+ unset($_SESSION["pass"]);
+ $_SESSION["ip"] = $_SERVER["REMOTE_ADDR"];
+ $_SESSION["id"] = md5(rand());
+ $env = $this->env();
+ return setcookie("user", "", 0, $env->path("web"));
+ }
+
+ function get_session_user() { return $this->_user; }
+
+ # ----------------------------------------------------------------------------------------
+ # uploads
+ #
+
+ function check_user_uploads_dir($user = null)
+ { $env = $this->env();
+ $user_dir = $env->path("content")."uploads/".(isset($user) ? $user : $this->_user["id"]);
+ if(!file_exists($user_dir)) @mkdir($user_dir);
+ return file_exists($user_dir);
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_data extends empty_class
+ {
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_sgbd
+ {
+ var $sgbd_impl;
+ var $env;
+
+ function mw_sgbd($sgbd_impl, $env)
+ { $this->sgbd_impl = $sgbd_impl;
+ $this->env = $env;
+ }
+
+ function extention_ok() { return $this->sgbd_impl->extention_ok($this->env); }
+
+ function connect($host, $base, $user, $password)
+ { return $this->sgbd_impl->connect($host, $base, $user, $password);
+ }
+
+ function select_db($db_name)
+ { return $this->sgbd_impl->select_db($db_name);
+ }
+
+ # ---------------------------------------------------------------------------------
+ # SQL
+ #
+
+ function table_exists($table_name)
+ { return $this->sgbd_impl->table_exists
+ ( ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
+ str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
+ : $table_name
+ );
+ }
+
+ function query($sql)
+ { return $this->sgbd_impl->query
+ ( ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
+ str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $sql)
+ : $sql
+ );
+ }
+
+ function insert_id()
+ { return $this->sgbd_impl->insert_id();
+ }
+
+ function fetch_assoc($rst)
+ { return $this->sgbd_impl->fetch_assoc($rst);
+ }
+
+ function free_result($rst)
+ { return $this->sgbd_impl->free_result($rst);
+ }
+
+ function close()
+ { return $this->sgbd_impl->close();
+ }
+
+ # ---------------------------------------------------------------------------------
+ # XML
+ #
+
+ function data_exists($data_path)
+ { return $this->sgbd_impl->data_exists($data_path);
+ }
+
+ function create_data($data_path)
+ { return $this->sgbd_impl->create_data($data_path);
+ }
+
+ function get_data($data_path, $data_id)
+ { return $this->sgbd_impl->get_data($data_path, $data_id);
+ }
+
+ function open_data($data_path, $FETCH = true)
+ { return $this->sgbd_impl->open_data($data_path, $FETCH);
+ }
+
+ function fetch_data($dh)
+ { return $this->sgbd_impl->fetch_data($dh);
+ }
+
+ function add_data($data_path, $data)
+ { return $this->sgbd_impl->add_data($data_path, $data);
+ }
+
+ function last_index($dh)
+ { return $this->sgbd_impl->last_index($dh);
+ }
+
+ function set_data($data_path, $data_id, $data)
+ { return $this->sgbd_impl->set_data($data_path, $data_id, $data);
+ }
+
+ function del_data($data_path, $data_id)
+ { return $this->sgbd_impl->del_data($data_path, $data_id);
+ }
+
+ function close_data($dh)
+ { return $this->sgbd_impl->close_data($dh);
+ }
+
+ function remove_data($data_path)
+ { return $this->sgbd_impl->remove_data($data_path);
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_config extends mw_env
+ {
+
+ var $config_file;
+ var $PATHES;
+ var $PARAMS;
+ var $CONFIG;
+ var $bdd;
+
+ function load_config($bdd, $CONFIG)
+ { if(true)
+ { $this->bdd = $bdd;
+ $this->bdd["table_prefix"] = array();
+ $this->CONFIG = isset($CONFIG) ? $CONFIG : array();
+ $this->PARAMS = array();
+ $xml_parser = new sxml();
+ $app_config_file = $this->path("app")."config.xml";
+ if(file_exists($app_config_file))
+ { $xml_parser->parse(file_get_contents($app_config_file));
+ $app_config = $xml_parser->data["config"][0];
+ if(isset($app_config["subs"]["params"]))
+ { foreach($app_config["subs"]["params"][0]["subs"] as $param_key => $param_elt)
+ { $this->PARAMS[$param_key] = $param_elt[0]["data"];
+ }
+ }
+ if(isset($app_config["subs"]["config"]))
+ { foreach($app_config["subs"]["config"][0]["subs"] as $config_key => $config_elt)
+ { $this->CONFIG[$config_key] = $config_elt[0]["data"];
+ }
+ }
+ if(isset($app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"]))
+ { $this->add_table_prefix
+ ( array
+ ( $app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"][0]["data"] => $bdd["table_prefix"]
+ )
+ );
+ }
+ }
+ if(($plugins = $this->plugins("ASC")) !== false)
+ { foreach($plugins as $plugin_name => $plugin)
+ { $app_config_file = $this->path("plugins").$plugin_name."/app/config.xml";
+ if(file_exists($app_config_file) && $plugin["installed"] && $plugin["enabled"])
+ { $xml_parser->parse(file_get_contents($app_config_file));
+ $app_config = $xml_parser->data["config"][0];
+ if(isset($app_config["subs"]["params"]))
+ { foreach($app_config["subs"]["params"][0]["subs"] as $param_key => $param_elt)
+ { $this->PARAMS[$param_key] = $param_elt[0]["data"];
+ }
+ }
+ if(isset($app_config["subs"]["config"]))
+ { foreach($app_config["subs"]["config"][0]["subs"] as $config_key => $config_elt)
+ { $this->CONFIG[$config_key] = $config_elt[0]["data"];
+ }
+ }
+ if(isset($app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"]))
+ { $this->add_table_prefix
+ ( array
+ ( $app_config["subs"]["bdd"][0]["subs"]["table_prefix_code"][0]["data"] => $bdd["table_prefix"]
+ )
+ );
+ }
+ }
+ }
+ $this->init_additional_get_params();
+ }
+ else $this->erreur("impossible de lire les fichiers de configuration pour les plugins", true);
+ }
+ else $this->erreur("impossible de trouver le fichier de configuration pour l'installation", true);
+ }
+
+ function get_config_file() { return $this->config_file; }
+ function set_config_file($config_file) { $this->config_file = $config_file; }
+
+ function get_PATHES() { return $this->PATHES; }
+ function path($name)
+ { if(isset($this->PATHES[$name])) return $this->PATHES[$name];
+ return "";
+ }
+ function set_PATHES($PATHES)
+ { foreach($PATHES as $path_name => $path_value)
+ { if($path_value && substr($path_value, -1) != "/") $PATHES[$path_name] .= "/";
+ }
+ $this->PATHES = $PATHES;
+ }
+
+ function get_PARAMS() { return $this->PARAMS; }
+ function param($name) { return $this->PARAMS[$name]; }
+
+ function get_CONFIG() { return $this->CONFIG; }
+ function config($name) { return $this->CONFIG[$name]; }
+ function set_config($config)
+ { if(is_array($config))
+ { foreach($config as $key => $value) $this->CONFIG[$key] = $value;
+ return true;
+ }
+ return false;
+ }
+
+ function get_bdd() { return $this->bdd; }
+ function bdd($name) { return $this->bdd[$name]; }
+ function set_bdd($key, $value) { $this->bdd[$key] = $value; }
+ function add_table_prefix($table_prefix)
+ { if(is_array($table_prefix))
+ { foreach($table_prefix as $prefix_code => $prefix) $this->bdd["table_prefix"][$prefix_code] = $prefix;
+ return true;
+ }
+ return false;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_data extends mw_env
+ {
+ var $data;
+
+ function set_data(&$data) { $this->data = &$data; }
+
+ function data()
+ { return $this->data;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_init extends mw_env
+ {
+
+ function init()
+ { $init_files = array();
+ if(($plugins = $this->plugins()) !== false)
+ { foreach($plugins as $plugin_name => $plugin)
+ { $init_path = $this->path("plugins").$plugin_name."/app/init/";
+ if
+ ( $plugin["installed"]
+ && $plugin["enabled"]
+ && file_exists($init_path)
+ && is_dir($init_path)
+ )
+ { if($dh = opendir($init_path))
+ { $files = array();
+ while(($file = readdir($dh)) !== false)
+ { if
+ ( substr($file, 0, 1) != "."
+ && !is_dir($init_path.$file)
+ && strcmp(substr($file, -4), ".php") == 0
+ && !isset($init_files[$file])
+ ) $init_files[$file] = $init_path;
+ }
+ closedir($dh);
+
+ }
+ else $this->erreur("impossible d'ouvrir le dossier init du plugin ".$plugin_name, true);
+ }
+ if($this->check_stop()) return;
+ }
+ $init_path = $this->path("app")."init/";
+ if
+ ( file_exists($init_path)
+ && is_dir($init_path)
+ )
+ { if($dh = opendir($init_path))
+ { $files = array();
+ while(($file = readdir($dh)) !== false)
+ { if
+ ( substr($file, 0, 1) != "."
+ && !is_dir($init_path.$file)
+ && strcmp(substr($file, -4), ".php") == 0
+ ) $init_files[$file] = $init_path;
+ }
+ closedir($dh);
+ }
+ else $this->erreur("impossible d'ouvrir le dossier init du plugin ".$plugin_name, true);
+ }
+ }
+ if($this->check_stop()) return;
+ if($init_files)
+ { ksort($init_files);
+ foreach($init_files as $file => $init_path)
+ { require $init_path.$file;
+ if($this->check_stop()) return;
+ }
+ }
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_inputs extends mw_env
+ {
+
+ function prepare_inputs()
+ { if($_POST)
+ { require_once $this->path("libs")."inputfilter.php";
+ $allowed_tags = array
+ ( "p", "span", "pre", "blockquote", "address", "hr", "br",
+ "img",
+ "strong", "em", "u", "i", "b", "s",
+ "a",
+ "ul", "ol", "li",
+ "h1", "h2", "h3", "h4", "h5", "h6"
+ );
+ $allowed_attrs = array
+ ( "style",
+ "src", "alt", "width", "height",
+ "href", "title"
+ );
+ $input_filter = new InputFilter($allowed_tags, $allowed_attrs);
+ $_POST = $input_filter->process($_POST);
+ }
+ if($_FILES)
+ { foreach($_FILES as $file_key => $file_infos)
+ { $v_name = explode(".", $file_infos["name"]);
+ $ext = strtolower($v_name[count($v_name) - 1]);
+ if
+ ( $ext != "png"
+ && $ext != "jpg"
+ && $ext != "jpeg"
+ && $ext != "gif"
+ ) unset($_FILES[$file_key]);
+ }
+ }
+ return true;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_links extends mw_env
+ {
+
+ function init_links()
+ { $data = $this->data();
+ return $data->init_links();
+ }
+
+ function get_link($path = null)
+ { $data = $this->data();
+ return $data->get_link($path);
+ }
+
+ function set_link($path, $url, $intitule = "", $position = 0)
+ { $data = $this->data();
+ return $data->set_link($path, $url, $intitule, $position);
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_messages extends mw_env
+ {
+
+ function erreur($message, $EXIT = false)
+ { if($EXIT)
+ { echo "[erreur] ".$message;
+ exit();
+ }
+ else
+ { $this->set_etat("reponses/html/erreur", false);
+ $erreur = $this->out("erreur");
+ if(!isset($erreur)) $erreur = array("messages" => array());
+ $erreur["messages"][] = $message;
+ $this->set_out("erreur", $erreur);
+ }
+ }
+
+ function message($message)
+ { $messages = $this->out("messages");
+ if(!isset($messages)) $messages = array();
+ $messages[] = $message;
+ $this->set_out("messages", $messages);
+ }
+
+ function messages()
+ { $messages = $this->out("messages");
+ if(isset($messages)) return $messages;
+ return array();
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_out extends mw_env
+ {
+ var $out;
+ var $out_config;
+ var $layout;
+
+ function set_out($key, $value) { $this->out[$key] = $value; return $value; }
+ function get_out() { return $this->out; }
+ function out($key) { return $this->out[$key]; }
+
+ function out_pathes()
+ { $pathes = array();
+ if($dh = opendir($this->path("out")))
+ { while(($file = readdir($dh)) !== false)
+ { if(is_dir($this->path("out").$file) && substr($file, 0 ,1) != ".") $pathes[] = $file;
+ }
+ closedir($dh);
+ }
+ else $pathes = false;
+ return $pathes;
+ }
+
+ function out_file_exists($file, $PRIORITE = "DESC")
+ { $out_file = $this->_out_file($file, $PRIORITE);
+ return $out_file ? true : false;
+ }
+
+ function out_file($file, $PRIORITE = "DESC")
+ { $out_file = $this->_out_file($file, $PRIORITE);
+ return $out_file ? $out_file : $file;
+ }
+
+ function _out_file($file, $PRIORITE = "DESC")
+ { $out_file = false;
+ if($PRIORITE == "ASC")
+ { $tmp_out_file = $this->path("out").$this->config("out").$file;
+ if($file && file_exists($tmp_out_file))
+ { $out_file = $tmp_out_file;
+ }
+ if(!$out_file)
+ { $tmp_out_file = $this->path("out").$this->path("dist_out").$file;
+ if($file && file_exists($tmp_out_file))
+ { $out_file = $tmp_out_file;
+ }
+ }
+ }
+ if($out_file) return $out_file;
+ if(($plugins = $this->plugins($PRIORITE)) !== false)
+ { foreach($plugins as $plugin_name => $plugin)
+ { $tmp_out_file = $this->path("plugins").$plugin_name."/out/".$this->config("out").$file;
+ if($file && $plugin["installed"] && $plugin["enabled"] && file_exists($tmp_out_file))
+ { $out_file = $tmp_out_file;
+ break;
+ }
+ if(!$out_file)
+ { $tmp_out_file = $this->path("plugins").$plugin_name."/out/".$this->path("dist_out").$file;
+ if($file && $plugin["installed"] && $plugin["enabled"] && file_exists($tmp_out_file))
+ { $out_file = $tmp_out_file;
+ break;
+ }
+ }
+ }
+ if($PRIORITE == "DESC" && !$out_file)
+ { $tmp_out_file = $this->path("out").$this->config("out").$file;
+ if($file && file_exists($tmp_out_file))
+ { $out_file = $tmp_out_file;
+ }
+ if(!$out_file)
+ { $tmp_out_file = $this->path("out").$this->path("dist_out").$file;
+ if($file && file_exists($tmp_out_file))
+ { $out_file = $tmp_out_file;
+ }
+ }
+ }
+ }
+ return $out_file;
+ }
+
+ # ---------------------------------------------------------------------------------
+ # out config
+ #
+
+ function set_out_config($out_config)
+ { $this->out_config = $out_config;
+ return $this->out_config;
+ }
+
+ function get_out_config() { return isset($this->out_config) ? $this->out_config : array(); }
+
+ function out_config($name)
+ { if(isset($this->out_config))
+ { $CONFIG = $this->get_CONFIG();
+ return isset($CONFIG["out_".$name]) ? $CONFIG["out_".$name] : $this->out_config[$name]["default"];
+ }
+ return null;
+ }
+
+ # ---------------------------------------------------------------------------------
+ # layouts
+ #
+
+ function layout() { return $this->layout; }
+
+ function render_layout($layout = null)
+ { if(!isset($layout)) $layout = $this->init_layout();
+ if(($plugins = $this->plugins("ASC")) !== false)
+ { foreach($plugins as $plugin_name => $plugin)
+ { if($plugin["installed"] && $plugin["enabled"])
+ { $FOUND = false;
+ $functions_file = $this->path("plugins").$plugin_name."/out/".$this->config("out")."functions.php";
+ if(file_exists($functions_file))
+ { $FOUND = true;
+ require $functions_file;
+ }
+ if(!$FOUND)
+ { $functions_file = $this->path("plugins").$plugin_name."/out/".$this->path("dist_out")."functions.php";
+ if($plugin["installed"] && $plugin["enabled"] && file_exists($functions_file))
+ { require $functions_file;
+ }
+ }
+ }
+ }
+ $FOUND = false;
+ $functions_file = $this->path("out").$this->config("out")."functions.php";
+ if(file_exists($functions_file))
+ { $FOUND = true;
+ require $functions_file;
+ }
+ if(!$FOUND)
+ { $functions_file = $this->path("out").$this->path("dist_out")."functions.php";
+ if(file_exists($functions_file))
+ { require $functions_file;
+ }
+ }
+ if($layout["page"])
+ { if($this->out_file_exists($layout["page"])) require $this->out_file($layout["page"]);
+ }
+ elseif($layout["content"])
+ { if($this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+ }
+ }
+ }
+
+ function init_layout()
+ { $this->layout = array();
+ $this->_init_layout("index");
+ if(($mod = $this->etat("mod")) != "index") $this->_init_layout($mod);
+ return $this->get_layout();
+ }
+
+ function _init_layout($mod)
+ { if(($plugins = $this->plugins("ASC")) !== false)
+ { $layout_file = false;
+ $tmp_layout_file = $this->path("out").$this->config("out")."layouts/".$mod.".xml";
+ if(file_exists($tmp_layout_file)) $layout_file = $tmp_layout_file;
+ if(!$layout_file)
+ { $tmp_layout_file = $this->path("out").$this->path("dist_out")."layouts/".$mod.".xml";
+ if(file_exists($tmp_layout_file)) $layout_file = $tmp_layout_file;
+ }
+ if($layout_file) $this->load_layout($layout_file);
+ foreach($plugins as $plugin_name => $plugin)
+ { if($plugin["installed"] && $plugin["enabled"])
+ { $layout_file = false;
+ $tmp_layout_file = $this->path("plugins").$plugin_name."/out/".$this->config("out")."layouts/".$mod.".xml";
+ if(file_exists($tmp_layout_file)) $layout_file = $tmp_layout_file;
+ if(!$layout_file)
+ { $tmp_layout_file = $this->path("plugins").$plugin_name."/out/".$this->path("dist_out")."layouts/".$mod.".xml";
+ if(file_exists($tmp_layout_file)) $layout_file = $tmp_layout_file;
+ }
+ if($layout_file) $this->load_layout($layout_file);
+ }
+ }
+ }
+ }
+
+ function load_layout($layout_file)
+ { if(file_exists($layout_file))
+ { $xml_parser = new sxml();
+ $xml_parser->parse(file_get_contents($layout_file));
+ $layout = $xml_parser->data;
+ if(isset($layout["layout"][0]["subs"]))
+ { foreach($layout["layout"][0]["subs"] as $mod => $mod_node)
+ { if(!isset($this->layout[$mod]))
+ { $this->layout[$mod] = array
+ ( "page" => null,
+ "content" => null,
+ "controllers" => array()
+ );
+ }
+ if(isset($mod_node[0]["attrs"]["page"])) $this->layout[$mod]["page"] = $mod_node[0]["attrs"]["page"];
+ if(isset($mod_node[0]["attrs"]["content"])) $this->layout[$mod]["content"] = $mod_node[0]["attrs"]["content"];
+ if(isset($mod_node[0]["subs"]))
+ { foreach($mod_node[0]["subs"] as $controller => $controller_node)
+ { if(!isset($this->layout[$mod]["controllers"][$controller]))
+ { $this->layout[$mod]["controllers"][$controller] = array
+ ( "page" => null,
+ "content" => null,
+ "actions" => array()
+ );
+ }
+ if(isset($controller_node[0]["attrs"]["page"])) $this->layout[$mod]["controllers"][$controller]["page"] = $controller_node[0]["attrs"]["page"];
+ if(isset($controller_node[0]["attrs"]["content"])) $this->layout[$mod]["controllers"][$controller]["content"] = $controller_node[0]["attrs"]["content"];
+ if(isset($controller_node[0]["subs"]))
+ { foreach($controller_node[0]["subs"] as $action => $action_node)
+ { if(!isset($this->layout[$mod]["controllers"][$controller]["actions"][$action]))
+ { $this->layout[$mod]["controllers"][$controller]["actions"][$action] = array
+ ( "page" => null,
+ "content" => null
+ );
+ }
+ if(isset($action_node[0]["attrs"]["page"])) $this->layout[$mod]["controllers"][$controller]["actions"][$action]["page"] = $action_node[0]["attrs"]["page"];
+ if(isset($action_node[0]["attrs"]["content"])) $this->layout[$mod]["controllers"][$controller]["actions"][$action]["content"] = $action_node[0]["attrs"]["content"];
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ function get_layout()
+ { $mod = $this->etat("mod");
+ $controller = $this->etat("controller");
+ $action = $this->etat("action");
+ $content = "";
+ if(isset($this->layout[$mod]["controllers"][$controller]["actions"][$action]["content"]))
+ { $content = $this->layout[$mod]["controllers"][$controller]["actions"][$action]["content"];
+ }
+ else
+ { if(isset($this->layout[$mod]["controllers"][$controller]["content"]))
+ { $content = $this->layout[$mod]["controllers"][$controller]["content"];
+ }
+ else
+ { if(isset($this->layout[$mod]["content"]))
+ { $content = $this->layout[$mod]["content"];
+ }
+ else
+ { if(isset($this->layout["index"]["content"]))
+ { $content = $this->layout["index"]["content"];
+ }
+ }
+ }
+ }
+ $page = "";
+ if(isset($this->layout[$mod]["controllers"][$controller]["actions"][$action]["page"]))
+ { $page = $this->layout[$mod]["controllers"][$controller]["actions"][$action]["page"];
+ }
+ else
+ { if(isset($this->layout[$mod]["controllers"][$controller]["page"]))
+ { $page = $this->layout[$mod]["controllers"][$controller]["page"];
+ }
+ else
+ { if(isset($this->layout[$mod]["page"]))
+ { $page = $this->layout[$mod]["page"];
+ }
+ else
+ { if(isset($this->layout["index"]["page"]))
+ { $content = $this->layout["index"]["page"];
+ }
+ }
+ }
+ }
+ return array
+ ( "page" => $page,
+ "content" => $content
+ );
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_plugins extends mw_env
+ {
+
+ var $plugins_asc;
+ var $plugins_desc;
+
+ function plugins($PRIORITE = "ASC")
+ { $this->init_plugins($PRIORITE);
+ if($PRIORITE == "ASC") return $this->plugins_asc;
+ if($PRIORITE == "DESC") return $this->plugins_desc;
+ return false;
+ }
+
+ # ---------------------------------------------------------------------------------
+ # init
+ #
+
+ function init_plugins($PRIORITE = "ASC")
+ { if(isset($this->plugins_asc) || isset($this->plugins_desc))
+ { if($PRIORITE == "ASC")
+ { if(!isset($this->plugins_asc)) $this->plugins_asc = $this->ordonne_plugins($this->plugins_desc, $PRIORITE);
+ }
+ elseif($PRIORITE == "DESC")
+ { if(!isset($this->plugins_desc)) $this->plugins_desc = $this->ordonne_plugins($this->plugins_asc, $PRIORITE);
+ }
+ return;
+ }
+ $plugins = array();
+ if(!class_exists("mw_plugin"))
+ { require $this->path("app")."mw_plugin.php";
+ if(!class_exists("mw_plugin"))
+ { $plugins = false;
+ return;
+ }
+ }
+ if(file_exists($this->path("plugins")))
+ { if($dh = opendir($this->path("plugins")))
+ { $OK = true;
+ while($OK && ($plugin_name = readdir($dh)) !== false)
+ { if(substr($plugin_name, 0 ,1) !== "." && is_dir($this->path("plugins").$plugin_name))
+ { if(!isset($plugins[$plugin_name]))
+ { if(($plugin = $this->plugin_data($plugin_name)) !== false)
+ { $MAJ = false;
+ if(!isset($plugin["installed"]) || !isset($plugin["enabled"]))
+ { $plugin["installed"] = false;
+ $plugin["enabled"] = false;
+ $plugin["priorite"] = 0;
+ $MAJ = true;
+ }
+ if(!$plugin["installed"] && $plugin["enabled"]) { $plugin["enabled"] = false; $MAJ = true; }
+ if($MAJ) $OK = $this->set_plugin_data($plugin_name, $plugin);
+ if($OK)
+ { if(($plugin["impl"] = $this->plugin_impl($plugin_name)) !== false)
+ { $plugin["title"] = ($plugin_title = $this->plugin_call($plugin["impl"], "title")) ? $plugin_title : "";
+ $plugin["description"] = ($plugin_description = $this->plugin_call($plugin["impl"], "description")) ? $plugin_description : "";
+ $plugin["name"] = $plugin_name;
+ $plugins[$plugin_name] = $plugin;
+ }
+ }
+ }
+ else $OK = false;
+ }
+ }
+ if(!$OK) $plugins = false;
+ }
+ closedir($dh);
+ if($plugins !== false)
+ { if(file_exists($this->plugins_data_dir()) && is_dir($this->plugins_data_dir()))
+ { if($dh = opendir($this->plugins_data_dir()))
+ { $plugins_data_files = array();
+ $OK = true;
+ while($OK && ($plugin_name = readdir($dh)) !== false)
+ { if(substr($plugin_name, 0 ,1) != "." && !is_dir($this->plugin_data_file($plugin_name)))
+ { if(!$plugins[$plugin_name]) $this->del_plugin_data($plugin_name);
+ }
+ if(!$OK) $plugins = false;
+ }
+ closedir($dh);
+ }
+ }
+ }
+ }
+ else $plugins = false;
+ }
+ if($plugins !== false)
+ { if($PRIORITE == "ASC") $this->plugins_asc = $this->ordonne_plugins($plugins, $PRIORITE);
+ elseif($PRIORITE == "DESC") $this->plugins_desc = $this->ordonne_plugins($plugins, $PRIORITE);
+ }
+ else
+ { $this->plugins_asc = false;
+ $this->plugins_desc = false;
+ }
+ }
+
+ function ordonne_plugins($plugins, $PRIORITE = "ASC")
+ { $values = array_values($plugins);
+ $maximum = count($values);
+ while($maximum > 0)
+ { $maximumTemporaire = 0;
+ for($i = 0; $i < $maximum - 1; $i++)
+ { if
+ ( ($PRIORITE == "ASC" && $values[$i]["priorite"] > $values[$i + 1]["priorite"])
+ || ($PRIORITE == "DESC" && $values[$i]["priorite"] < $values[$i + 1]["priorite"])
+ )
+ { $tmp = $values[$i];
+ $values[$i] = $values[$i + 1];
+ $values[$i + 1] = $tmp;
+ $maximumTemporaire = $i + 1;
+ }
+ }
+ $maximum = $maximumTemporaire;
+ }
+ $res = array();
+ foreach($values as $value) if($value["name"]) $res[$value["name"]] = $value;
+ return $res;
+ }
+
+ function plugin_call($impl, $method) { if(method_exists($impl, $method)) return $impl->$method($this); }
+
+ # ---------------------------------------------------------------------------------
+ # impl
+ #
+
+ function plugin_impl($plugin_name)
+ { $plugin = false;
+ if(file_exists($this->path("plugins")))
+ { if(substr($plugin_name, 0 ,1) !== "." && is_dir($this->path("plugins").$plugin_name))
+ { if(file_exists($this->path("plugins").$plugin_name."/".$plugin_name.".php"))
+ { require $this->path("plugins").$plugin_name."/".$plugin_name.".php";
+ if(class_exists($plugin_name))
+ { $plugin = new $plugin_name();
+ }
+ }
+ }
+ }
+ return $plugin;
+ }
+
+ # ---------------------------------------------------------------------------------
+ # data
+ #
+
+ function plugins_data_dir()
+ { return $this->path("content")."data/plugins/";
+ }
+
+ function plugin_data_file($plugin_name)
+ { return $this->plugins_data_dir().$plugin_name;
+ }
+
+ function plugin_data($plugin_name)
+ { $data_file = $this->plugin_data_file($plugin_name);
+ $data = array();
+ if(file_exists($data_file))
+ { if($content = file_get_contents($data_file))
+ { $data = unserialize($content);
+ }
+ }
+ return $data;
+ }
+
+ function set_plugin_data($plugin_name, $data)
+ { $data_file = $this->plugin_data_file($plugin_name);
+ $content = serialize($data);
+ $OK = false;
+ if($fh = fopen($data_file, "w"))
+ { if(fwrite($fh, $content) !== false)
+ { $OK = true;
+ }
+ fclose($fh);
+ }
+ return $OK;
+ }
+
+ function del_plugin_data($plugin_name)
+ { $data_file = $this->plugin_data_file($plugin_name);
+ if(file_exists($data_file)) return @unlink($data_file);
+ return true;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_run extends mw_env
+ {
+ var $etat;
+
+ function user()
+ { $data = $this->data();
+ return $data->get_session_user();
+ }
+
+ function set_etat($etat, $valid_status = true)
+ { if(($this->etat = $this->valid_etat($etat)) !== false)
+ { if(!$valid_status || $this->status_ok($this->etat, false))
+ { return $this->etat;
+ }
+ else $this->erreur("Vous n'avez pas le statut requis pour effectuer cette action");
+ }
+ else $this->erreur("etat invalide");
+ return false;
+ }
+
+ function valid_etat($etat)
+ { $_etat = array();
+ $_etat["mod"] = "";
+ $_etat["controller"] = "";
+ $_etat["action"] = "";
+ if(is_array($etat))
+ { $_etat["mod"] = isset($etat["mod"]) ? $etat["mod"] : "";
+ $_etat["controller"] = isset($etat["controller"]) ? $etat["controller"] : "";
+ $_etat["action"] = isset($etat["action"]) ? $etat["action"] : "";
+ }
+ else
+ { $etat = explode("/", $etat);
+ foreach($etat as $etat_item)
+ { if($etat_item)
+ { if(!$_etat["mod"]) $_etat["mod"] = $etat_item;
+ else
+ { if(!$_etat["controller"]) $_etat["controller"] = $etat_item;
+ else
+ { if(!$_etat["action"]) $_etat["action"] = $etat_item;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if(!$_etat["mod"])
+ { $_etat["mod"] = "index";
+ $_etat["controller"] = "index";
+ $_etat["action"] = "index";
+ }
+ else
+ { if(!$_etat["controller"])
+ { $_etat["controller"] = "index";
+ $_etat["action"] = "index";
+ }
+ else
+ { if(!$_etat["action"]) $_etat["action"] = "index";
+ }
+ }
+ if
+ ( is_array($_etat)
+ && count($_etat) == 3
+ && isset($_etat["mod"]) && preg_match("/^[a-zA-Z0-9_]+$/", $_etat["mod"])
+ && isset($_etat["controller"]) && preg_match("/^[a-zA-Z0-9_]+$/", $_etat["controller"])
+ && isset($_etat["action"]) && preg_match("/^[a-zA-Z0-9_]+$/", $_etat["action"])
+ ) return $_etat;
+ return false;
+ }
+
+ function etat_is_valid()
+ { return $this->valid_etat($this->etat);
+ }
+
+ function status_ok($etat, $CHECK_FORMAT = true)
+ { $OK = $this->config("default_allow");
+ $data = $this->data();
+ if($CHECK_FORMAT) $etat = $this->valid_etat($etat);
+ if($etat !== false)
+ { if(($user_status = $data->get_user_status()) !== false)
+ { if
+ ( ( $action_status = $data->get_action_status
+ ( $etat["mod"],
+ $etat["controller"],
+ $etat["action"]
+ )
+ ) !== false
+ )
+ { $action = $etat["mod"]."/".$etat["controller"]."/".$etat["action"];
+ if(isset($action_status[$action]))
+ { $OK = $action_status[$action][0] || (isset($action_status[$action][$user_status]) && $action_status[$action][$user_status]);
+ }
+ else
+ { $action = $etat["mod"]."/".$etat["controller"];
+ if(isset($action_status[$action]))
+ { $OK = $action_status[$action][0] || (isset($action_status[$action][$user_status]) && $action_status[$action][$user_status]);
+ }
+ else
+ { $action = $etat["mod"];
+ if(isset($action_status[$action]))
+ { $OK = $action_status[$action][0] || (isset($action_status[$action][$user_status]) && $action_status[$action][$user_status]);
+ }
+ }
+ }
+ }
+ else $this->erreur("Impossible de lire les status des actions en base");
+ }
+ else $this->erreur("Impossible de lire le statut de l'utilisateur courant");
+ }
+ else $this->erreur("etat invalide");
+ return $OK;
+ }
+
+ function run($etat, $valid_status = true, $params = array(), $method = "GET")
+ { if($this->set_etat($etat, $valid_status))
+ { $controller_file = "mods/".$this->etat("mod")."/".$this->etat("controller").".php";
+ if($this->app_file_exists($controller_file = "mods/".$this->etat("mod")."/".$this->etat("controller").".php", "DESC"))
+ { if(!class_exists("mw_mod")) require $this->app_file("mods/mw_mod.php");
+ if(!class_exists($controller_class = "mw_".$this->etat("mod")."_".$this->etat("controller")))
+ { require $this->app_file($controller_file, "DESC");
+ }
+ if(class_exists($controller_class))
+ { $controller = new $controller_class();
+ $action_method = $this->etat("action");
+ if(method_exists($controller, $action_method))
+ { foreach($params as $key => $value)
+ { switch(strtolower($method))
+ { case "get": $_GET[$this->param($key)] = $value; break;
+ case "post": $_POST[$key] = $value; break;
+ default: break;
+ }
+ }
+ if(($controller_validate = $controller->validate($this)) === true)
+ { if(($controller_prepare_inputs = $controller->prepare_inputs($this)) === true)
+ { $controller->$action_method($this);
+ }
+ else $this->erreur($controller_prepare_inputs);
+ }
+ else $this->erreur($controller_validate);
+ }
+ else $this->erreur("Impossible de trouver l'action ".$this->etat("action"));
+ }
+ else $this->erreur("Impossible d'instancier le controleur ".$this->etat("controller"));
+ }
+ else $this->erreur("Impossible de trouver le controleur ".$this->etat("controller")." pour le module ".$this->etat("mod"));
+ }
+ else $this->erreur("Impossible d'effectuer cette action");
+ }
+
+ function etat($name) { return $this->etat[$name]; }
+
+ function check_stop()
+ { return $this->etat("mod") == "reponses";
+ }
+
+ function get_mod($mod_name)
+ { if($etat = $this->valid_etat($mod_name))
+ { if($this->app_file_exists($controller_file = "mods/".$etat["mod"]."/".$etat["controller"].".php"))
+ { if(!class_exists("mw_mod")) require $this->app_file("mods/mw_mod.php");
+ if(!class_exists($controller_class = "mw_".$etat["mod"]."_".$etat["controller"]))
+ { require $this->app_file($controller_file);
+ }
+ if(class_exists($controller_class))
+ { return new $controller_class();
+ }
+ }
+ }
+ return false;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env_urls extends mw_env
+ {
+ var $additional_get_params;
+
+ function init_additional_get_params()
+ { $this->additional_get_params = array();
+ $_params = $_SERVER["QUERY_STRING"];
+ $v_params = explode("&", $_params);
+ foreach($v_params as $param)
+ { if($param)
+ { $key = strpos($param, "=") === false ? $param : substr($param, 0, strpos($param, "="));
+ $value = strpos($param, "=") === false ? "" : substr($param, strpos($param, "=") + 1);
+ if(!$this->is_a_param($key)) $this->additional_get_params[$key] = $value;
+ }
+ }
+ }
+
+ function is_a_param($key)
+ { foreach($this->get_PARAMS() as $_key => $_value) if(strcmp($key, $_value) == 0) return true;
+ return false;
+ }
+
+ function url($action = "", $_params = array(), $script_name = "index.php")
+ { if($action) $_params["e"] = $action;
+ $get_params = "";
+ if(isset($this->additional_get_params)) foreach($this->additional_get_params as $key => $value) $get_params .= ($get_params ? "&" : "?").$key."=".$value;
+ foreach($_params as $key => $value) $get_params .= ($get_params ? "&" : "?").$this->param($key)."=".$value;
+ return $this->path("web").$script_name.$get_params;
+ }
+
+ function redirect($url, $message, $wait = 1)
+ { $this->set_etat("reponses/html/redirect_javascript", false);
+ $this->set_out
+ ( "redirect",
+ array
+ ( "url" => str_replace("&", "&", $url),
+ "message" => $message,
+ "wait" => $wait
+ )
+ );
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_env extends empty_class
+ {
+
+ function app_file_exists($file, $PRIORITE = "ASC")
+ { $app_file = $this->_app_file($file, $PRIORITE);
+ return $app_file ? true : false;
+ }
+
+ function app_file($file, $PRIORITE = "ASC")
+ { $app_file = $this->_app_file($file, $PRIORITE);
+ return $app_file ? $app_file : $file;
+ }
+
+ function _app_file($file, $PRIORITE = "ASC")
+ { $app_file = false;
+ if($PRIORITE == "ASC" && file_exists($this->path("app").$file)) return $this->path("app").$file;
+ if(($plugins = $this->plugins($PRIORITE)) !== false)
+ { foreach($plugins as $plugin_name => $plugin)
+ { if($file && $plugin["installed"] && $plugin["enabled"] && file_exists($this->path("plugins").$plugin_name."/app/".$file))
+ { $app_file = $this->path("plugins").$plugin_name."/app/".$file;
+ break;
+ }
+ }
+ if($PRIORITE == "DESC" && !$app_file)
+ { if(file_exists($this->path("app").$file)) $app_file = $this->path("app").$file;
+ }
+ }
+ return $app_file;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ function debug($content)
+ { echo "<pre class=\"debug\">\n".htmlentities(print_r($content, true))."\n</pre>\n";
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if(get_magic_quotes_gpc())
+ { $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
+ while(list($key, $val) = each($process))
+ { foreach($val as $k => $v)
+ { unset($process[$key][$k]);
+ if(is_array($v))
+ { $process[$key][stripslashes($k)] = $v;
+ $process[] = &$process[$key][stripslashes($k)];
+ }
+ else $process[$key][stripslashes($k)] = stripslashes($v);
+ }
+ }
+ unset($process);
+ }
+
+
+
+ /*
+ *
+ * decommentez la fin du fichier pour activer le filtrage
+ * des inputs (ici POST et FILES)
+ *
+
+ if($_POST)
+ { require $this->path("libs")."inputfilter.php";
+ $allowed_tags = array
+ ( "p", "span", "pre", "blockquote", "address", "hr", "br",
+ "img",
+ "strong", "em", "u", "i", "b", "s",
+ "a",
+ "ul", "ol", "li",
+ "h1", "h2", "h3", "h4", "h5", "h6"
+ );
+ $allowed_attrs = array
+ ( "style",
+ "src", "alt", "width", "height",
+ "href", "title"
+ );
+ $input_filter = new InputFilter($allowed_tags, $allowed_attrs);
+ $_POST = $input_filter->process($_POST);
+ }
+
+ if($_FILES)
+ { foreach($_FILES as $file_key => $file_infos)
+ { $v_name = explode(".", $file_infos["name"]);
+ $ext = strtolower($v_name[count($v_name) - 1]);
+ if
+ ( $ext != "png"
+ && $ext != "jpg"
+ && $ext != "jpeg"
+ && $ext != "gif"
+ ) unset($_FILES[$file_key]);
+ }
+ }
+
+ */
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ require $this->app_file("data/mw_sgbd.php");
+ require $this->app_file("data/mw_data.php");
+ if($this->app_file_exists("data/impl/mw_".$this->bdd("sgbd").".php"))
+ { require $this->app_file("data/impl/mw_".$this->bdd("sgbd").".php");
+ if(class_exists($sgbd_impl = "mw_".$this->bdd("sgbd")))
+ { if(($plugins = $this->plugins("DESC")) !== false)
+ { $data = new mw_data(true);
+ foreach($plugins as $plugin_name => $plugin)
+ { if($plugin["installed"] && $plugin["enabled"])
+ { $data->load_modules($this->path("plugins").$plugin_name."/app/", "data/modules/share/");
+ $data->load_modules($this->path("plugins").$plugin_name."/app/", "data/modules/".($this->bdd("sgbd") == "xml" ? "xml" : "sql")."/");
+ }
+ }
+ $data->load_modules($this->path("app"), "data/modules/share/");
+ $data->load_modules($this->path("app"), "data/modules/".($this->bdd("sgbd") == "xml" ? "xml" : "sql")."/");
+ $sgbd = new mw_sgbd
+ ( new $sgbd_impl
+ ( $this->bdd("host"),
+ $this->bdd("base"),
+ $this->bdd("user"),
+ $this->bdd("password")
+ ),
+ $this
+ );
+ if($sgbd->extention_ok())
+ { $data->set_sgbd($sgbd);
+ $data->set_env($this);
+ $this->set_data($data);
+ }
+ else $this->erreur("L'extention php ".$this->bdd("sgbd")." n'est pas installée", true);
+ }
+ else $this->erreur("Impossible de lire les plugins pour charger les modules de donnees");
+ }
+ else $this->erreur("Impossible de trouver la classe d'implementation du sgbd ".$this->bdd("sgbd"), true);
+ }
+ else $this->erreur("Impossible de trouver le fichier d'implementation du sgbd ".$this->bdd("sgbd"), true);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if(($config = $data->config()) !== false)
+ { $this->set_config($config);
+ $start_action_params_config = $this->config("start_action_params") ? @unserialize($this->config("start_action_params")) : array();
+ $out_config = $this->config("out");
+ $out_config .= $out_config && substr($out_config, -1) != "/" ? "/" : "";
+ $this->set_config
+ ( array
+ ( "out" => $out_config,
+ "start_action_params" => $start_action_params_config
+ )
+ );
+ if($this->set_out_config($data->out_config()) === false) $this->erreur("Impossible de lire la configuration du template");
+ }
+ else $this->erreur("Impossible de lire la configuration", true);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if($data->load_session() !== false)
+ { if($data->init_user_status($this->config("user_status")) !== false)
+ { if($data->init_action_status($this->config("action_status")) !== false)
+ {
+ }
+ else $this->erreur("Impossible de charger les statuts des actions", true);
+ }
+ else $this->erreur("Impossible de charger les statuts des utilisateurs", true);
+ }
+ else $this->erreur("Impossible de charger la session", true);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if(($check_instance_return = $data->check_instance()) !== false)
+ { if($check_instance_return === true)
+ {
+ }
+ else $this->erreur($check_instance_return, true);
+ }
+ else $this->erreur("Impossible de verifier l'integrité de la base de donné", true);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if($this->init_links())
+ { $this->set_link("admin/config", $this->url("admin/config"), "Configuration", 10);
+ $this->set_link("admin/users", $this->url("admin/users"), "Utilisateurs", 20);
+ $this->set_link("admin/plugins", $this->url("admin/plugins"), "Plugins", 30);
+ }
+ else $this->erreur("impossible de charger les liens", true);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if(($plugins = $this->plugins("DESC")) !== false)
+ { foreach($plugins as $plugin_name => $plugin)
+ { if($plugin["installed"] && $plugin["enabled"])
+ { if(!$plugin["impl"]->init($this)) $this->erreur("erreur lors de l'initialisation du plugin ".$plugin_name, true);
+ }
+ }
+ }
+ else $this->erreur("erreur lors de l'initialisation des plugins", true);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ header("Content-type: text/html; charset=UTF-8");
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ function __mw($config_file, $etat = "")
+ { require $config_file;
+ $PATHES["app"] .= $PATHES["app"] && substr($PATHES["app"], -1) != "/" ? "/" : "";
+ $PATHES["libs"] .= $PATHES["libs"] && substr($PATHES["libs"], -1) != "/" ? "/" : "";
+ if($sxml_class_file = (file_exists($PATHES["libs"]."sxml.php") ? $PATHES["libs"]."sxml.php" : ""))
+ { if($empty_class_file = (file_exists($PATHES["libs"]."empty_class.php") ? $PATHES["libs"]."empty_class.php" : ""))
+ { if($env_class_file = (file_exists($PATHES["app"]."env/mw_env.php") ? $PATHES["app"]."env/mw_env.php" : ""))
+ { require $sxml_class_file;
+ require $empty_class_file;
+ require $env_class_file;
+ $env = new mw_env(true);
+ $env->load_modules($PATHES["app"], "env/modules/");
+ $env->set_config_file($config_file);
+ $env->set_PATHES($PATHES);
+ $env->init_plugins();
+ $env->load_config($bdd, $CONFIG);
+ $env->init();
+ $etat = ($etat === false ? false : ($etat ? $etat : (isset($_GET[$env->param("e")]) ? $_GET[$env->param("e")] : "")));
+ if($etat !== false) $env->run($etat);
+ return $env;
+ }
+ else echo "<pre>impossible de trouver le fichier <strong>env/mw_env.php</strong></pre>";
+ }
+ else echo "<pre>impossible de trouver le fichier <strong>".$libs_path."empty_class.php</strong></pre>";
+ }
+ else echo "<pre>impossible de trouver le fichier <strong>".$libs_path."sxml.php</strong></pre>";
+ return false;
+ }
+
+ function __mw_display($env)
+ { if($env->etat_is_valid()) $env->render_layout($env->init_layout());
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_admin_config extends mw_mod
+ {
+
+ var $groupes;
+ var $albums;
+ var $status;
+ var $album_status_id;
+
+ function index(&$env)
+ { $data = $env->data();
+ if(($CONFIG = $env->get_CONFIG()) !== false)
+ { if(!$CONFIG["out"]) $CONFIG["out"] = "dist";
+ $env->set_out("config", $CONFIG);
+ if(($out_config = $env->get_out_config()) !== false)
+ { $env->set_out("out_config", $out_config);
+ if($env->set_out("out_pathes", $env->out_pathes()) !== false)
+ { if($_POST)
+ { $env->set_out("config", $_POST);
+ if(preg_match("/^[0-9]+$/", $_POST["max_list"]))
+ { if(!$_POST["contact_form"] || trim($_POST["email"]))
+ { $CONTINUE = true;
+ if($CONTINUE && $data->set_config("site_name", $_POST["site_name"]));
+ else $CONTINUE = false;
+ if($CONTINUE && $data->set_config("description", $_POST["description"]));
+ else $CONTINUE = false;
+ if($CONTINUE && $data->set_config("max_list", $_POST["max_list"]));
+ else $CONTINUE = false;
+ if($CONTINUE && $data->set_config("contact_form", $_POST["contact_form"] ? "1" : "0"));
+ else $CONTINUE = false;
+ if($CONTINUE && $data->set_config("email", $_POST["email"]));
+ else $CONTINUE = false;
+ if($CONTINUE && $data->set_config("captcha", $_POST["captcha"] ? "1" : "0"));
+ else $CONTINUE = false;
+ if($CONTINUE && $data->set_config("out", $_POST["out"]));
+ else $CONTINUE = false;
+ if($CONTINUE)
+ { foreach($out_config as $key => $values)
+ { if($data->set_config("out_".$key, isset($_POST["out_".$key]) ? $_POST["out_".$key] : "") === false)
+ { $CONTINUE = false;
+ break;
+ }
+ }
+ }
+ if($CONTINUE) $env->redirect
+ ( $env->url("admin/config"),
+ "la configuration a été enregistrée"
+ );
+ else $env->erreur("Impossible d'enregistrer la configuration");
+ }
+ else $env->message("merci de préciser un email pour le formulaire de contact");
+ }
+ else $env->message("la taille maximum des listes doit être un nombre");
+ }
+ }
+ else $env->erreur("Impossible de lire la liste des templates");
+ }
+ else $env->erreur("Impossible de lire l configuration du templates");
+ }
+ else $env->erreur("Impossible de lire la configuration");
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_admin_index extends mw_mod
+ {
+ function index(&$env)
+ { $env->run("admin/config");
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_admin_plugins extends mw_mod
+ {
+ var $plugins;
+
+ function validate(&$env)
+ { if(($this->plugins = $env->plugins("DESC")) === false) return "impossible de lire la liste des plugins";
+ return true;
+ }
+
+ function index(&$env)
+ { if($this->plugins !== false)
+ { if($_POST)
+ { $OK = true;
+ foreach($this->plugins as $plugin_name => $plugin)
+ { if(isset($_POST["priorite_".$plugin_name]))
+ { $this->plugins[$plugin_name]["priorite"] = $_POST["priorite_".$plugin_name];
+ if(!preg_match("/^[0-9]+(\.[0-9]+)?$/", $_POST["priorite_".$plugin_name]))
+ { $env->message("les priorités des plugins doivent être des nombres");
+ $OK = false;
+ break;
+ }
+ }
+ else $this->plugins[$plugin_name]["priorite"] = 0;
+ }
+ if($OK)
+ { foreach($this->plugins as $plugin_name => $plugin)
+ { $plugin_data = array
+ ( "installed" => $this->plugins[$plugin_name]["installed"],
+ "enabled" => $this->plugins[$plugin_name]["enabled"],
+ "priorite" => $this->plugins[$plugin_name]["priorite"]
+ );
+ if(!$env->set_plugin_data($plugin_name, $plugin_data))
+ { $env->erreur("impossible de mettre à jour la priorité du plugin ".$plugin_name);
+ $OK = false;
+ break;
+ }
+ }
+ if($OK)
+ { $env->redirect
+ ( $env->url("admin/plugins/index"),
+ "les priorités des plugins ont été enregistrées"
+ );
+ }
+ }
+ }
+ $env->set_out("plugins", $this->plugins);
+ }
+ else $env->erreur("impossible de lire la liste des plugins");
+ }
+
+ function install(&$env)
+ { $plugin_name = $_GET[$env->param("id")];
+ if(isset($this->plugins[$plugin_name]))
+ { $impl = $this->plugins[$plugin_name]["impl"];
+ $res = $impl->install($env);
+ if($res === true)
+ { $plugin_data = array
+ ( "installed" => true,
+ "enabled" => false,
+ "priorite" => isset($this->plugins[$plugin_name]["priorite"]) ? $this->plugins[$plugin_name]["priorite"] : 0
+ );
+ if($env->set_plugin_data($plugin_name, $plugin_data))
+ { $env->redirect
+ ( $env->url("admin/plugins/index"),
+ "le plugin a été installé"
+ );
+ }
+ else $env->erreur("impossible de mettre à jour le statut du plugin ".$plugin_name);
+ }
+ else $env->erreur("erreur lors de l'installation du plugin ".$plugin_name."<br>".$res);
+ }
+ else $env->erreur("impossible de trouver le plugin ".$plugin_name);
+ }
+
+ function uninstall(&$env)
+ { $plugin_name = $_GET[$env->param("id")];
+ if(isset($this->plugins[$plugin_name]))
+ { $impl = $this->plugins[$plugin_name]["impl"];
+ $res= $impl->uninstall($env);
+ if($res === true)
+ { $plugin_data = array
+ ( "installed" => false,
+ "enabled" => false,
+ "priorite" => isset($this->plugins[$plugin_name]["priorite"]) ? $this->plugins[$plugin_name]["priorite"] : 0
+ );
+ if($env->set_plugin_data($plugin_name, $plugin_data))
+ { $env->redirect
+ ( $env->url("admin/plugins/index"),
+ "le plugin a été désinstallé"
+ );
+ }
+ else $env->erreur("impossible de mettre à jour le statut du plugin ".$plugin_name);
+ }
+ else $env->erreur("erreur lors de la désinstallation du plugin ".$plugin_name."<br>".$res);
+ }
+ else $env->erreur("impossible de trouver le plugin ".$plugin_name);
+ }
+
+ function enable(&$env)
+ { $plugin_name = $_GET[$env->param("id")];
+ if(isset($this->plugins[$plugin_name]))
+ { if($this->plugins[$plugin_name]["installed"])
+ { if(!$this->plugins[$plugin_name]["enabled"])
+ { $impl = $this->plugins[$plugin_name]["impl"];
+ $res = $impl->enable($env);
+ if($res === true)
+ { $plugin_data = array
+ ( "installed" => true,
+ "enabled" => true,
+ "priorite" => isset($this->plugins[$plugin_name]["priorite"]) ? $this->plugins[$plugin_name]["priorite"] : 0
+ );
+ if($env->set_plugin_data($plugin_name, $plugin_data))
+ { $env->redirect
+ ( $env->url("admin/plugins/index"),
+ "le plugin a été activé"
+ );
+ }
+ else $env->erreur("impossible de mettre à jour le statut du plugin ".$plugin_name);
+ }
+ else $env->erreur("erreur lors de l'activation du plugin ".$plugin_name."<br>".$res);
+ }
+ else $env->erreur("le plugin ".$plugin_name." est déjà actif");
+ }
+ else $env->erreur("le plugin ".$plugin_name." n'est pas installé");
+ }
+ else $env->erreur("impossible de trouver le plugin ".$plugin_name);
+ }
+
+ function disable(&$env)
+ { $plugin_name = $_GET[$env->param("id")];
+ if(isset($this->plugins[$plugin_name]))
+ { if($this->plugins[$plugin_name]["installed"])
+ { if($this->plugins[$plugin_name]["enabled"])
+ { $impl = $this->plugins[$plugin_name]["impl"];
+ $res = $impl->disable($env);
+ if($res === true)
+ { $plugin_data = array
+ ( "installed" => true,
+ "enabled" => false,
+ "priorite" => isset($this->plugins[$plugin_name]["priorite"]) ? $this->plugins[$plugin_name]["priorite"] : 0
+ );
+ if($env->set_plugin_data($plugin_name, $plugin_data))
+ { $env->redirect
+ ( $env->url("admin/plugins/index"),
+ "le plugin a été désactivé"
+ );
+ }
+ else $env->erreur("impossible de mettre à jour le statut du plugin ".$plugin_name);
+ }
+ else $env->erreur("erreur lors de la désactivation du plugin ".$plugin_name."<br>".$res);
+ }
+ else $env->erreur("le plugin ".$plugin_name." est déjà inactif");
+ }
+ else $env->erreur("le plugin ".$plugin_name." n'est pas installé");
+ }
+ else $env->erreur("impossible de trouver le plugin ".$plugin_name);
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_admin_users extends mw_mod
+ {
+ var $status;
+
+ function validate(&$env)
+ { $data = $env->data();
+ if(($this->status = $data->status()) === false) return "impossible de lire la liste des statuts";
+ return true;
+ }
+
+ function index(&$env)
+ { $data = $env->data();
+ if
+ ( $env->set_out
+ ( "users",
+ $data->users
+ ( $_GET[$env->param("start")] ? $_GET[$env->param("start")] : 0,
+ $_GET[$env->param("alpha")],
+ $_GET[$env->param("status")]
+ )
+ ) !== false
+ )
+ { if($this->status)
+ { $env->set_out("status", $this->status);
+ }
+ else $env->erreur("impossible de lire la liste des status");
+ }
+ else $env->erreur("impossible de lire la liste des utilisateurs");
+ }
+
+ function add(&$env)
+ { $data = $env->data();
+ if($this->status)
+ { $env->set_out("status", $this->status);
+ $env->set_out("user", array("status" => $data->creation_default_status()));
+ if($_POST)
+ { $env->set_out("user", $_POST);
+ if($_POST["login"])
+ { if(($exists = $data->user($_POST["login"])) !== false)
+ { if(!$exists)
+ { $VALID = true;
+ if(!$_POST["email"])
+ { $env->message("merci de preciser un email");
+ $VALID = false;
+ }
+ if(!$_POST["password"])
+ { $env->message("merci de preciser un mot de passe");
+ $VALID = false;
+ }
+ if($_POST["password"] != $_POST["password_confirm"])
+ { $env->message("la confirmation du mot de passe est incorrecte");
+ $VALID = false;
+ }
+ if($VALID)
+ { if
+ ( $data->add_user
+ ( $_POST["login"],
+ md5($_POST["password"]),
+ $_POST["email"],
+ $_POST["status"]
+ )
+ )
+ $env->redirect
+ ( $env->url("admin/users"),
+ "l'utilisateur <strong>".$_POST["login"]."</strong> a été ajouté"
+ );
+ else $env->erreur("Impossible d'ajouter l'utilisateur");
+ }
+ }
+ else $env->message("ce login existe déjà");
+ }
+ else $env->erreur("impossible de savoir si cet login existe déjà");
+ }
+ else $env->message("merci de préciser un login");
+ }
+ }
+ else $env->erreur("impossible de lire la liste des status");
+ }
+
+ function edit(&$env)
+ { $data = $env->data();
+ if($this->status)
+ { $env->set_out("status", $this->status);
+ if($env->set_out("user", $data->user($_GET[$env->param("id")])))
+ { if($_POST)
+ { $user = $env->out("user");
+ $id = $user["id"];
+ $login = $user["login"];
+ $password = $user["password"];
+ $_POST["login"] = $login;
+ $env->set_out("user", $_POST);
+ $VALID = true;
+ if(!$_POST["email"])
+ { $env->message("merci de preciser un email");
+ $VALID = false;
+ }
+ if(isset($_POST["change_password"]) && $_POST["change_password"])
+ { if(!$_POST["password"])
+ { $env->message("merci de preciser un mot de passe");
+ $VALID = false;
+ }
+ if($_POST["password"] != $_POST["password_confirm"])
+ { $env->message("la confirmation du mot de passe est incorrecte");
+ $VALID = false;
+ }
+ }
+ if($VALID)
+ { if
+ ( $data->set_user
+ ( $id,
+ $login,
+ isset($_POST["change_password"]) && $_POST["change_password"] ? md5($_POST["password"]) : $password,
+ $_POST["email"],
+ $_POST["status"]
+ )
+ )
+ $env->redirect
+ ( $env->url("admin/users"),
+ "l'utilisateur <strong>".$login."</strong> a été modifié"
+ );
+ else $env->erreur("Impossible de mettre à jour l'utilisateur");
+ }
+ }
+ }
+ else $env->erreur("Impossible de lire les informations de cet utilisateur");
+ }
+ else $env->erreur("impossible de lire la liste des status");
+ }
+
+ function del(&$env)
+ { $data = $env->data();
+ if($env->set_out("user", $data->user($_GET[$env->param("id")])))
+ { $user = $env->out("user");
+ if($data->del_user($_GET[$env->param("id")])) $env->redirect
+ ( $env->url("admin/users"),
+ "l'utilisateur <strong>".$user["login"]."</strong> a été supprimé"
+ );
+ else $env->erreur("Impossible de supprimer l'utilisateur");
+ }
+ else $env->erreur("Impossible de lire les informations de cet utilisateur");
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ if(file_exists($this->path("libs")."ptitcaptcha.php")) require $this->path("libs")."ptitcaptcha.php";
+
+ class mw_forms_contact extends mw_mod
+ {
+
+ function validate(&$env)
+ { if($pages_view_mod = $env->get_mod("pages/view"))
+ { return $pages_view_mod->validate(&$env);
+ }
+ return true;
+ }
+
+ function index(&$env)
+ { if($env->config("contact_form") && $env->config("email"))
+ { if($_POST)
+ { if
+ ( $this->send
+ ( $env,
+ $_POST["email"],
+ "[".$env->config("site_name")."] nouveau message",
+ $_POST["message"],
+ $env->config("email"),
+ $env->config("captcha")
+ )
+ )
+ { $env->redirect
+ ( $env->url("index"),
+ "Le message a été envoyé",
+ 2
+ );
+ }
+ }
+ }
+ else $env->run("index");
+ }
+
+ function send(&$env, $from, $titre, $message, $dest, $captcha)
+ { $env->set_out("ENVOYE", false);
+ if($captcha && !file_exists($env->path("libs")."ptitcaptcha.php"))
+ { $env->erreur("fichier du captcha introuvable");
+ return false;
+ }
+ if(!$captcha || PtitCaptchaHelper::checkCaptcha())
+ { if($from)
+ { if($dest)
+ { if
+ ( mail
+ ( $dest,
+ $titre,
+ $message,
+ "From: ".$from."\r\n"
+ ."Reply-To: ".$from."\r\n"
+ )
+ )
+ { $env->set_out("ENVOYE", true);
+ return true;
+ }
+ else $env->erreur("Erreur à l'envoi du mail");
+ }
+ else $env->erreur("Impossible de trouver l'email du destinataire");
+ }
+ else $env->message("merci de préciser un email");
+ }
+ else $env->message("anti-spam incorrect");
+ return false;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_index_index extends mw_mod
+ {
+
+ function index(&$env)
+ { $start_action = $env->config("start_action");
+ if($start_action)
+ { $start_action_params = $env->config("start_action_params");
+ if($start_action_params && is_array($start_action_params))
+ { foreach($start_action_params as $key => $value) $_GET[$key] = $value;
+ }
+ $env->run($start_action);
+ }
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_mod
+ {
+ function validate(&$env) { return true; }
+
+ function prepare_inputs(&$env) { return true; }
+// function prepare_inputs(&$env) { return $env->prepare_inputs(); }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_reponses_html extends mw_mod
+ {
+ function index(&$env)
+ {
+ }
+
+ function redirect_javascript(&$env)
+ {
+ }
+
+ function erreur(&$env)
+ {
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_users_compte extends mw_mod
+ {
+
+ var $status;
+ var $user;
+
+ var $validation_result;
+
+ function validate(&$env)
+ { $this->validation_result = true;
+ $this->validate_status($env);
+ $this->validate_user($env);
+ return true;
+ }
+
+ function validate_status(&$env)
+ { $data = $env->data();
+ if(($this->status = $data->status()) !== false) $this->validation_result = true;
+ else $this->validation_result = "impossible de lire la liste des statuts";
+ }
+
+ function validate_user(&$env)
+ { if($this->user = $env->user()) $this->validation_result = true;
+ else $this->validation_result = "Vous devez être identifier pour accéder à cette page";
+ }
+
+ function index(&$env)
+ { if($this->validation_result === true)
+ { $env->run("users/infos");
+ }
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_users_identification extends mw_mod
+ {
+ function index(&$env)
+ {
+ }
+
+ function login(&$env)
+ { if(!$env->user())
+ { $data = $env->data();
+ if($data->login(trim($_POST['login']), trim($_POST['pass'])))
+ { $env->redirect
+ ( isset($_POST["from"]) ? urldecode($_POST["from"]) : $this->env->url(),
+ "Vous êtes maintenant identifié en tant que ".$_POST['login']
+ );
+ }
+ else $env->message("Idantifiants incorrects");
+ }
+ else $env->message("Vous êtes déjà identifié");
+ }
+
+ function logout(&$env)
+ { $data = $env->data();
+ if($data->logout())
+ { $env->redirect
+ ( $env->url(),
+ "Vous n'êtes plus identifié sur le site"
+ );
+ }
+ else $env->message("Erreur lors de la deconnection. il se peut que vous soyez encore identifié");
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_users_index extends mw_mod
+ {
+ function index(&$env)
+ { $env->run("users/infos");
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_users_infos extends mw_mod
+ {
+
+ var $users_compte_mod;
+
+ function validate(&$env)
+ { if($this->users_compte_mod = $env->get_mod("users/compte"))
+ { $this->users_compte_mod->validation_result = true;
+ $this->users_compte_mod->validate_status($env);
+ $this->users_compte_mod->validate_user($env);
+ return $this->users_compte_mod->validation_result;
+ }
+ return "impossible de trouver le module users/compte";
+ }
+
+ function index(&$env)
+ { $env->run("users/infos/edit");
+ }
+
+ function edit(&$env)
+ { if(isset($this->users_compte_mod->user) && $this->users_compte_mod->user !== false)
+ { $user = $this->users_compte_mod->user;
+ if($_POST)
+ { $data = $env->data();
+ $VALID = true;
+ if($_POST["email"]) $user["email"] = $_POST["email"];
+ else
+ { $env->message("merci de preciser un email");
+ $VALID = false;
+ }
+ if($VALID && isset($_POST["change_password"]) && $_POST["change_password"])
+ { if($_POST["password"])
+ { if($_POST["password"] == $_POST["password_confirm"])
+ { $user["password"] = md5($_POST["password"]);
+ }
+ else
+ { $env->message("la confirmation du mot de passe est incorrecte");
+ $VALID = false;
+ }
+ }
+ else
+ { $env->message("merci de preciser un mot de passe");
+ $VALID = false;
+ }
+ }
+ if($VALID)
+ { if
+ ( $data->set_user
+ ( $user["id"],
+ $user["login"],
+ $user["password"],
+ $user["email"],
+ $user["status"]
+ )
+ )
+ $env->redirect
+ ( $env->url("users/infos"),
+ "vos informations ont été modifiées"
+ );
+ else $env->erreur("Impossible de mettre à jour l'utilisateur");
+ }
+ }
+ $env->set_out("user", $user);
+ $env->set_out("status", $this->users_compte_mod->status);
+ }
+ else $env->erreur("Impossible de lire les informations de l'utilisateur");
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ class mw_plugin
+ {
+
+ function title()
+ { return "(sans titre)";
+ }
+
+ function description()
+ { return "";
+ }
+
+ function install($env)
+ { return true;
+ }
+
+ function uninstall($env)
+ { return true;
+ }
+
+ function enable($env)
+ { return true;
+ }
+
+
+ function disable($env)
+ { return true;
+ }
+
+ function init($env)
+ { return true;
+ }
+
+ }
+
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+ # FICHIER A ADAPTER EN FONCTION DE VOTRE INSTALLATION
+
+ # chemin web du site (dossier d'execution du script d'appel)
+ # absolu a partir de la racine du site
+
+ # installation a la racine du site :
+ $PATHES["web"] = "/";
+
+
+
+ # les chemins suivant sont des chemins internes a l'application
+
+ # dossier de l'application
+ # relatif au dossier d'execution du script
+ $PATHES["app"] = "app";
+
+ # dossier des plugins
+ # relatif au dossier d'execution du script
+ $PATHES["plugins"] = "plugins";
+
+ # dossier des librairies
+ # relatif au dossier d'execution du script
+ $PATHES["libs"] = "libs";
+
+ # dossier des contenus editables par l'application
+ # relatif au dossier d'execution du script
+ $PATHES["content"] = "content";
+
+ # dossier des templates
+ # relatif au dossier d'execution du script
+ $PATHES["out"] = "out";
+
+ # nom du dossier (sans chemin) du template par defaut
+ $PATHES["dist_out"] = "dist";
+
+ # --------------------------------------------------------------
+ # base de donnees
+ # "mysql" ou "xml"
+
+ # --------------------------- MYSQL
+/*
+ # remplacez avec vos parametres de connexion
+ $bdd["sgbd"] = "mysql";
+ $bdd["host"] = "localhost";
+ $bdd["base"] = "mtweb";
+ $bdd["table_prefix"] = "mw_";
+ $bdd["user"] = "mysql_user";
+ $bdd["password"] = "mysql_password";
+*/
+ # --------------------------- XML
+
+ $bdd["sgbd"] = "xml";
+ $bdd["host"] = "content/data/xml";
+ $bdd["base"] = "mw";
+ $bdd["table_prefix"] = "mw_";
+
+ # --------------------------------------------------------------
+ # lien sourceML
+ #
+
+ $CONFIG["version"] = "<a href=\"http://mtweb.dj3c1t.com/\">mtweb</a>";
+
+?>
\ No newline at end of file
--- /dev/null
+Deny from all
--- /dev/null
+-- phpMyAdmin SQL Dump
+-- version 3.3.2deb1
+-- http://www.phpmyadmin.net
+--
+-- Serveur: localhost
+-- Généré le : Dim 25 Décembre 2011 à 15:01
+-- Version du serveur: 5.1.41
+-- Version de PHP: 5.3.2-1ubuntu4.11
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+--
+-- Base de données: `mtweb`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mw_action_status`
+--
+
+CREATE TABLE IF NOT EXISTS `mw_action_status` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `action` varchar(255) NOT NULL,
+ `id_status` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
+
+--
+-- Contenu de la table `mw_action_status`
+--
+
+INSERT INTO `mw_action_status` (`id`, `action`, `id_status`) VALUES
+(1, 'admin', 1),
+(2, 'users', 1),
+(3, 'users', 2),
+(4, 'users/identification', 0);
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mw_config`
+--
+
+CREATE TABLE IF NOT EXISTS `mw_config` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `key` varchar(255) NOT NULL,
+ `value` text NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ;
+
+--
+-- Contenu de la table `mw_config`
+--
+
+INSERT INTO `mw_config` (`id`, `key`, `value`) VALUES
+(1, 'site_name', 'mtweb'),
+(2, 'max_list', '10'),
+(3, 'description', ''),
+(4, 'out', 'dist'),
+(5, 'start_action', ''),
+(6, 'contact_form', '0'),
+(8, 'email', ''),
+(9, 'captcha', '0'),
+(16, 'start_action_params', '');
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mw_users`
+--
+
+CREATE TABLE IF NOT EXISTS `mw_users` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `login` varchar(255) NOT NULL,
+ `password` varchar(255) NOT NULL,
+ `email` varchar(255) NOT NULL,
+ `status` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
+
+--
+-- Contenu de la table `mw_users`
+--
+
+INSERT INTO `mw_users` (`id`, `login`, `password`, `email`, `status`) VALUES
+(1, 'admin', '25e4ee4e9229397b6b17776bfceaf8e7', 'admin@domain.tld', 1);
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mw_user_status`
+--
+
+CREATE TABLE IF NOT EXISTS `mw_user_status` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `nom` varchar(255) NOT NULL,
+ `creation_default` tinyint(4) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
+
+--
+-- Contenu de la table `mw_user_status`
+--
+
+INSERT INTO `mw_user_status` (`id`, `nom`, `creation_default`) VALUES
+(1, 'admin', 0),
+(2, 'membre', 1);
--- /dev/null
+176
\ No newline at end of file
--- /dev/null
+<tuple>
+ <id_status><![CDATA[1]]></id_status>
+ <action><![CDATA[admin]]></action>
+</tuple>
--- /dev/null
+<tuple>
+ <id_status><![CDATA[1]]></id_status>
+ <action><![CDATA[users]]></action>
+</tuple>
--- /dev/null
+<tuple>
+ <id_status><![CDATA[2]]></id_status>
+ <action><![CDATA[users]]></action>
+</tuple>
+
--- /dev/null
+<tuple>
+ <id_status><![CDATA[0]]></id_status>
+ <action><![CDATA[users/identification]]></action>
+</tuple>
--- /dev/null
+58
\ No newline at end of file
--- /dev/null
+<tuple>
+ <site_name><![CDATA[mtweb]]></site_name>
+</tuple>
--- /dev/null
+<tuple>
+ <max_list><![CDATA[10]]></max_list>
+</tuple>
--- /dev/null
+<tuple>
+ <description><![CDATA[]]></description>
+</tuple>
--- /dev/null
+<tuple>
+ <out><![CDATA[dist]]></out>
+</tuple>
--- /dev/null
+<tuple>
+ <start_action><![CDATA[]]></start_action>
+</tuple>
--- /dev/null
+<tuple>
+ <contact_form><![CDATA[0]]></contact_form>
+</tuple>
--- /dev/null
+<tuple>
+ <email><![CDATA[]]></email>
+</tuple>
--- /dev/null
+<tuple>
+ <captcha><![CDATA[0]]></captcha>
+</tuple>
--- /dev/null
+<tuple>
+ <out_navig_menu_top><![CDATA[on]]></out_navig_menu_top>
+</tuple>
--- /dev/null
+<tuple>
+ <out_colonne><![CDATA[on]]></out_colonne>
+</tuple>
--- /dev/null
+<tuple>
+ <start_action_params><![CDATA[]]></start_action_params>
+</tuple>
--- /dev/null
+4
\ No newline at end of file
--- /dev/null
+<tuple>
+ <nom>admin</nom>
+ <creation_default>0</creation_default>
+</tuple>
\ No newline at end of file
--- /dev/null
+<tuple>
+ <nom><![CDATA[membre]]></nom>
+ <creation_default><![CDATA[1]]></creation_default>
+</tuple>
--- /dev/null
+14
\ No newline at end of file
--- /dev/null
+<tuple>
+ <login><![CDATA[admin]]></login>
+ <password><![CDATA[25e4ee4e9229397b6b17776bfceaf8e7]]></password>
+ <email><![CDATA[admin@domain.tld]]></email>
+ <status><![CDATA[1]]></status>
+</tuple>
--- /dev/null
+<?php
+
+ // error_reporting(E_ALL);
+
+ require "app/main.php";
+ if($mw = __mw("config.php")) __mw_display($mw);
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+/*
+
+ Cette classe aide a agreger des classes qui en heritent
+
+ une classe qui herite de empty_class peut etre vide
+ (sans attribut ni methode). une fois instanciee,
+ la fonction load_modules lui ajoute les methodes
+ qui sont definies dans d'autres classes qui heritent
+ aussi de empty_class
+
+ NOTE: pour la compatibilite php4 et php5,
+ le mecanisme d'agregation est different selon
+ la version de php
+
+ php4: c'est la methode aggregate qui est utilisee
+
+ php5: les classes contenant les nouvelles methodes
+ sont instanciees et sont enregistrées dans
+ le tableau associatif $module
+
+ ATTENTION: les attributs de ces classes, en php5,
+ on donc un contexte qui depend de
+ leur classe et ne sont pas accessibles
+ directement via l'instance principale
+
+ si ces attributs doivent etre accessible
+ via l'instance principale, il faut prevoir
+ des accesseurs.
+
+*/
+
+ class empty_class
+ {
+
+ var $root_inst;
+ var $modules;
+
+ function empty_class($root_inst)
+ { if($root_inst === true) $this->root_inst = $this;
+ else $this->root_inst = $root_inst;
+ }
+
+ function load_modules($modules_path, $current_modules, $core_modules = null)
+ { $this->_load_modules($modules_path, $current_modules, $this->root_inst, true);
+ if(isset($core_modules) && $current_modules != $core_modules)
+ { $this->_load_modules($modules_path, $core_modules, $this->root_inst, true);
+ }
+ }
+
+ function _load_modules($modules_path, $modules_path_suffixe, $root_inst, $recursif = false)
+ { if(file_exists($modules_path.$modules_path_suffixe) && $dh = opendir($modules_path.$modules_path_suffixe))
+ { while(($file = readdir($dh)) !== false)
+ { if(is_dir($modules_path.$modules_path_suffixe.$file))
+ { if($recursif && substr($file, 0, 1) != ".")
+ { $this->_load_modules($modules_path, $modules_path_suffixe.$file."/", $root_inst, $recursif);
+ }
+ }
+ elseif(strcasecmp(substr($file, -4), ".php") == 0)
+ { $this->load($modules_path.$modules_path_suffixe.$file, $root_inst);
+ }
+ }
+ closedir($dh);
+ }
+ }
+
+ function load($module_file, $root_inst)
+ { if($module_file && file_exists($module_file))
+ { $v_path = explode("/", $module_file);
+ $file = $v_path[count($v_path) - 1];
+ if(strcasecmp(substr($file, -4), ".php") == 0)
+ { $class_name = substr($file, 0, -4);
+ if(!class_exists($class_name))
+ { require_once $module_file;
+ if(version_compare(PHP_VERSION, '5.0.0', '>='))
+ { if(class_exists($class_name) && !isset($this->modules[$class_name]))
+ { $this->modules[$class_name] = new $class_name($root_inst);
+ }
+ }
+ else
+ { if(class_exists($class_name))
+ { aggregate($this, $class_name);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function __call($method_name, $arguments)
+ { return $this->empty_class_call($this->root_inst, $method_name, $arguments);
+ }
+
+ function empty_class_call($inst, $method_name, $arguments)
+ { $r = false;
+ $args = "";
+ foreach($arguments as $i => $arg) $args .= ($args ? ", " : "")."\$arguments[".$i."]";
+ if(isset($inst->modules)) foreach($inst->modules as $module_name => $module)
+ { if(method_exists($module, $method_name))
+ { eval("\$r = \$module->".$method_name."(".$args.");");
+ break;
+ }
+ else
+ { $r = $this->empty_class_call($module, $method_name, $arguments);
+ if($r !== false) break;
+ }
+ }
+ return $r;
+ }
+
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+/** @class: InputFilter (PHP4 & PHP5, with comments)
+ * @project: PHP Input Filter
+ * @date: 10-05-2005
+ * @version: 1.2.2_php4/php5
+ * @author: Daniel Morris
+ * @contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
+ * @copyright: Daniel Morris
+ * @email: dan@rootcube.com
+ * @license: GNU General Public License (GPL)
+ */
+class InputFilter {
+ var $tagsArray; // default = empty array
+ var $attrArray; // default = empty array
+
+ var $tagsMethod; // default = 0
+ var $attrMethod; // default = 0
+
+ var $xssAuto; // default = 1
+ var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');
+ var $attrBlacklist = array('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers
+
+ /**
+ * Constructor for inputFilter class. Only first parameter is required.
+ * @access constructor
+ * @param Array $tagsArray - list of user-defined tags
+ * @param Array $attrArray - list of user-defined attributes
+ * @param int $tagsMethod - 0= allow just user-defined, 1= allow all but user-defined
+ * @param int $attrMethod - 0= allow just user-defined, 1= allow all but user-defined
+ * @param int $xssAuto - 0= only auto clean essentials, 1= allow clean blacklisted tags/attr
+ */
+ function inputFilter($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) {
+ // make sure user defined arrays are in lowercase
+ for ($i = 0; $i < count($tagsArray); $i++) $tagsArray[$i] = strtolower($tagsArray[$i]);
+ for ($i = 0; $i < count($attrArray); $i++) $attrArray[$i] = strtolower($attrArray[$i]);
+ // assign to member vars
+ $this->tagsArray = (array) $tagsArray;
+ $this->attrArray = (array) $attrArray;
+ $this->tagsMethod = $tagsMethod;
+ $this->attrMethod = $attrMethod;
+ $this->xssAuto = $xssAuto;
+ }
+
+ /**
+ * Method to be called by another php script. Processes for XSS and specified bad code.
+ * @access public
+ * @param Mixed $source - input string/array-of-string to be 'cleaned'
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function process($source) {
+ // clean all elements in this array
+ if (is_array($source)) {
+ foreach($source as $key => $value)
+ // filter element for XSS and other 'bad' code etc.
+ if (is_string($value)) $source[$key] = $this->remove($this->decode($value));
+ return $source;
+ // clean this string
+ } else if (is_string($source)) {
+ // filter source for XSS and other 'bad' code etc.
+ return $this->remove($this->decode($source));
+ // return parameter as given
+ } else return $source;
+ }
+
+ /**
+ * Internal method to iteratively remove all unwanted tags and attributes
+ * @access protected
+ * @param String $source - input string to be 'cleaned'
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function remove($source) {
+ $loopCounter=0;
+ // provides nested-tag protection
+ while($source != $this->filterTags($source)) {
+ $source = $this->filterTags($source);
+ $loopCounter++;
+ }
+ return $source;
+ }
+
+ /**
+ * Internal method to strip a string of certain tags
+ * @access protected
+ * @param String $source - input string to be 'cleaned'
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function filterTags($source) {
+ // filter pass setup
+ $preTag = NULL;
+ $postTag = $source;
+ // find initial tag's position
+ $tagOpen_start = strpos($source, '<');
+ // interate through string until no tags left
+ while($tagOpen_start !== FALSE) {
+ // process tag interatively
+ $preTag .= substr($postTag, 0, $tagOpen_start);
+ $postTag = substr($postTag, $tagOpen_start);
+ $fromTagOpen = substr($postTag, 1);
+ // end of tag
+ $tagOpen_end = strpos($fromTagOpen, '>');
+ if ($tagOpen_end === false) break;
+ // next start of tag (for nested tag assessment)
+ $tagOpen_nested = strpos($fromTagOpen, '<');
+ if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) {
+ $preTag .= substr($postTag, 0, ($tagOpen_nested+1));
+ $postTag = substr($postTag, ($tagOpen_nested+1));
+ $tagOpen_start = strpos($postTag, '<');
+ continue;
+ }
+ $tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1);
+ $currentTag = substr($fromTagOpen, 0, $tagOpen_end);
+ $tagLength = strlen($currentTag);
+ if (!$tagOpen_end) {
+ $preTag .= $postTag;
+ $tagOpen_start = strpos($postTag, '<');
+ }
+ // iterate through tag finding attribute pairs - setup
+ $tagLeft = $currentTag;
+ $attrSet = array();
+ $currentSpace = strpos($tagLeft, ' ');
+ // is end tag
+ if (substr($currentTag, 0, 1) == "/") {
+ $isCloseTag = TRUE;
+ list($tagName) = explode(' ', $currentTag);
+ $tagName = substr($tagName, 1);
+ // is start tag
+ } else {
+ $isCloseTag = FALSE;
+ list($tagName) = explode(' ', $currentTag);
+ }
+ // excludes all "non-regular" tagnames OR no tagname OR remove if xssauto is on and tag is blacklisted
+ if ((!preg_match("/^[a-z][a-z0-9]*$/i",$tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) {
+ $postTag = substr($postTag, ($tagLength + 2));
+ $tagOpen_start = strpos($postTag, '<');
+ // don't append this tag
+ continue;
+ }
+ // this while is needed to support attribute values with spaces in!
+ while ($currentSpace !== FALSE) {
+ $fromSpace = substr($tagLeft, ($currentSpace+1));
+ $nextSpace = strpos($fromSpace, ' ');
+ $openQuotes = strpos($fromSpace, '"');
+ $closeQuotes = strpos(substr($fromSpace, ($openQuotes+1)), '"') + $openQuotes + 1;
+ // another equals exists
+ if (strpos($fromSpace, '=') !== FALSE) {
+ // opening and closing quotes exists
+ if (($openQuotes !== FALSE) && (strpos(substr($fromSpace, ($openQuotes+1)), '"') !== FALSE))
+ $attr = substr($fromSpace, 0, ($closeQuotes+1));
+ // one or neither exist
+ else $attr = substr($fromSpace, 0, $nextSpace);
+ // no more equals exist
+ } else $attr = substr($fromSpace, 0, $nextSpace);
+ // last attr pair
+ if (!$attr) $attr = $fromSpace;
+ // add to attribute pairs array
+ $attrSet[] = $attr;
+ // next inc
+ $tagLeft = substr($fromSpace, strlen($attr));
+ $currentSpace = strpos($tagLeft, ' ');
+ }
+ // appears in array specified by user
+ $tagFound = in_array(strtolower($tagName), $this->tagsArray);
+ // remove this tag on condition
+ if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) {
+ // reconstruct tag with allowed attributes
+ if (!$isCloseTag) {
+ $attrSet = $this->filterAttr($attrSet);
+ $preTag .= '<' . $tagName;
+ for ($i = 0; $i < count($attrSet); $i++)
+ $preTag .= ' ' . $attrSet[$i];
+ // reformat single tags to XHTML
+ if (strpos($fromTagOpen, "</" . $tagName)) $preTag .= '>';
+ else $preTag .= ' />';
+ // just the tagname
+ } else $preTag .= '</' . $tagName . '>';
+ }
+ // find next tag's start
+ $postTag = substr($postTag, ($tagLength + 2));
+ $tagOpen_start = strpos($postTag, '<');
+ }
+ // append any code after end of tags
+ $preTag .= $postTag;
+ return $preTag;
+ }
+
+ /**
+ * Internal method to strip a tag of certain attributes
+ * @access protected
+ * @param Array $attrSet
+ * @return Array $newSet
+ */
+ function filterAttr($attrSet) {
+ $newSet = array();
+ // process attributes
+ for ($i = 0; $i <count($attrSet); $i++) {
+ // skip blank spaces in tag
+ if (!$attrSet[$i]) continue;
+ // split into attr name and value
+ $attrSubSet = explode('=', trim($attrSet[$i]));
+ list($attrSubSet[0]) = explode(' ', $attrSubSet[0]);
+ // removes all "non-regular" attr names AND also attr blacklisted
+ if ((!eregi("^[a-z]*$",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
+ continue;
+ // xss attr value filtering
+ if ($attrSubSet[1]) {
+ // strips unicode, hex, etc
+ $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);
+ // strip normal newline within attr value
+ $attrSubSet[1] = preg_replace('/\s+/', '', $attrSubSet[1]);
+ // strip double quotes
+ $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]);
+ // [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)
+ if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'"))
+ $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));
+ // strip slashes
+ $attrSubSet[1] = stripslashes($attrSubSet[1]);
+ }
+ // auto strip attr's with "javascript:
+ if ( ((strpos(strtolower($attrSubSet[1]), 'expression') !== false) && (strtolower($attrSubSet[0]) == 'style')) ||
+ (strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||
+ (strpos(strtolower($attrSubSet[1]), 'livescript:') !== false)
+ ) continue;
+
+ // if matches user defined array
+ $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);
+ // keep this attr on condition
+ if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {
+ // attr has value
+ if ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"';
+ // attr has decimal zero as value
+ else if ($attrSubSet[1] == "0") $newSet[] = $attrSubSet[0] . '="0"';
+ // reformat single attributes to XHTML
+ else $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"';
+ }
+ }
+ return $newSet;
+ }
+
+ /**
+ * Try to convert to plaintext
+ * @access protected
+ * @param String $source
+ * @return String $source
+ */
+ function decode($source) {
+ // url decode
+// $source = html_entity_decode($source, ENT_QUOTES, "ISO-8859-1");
+ $source = html_entity_decode($source, ENT_QUOTES, "UTF-8");
+ // convert decimal
+ $source = preg_replace('/&#(\d+);/me',"chr(\\1)", $source); // decimal notation
+ // convert hex
+ $source = preg_replace('/&#x([a-f0-9]+);/mei',"chr(0x\\1)", $source); // hex notation
+ return $source;
+ }
+
+ /**
+ * Method to be called by another php script. Processes for SQL injection
+ * @access public
+ * @param Mixed $source - input string/array-of-string to be 'cleaned'
+ * @param Buffer $connection - An open MySQL connection
+ * @return String $source - 'cleaned' version of input parameter
+ */
+ function safeSQL($source, &$connection) {
+ // clean all elements in this array
+ if (is_array($source)) {
+ foreach($source as $key => $value)
+ // filter element for SQL injection
+ if (is_string($value)) $source[$key] = $this->quoteSmart($this->decode($value), $connection);
+ return $source;
+ // clean this string
+ } else if (is_string($source)) {
+ // filter source for SQL injection
+ if (is_string($source)) return $this->quoteSmart($this->decode($source), $connection);
+ // return parameter as given
+ } else return $source;
+ }
+
+ /**
+ * @author Chris Tobin
+ * @author Daniel Morris
+ * @access protected
+ * @param String $source
+ * @param Resource $connection - An open MySQL connection
+ * @return String $source
+ */
+ function quoteSmart($source, &$connection) {
+ // strip slashes
+ if (get_magic_quotes_gpc()) $source = stripslashes($source);
+ // quote both numeric and text
+ $source = $this->escapeString($source, $connection);
+ return $source;
+ }
+
+ /**
+ * @author Chris Tobin
+ * @author Daniel Morris
+ * @access protected
+ * @param String $source
+ * @param Resource $connection - An open MySQL connection
+ * @return String $source
+ */
+ function escapeString($string, &$connection) {
+ // depreciated function
+ if (version_compare(phpversion(),"4.3.0", "<")) mysql_escape_string($string);
+ // current function
+ else mysql_real_escape_string($string);
+ return $string;
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * Ptitcaptcha : simple php captcha system
+ *
+ * @author Jean-Pierre Morfin
+ * @license Creative Commons By
+ * @license http://creativecommons.org/licenses/by/2.0/fr/
+ */
+
+/* Change it to have a specific encoding ! */
+define("PTITCAPTCHA_ENTROPY","sourceml ptitcaptcha entropy");
+
+/* Choose length (max 32) */
+define("PTITCAPTCHA_LENGTH",5);
+
+$GLOBALS["ptitcaptcha_akey"] = md5(uniqid(rand(), true));
+
+/**
+ * Helper to generate html form tags
+ *
+ */
+class PtitCaptchaHelper
+{
+ /**
+ * Generate IMG Tag
+ *
+ * @param string $baseuri : relative or absolute path to folder containing this file on web
+ * @return IMG Tag
+ */
+ function generateImgTags($baseuri)
+ {
+ return "<a class=\"ptitcaptcha\" href=\"#\"><img alt=\"???\" title=\"?\"".
+ " src=\"".$baseuri."ptitcaptcha.php?pck=".$GLOBALS['ptitcaptcha_akey']."\"".
+ " id=\"ptitcaptcha\"".
+ " onclick=\"javascript:this.src='".$baseuri."ptitcaptcha.php?pck=".
+ $GLOBALS['ptitcaptcha_akey'].
+ "&z='+Math.random();return false;\" /></a>\n";
+ }
+
+ /**
+ * Generate hidden tag (must be in a form)
+ *
+ * @return input hidden tag
+ */
+ function generateHiddenTags()
+ {
+ return "<input type=\"hidden\" name=\"ptitcaptcha_key\" value=\"".$GLOBALS['ptitcaptcha_akey']."\"/>";
+ }
+
+ /**
+ * Generate input tag (must be in a form)
+ *
+ * @return input tag
+ */
+ function generateInputTags()
+ {
+ return "<input type=\"text\" name=\"ptitcaptcha_entry\" id=\"ptitcaptcha_entry\" value=\"\"/>";
+ }
+
+ /**
+ * Check if user input is correct
+ *
+ * @return boolean (true=correct, false=incorrect)
+ */
+ function checkCaptcha()
+ {
+ if( isset($_POST['ptitcaptcha_entry']) &&
+ $_POST['ptitcaptcha_entry'] == PtitCaptchaHelper::_getDisplayText($_POST['ptitcaptcha_key']))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Internal function
+ *
+ * @param string $pck
+ * @return string
+ */
+ function _getDisplayText($pck) // internal function
+ {
+ $src=md5(PTITCAPTCHA_ENTROPY.$pck);
+ $txt="";
+ for($i=0;$i<PTITCAPTCHA_LENGTH;$i++)
+ $txt.=substr($src,$i*32/PTITCAPTCHA_LENGTH,1);
+ return $txt;
+ }
+}
+
+
+// If script called directly : generate image
+if(basename($_SERVER["SCRIPT_NAME"])=="ptitcaptcha.php" && isset($_GET["pck"]))
+{
+ $width = PTITCAPTCHA_LENGTH*10+10;
+ $height = 30;
+
+ $image = imagecreatetruecolor($width, $height);
+ $bgCol = imagecolorallocate($image, rand(128,255), rand(128,255), rand(128,255));
+ imagefilledrectangle($image,0,0,$width,$height,$bgCol);
+
+ $txt = PtitCaptchaHelper::_getDisplayText($_GET["pck"]);
+
+ for($c=0;$c<PTITCAPTCHA_LENGTH*2;$c++)
+ {
+ $bgCol = imagecolorallocate($image, rand(100,255), rand(100,255), rand(100,255));
+ $x=rand(0,$width);
+ $y=rand(0,$height);
+ $w=rand(5,$width/2);
+ $h=rand(5,$height/2);
+ imagefilledrectangle($image,$x,$y,$x+$w,$y+$h,$bgCol);
+ imagecolordeallocate($image,$bgCol);
+ }
+ for($c=0;$c<PTITCAPTCHA_LENGTH;$c++)
+ {
+ $txtCol = imagecolorallocate($image, rand(0,128) , rand(0,128), rand(0,128));
+ imagestring($image,5,5+10*$c,rand(0,10),substr($txt,$c,1),$txtCol);
+ imagecolordeallocate($image,$txtCol);
+ }
+
+ header("Content-type: image/png");
+ imagepng($image);
+ imagedestroy($image);
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+/*
+
+ from :
+
+ http://www.shop24-7.info/32-0-simplexml-alternative-php4.html
+
+ ajout :
+
+- xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+ dans la fonction parse($data) pour la prise en compte de la casse
+
+- if($attribs) $this->data['attrs'] = $attribs;
+ dans la fonction tag_open pour la prise en compte des attributs
+
+*/
+
+class sxml
+{
+ var $parser;
+ var $error_code;
+ var $error_string;
+ var $current_line;
+ var $current_column;
+ var $data;
+ var $datas;
+ function parse($data)
+ {
+// $this->parser = xml_parser_create('UTF-8');
+ $this->data = array();
+ $this->datas = array();
+ $this->parser = xml_parser_create();
+ xml_set_object($this->parser, $this);
+ xml_parser_set_option($this->parser, XML_OPTION_SKIP_WHITE, 1);
+ xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+ xml_set_element_handler($this->parser, 'tag_open', 'tag_close');
+ xml_set_character_data_handler($this->parser, 'cdata');
+ if (!xml_parse($this->parser, $data))
+ {
+ $this->data = array();
+ $this->error_code = xml_get_error_code($this->parser);
+ $this->error_string = xml_error_string($this->error_code);
+ $this->current_line = xml_get_current_line_number($this->parser);
+ $this->current_column = xml_get_current_column_number($this->parser);
+ }
+ else
+ {
+ $this->data = $this->data['subs'];
+ }
+ xml_parser_free($this->parser);
+ }
+
+ function tag_open($parser, $tag, $attribs)
+ {
+ $this->datas[] = &$this->data;
+ $this->data = &$this->data['subs'][$tag][];
+ if($attribs) $this->data['attrs'] = $attribs;
+
+ }
+
+ function cdata($parser, $cdata)
+ {
+ @$this->data['data'] .= $cdata;
+ }
+
+ function tag_close($parser, $tag)
+ {
+ $this->data =& $this->datas[count($this->datas)-1];
+ array_pop($this->datas);
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n({en:{\r
+common:{\r
+edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",\r
+apply:"Apply",\r
+insert:"Insert",\r
+update:"Update",\r
+cancel:"Cancel",\r
+close:"Close",\r
+browse:"Browse",\r
+class_name:"Class",\r
+not_set:"-- Not set --",\r
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",\r
+clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",\r
+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.",\r
+invalid_data:"Error: Invalid values entered, these are marked in red.",\r
+more_colors:"More colors"\r
+},\r
+contextmenu:{\r
+align:"Alignment",\r
+left:"Left",\r
+center:"Center",\r
+right:"Right",\r
+full:"Full"\r
+},\r
+insertdatetime:{\r
+date_fmt:"%Y-%m-%d",\r
+time_fmt:"%H:%M:%S",\r
+insertdate_desc:"Insert date",\r
+inserttime_desc:"Insert time",\r
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",\r
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",\r
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",\r
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"\r
+},\r
+print:{\r
+print_desc:"Print"\r
+},\r
+preview:{\r
+preview_desc:"Preview"\r
+},\r
+directionality:{\r
+ltr_desc:"Direction left to right",\r
+rtl_desc:"Direction right to left"\r
+},\r
+layer:{\r
+insertlayer_desc:"Insert new layer",\r
+forward_desc:"Move forward",\r
+backward_desc:"Move backward",\r
+absolute_desc:"Toggle absolute positioning",\r
+content:"New layer..."\r
+},\r
+save:{\r
+save_desc:"Save",\r
+cancel_desc:"Cancel all changes"\r
+},\r
+nonbreaking:{\r
+nonbreaking_desc:"Insert non-breaking space character"\r
+},\r
+iespell:{\r
+iespell_desc:"Run spell checking",\r
+download:"ieSpell not detected. Do you want to install it now?"\r
+},\r
+advhr:{\r
+advhr_desc:"Horizontal rule"\r
+},\r
+emotions:{\r
+emotions_desc:"Emotions"\r
+},\r
+searchreplace:{\r
+search_desc:"Find",\r
+replace_desc:"Find/Replace"\r
+},\r
+advimage:{\r
+image_desc:"Insert/edit image"\r
+},\r
+advlink:{\r
+link_desc:"Insert/edit link"\r
+},\r
+xhtmlxtras:{\r
+cite_desc:"Citation",\r
+abbr_desc:"Abbreviation",\r
+acronym_desc:"Acronym",\r
+del_desc:"Deletion",\r
+ins_desc:"Insertion",\r
+attribs_desc:"Insert/Edit Attributes"\r
+},\r
+style:{\r
+desc:"Edit CSS Style"\r
+},\r
+paste:{\r
+paste_text_desc:"Paste as Plain Text",\r
+paste_word_desc:"Paste from Word",\r
+selectall_desc:"Select All",\r
+plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",\r
+plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."\r
+},\r
+paste_dlg:{\r
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",\r
+text_linebreaks:"Keep linebreaks",\r
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."\r
+},\r
+table:{\r
+desc:"Inserts a new table",\r
+row_before_desc:"Insert row before",\r
+row_after_desc:"Insert row after",\r
+delete_row_desc:"Delete row",\r
+col_before_desc:"Insert column before",\r
+col_after_desc:"Insert column after",\r
+delete_col_desc:"Remove column",\r
+split_cells_desc:"Split merged table cells",\r
+merge_cells_desc:"Merge table cells",\r
+row_desc:"Table row properties",\r
+cell_desc:"Table cell properties",\r
+props_desc:"Table properties",\r
+paste_row_before_desc:"Paste table row before",\r
+paste_row_after_desc:"Paste table row after",\r
+cut_row_desc:"Cut table row",\r
+copy_row_desc:"Copy table row",\r
+del:"Delete table",\r
+row:"Row",\r
+col:"Column",\r
+cell:"Cell"\r
+},\r
+autosave:{\r
+unload_msg:"The changes you made will be lost if you navigate away from this page.",\r
+restore_content:"Restore auto-saved content.",\r
+warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."\r
+},\r
+fullscreen:{\r
+desc:"Toggle fullscreen mode"\r
+},\r
+media:{\r
+desc:"Insert / edit embedded media",\r
+edit:"Edit embedded media"\r
+},\r
+fullpage:{\r
+desc:"Document properties"\r
+},\r
+template:{\r
+desc:"Insert predefined template content"\r
+},\r
+visualchars:{\r
+desc:"Visual control characters on/off."\r
+},\r
+spellchecker:{\r
+desc:"Toggle spellchecker",\r
+menu:"Spellchecker settings",\r
+ignore_word:"Ignore word",\r
+ignore_words:"Ignore all",\r
+langs:"Languages",\r
+wait:"Please wait...",\r
+sug:"Suggestions",\r
+no_sug:"No suggestions",\r
+no_mpell:"No misspellings found."\r
+},\r
+pagebreak:{\r
+desc:"Insert page break."\r
+},\r
+advlist:{\r
+types:"Types",\r
+def:"Default",\r
+lower_alpha:"Lower alpha",\r
+lower_greek:"Lower greek",\r
+lower_roman:"Lower roman",\r
+upper_alpha:"Upper alpha",\r
+upper_roman:"Upper roman",\r
+circle:"Circle",\r
+disc:"Disc",\r
+square:"Square"\r
+}}});
\ No newline at end of file
--- /dev/null
+ GNU LESSER GENERAL PUBLIC LICENSE\r
+ Version 2.1, February 1999\r
+\r
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.\r
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+[This is the first released version of the Lesser GPL. It also counts\r
+ as the successor of the GNU Library Public License, version 2, hence\r
+ the version number 2.1.]\r
+\r
+ Preamble\r
+\r
+ The licenses for most software are designed to take away your\r
+freedom to share and change it. By contrast, the GNU General Public\r
+Licenses are intended to guarantee your freedom to share and change\r
+free software--to make sure the software is free for all its users.\r
+\r
+ This license, the Lesser General Public License, applies to some\r
+specially designated software packages--typically libraries--of the\r
+Free Software Foundation and other authors who decide to use it. You\r
+can use it too, but we suggest you first think carefully about whether\r
+this license or the ordinary General Public License is the better\r
+strategy to use in any particular case, based on the explanations below.\r
+\r
+ When we speak of free software, we are referring to freedom of use,\r
+not price. Our General Public Licenses are designed to make sure that\r
+you have the freedom to distribute copies of free software (and charge\r
+for this service if you wish); that you receive source code or can get\r
+it if you want it; that you can change the software and use pieces of\r
+it in new free programs; and that you are informed that you can do\r
+these things.\r
+\r
+ To protect your rights, we need to make restrictions that forbid\r
+distributors to deny you these rights or to ask you to surrender these\r
+rights. These restrictions translate to certain responsibilities for\r
+you if you distribute copies of the library or if you modify it.\r
+\r
+ For example, if you distribute copies of the library, whether gratis\r
+or for a fee, you must give the recipients all the rights that we gave\r
+you. You must make sure that they, too, receive or can get the source\r
+code. If you link other code with the library, you must provide\r
+complete object files to the recipients, so that they can relink them\r
+with the library after making changes to the library and recompiling\r
+it. And you must show them these terms so they know their rights.\r
+\r
+ We protect your rights with a two-step method: (1) we copyright the\r
+library, and (2) we offer you this license, which gives you legal\r
+permission to copy, distribute and/or modify the library.\r
+\r
+ To protect each distributor, we want to make it very clear that\r
+there is no warranty for the free library. Also, if the library is\r
+modified by someone else and passed on, the recipients should know\r
+that what they have is not the original version, so that the original\r
+author's reputation will not be affected by problems that might be\r
+introduced by others.\r
+\r
+ Finally, software patents pose a constant threat to the existence of\r
+any free program. We wish to make sure that a company cannot\r
+effectively restrict the users of a free program by obtaining a\r
+restrictive license from a patent holder. Therefore, we insist that\r
+any patent license obtained for a version of the library must be\r
+consistent with the full freedom of use specified in this license.\r
+\r
+ Most GNU software, including some libraries, is covered by the\r
+ordinary GNU General Public License. This license, the GNU Lesser\r
+General Public License, applies to certain designated libraries, and\r
+is quite different from the ordinary General Public License. We use\r
+this license for certain libraries in order to permit linking those\r
+libraries into non-free programs.\r
+\r
+ When a program is linked with a library, whether statically or using\r
+a shared library, the combination of the two is legally speaking a\r
+combined work, a derivative of the original library. The ordinary\r
+General Public License therefore permits such linking only if the\r
+entire combination fits its criteria of freedom. The Lesser General\r
+Public License permits more lax criteria for linking other code with\r
+the library.\r
+\r
+ We call this license the "Lesser" General Public License because it\r
+does Less to protect the user's freedom than the ordinary General\r
+Public License. It also provides other free software developers Less\r
+of an advantage over competing non-free programs. These disadvantages\r
+are the reason we use the ordinary General Public License for many\r
+libraries. However, the Lesser license provides advantages in certain\r
+special circumstances.\r
+\r
+ For example, on rare occasions, there may be a special need to\r
+encourage the widest possible use of a certain library, so that it becomes\r
+a de-facto standard. To achieve this, non-free programs must be\r
+allowed to use the library. A more frequent case is that a free\r
+library does the same job as widely used non-free libraries. In this\r
+case, there is little to gain by limiting the free library to free\r
+software only, so we use the Lesser General Public License.\r
+\r
+ In other cases, permission to use a particular library in non-free\r
+programs enables a greater number of people to use a large body of\r
+free software. For example, permission to use the GNU C Library in\r
+non-free programs enables many more people to use the whole GNU\r
+operating system, as well as its variant, the GNU/Linux operating\r
+system.\r
+\r
+ Although the Lesser General Public License is Less protective of the\r
+users' freedom, it does ensure that the user of a program that is\r
+linked with the Library has the freedom and the wherewithal to run\r
+that program using a modified version of the Library.\r
+\r
+ The precise terms and conditions for copying, distribution and\r
+modification follow. Pay close attention to the difference between a\r
+"work based on the library" and a "work that uses the library". The\r
+former contains code derived from the library, whereas the latter must\r
+be combined with the library in order to run.\r
+\r
+ GNU LESSER GENERAL PUBLIC LICENSE\r
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+ 0. This License Agreement applies to any software library or other\r
+program which contains a notice placed by the copyright holder or\r
+other authorized party saying it may be distributed under the terms of\r
+this Lesser General Public License (also called "this License").\r
+Each licensee is addressed as "you".\r
+\r
+ A "library" means a collection of software functions and/or data\r
+prepared so as to be conveniently linked with application programs\r
+(which use some of those functions and data) to form executables.\r
+\r
+ The "Library", below, refers to any such software library or work\r
+which has been distributed under these terms. A "work based on the\r
+Library" means either the Library or any derivative work under\r
+copyright law: that is to say, a work containing the Library or a\r
+portion of it, either verbatim or with modifications and/or translated\r
+straightforwardly into another language. (Hereinafter, translation is\r
+included without limitation in the term "modification".)\r
+\r
+ "Source code" for a work means the preferred form of the work for\r
+making modifications to it. For a library, complete source code means\r
+all the source code for all modules it contains, plus any associated\r
+interface definition files, plus the scripts used to control compilation\r
+and installation of the library.\r
+\r
+ Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope. The act of\r
+running a program using the Library is not restricted, and output from\r
+such a program is covered only if its contents constitute a work based\r
+on the Library (independent of the use of the Library in a tool for\r
+writing it). Whether that is true depends on what the Library does\r
+and what the program that uses the Library does.\r
+ \r
+ 1. You may copy and distribute verbatim copies of the Library's\r
+complete source code as you receive it, in any medium, provided that\r
+you conspicuously and appropriately publish on each copy an\r
+appropriate copyright notice and disclaimer of warranty; keep intact\r
+all the notices that refer to this License and to the absence of any\r
+warranty; and distribute a copy of this License along with the\r
+Library.\r
+\r
+ You may charge a fee for the physical act of transferring a copy,\r
+and you may at your option offer warranty protection in exchange for a\r
+fee.\r
+\r
+ 2. You may modify your copy or copies of the Library or any portion\r
+of it, thus forming a work based on the Library, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+ a) The modified work must itself be a software library.\r
+\r
+ b) You must cause the files modified to carry prominent notices\r
+ stating that you changed the files and the date of any change.\r
+\r
+ c) You must cause the whole of the work to be licensed at no\r
+ charge to all third parties under the terms of this License.\r
+\r
+ d) If a facility in the modified Library refers to a function or a\r
+ table of data to be supplied by an application program that uses\r
+ the facility, other than as an argument passed when the facility\r
+ is invoked, then you must make a good faith effort to ensure that,\r
+ in the event an application does not supply such function or\r
+ table, the facility still operates, and performs whatever part of\r
+ its purpose remains meaningful.\r
+\r
+ (For example, a function in a library to compute square roots has\r
+ a purpose that is entirely well-defined independent of the\r
+ application. Therefore, Subsection 2d requires that any\r
+ application-supplied function or table used by this function must\r
+ be optional: if the application does not supply it, the square\r
+ root function must still compute square roots.)\r
+\r
+These requirements apply to the modified work as a whole. If\r
+identifiable sections of that work are not derived from the Library,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works. But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Library, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote\r
+it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Library.\r
+\r
+In addition, mere aggregation of another work not based on the Library\r
+with the Library (or with a work based on the Library) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+ 3. You may opt to apply the terms of the ordinary GNU General Public\r
+License instead of this License to a given copy of the Library. To do\r
+this, you must alter all the notices that refer to this License, so\r
+that they refer to the ordinary GNU General Public License, version 2,\r
+instead of to this License. (If a newer version than version 2 of the\r
+ordinary GNU General Public License has appeared, then you can specify\r
+that version instead if you wish.) Do not make any other change in\r
+these notices.\r
+\r
+ Once this change is made in a given copy, it is irreversible for\r
+that copy, so the ordinary GNU General Public License applies to all\r
+subsequent copies and derivative works made from that copy.\r
+\r
+ This option is useful when you wish to copy part of the code of\r
+the Library into a program that is not a library.\r
+\r
+ 4. You may copy and distribute the Library (or a portion or\r
+derivative of it, under Section 2) in object code or executable form\r
+under the terms of Sections 1 and 2 above provided that you accompany\r
+it with the complete corresponding machine-readable source code, which\r
+must be distributed under the terms of Sections 1 and 2 above on a\r
+medium customarily used for software interchange.\r
+\r
+ If distribution of object code is made by offering access to copy\r
+from a designated place, then offering equivalent access to copy the\r
+source code from the same place satisfies the requirement to\r
+distribute the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+ 5. A program that contains no derivative of any portion of the\r
+Library, but is designed to work with the Library by being compiled or\r
+linked with it, is called a "work that uses the Library". Such a\r
+work, in isolation, is not a derivative work of the Library, and\r
+therefore falls outside the scope of this License.\r
+\r
+ However, linking a "work that uses the Library" with the Library\r
+creates an executable that is a derivative of the Library (because it\r
+contains portions of the Library), rather than a "work that uses the\r
+library". The executable is therefore covered by this License.\r
+Section 6 states terms for distribution of such executables.\r
+\r
+ When a "work that uses the Library" uses material from a header file\r
+that is part of the Library, the object code for the work may be a\r
+derivative work of the Library even though the source code is not.\r
+Whether this is true is especially significant if the work can be\r
+linked without the Library, or if the work is itself a library. The\r
+threshold for this to be true is not precisely defined by law.\r
+\r
+ If such an object file uses only numerical parameters, data\r
+structure layouts and accessors, and small macros and small inline\r
+functions (ten lines or less in length), then the use of the object\r
+file is unrestricted, regardless of whether it is legally a derivative\r
+work. (Executables containing this object code plus portions of the\r
+Library will still fall under Section 6.)\r
+\r
+ Otherwise, if the work is a derivative of the Library, you may\r
+distribute the object code for the work under the terms of Section 6.\r
+Any executables containing that work also fall under Section 6,\r
+whether or not they are linked directly with the Library itself.\r
+\r
+ 6. As an exception to the Sections above, you may also combine or\r
+link a "work that uses the Library" with the Library to produce a\r
+work containing portions of the Library, and distribute that work\r
+under terms of your choice, provided that the terms permit\r
+modification of the work for the customer's own use and reverse\r
+engineering for debugging such modifications.\r
+\r
+ You must give prominent notice with each copy of the work that the\r
+Library is used in it and that the Library and its use are covered by\r
+this License. You must supply a copy of this License. If the work\r
+during execution displays copyright notices, you must include the\r
+copyright notice for the Library among them, as well as a reference\r
+directing the user to the copy of this License. Also, you must do one\r
+of these things:\r
+\r
+ a) Accompany the work with the complete corresponding\r
+ machine-readable source code for the Library including whatever\r
+ changes were used in the work (which must be distributed under\r
+ Sections 1 and 2 above); and, if the work is an executable linked\r
+ with the Library, with the complete machine-readable "work that\r
+ uses the Library", as object code and/or source code, so that the\r
+ user can modify the Library and then relink to produce a modified\r
+ executable containing the modified Library. (It is understood\r
+ that the user who changes the contents of definitions files in the\r
+ Library will not necessarily be able to recompile the application\r
+ to use the modified definitions.)\r
+\r
+ b) Use a suitable shared library mechanism for linking with the\r
+ Library. A suitable mechanism is one that (1) uses at run time a\r
+ copy of the library already present on the user's computer system,\r
+ rather than copying library functions into the executable, and (2)\r
+ will operate properly with a modified version of the library, if\r
+ the user installs one, as long as the modified version is\r
+ interface-compatible with the version that the work was made with.\r
+\r
+ c) Accompany the work with a written offer, valid for at\r
+ least three years, to give the same user the materials\r
+ specified in Subsection 6a, above, for a charge no more\r
+ than the cost of performing this distribution.\r
+\r
+ d) If distribution of the work is made by offering access to copy\r
+ from a designated place, offer equivalent access to copy the above\r
+ specified materials from the same place.\r
+\r
+ e) Verify that the user has already received a copy of these\r
+ materials or that you have already sent this user a copy.\r
+\r
+ For an executable, the required form of the "work that uses the\r
+Library" must include any data and utility programs needed for\r
+reproducing the executable from it. However, as a special exception,\r
+the materials to be distributed need not include anything that is\r
+normally distributed (in either source or binary form) with the major\r
+components (compiler, kernel, and so on) of the operating system on\r
+which the executable runs, unless that component itself accompanies\r
+the executable.\r
+\r
+ It may happen that this requirement contradicts the license\r
+restrictions of other proprietary libraries that do not normally\r
+accompany the operating system. Such a contradiction means you cannot\r
+use both them and the Library together in an executable that you\r
+distribute.\r
+\r
+ 7. You may place library facilities that are a work based on the\r
+Library side-by-side in a single library together with other library\r
+facilities not covered by this License, and distribute such a combined\r
+library, provided that the separate distribution of the work based on\r
+the Library and of the other library facilities is otherwise\r
+permitted, and provided that you do these two things:\r
+\r
+ a) Accompany the combined library with a copy of the same work\r
+ based on the Library, uncombined with any other library\r
+ facilities. This must be distributed under the terms of the\r
+ Sections above.\r
+\r
+ b) Give prominent notice with the combined library of the fact\r
+ that part of it is a work based on the Library, and explaining\r
+ where to find the accompanying uncombined form of the same work.\r
+\r
+ 8. You may not copy, modify, sublicense, link with, or distribute\r
+the Library except as expressly provided under this License. Any\r
+attempt otherwise to copy, modify, sublicense, link with, or\r
+distribute the Library is void, and will automatically terminate your\r
+rights under this License. However, parties who have received copies,\r
+or rights, from you under this License will not have their licenses\r
+terminated so long as such parties remain in full compliance.\r
+\r
+ 9. You are not required to accept this License, since you have not\r
+signed it. However, nothing else grants you permission to modify or\r
+distribute the Library or its derivative works. These actions are\r
+prohibited by law if you do not accept this License. Therefore, by\r
+modifying or distributing the Library (or any work based on the\r
+Library), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Library or works based on it.\r
+\r
+ 10. Each time you redistribute the Library (or any work based on the\r
+Library), the recipient automatically receives a license from the\r
+original licensor to copy, distribute, link with or modify the Library\r
+subject to these terms and conditions. You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties with\r
+this License.\r
+\r
+ 11. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License. If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Library at all. For example, if a patent\r
+license would not permit royalty-free redistribution of the Library by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Library.\r
+\r
+If any portion of this section is held invalid or unenforceable under any\r
+particular circumstance, the balance of the section is intended to apply,\r
+and the section as a whole is intended to apply in other circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system which is\r
+implemented by public license practices. Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+ 12. If the distribution and/or use of the Library is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Library under this License may add\r
+an explicit geographical distribution limitation excluding those countries,\r
+so that distribution is permitted only in or among countries not thus\r
+excluded. In such case, this License incorporates the limitation as if\r
+written in the body of this License.\r
+\r
+ 13. The Free Software Foundation may publish revised and/or new\r
+versions of the Lesser General Public License from time to time.\r
+Such new versions will be similar in spirit to the present version,\r
+but may differ in detail to address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number. If the Library\r
+specifies a version number of this License which applies to it and\r
+"any later version", you have the option of following the terms and\r
+conditions either of that version or of any later version published by\r
+the Free Software Foundation. If the Library does not specify a\r
+license version number, you may choose any version ever published by\r
+the Free Software Foundation.\r
+\r
+ 14. If you wish to incorporate parts of the Library into other free\r
+programs whose distribution conditions are incompatible with these,\r
+write to the author to ask for permission. For software which is\r
+copyrighted by the Free Software Foundation, write to the Free\r
+Software Foundation; we sometimes make exceptions for this. Our\r
+decision will be guided by the two goals of preserving the free status\r
+of all derivatives of our free software and of promoting the sharing\r
+and reuse of software generally.\r
+\r
+ NO WARRANTY\r
+\r
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\r
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\r
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\r
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY\r
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\r
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\r
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\r
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\r
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\r
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\r
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\r
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\r
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\r
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\r
+DAMAGES.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ How to Apply These Terms to Your New Libraries\r
+\r
+ If you develop a new library, and you want it to be of the greatest\r
+possible use to the public, we recommend making it free software that\r
+everyone can redistribute and change. You can do so by permitting\r
+redistribution under these terms (or, alternatively, under the terms of the\r
+ordinary General Public License).\r
+\r
+ To apply these terms, attach the following notices to the library. It is\r
+safest to attach them to the start of each source file to most effectively\r
+convey the exclusion of warranty; and each file should have at least the\r
+"copyright" line and a pointer to where the full notice is found.\r
+\r
+ <one line to give the library's name and a brief idea of what it does.>\r
+ Copyright (C) <year> <name of author>\r
+\r
+ This library is free software; you can redistribute it and/or\r
+ modify it under the terms of the GNU Lesser General Public\r
+ License as published by the Free Software Foundation; either\r
+ version 2.1 of the License, or (at your option) any later version.\r
+\r
+ This library is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+ Lesser General Public License for more details.\r
+\r
+ You should have received a copy of the GNU Lesser General Public\r
+ License along with this library; if not, write to the Free Software\r
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+You should also get your employer (if you work as a programmer) or your\r
+school, if any, to sign a "copyright disclaimer" for the library, if\r
+necessary. Here is a sample; alter the names:\r
+\r
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the\r
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.\r
+\r
+ <signature of Ty Coon>, 1 April 1990\r
+ Ty Coon, President of Vice\r
+\r
+That's all there is to it!\r
+\r
+\r
--- /dev/null
+input.radio {border:1px none #000; background:transparent; vertical-align:middle;}\r
+.panel_wrapper div.current {height:80px;}\r
+#width {width:50px; vertical-align:middle;}\r
+#width2 {width:50px; vertical-align:middle;}\r
+#size {width:100px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},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}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.AdvancedHRPlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceAdvancedHr', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/rule.htm',\r
+ width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),\r
+ height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('advhr', {\r
+ title : 'advhr.advhr_desc',\r
+ cmd : 'mceAdvancedHr'\r
+ });\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ cm.setActive('advhr', n.nodeName == 'HR');\r
+ });\r
+\r
+ ed.onClick.add(function(ed, e) {\r
+ e = e.target;\r
+\r
+ if (e.nodeName === 'HR')\r
+ ed.selection.select(e);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced HR',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+var AdvHRDialog = {\r
+ init : function(ed) {\r
+ var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;\r
+\r
+ w = dom.getAttrib(n, 'width');\r
+ f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');\r
+ f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';\r
+ f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');\r
+ selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');\r
+ },\r
+\r
+ update : function() {\r
+ var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';\r
+\r
+ h = '<hr';\r
+\r
+ if (f.size.value) {\r
+ h += ' size="' + f.size.value + '"';\r
+ st += ' height:' + f.size.value + 'px;';\r
+ }\r
+\r
+ if (f.width.value) {\r
+ h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';\r
+ st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';\r
+ }\r
+\r
+ if (f.noshade.checked) {\r
+ h += ' noshade="noshade"';\r
+ st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';\r
+ }\r
+\r
+ if (ed.settings.inline_styles)\r
+ h += ' style="' + tinymce.trim(st) + '"';\r
+\r
+ h += ' />';\r
+\r
+ ed.execCommand("mceInsertContent", false, h);\r
+ tinyMCEPopup.close();\r
+ }\r
+};\r
+\r
+tinyMCEPopup.requireLangPack();\r
+tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.advhr_dlg',{\r
+width:"Width",\r
+size:"Height",\r
+noshade:"No shadow"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advhr.advhr_desc}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/rule.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <link href="css/advhr.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body>\r
+<form onsubmit="AdvHRDialog.update();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="width">{#advhr_dlg.width}</label></td>\r
+ <td class="nowrap">\r
+ <input id="width" name="width" type="text" value="" class="mceFocus" />\r
+ <select name="width2" id="width2">\r
+ <option value="">px</option>\r
+ <option value="%">%</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="size">{#advhr_dlg.size}</label></td>\r
+ <td><select id="size" name="size">\r
+ <option value="">Normal</option>\r
+ <option value="1">1</option>\r
+ <option value="2">2</option>\r
+ <option value="3">3</option>\r
+ <option value="4">4</option>\r
+ <option value="5">5</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="noshade">{#advhr_dlg.noshade}</label></td>\r
+ <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+#src_list, #over_list, #out_list {width:280px;}\r
+.mceActionPanel {margin-top:7px;}\r
+.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}\r
+.checkbox {border:0;}\r
+.panel_wrapper div.current {height:305px;}\r
+#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}\r
+#align, #classlist {width:150px;}\r
+#width, #height {vertical-align:middle; width:50px; text-align:center;}\r
+#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}\r
+#class_list {width:180px;}\r
+input {width: 280px;}\r
+#constrain, #onmousemovecheck {width:auto;}\r
+#id, #dir, #lang, #usemap, #longdesc {width:200px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},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}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.AdvancedImagePlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceAdvImage', function() {\r
+ // Internal image object like a flash placeholder\r
+ if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\r
+ return;\r
+\r
+ ed.windowManager.open({\r
+ file : url + '/image.htm',\r
+ width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),\r
+ height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('image', {\r
+ title : 'advimage.image_desc',\r
+ cmd : 'mceAdvImage'\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced image',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advimage_dlg.dialog_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/image.js"></script>\r
+ <link href="css/advimage.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advimage" style="display: none">\r
+ <form onsubmit="ImageDialog.insert();return false;" action="#"> \r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>\r
+ <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.general}</legend>\r
+\r
+ <table class="properties">\r
+ <tr>\r
+ <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>\r
+ <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr> \r
+ <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td> \r
+ <td id="srcbrowsercontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="src_list">{#advimage_dlg.image_list}</label></td>\r
+ <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr> \r
+ <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> \r
+ <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> \r
+ </tr> \r
+ <tr> \r
+ <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> \r
+ <td colspan="2"><input id="title" name="title" type="text" value="" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.preview}</legend>\r
+ <div id="prev"></div>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="appearance_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.tab_appearance}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr> \r
+ <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> \r
+ <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="baseline">{#advimage_dlg.align_baseline}</option>\r
+ <option value="top">{#advimage_dlg.align_top}</option>\r
+ <option value="middle">{#advimage_dlg.align_middle}</option>\r
+ <option value="bottom">{#advimage_dlg.align_bottom}</option>\r
+ <option value="text-top">{#advimage_dlg.align_texttop}</option>\r
+ <option value="text-bottom">{#advimage_dlg.align_textbottom}</option>\r
+ <option value="left">{#advimage_dlg.align_left}</option>\r
+ <option value="right">{#advimage_dlg.align_right}</option>\r
+ </select> \r
+ </td>\r
+ <td rowspan="6" valign="top">\r
+ <div class="alignPreview">\r
+ <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />\r
+ Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam\r
+ nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum\r
+ edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam\r
+ erat volutpat.\r
+ </div>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>\r
+ <td class="nowrap">\r
+ <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x \r
+ <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td> </td>\r
+ <td><table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>\r
+ <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> \r
+ <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />\r
+ </td>\r
+ </tr>\r
+\r
+ <tr> \r
+ <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> \r
+ <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> \r
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="class_list">{#class_name}</label></td>\r
+ <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> \r
+ <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> \r
+ </tr>\r
+\r
+ <!-- <tr>\r
+ <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> \r
+ <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> \r
+ </tr> -->\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.swap_image}</legend>\r
+\r
+ <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" />\r
+ <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+ <tr>\r
+ <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> \r
+ <td><table border="0" cellspacing="0" cellpadding="0"> \r
+ <tr> \r
+ <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> \r
+ <td id="onmouseoversrccontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="over_list">{#advimage_dlg.image_list}</label></td>\r
+ <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr> \r
+ <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> \r
+ <td class="column2"><table border="0" cellspacing="0" cellpadding="0"> \r
+ <tr> \r
+ <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> \r
+ <td id="onmouseoutsrccontainer"> </td>\r
+ </tr> \r
+ </table></td> \r
+ </tr>\r
+ <tr>\r
+ <td><label for="out_list">{#advimage_dlg.image_list}</label></td>\r
+ <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#advimage_dlg.misc}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#advimage_dlg.ltr}</option> \r
+ <option value="rtl">{#advimage_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> \r
+ <td>\r
+ <input id="usemap" name="usemap" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>\r
+ <td><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="longdesc" name="longdesc" type="text" value="" /></td>\r
+ <td id="longdesccontainer"> </td>\r
+ </tr>\r
+ </table></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body> \r
+</html> \r
--- /dev/null
+var ImageDialog = {\r
+ preInit : function() {\r
+ var url;\r
+\r
+ tinyMCEPopup.requireLangPack();\r
+\r
+ if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+ },\r
+\r
+ init : function(ed) {\r
+ var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();\r
+\r
+ tinyMCEPopup.resizeToInnerSize();\r
+ this.fillClassList('class_list');\r
+ this.fillFileList('src_list', 'tinyMCEImageList');\r
+ this.fillFileList('over_list', 'tinyMCEImageList');\r
+ this.fillFileList('out_list', 'tinyMCEImageList');\r
+ TinyMCE_EditableSelects.init();\r
+\r
+ if (n.nodeName == 'IMG') {\r
+ nl.src.value = dom.getAttrib(n, 'src');\r
+ nl.width.value = dom.getAttrib(n, 'width');\r
+ nl.height.value = dom.getAttrib(n, 'height');\r
+ nl.alt.value = dom.getAttrib(n, 'alt');\r
+ nl.title.value = dom.getAttrib(n, 'title');\r
+ nl.vspace.value = this.getAttrib(n, 'vspace');\r
+ nl.hspace.value = this.getAttrib(n, 'hspace');\r
+ nl.border.value = this.getAttrib(n, 'border');\r
+ selectByValue(f, 'align', this.getAttrib(n, 'align'));\r
+ selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);\r
+ nl.style.value = dom.getAttrib(n, 'style');\r
+ nl.id.value = dom.getAttrib(n, 'id');\r
+ nl.dir.value = dom.getAttrib(n, 'dir');\r
+ nl.lang.value = dom.getAttrib(n, 'lang');\r
+ nl.usemap.value = dom.getAttrib(n, 'usemap');\r
+ nl.longdesc.value = dom.getAttrib(n, 'longdesc');\r
+ nl.insert.value = ed.getLang('update');\r
+\r
+ if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))\r
+ nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
+\r
+ if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))\r
+ nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');\r
+\r
+ if (ed.settings.inline_styles) {\r
+ // Move attribs to styles\r
+ if (dom.getAttrib(n, 'align'))\r
+ this.updateStyle('align');\r
+\r
+ if (dom.getAttrib(n, 'hspace'))\r
+ this.updateStyle('hspace');\r
+\r
+ if (dom.getAttrib(n, 'border'))\r
+ this.updateStyle('border');\r
+\r
+ if (dom.getAttrib(n, 'vspace'))\r
+ this.updateStyle('vspace');\r
+ }\r
+ }\r
+\r
+ // Setup browse button\r
+ document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
+ if (isVisible('srcbrowser'))\r
+ document.getElementById('src').style.width = '260px';\r
+\r
+ // Setup browse button\r
+ document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');\r
+ if (isVisible('overbrowser'))\r
+ document.getElementById('onmouseoversrc').style.width = '260px';\r
+\r
+ // Setup browse button\r
+ document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');\r
+ if (isVisible('outbrowser'))\r
+ document.getElementById('onmouseoutsrc').style.width = '260px';\r
+\r
+ // If option enabled default contrain proportions to checked\r
+ if (ed.getParam("advimage_constrain_proportions", true))\r
+ f.constrain.checked = true;\r
+\r
+ // Check swap image if valid data\r
+ if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)\r
+ this.setSwapImage(true);\r
+ else\r
+ this.setSwapImage(false);\r
+\r
+ this.changeAppearance();\r
+ this.showPreviewImage(nl.src.value, 1);\r
+ },\r
+\r
+ insert : function(file, title) {\r
+ var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];\r
+\r
+ if (f.src.value === '') {\r
+ if (ed.selection.getNode().nodeName == 'IMG') {\r
+ ed.dom.remove(ed.selection.getNode());\r
+ ed.execCommand('mceRepaint');\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {\r
+ if (!f.alt.value) {\r
+ tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {\r
+ if (s)\r
+ t.insertAndClose();\r
+ });\r
+\r
+ return;\r
+ }\r
+ }\r
+\r
+ t.insertAndClose();\r
+ },\r
+\r
+ insertAndClose : function() {\r
+ var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ // Fixes crash in Safari\r
+ if (tinymce.isWebKit)\r
+ ed.getWin().focus();\r
+\r
+ if (!ed.settings.inline_styles) {\r
+ args = {\r
+ vspace : nl.vspace.value,\r
+ hspace : nl.hspace.value,\r
+ border : nl.border.value,\r
+ align : getSelectValue(f, 'align')\r
+ };\r
+ } else {\r
+ // Remove deprecated values\r
+ args = {\r
+ vspace : '',\r
+ hspace : '',\r
+ border : '',\r
+ align : ''\r
+ };\r
+ }\r
+\r
+ tinymce.extend(args, {\r
+ src : nl.src.value,\r
+ width : nl.width.value,\r
+ height : nl.height.value,\r
+ alt : nl.alt.value,\r
+ title : nl.title.value,\r
+ 'class' : getSelectValue(f, 'class_list'),\r
+ style : nl.style.value,\r
+ id : nl.id.value,\r
+ dir : nl.dir.value,\r
+ lang : nl.lang.value,\r
+ usemap : nl.usemap.value,\r
+ longdesc : nl.longdesc.value\r
+ });\r
+\r
+ args.onmouseover = args.onmouseout = '';\r
+\r
+ if (f.onmousemovecheck.checked) {\r
+ if (nl.onmouseoversrc.value)\r
+ args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";\r
+\r
+ if (nl.onmouseoutsrc.value)\r
+ args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";\r
+ }\r
+\r
+ el = ed.selection.getNode();\r
+\r
+ if (el && el.nodeName == 'IMG') {\r
+ ed.dom.setAttribs(el, args);\r
+ } else {\r
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});\r
+ ed.dom.setAttribs('__mce_tmp', args);\r
+ ed.dom.setAttrib('__mce_tmp', 'id', '');\r
+ ed.undoManager.add();\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ getAttrib : function(e, at) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
+\r
+ if (ed.settings.inline_styles) {\r
+ switch (at) {\r
+ case 'align':\r
+ if (v = dom.getStyle(e, 'float'))\r
+ return v;\r
+\r
+ if (v = dom.getStyle(e, 'vertical-align'))\r
+ return v;\r
+\r
+ break;\r
+\r
+ case 'hspace':\r
+ v = dom.getStyle(e, 'margin-left')\r
+ v2 = dom.getStyle(e, 'margin-right');\r
+\r
+ if (v && v == v2)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+\r
+ case 'vspace':\r
+ v = dom.getStyle(e, 'margin-top')\r
+ v2 = dom.getStyle(e, 'margin-bottom');\r
+ if (v && v == v2)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+\r
+ case 'border':\r
+ v = 0;\r
+\r
+ tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
+ sv = dom.getStyle(e, 'border-' + sv + '-width');\r
+\r
+ // False or not the same as prev\r
+ if (!sv || (sv != v && v !== 0)) {\r
+ v = 0;\r
+ return false;\r
+ }\r
+\r
+ if (sv)\r
+ v = sv;\r
+ });\r
+\r
+ if (v)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (v = dom.getAttrib(e, at))\r
+ return v;\r
+\r
+ return '';\r
+ },\r
+\r
+ setSwapImage : function(st) {\r
+ var f = document.forms[0];\r
+\r
+ f.onmousemovecheck.checked = st;\r
+ setBrowserDisabled('overbrowser', !st);\r
+ setBrowserDisabled('outbrowser', !st);\r
+\r
+ if (f.over_list)\r
+ f.over_list.disabled = !st;\r
+\r
+ if (f.out_list)\r
+ f.out_list.disabled = !st;\r
+\r
+ f.onmouseoversrc.disabled = !st;\r
+ f.onmouseoutsrc.disabled = !st;\r
+ },\r
+\r
+ fillClassList : function(id) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
+ cl = [];\r
+\r
+ tinymce.each(v.split(';'), function(v) {\r
+ var p = v.split('=');\r
+\r
+ cl.push({'title' : p[0], 'class' : p[1]});\r
+ });\r
+ } else\r
+ cl = tinyMCEPopup.editor.dom.getClasses();\r
+\r
+ if (cl.length > 0) {\r
+ lst.options.length = 0;\r
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+\r
+ tinymce.each(cl, function(o) {\r
+ lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ fillFileList : function(id, l) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ l = window[l];\r
+ lst.options.length = 0;\r
+\r
+ if (l && l.length > 0) {\r
+ lst.options[lst.options.length] = new Option('', '');\r
+\r
+ tinymce.each(l, function(o) {\r
+ lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ resetImageData : function() {\r
+ var f = document.forms[0];\r
+\r
+ f.elements.width.value = f.elements.height.value = '';\r
+ },\r
+\r
+ updateImageData : function(img, st) {\r
+ var f = document.forms[0];\r
+\r
+ if (!st) {\r
+ f.elements.width.value = img.width;\r
+ f.elements.height.value = img.height;\r
+ }\r
+\r
+ this.preloadImg = img;\r
+ },\r
+\r
+ changeAppearance : function() {\r
+ var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');\r
+\r
+ if (img) {\r
+ if (ed.getParam('inline_styles')) {\r
+ ed.dom.setAttrib(img, 'style', f.style.value);\r
+ } else {\r
+ img.align = f.align.value;\r
+ img.border = f.border.value;\r
+ img.hspace = f.hspace.value;\r
+ img.vspace = f.vspace.value;\r
+ }\r
+ }\r
+ },\r
+\r
+ changeHeight : function() {\r
+ var f = document.forms[0], tp, t = this;\r
+\r
+ if (!f.constrain.checked || !t.preloadImg) {\r
+ return;\r
+ }\r
+\r
+ if (f.width.value == "" || f.height.value == "")\r
+ return;\r
+\r
+ tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;\r
+ f.height.value = tp.toFixed(0);\r
+ },\r
+\r
+ changeWidth : function() {\r
+ var f = document.forms[0], tp, t = this;\r
+\r
+ if (!f.constrain.checked || !t.preloadImg) {\r
+ return;\r
+ }\r
+\r
+ if (f.width.value == "" || f.height.value == "")\r
+ return;\r
+\r
+ tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;\r
+ f.width.value = tp.toFixed(0);\r
+ },\r
+\r
+ updateStyle : function(ty) {\r
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});\r
+\r
+ if (tinyMCEPopup.editor.settings.inline_styles) {\r
+ // Handle align\r
+ if (ty == 'align') {\r
+ dom.setStyle(img, 'float', '');\r
+ dom.setStyle(img, 'vertical-align', '');\r
+\r
+ v = getSelectValue(f, 'align');\r
+ if (v) {\r
+ if (v == 'left' || v == 'right')\r
+ dom.setStyle(img, 'float', v);\r
+ else\r
+ img.style.verticalAlign = v;\r
+ }\r
+ }\r
+\r
+ // Handle border\r
+ if (ty == 'border') {\r
+ dom.setStyle(img, 'border', '');\r
+\r
+ v = f.border.value;\r
+ if (v || v == '0') {\r
+ if (v == '0')\r
+ img.style.border = '0';\r
+ else\r
+ img.style.border = v + 'px solid black';\r
+ }\r
+ }\r
+\r
+ // Handle hspace\r
+ if (ty == 'hspace') {\r
+ dom.setStyle(img, 'marginLeft', '');\r
+ dom.setStyle(img, 'marginRight', '');\r
+\r
+ v = f.hspace.value;\r
+ if (v) {\r
+ img.style.marginLeft = v + 'px';\r
+ img.style.marginRight = v + 'px';\r
+ }\r
+ }\r
+\r
+ // Handle vspace\r
+ if (ty == 'vspace') {\r
+ dom.setStyle(img, 'marginTop', '');\r
+ dom.setStyle(img, 'marginBottom', '');\r
+\r
+ v = f.vspace.value;\r
+ if (v) {\r
+ img.style.marginTop = v + 'px';\r
+ img.style.marginBottom = v + 'px';\r
+ }\r
+ }\r
+\r
+ // Merge\r
+ dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');\r
+ }\r
+ },\r
+\r
+ changeMouseMove : function() {\r
+ },\r
+\r
+ showPreviewImage : function(u, st) {\r
+ if (!u) {\r
+ tinyMCEPopup.dom.setHTML('prev', '');\r
+ return;\r
+ }\r
+\r
+ if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))\r
+ this.resetImageData();\r
+\r
+ u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);\r
+\r
+ if (!st)\r
+ tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');\r
+ else\r
+ tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');\r
+ }\r
+};\r
+\r
+ImageDialog.preInit();\r
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.advimage_dlg',{\r
+tab_general:"General",\r
+tab_appearance:"Appearance",\r
+tab_advanced:"Advanced",\r
+general:"General",\r
+title:"Title",\r
+preview:"Preview",\r
+constrain_proportions:"Constrain proportions",\r
+langdir:"Language direction",\r
+langcode:"Language code",\r
+long_desc:"Long description link",\r
+style:"Style",\r
+classes:"Classes",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+id:"Id",\r
+map:"Image map",\r
+swap_image:"Swap image",\r
+alt_image:"Alternative image",\r
+mouseover:"for mouse over",\r
+mouseout:"for mouse out",\r
+misc:"Miscellaneous",\r
+example_img:"Appearance preview image",\r
+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.",\r
+dialog_title:"Insert/edit image",\r
+src:"Image URL",\r
+alt:"Image description",\r
+list:"Image list",\r
+border:"Border",\r
+dimensions:"Dimensions",\r
+vspace:"Vertical space",\r
+hspace:"Horizontal space",\r
+align:"Alignment",\r
+align_baseline:"Baseline",\r
+align_top:"Top",\r
+align_middle:"Middle",\r
+align_bottom:"Bottom",\r
+align_texttop:"Text top",\r
+align_textbottom:"Text bottom",\r
+align_left:"Left",\r
+align_right:"Right",\r
+image_list:"Image list"\r
+});
\ No newline at end of file
--- /dev/null
+.mceLinkList, .mceAnchorList, #targetlist {width:280px;}\r
+.mceActionPanel {margin-top:7px;}\r
+.panel_wrapper div.current {height:320px;}\r
+#classlist, #title, #href {width:280px;}\r
+#popupurl, #popupname {width:200px;}\r
+#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}\r
+#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}\r
+#events_panel input {width:200px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},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}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {\r
+ init : function(ed, url) {\r
+ this.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceAdvLink', function() {\r
+ var se = ed.selection;\r
+\r
+ // No selection and not in link\r
+ if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))\r
+ return;\r
+\r
+ ed.windowManager.open({\r
+ file : url + '/link.htm',\r
+ width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),\r
+ height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('link', {\r
+ title : 'advlink.link_desc',\r
+ cmd : 'mceAdvLink'\r
+ });\r
+\r
+ ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n, co) {\r
+ cm.setDisabled('link', co && n.nodeName != 'A');\r
+ cm.setActive('link', n.nodeName == 'A' && !n.name);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced link',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+/* Functions for the advlink plugin popup */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var templates = {\r
+ "window.open" : "window.open('${url}','${target}','${options}')"\r
+};\r
+\r
+function preinit() {\r
+ var url;\r
+\r
+ if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+}\r
+\r
+function changeClass() {\r
+ var f = document.forms[0];\r
+\r
+ f.classes.value = getSelectValue(f, 'classlist');\r
+}\r
+\r
+function init() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ var formObj = document.forms[0];\r
+ var inst = tinyMCEPopup.editor;\r
+ var elm = inst.selection.getNode();\r
+ var action = "insert";\r
+ var html;\r
+\r
+ document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');\r
+ document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');\r
+ document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');\r
+ document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');\r
+ document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');\r
+\r
+ // Link list\r
+ html = getLinkListHTML('linklisthref','href');\r
+ if (html == "")\r
+ document.getElementById("linklisthrefrow").style.display = 'none';\r
+ else\r
+ document.getElementById("linklisthrefcontainer").innerHTML = html;\r
+\r
+ // Resize some elements\r
+ if (isVisible('hrefbrowser'))\r
+ document.getElementById('href').style.width = '260px';\r
+\r
+ if (isVisible('popupurlbrowser'))\r
+ document.getElementById('popupurl').style.width = '180px';\r
+\r
+ elm = inst.dom.getParent(elm, "A");\r
+ if (elm != null && elm.nodeName == "A")\r
+ action = "update";\r
+\r
+ formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); \r
+\r
+ setPopupControlsDisabled(true);\r
+\r
+ if (action == "update") {\r
+ var href = inst.dom.getAttrib(elm, 'href');\r
+ var onclick = inst.dom.getAttrib(elm, 'onclick');\r
+\r
+ // Setup form data\r
+ setFormValue('href', href);\r
+ setFormValue('title', inst.dom.getAttrib(elm, 'title'));\r
+ setFormValue('id', inst.dom.getAttrib(elm, 'id'));\r
+ setFormValue('style', inst.dom.getAttrib(elm, "style"));\r
+ setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));\r
+ setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));\r
+ setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));\r
+ setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));\r
+ setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));\r
+ setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));\r
+ setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
+ setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
+ setFormValue('type', inst.dom.getAttrib(elm, 'type'));\r
+ setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));\r
+ setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));\r
+ setFormValue('onclick', onclick);\r
+ setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));\r
+ setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));\r
+ setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));\r
+ setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));\r
+ setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));\r
+ setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));\r
+ setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));\r
+ setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));\r
+ setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));\r
+ setFormValue('target', inst.dom.getAttrib(elm, 'target'));\r
+ setFormValue('classes', inst.dom.getAttrib(elm, 'class'));\r
+\r
+ // Parse onclick data\r
+ if (onclick != null && onclick.indexOf('window.open') != -1)\r
+ parseWindowOpen(onclick);\r
+ else\r
+ parseFunction(onclick);\r
+\r
+ // Select by the values\r
+ selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));\r
+ selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));\r
+ selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));\r
+ selectByValue(formObj, 'linklisthref', href);\r
+\r
+ if (href.charAt(0) == '#')\r
+ selectByValue(formObj, 'anchorlist', href);\r
+\r
+ addClassesToList('classlist', 'advlink_styles');\r
+\r
+ selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);\r
+ selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);\r
+ } else\r
+ addClassesToList('classlist', 'advlink_styles');\r
+}\r
+\r
+function checkPrefix(n) {\r
+ if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))\r
+ n.value = 'mailto:' + n.value;\r
+\r
+ if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))\r
+ n.value = 'http://' + n.value;\r
+}\r
+\r
+function setFormValue(name, value) {\r
+ document.forms[0].elements[name].value = value;\r
+}\r
+\r
+function parseWindowOpen(onclick) {\r
+ var formObj = document.forms[0];\r
+\r
+ // Preprocess center code\r
+ if (onclick.indexOf('return false;') != -1) {\r
+ formObj.popupreturn.checked = true;\r
+ onclick = onclick.replace('return false;', '');\r
+ } else\r
+ formObj.popupreturn.checked = false;\r
+\r
+ var onClickData = parseLink(onclick);\r
+\r
+ if (onClickData != null) {\r
+ formObj.ispopup.checked = true;\r
+ setPopupControlsDisabled(false);\r
+\r
+ var onClickWindowOptions = parseOptions(onClickData['options']);\r
+ var url = onClickData['url'];\r
+\r
+ formObj.popupname.value = onClickData['target'];\r
+ formObj.popupurl.value = url;\r
+ formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');\r
+ formObj.popupheight.value = getOption(onClickWindowOptions, 'height');\r
+\r
+ formObj.popupleft.value = getOption(onClickWindowOptions, 'left');\r
+ formObj.popuptop.value = getOption(onClickWindowOptions, 'top');\r
+\r
+ if (formObj.popupleft.value.indexOf('screen') != -1)\r
+ formObj.popupleft.value = "c";\r
+\r
+ if (formObj.popuptop.value.indexOf('screen') != -1)\r
+ formObj.popuptop.value = "c";\r
+\r
+ formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";\r
+ formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";\r
+ formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";\r
+ formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";\r
+ formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";\r
+ formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";\r
+ formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";\r
+\r
+ buildOnClick();\r
+ }\r
+}\r
+\r
+function parseFunction(onclick) {\r
+ var formObj = document.forms[0];\r
+ var onClickData = parseLink(onclick);\r
+\r
+ // TODO: Add stuff here\r
+}\r
+\r
+function getOption(opts, name) {\r
+ return typeof(opts[name]) == "undefined" ? "" : opts[name];\r
+}\r
+\r
+function setPopupControlsDisabled(state) {\r
+ var formObj = document.forms[0];\r
+\r
+ formObj.popupname.disabled = state;\r
+ formObj.popupurl.disabled = state;\r
+ formObj.popupwidth.disabled = state;\r
+ formObj.popupheight.disabled = state;\r
+ formObj.popupleft.disabled = state;\r
+ formObj.popuptop.disabled = state;\r
+ formObj.popuplocation.disabled = state;\r
+ formObj.popupscrollbars.disabled = state;\r
+ formObj.popupmenubar.disabled = state;\r
+ formObj.popupresizable.disabled = state;\r
+ formObj.popuptoolbar.disabled = state;\r
+ formObj.popupstatus.disabled = state;\r
+ formObj.popupreturn.disabled = state;\r
+ formObj.popupdependent.disabled = state;\r
+\r
+ setBrowserDisabled('popupurlbrowser', state);\r
+}\r
+\r
+function parseLink(link) {\r
+ link = link.replace(new RegExp(''', 'g'), "'");\r
+\r
+ var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");\r
+\r
+ // Is function name a template function\r
+ var template = templates[fnName];\r
+ if (template) {\r
+ // Build regexp\r
+ var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));\r
+ var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";\r
+ var replaceStr = "";\r
+ for (var i=0; i<variableNames.length; i++) {\r
+ // Is string value\r
+ if (variableNames[i].indexOf("'${") != -1)\r
+ regExp += "'(.*)'";\r
+ else // Number value\r
+ regExp += "([0-9]*)";\r
+\r
+ replaceStr += "$" + (i+1);\r
+\r
+ // Cleanup variable name\r
+ variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");\r
+\r
+ if (i != variableNames.length-1) {\r
+ regExp += "\\s*,\\s*";\r
+ replaceStr += "<delim>";\r
+ } else\r
+ regExp += ".*";\r
+ }\r
+\r
+ regExp += "\\);?";\r
+\r
+ // Build variable array\r
+ var variables = [];\r
+ variables["_function"] = fnName;\r
+ var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');\r
+ for (var i=0; i<variableNames.length; i++)\r
+ variables[variableNames[i]] = variableValues[i];\r
+\r
+ return variables;\r
+ }\r
+\r
+ return null;\r
+}\r
+\r
+function parseOptions(opts) {\r
+ if (opts == null || opts == "")\r
+ return [];\r
+\r
+ // Cleanup the options\r
+ opts = opts.toLowerCase();\r
+ opts = opts.replace(/;/g, ",");\r
+ opts = opts.replace(/[^0-9a-z=,]/g, "");\r
+\r
+ var optionChunks = opts.split(',');\r
+ var options = [];\r
+\r
+ for (var i=0; i<optionChunks.length; i++) {\r
+ var parts = optionChunks[i].split('=');\r
+\r
+ if (parts.length == 2)\r
+ options[parts[0]] = parts[1];\r
+ }\r
+\r
+ return options;\r
+}\r
+\r
+function buildOnClick() {\r
+ var formObj = document.forms[0];\r
+\r
+ if (!formObj.ispopup.checked) {\r
+ formObj.onclick.value = "";\r
+ return;\r
+ }\r
+\r
+ var onclick = "window.open('";\r
+ var url = formObj.popupurl.value;\r
+\r
+ onclick += url + "','";\r
+ onclick += formObj.popupname.value + "','";\r
+\r
+ if (formObj.popuplocation.checked)\r
+ onclick += "location=yes,";\r
+\r
+ if (formObj.popupscrollbars.checked)\r
+ onclick += "scrollbars=yes,";\r
+\r
+ if (formObj.popupmenubar.checked)\r
+ onclick += "menubar=yes,";\r
+\r
+ if (formObj.popupresizable.checked)\r
+ onclick += "resizable=yes,";\r
+\r
+ if (formObj.popuptoolbar.checked)\r
+ onclick += "toolbar=yes,";\r
+\r
+ if (formObj.popupstatus.checked)\r
+ onclick += "status=yes,";\r
+\r
+ if (formObj.popupdependent.checked)\r
+ onclick += "dependent=yes,";\r
+\r
+ if (formObj.popupwidth.value != "")\r
+ onclick += "width=" + formObj.popupwidth.value + ",";\r
+\r
+ if (formObj.popupheight.value != "")\r
+ onclick += "height=" + formObj.popupheight.value + ",";\r
+\r
+ if (formObj.popupleft.value != "") {\r
+ if (formObj.popupleft.value != "c")\r
+ onclick += "left=" + formObj.popupleft.value + ",";\r
+ else\r
+ onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";\r
+ }\r
+\r
+ if (formObj.popuptop.value != "") {\r
+ if (formObj.popuptop.value != "c")\r
+ onclick += "top=" + formObj.popuptop.value + ",";\r
+ else\r
+ onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";\r
+ }\r
+\r
+ if (onclick.charAt(onclick.length-1) == ',')\r
+ onclick = onclick.substring(0, onclick.length-1);\r
+\r
+ onclick += "');";\r
+\r
+ if (formObj.popupreturn.checked)\r
+ onclick += "return false;";\r
+\r
+ // tinyMCE.debug(onclick);\r
+\r
+ formObj.onclick.value = onclick;\r
+\r
+ if (formObj.href.value == "")\r
+ formObj.href.value = url;\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+ var formObj = document.forms[0];\r
+ var valueElm = formObj.elements[attrib.toLowerCase()];\r
+ var dom = tinyMCEPopup.editor.dom;\r
+\r
+ if (typeof(value) == "undefined" || value == null) {\r
+ value = "";\r
+\r
+ if (valueElm)\r
+ value = valueElm.value;\r
+ }\r
+\r
+ // Clean up the style\r
+ if (attrib == 'style')\r
+ value = dom.serializeStyle(dom.parseStyle(value), 'a');\r
+\r
+ dom.setAttrib(elm, attrib, value);\r
+}\r
+\r
+function getAnchorListHTML(id, target) {\r
+ var inst = tinyMCEPopup.editor;\r
+ var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i;\r
+ var html = "";\r
+\r
+ html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';\r
+ html += 'this.options[this.selectedIndex].value;">';\r
+ html += '<option value="">---</option>';\r
+\r
+ for (i=0; i<nodes.length; i++) {\r
+ if ((name = inst.dom.getAttrib(nodes[i], "name")) != "")\r
+ html += '<option value="#' + name + '">' + name + '</option>';\r
+ }\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+}\r
+\r
+function insertAction() {\r
+ var inst = tinyMCEPopup.editor;\r
+ var elm, elementArray, i;\r
+\r
+ elm = inst.selection.getNode();\r
+ checkPrefix(document.forms[0].href);\r
+\r
+ elm = inst.dom.getParent(elm, "A");\r
+\r
+ // Remove element if there is no href\r
+ if (!document.forms[0].href.value) {\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+ i = inst.selection.getBookmark();\r
+ inst.dom.remove(elm, 1);\r
+ inst.selection.moveToBookmark(i);\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+\r
+ // Create new anchor elements\r
+ if (elm == null) {\r
+ inst.getDoc().execCommand("unlink", false, null);\r
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});\r
+\r
+ elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});\r
+ for (i=0; i<elementArray.length; i++)\r
+ setAllAttribs(elm = elementArray[i]);\r
+ } else\r
+ setAllAttribs(elm);\r
+\r
+ // Don't move caret if selection was image\r
+ if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {\r
+ inst.focus();\r
+ inst.selection.select(elm);\r
+ inst.selection.collapse(0);\r
+ tinyMCEPopup.storeSelection();\r
+ }\r
+\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function setAllAttribs(elm) {\r
+ var formObj = document.forms[0];\r
+ var href = formObj.href.value;\r
+ var target = getSelectValue(formObj, 'targetlist');\r
+\r
+ setAttrib(elm, 'href', href);\r
+ setAttrib(elm, 'title');\r
+ setAttrib(elm, 'target', target == '_self' ? '' : target);\r
+ setAttrib(elm, 'id');\r
+ setAttrib(elm, 'style');\r
+ setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));\r
+ setAttrib(elm, 'rel');\r
+ setAttrib(elm, 'rev');\r
+ setAttrib(elm, 'charset');\r
+ setAttrib(elm, 'hreflang');\r
+ setAttrib(elm, 'dir');\r
+ setAttrib(elm, 'lang');\r
+ setAttrib(elm, 'tabindex');\r
+ setAttrib(elm, 'accesskey');\r
+ setAttrib(elm, 'type');\r
+ setAttrib(elm, 'onfocus');\r
+ setAttrib(elm, 'onblur');\r
+ setAttrib(elm, 'onclick');\r
+ setAttrib(elm, 'ondblclick');\r
+ setAttrib(elm, 'onmousedown');\r
+ setAttrib(elm, 'onmouseup');\r
+ setAttrib(elm, 'onmouseover');\r
+ setAttrib(elm, 'onmousemove');\r
+ setAttrib(elm, 'onmouseout');\r
+ setAttrib(elm, 'onkeypress');\r
+ setAttrib(elm, 'onkeydown');\r
+ setAttrib(elm, 'onkeyup');\r
+\r
+ // Refresh in old MSIE\r
+ if (tinyMCE.isMSIE5)\r
+ elm.outerHTML = elm.outerHTML;\r
+}\r
+\r
+function getSelectValue(form_obj, field_name) {\r
+ var elm = form_obj.elements[field_name];\r
+\r
+ if (!elm || elm.options == null || elm.selectedIndex == -1)\r
+ return "";\r
+\r
+ return elm.options[elm.selectedIndex].value;\r
+}\r
+\r
+function getLinkListHTML(elm_id, target_form_element, onchange_func) {\r
+ if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)\r
+ return "";\r
+\r
+ var html = "";\r
+\r
+ html += '<select id="' + elm_id + '" name="' + elm_id + '"';\r
+ html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';\r
+ html += 'this.options[this.selectedIndex].value;';\r
+\r
+ if (typeof(onchange_func) != "undefined")\r
+ html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';\r
+\r
+ html += '"><option value="">---</option>';\r
+\r
+ for (var i=0; i<tinyMCELinkList.length; i++)\r
+ html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+\r
+ // tinyMCE.debug('-- image list start --', html, '-- image list end --');\r
+}\r
+\r
+function getTargetListHTML(elm_id, target_form_element) {\r
+ var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');\r
+ var html = '';\r
+\r
+ html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';\r
+ html += 'this.options[this.selectedIndex].value;">';\r
+ html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';\r
+ html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';\r
+ html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';\r
+ html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';\r
+\r
+ for (var i=0; i<targets.length; i++) {\r
+ var key, value;\r
+\r
+ if (targets[i] == "")\r
+ continue;\r
+\r
+ key = targets[i].split('=')[0];\r
+ value = targets[i].split('=')[1];\r
+\r
+ html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';\r
+ }\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+}\r
+\r
+// While loading\r
+preinit();\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.advlink_dlg',{\r
+title:"Insert/edit link",\r
+url:"Link URL",\r
+target:"Target",\r
+titlefield:"Title",\r
+is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",\r
+is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",\r
+list:"Link list",\r
+general_tab:"General",\r
+popup_tab:"Popup",\r
+events_tab:"Events",\r
+advanced_tab:"Advanced",\r
+general_props:"General properties",\r
+popup_props:"Popup properties",\r
+event_props:"Events",\r
+advanced_props:"Advanced properties",\r
+popup_opts:"Options",\r
+anchor_names:"Anchors",\r
+target_same:"Open in this window / frame",\r
+target_parent:"Open in parent window / frame",\r
+target_top:"Open in top frame (replaces all frames)",\r
+target_blank:"Open in new window",\r
+popup:"Javascript popup",\r
+popup_url:"Popup URL",\r
+popup_name:"Window name",\r
+popup_return:"Insert 'return false'",\r
+popup_scrollbars:"Show scrollbars",\r
+popup_statusbar:"Show status bar",\r
+popup_toolbar:"Show toolbars",\r
+popup_menubar:"Show menu bar",\r
+popup_location:"Show location bar",\r
+popup_resizable:"Make window resizable",\r
+popup_dependent:"Dependent (Mozilla/Firefox only)",\r
+popup_size:"Size",\r
+popup_position:"Position (X/Y)",\r
+id:"Id",\r
+style:"Style",\r
+classes:"Classes",\r
+target_name:"Target name",\r
+langdir:"Language direction",\r
+target_langcode:"Target language",\r
+langcode:"Language code",\r
+encoding:"Target character encoding",\r
+mime:"Target MIME type",\r
+rel:"Relationship page to target",\r
+rev:"Relationship target to page",\r
+tabindex:"Tabindex",\r
+accesskey:"Accesskey",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+link_list:"Link list"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advlink_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="js/advlink.js"></script>\r
+ <link href="css/advlink.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advlink" style="display: none">\r
+ <form onsubmit="insertAction();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>\r
+ <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>\r
+ <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.general_props}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>\r
+ <td><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>\r
+ <td id="hrefbrowsercontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr id="linklisthrefrow">\r
+ <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>\r
+ <td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>\r
+ <td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>\r
+ <td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>\r
+ <td><input id="title" name="title" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
+ <td>\r
+ <select id="classlist" name="classlist" onchange="changeClass();">\r
+ <option value="" selected="selected">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="popup_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.popup_props}</legend>\r
+\r
+ <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />\r
+ <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td>\r
+ <td>\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>\r
+ <td id="popupurlbrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td>\r
+ <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label>{#advlink_dlg.popup_size}</label> </td>\r
+ <td class="nowrap">\r
+ <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x\r
+ <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label> </td>\r
+ <td class="nowrap">\r
+ <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> / \r
+ <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)\r
+ </td>\r
+ </tr>\r
+ </table>\r
+\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.popup_opts}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>\r
+ <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>\r
+ </tr>\r
+ <tr>\r
+ <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>\r
+ <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>\r
+ </tr>\r
+ <tr>\r
+ <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>\r
+ <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>\r
+ </tr>\r
+ <tr>\r
+ <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>\r
+ <td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>\r
+ <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>\r
+ <td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.advanced_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>\r
+ <td><input type="text" id="style" name="style" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>\r
+ <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>\r
+ <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#advlink_dlg.ltr}</option> \r
+ <option value="rtl">{#advlink_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>\r
+ <td><input type="text" id="hreflang" name="hreflang" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>\r
+ <td><input type="text" id="charset" name="charset" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>\r
+ <td><input type="text" id="type" name="type" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>\r
+ <td><select id="rel" name="rel"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="lightbox">Lightbox</option> \r
+ <option value="alternate">Alternate</option> \r
+ <option value="designates">Designates</option> \r
+ <option value="stylesheet">Stylesheet</option> \r
+ <option value="start">Start</option> \r
+ <option value="next">Next</option> \r
+ <option value="prev">Prev</option> \r
+ <option value="contents">Contents</option> \r
+ <option value="index">Index</option> \r
+ <option value="glossary">Glossary</option> \r
+ <option value="copyright">Copyright</option> \r
+ <option value="chapter">Chapter</option> \r
+ <option value="subsection">Subsection</option> \r
+ <option value="appendix">Appendix</option> \r
+ <option value="help">Help</option> \r
+ <option value="bookmark">Bookmark</option>\r
+ <option value="nofollow">No Follow</option>\r
+ <option value="tag">Tag</option>\r
+ </select> \r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>\r
+ <td><select id="rev" name="rev"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="alternate">Alternate</option> \r
+ <option value="designates">Designates</option> \r
+ <option value="stylesheet">Stylesheet</option> \r
+ <option value="start">Start</option> \r
+ <option value="next">Next</option> \r
+ <option value="prev">Prev</option> \r
+ <option value="contents">Contents</option> \r
+ <option value="index">Index</option> \r
+ <option value="glossary">Glossary</option> \r
+ <option value="copyright">Copyright</option> \r
+ <option value="chapter">Chapter</option> \r
+ <option value="subsection">Subsection</option> \r
+ <option value="appendix">Appendix</option> \r
+ <option value="help">Help</option> \r
+ <option value="bookmark">Bookmark</option> \r
+ </select> \r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>\r
+ <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>\r
+ <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advlink_dlg.event_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label for="onfocus">onfocus</label></td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onblur">onblur</label></td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onclick">onclick</label></td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="ondblclick">ondblclick</label></td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmousedown">onmousedown</label></td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmouseup">onmouseup</label></td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmouseover">onmouseover</label></td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmousemove">onmousemove</label></td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onmouseout">onmouseout</label></td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onkeypress">onkeypress</label></td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onkeydown">onkeydown</label></td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="onkeyup">onkeyup</label></td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.plugins.AdvListPlugin', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ function buildFormats(str) {\r
+ var formats = [];\r
+\r
+ each(str.split(/,/), function(type) {\r
+ formats.push({\r
+ title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),\r
+ styles : {\r
+ listStyleType : type == 'default' ? '' : type\r
+ }\r
+ });\r
+ });\r
+\r
+ return formats;\r
+ };\r
+\r
+ // Setup number formats from config or default\r
+ t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");\r
+ t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");\r
+ },\r
+\r
+ createControl: function(name, cm) {\r
+ var t = this, btn, format;\r
+\r
+ if (name == 'numlist' || name == 'bullist') {\r
+ // Default to first item if it's a default item\r
+ if (t[name][0].title == 'advlist.def')\r
+ format = t[name][0];\r
+\r
+ function hasFormat(node, format) {\r
+ var state = true;\r
+\r
+ each(format.styles, function(value, name) {\r
+ // Format doesn't match\r
+ if (t.editor.dom.getStyle(node, name) != value) {\r
+ state = false;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return state;\r
+ };\r
+\r
+ function applyListFormat() {\r
+ var list, ed = t.editor, dom = ed.dom, sel = ed.selection;\r
+\r
+ // Check for existing list element\r
+ list = dom.getParent(sel.getNode(), 'ol,ul');\r
+\r
+ // Switch/add list type if needed\r
+ if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))\r
+ ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');\r
+\r
+ // Append styles to new list element\r
+ if (format) {\r
+ list = dom.getParent(sel.getNode(), 'ol,ul');\r
+\r
+ if (list) {\r
+ dom.setStyles(list, format.styles);\r
+ list.removeAttribute('_mce_style');\r
+ }\r
+ }\r
+ };\r
+\r
+ btn = cm.createSplitButton(name, {\r
+ title : 'advanced.' + name + '_desc',\r
+ 'class' : 'mce_' + name,\r
+ onclick : function() {\r
+ applyListFormat();\r
+ }\r
+ });\r
+\r
+ btn.onRenderMenu.add(function(btn, menu) {\r
+ menu.onShowMenu.add(function() {\r
+ var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList;\r
+\r
+ if (list || format) {\r
+ fmtList = t[name];\r
+\r
+ // Unselect existing items\r
+ each(menu.items, function(item) {\r
+ var state = true;\r
+\r
+ item.setSelected(0);\r
+\r
+ if (list && !item.isDisabled()) {\r
+ each(fmtList, function(fmt) {\r
+ if (fmt.id == item.id) {\r
+ if (!hasFormat(list, fmt)) {\r
+ state = false;\r
+ return false;\r
+ }\r
+ }\r
+ });\r
+\r
+ if (state)\r
+ item.setSelected(1);\r
+ }\r
+ });\r
+\r
+ // Select the current format\r
+ if (!list)\r
+ menu.items[format.id].setSelected(1);\r
+ }\r
+ });\r
+\r
+ menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+ each(t[name], function(item) {\r
+ item.id = t.editor.dom.uniqueId();\r
+\r
+ menu.add({id : item.id, title : item.title, onclick : function() {\r
+ format = item;\r
+ applyListFormat();\r
+ }});\r
+ });\r
+ });\r
+\r
+ return btn;\r
+ }\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced lists',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
\ No newline at end of file
--- /dev/null
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ /**
+ * Auto Resize
+ *
+ * This plugin automatically resizes the content area to fit its content height.
+ * It will retain a minimum height, which is the height of the content area when
+ * it's initialized.
+ */
+ tinymce.create('tinymce.plugins.AutoResizePlugin', {
+ /**
+ * Initializes the plugin, this will be executed after the plugin has been created.
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
+ * of the editor instance to intercept that event.
+ *
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+ * @param {string} url Absolute URL to where the plugin is located.
+ */
+ init : function(ed, url) {
+ var t = this;
+
+ if (ed.getParam('fullscreen_is_enabled'))
+ return;
+
+ /**
+ * This method gets executed each time the editor needs to resize.
+ */
+ function resize() {
+ var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
+
+ // Get height differently depending on the browser used
+ myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
+
+ // Don't make it smaller than the minimum height
+ if (myHeight > t.autoresize_min_height)
+ resizeHeight = myHeight;
+
+ // Resize content element
+ DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
+
+ // if we're throbbing, we'll re-throb to match the new size
+ if (t.throbbing) {
+ ed.setProgressState(false);
+ ed.setProgressState(true);
+ }
+ };
+
+ t.editor = ed;
+
+ // Define minimum height
+ t.autoresize_min_height = ed.getElement().offsetHeight;
+
+ // Add appropriate listeners for resizing content area
+ ed.onChange.add(resize);
+ ed.onSetContent.add(resize);
+ ed.onPaste.add(resize);
+ ed.onKeyUp.add(resize);
+ ed.onPostRender.add(resize);
+
+ if (ed.getParam('autoresize_on_init', true)) {
+ // Things to do when the editor is ready
+ ed.onInit.add(function(ed, l) {
+ // Show throbber until content area is resized properly
+ ed.setProgressState(true);
+ t.throbbing = true;
+
+ // Hide scrollbars
+ ed.getBody().style.overflowY = "hidden";
+ });
+
+ ed.onLoadContent.add(function(ed, l) {
+ resize();
+
+ // Because the content area resizes when its content CSS loads,
+ // and we can't easily add a listener to its onload event,
+ // we'll just trigger a resize after a short loading period
+ setTimeout(function() {
+ resize();
+
+ // Disable throbber
+ ed.setProgressState(false);
+ t.throbbing = false;
+ }, 1250);
+ });
+ }
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+ ed.addCommand('mceAutoResize', resize);
+ },
+
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ getInfo : function() {
+ return {
+ longname : 'Auto Resize',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
+})();
\ No newline at end of file
--- /dev/null
+(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},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:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();m.save("TinyMCE")},getItem:function(l){var m=i.getElement();m.load("TinyMCE");return m.getAttribute(l)},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ *\r
+ * Adds auto-save capability to the TinyMCE text editor to rescue content\r
+ * inadvertently lost. This plugin was originally developed by Speednet\r
+ * and that project can be found here: http://code.google.com/p/tinyautosave/\r
+ *\r
+ * TECHNOLOGY DISCUSSION:\r
+ * \r
+ * The plugin attempts to use the most advanced features available in the current browser to save\r
+ * as much content as possible. There are a total of four different methods used to autosave the\r
+ * content. In order of preference, they are:\r
+ * \r
+ * 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain\r
+ * on the client computer. Data stored in the localStorage area has no expiration date, so we must\r
+ * manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed\r
+ * to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As\r
+ * HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,\r
+ * localStorage is stored in the following folder:\r
+ * C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]\r
+ * \r
+ * 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,\r
+ * except it is designed to expire after a certain amount of time. Because the specification\r
+ * around expiration date/time is very loosely-described, it is preferrable to use locaStorage and\r
+ * manage the expiration ourselves. sessionStorage has similar storage characteristics to\r
+ * localStorage, although it seems to have better support by Firefox 3 at the moment. (That will\r
+ * certainly change as Firefox continues getting better at HTML 5 adoption.)\r
+ * \r
+ * 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a\r
+ * way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client\r
+ * computer. The feature is available for IE 5+, which makes it available for every version of IE\r
+ * supported by TinyMCE. The content is persistent across browser restarts and expires on the\r
+ * date/time specified, just like a cookie. However, the data is not cleared when the user clears\r
+ * cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData,\r
+ * like other Microsoft IE browser technologies, is implemented as a behavior attached to a\r
+ * specific DOM object, so in this case we attach the behavior to the same DOM element that the\r
+ * TinyMCE editor instance is attached to.\r
+ */\r
+\r
+(function(tinymce) {\r
+ // Setup constants to help the compressor to reduce script size\r
+ var PLUGIN_NAME = 'autosave',\r
+ RESTORE_DRAFT = 'restoredraft',\r
+ TRUE = true,\r
+ undefined,\r
+ unloadHandlerAdded,\r
+ Dispatcher = tinymce.util.Dispatcher;\r
+\r
+ /**\r
+ * This plugin adds auto-save capability to the TinyMCE text editor to rescue content\r
+ * inadvertently lost. By using localStorage.\r
+ *\r
+ * @class tinymce.plugins.AutoSave\r
+ */\r
+ tinymce.create('tinymce.plugins.AutoSave', {\r
+ /**\r
+ * Initializes the plugin, this will be executed after the plugin has been created.\r
+ * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+ * of the editor instance to intercept that event.\r
+ *\r
+ * @method init\r
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+ * @param {string} url Absolute URL to where the plugin is located.\r
+ */\r
+ init : function(ed, url) {\r
+ var self = this, settings = ed.settings;\r
+\r
+ self.editor = ed;\r
+\r
+ // Parses the specified time string into a milisecond number 10m, 10s etc.\r
+ function parseTime(time) {\r
+ var multipels = {\r
+ s : 1000,\r
+ m : 60000\r
+ };\r
+\r
+ time = /^(\d+)([ms]?)$/.exec('' + time);\r
+\r
+ return (time[2] ? multipels[time[2]] : 1) * parseInt(time);\r
+ };\r
+\r
+ // Default config\r
+ tinymce.each({\r
+ ask_before_unload : TRUE,\r
+ interval : '30s',\r
+ retention : '20m',\r
+ minlength : 50\r
+ }, function(value, key) {\r
+ key = PLUGIN_NAME + '_' + key;\r
+\r
+ if (settings[key] === undefined)\r
+ settings[key] = value;\r
+ });\r
+\r
+ // Parse times\r
+ settings.autosave_interval = parseTime(settings.autosave_interval);\r
+ settings.autosave_retention = parseTime(settings.autosave_retention);\r
+\r
+ // Register restore button\r
+ ed.addButton(RESTORE_DRAFT, {\r
+ title : PLUGIN_NAME + ".restore_content",\r
+ onclick : function() {\r
+ if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {\r
+ // Show confirm dialog if the editor isn't empty\r
+ ed.windowManager.confirm(\r
+ PLUGIN_NAME + ".warning_message",\r
+ function(ok) {\r
+ if (ok)\r
+ self.restoreDraft();\r
+ }\r
+ );\r
+ } else\r
+ self.restoreDraft();\r
+ }\r
+ });\r
+\r
+ // Enable/disable restoredraft button depending on if there is a draft stored or not\r
+ ed.onNodeChange.add(function() {\r
+ var controlManager = ed.controlManager;\r
+\r
+ if (controlManager.get(RESTORE_DRAFT))\r
+ controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());\r
+ });\r
+\r
+ ed.onInit.add(function() {\r
+ // Check if the user added the restore button, then setup auto storage logic\r
+ if (ed.controlManager.get(RESTORE_DRAFT)) {\r
+ // Setup storage engine\r
+ self.setupStorage(ed);\r
+\r
+ // Auto save contents each interval time\r
+ setInterval(function() {\r
+ self.storeDraft();\r
+ ed.nodeChanged();\r
+ }, settings.autosave_interval);\r
+ }\r
+ });\r
+\r
+ /**\r
+ * This event gets fired when a draft is stored to local storage.\r
+ *\r
+ * @event onStoreDraft\r
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+ * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+ */\r
+ self.onStoreDraft = new Dispatcher(self);\r
+\r
+ /**\r
+ * This event gets fired when a draft is restored from local storage.\r
+ *\r
+ * @event onStoreDraft\r
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+ * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+ */\r
+ self.onRestoreDraft = new Dispatcher(self);\r
+\r
+ /**\r
+ * This event gets fired when a draft removed/expired.\r
+ *\r
+ * @event onRemoveDraft\r
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.\r
+ * @param {Object} draft Draft object containing the HTML contents of the editor.\r
+ */\r
+ self.onRemoveDraft = new Dispatcher(self);\r
+\r
+ // Add ask before unload dialog only add one unload handler\r
+ if (!unloadHandlerAdded) {\r
+ window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;\r
+ unloadHandlerAdded = TRUE;\r
+ }\r
+ },\r
+\r
+ /**\r
+ * Returns information about the plugin as a name/value array.\r
+ * The current keys are longname, author, authorurl, infourl and version.\r
+ *\r
+ * @method getInfo\r
+ * @return {Object} Name/value array containing information about the plugin.\r
+ */\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Auto save',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ /**\r
+ * Returns an expiration date UTC string.\r
+ *\r
+ * @method getExpDate\r
+ * @return {String} Expiration date UTC string.\r
+ */\r
+ getExpDate : function() {\r
+ return new Date(\r
+ new Date().getTime() + this.editor.settings.autosave_retention\r
+ ).toUTCString();\r
+ },\r
+\r
+ /**\r
+ * This method will setup the storage engine. If the browser has support for it.\r
+ *\r
+ * @method setupStorage\r
+ */\r
+ setupStorage : function(ed) {\r
+ var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";\r
+\r
+ self.key = PLUGIN_NAME + ed.id;\r
+\r
+ // Loop though each storage engine type until we find one that works\r
+ tinymce.each([\r
+ function() {\r
+ // Try HTML5 Local Storage\r
+ if (localStorage) {\r
+ localStorage.setItem(testKey, testVal);\r
+\r
+ if (localStorage.getItem(testKey) === testVal) {\r
+ localStorage.removeItem(testKey);\r
+\r
+ return localStorage;\r
+ }\r
+ }\r
+ },\r
+\r
+ function() {\r
+ // Try HTML5 Session Storage\r
+ if (sessionStorage) {\r
+ sessionStorage.setItem(testKey, testVal);\r
+\r
+ if (sessionStorage.getItem(testKey) === testVal) {\r
+ sessionStorage.removeItem(testKey);\r
+\r
+ return sessionStorage;\r
+ }\r
+ }\r
+ },\r
+\r
+ function() {\r
+ // Try IE userData\r
+ if (tinymce.isIE) {\r
+ ed.getElement().style.behavior = "url('#default#userData')";\r
+\r
+ // Fake localStorage on old IE\r
+ return {\r
+ autoExpires : TRUE,\r
+\r
+ setItem : function(key, value) {\r
+ var userDataElement = ed.getElement();\r
+\r
+ userDataElement.setAttribute(key, value);\r
+ userDataElement.expires = self.getExpDate();\r
+ userDataElement.save("TinyMCE");\r
+ },\r
+\r
+ getItem : function(key) {\r
+ var userDataElement = ed.getElement();\r
+\r
+ userDataElement.load("TinyMCE");\r
+\r
+ return userDataElement.getAttribute(key);\r
+ },\r
+\r
+ removeItem : function(key) {\r
+ ed.getElement().removeAttribute(key);\r
+ }\r
+ };\r
+ }\r
+ },\r
+ ], function(setup) {\r
+ // Try executing each function to find a suitable storage engine\r
+ try {\r
+ self.storage = setup();\r
+\r
+ if (self.storage)\r
+ return false;\r
+ } catch (e) {\r
+ // Ignore\r
+ }\r
+ });\r
+ },\r
+\r
+ /**\r
+ * This method will store the current contents in the the storage engine.\r
+ *\r
+ * @method storeDraft\r
+ */\r
+ storeDraft : function() {\r
+ var self = this, storage = self.storage, editor = self.editor, expires, content;\r
+\r
+ // Is the contents dirty\r
+ if (storage) {\r
+ // If there is no existing key and the contents hasn't been changed since\r
+ // it's original value then there is no point in saving a draft\r
+ if (!storage.getItem(self.key) && !editor.isDirty())\r
+ return;\r
+\r
+ // Store contents if the contents if longer than the minlength of characters\r
+ content = editor.getContent({draft: true});\r
+ if (content.length > editor.settings.autosave_minlength) {\r
+ expires = self.getExpDate();\r
+\r
+ // Store expiration date if needed IE userData has auto expire built in\r
+ if (!self.storage.autoExpires)\r
+ self.storage.setItem(self.key + "_expires", expires);\r
+\r
+ self.storage.setItem(self.key, content);\r
+ self.onStoreDraft.dispatch(self, {\r
+ expires : expires,\r
+ content : content\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ /**\r
+ * This method will restore the contents from the storage engine back to the editor.\r
+ *\r
+ * @method restoreDraft\r
+ */\r
+ restoreDraft : function() {\r
+ var self = this, storage = self.storage;\r
+\r
+ if (storage) {\r
+ content = storage.getItem(self.key);\r
+\r
+ if (content) {\r
+ self.editor.setContent(content);\r
+ self.onRestoreDraft.dispatch(self, {\r
+ content : content\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ /**\r
+ * This method will return true/false if there is a local storage draft available.\r
+ *\r
+ * @method hasDraft\r
+ * @return {boolean} true/false state if there is a local draft.\r
+ */\r
+ hasDraft : function() {\r
+ var self = this, storage = self.storage, expDate, exists;\r
+\r
+ if (storage) {\r
+ // Does the item exist at all\r
+ exists = !!storage.getItem(self.key);\r
+ if (exists) {\r
+ // Storage needs autoexpire\r
+ if (!self.storage.autoExpires) {\r
+ expDate = new Date(storage.getItem(self.key + "_expires"));\r
+\r
+ // Contents hasn't expired\r
+ if (new Date().getTime() < expDate.getTime())\r
+ return TRUE;\r
+\r
+ // Remove it if it has\r
+ self.removeDraft();\r
+ } else\r
+ return TRUE;\r
+ }\r
+ }\r
+\r
+ return false;\r
+ },\r
+\r
+ /**\r
+ * Removes the currently stored draft.\r
+ *\r
+ * @method removeDraft\r
+ */\r
+ removeDraft : function() {\r
+ var self = this, storage = self.storage, key = self.key, content;\r
+\r
+ if (storage) {\r
+ // Get current contents and remove the existing draft\r
+ content = storage.getItem(key);\r
+ storage.removeItem(key);\r
+ storage.removeItem(key + "_expires");\r
+\r
+ // Dispatch remove event if we had any contents\r
+ if (content) {\r
+ self.onRemoveDraft.dispatch(self, {\r
+ content : content\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ "static" : {\r
+ // Internal unload handler will be called before the page is unloaded\r
+ _beforeUnloadHandler : function(e) {\r
+ var msg;\r
+\r
+ tinymce.each(tinyMCE.editors, function(ed) {\r
+ // Store a draft for each editor instance\r
+ if (ed.plugins.autosave)\r
+ ed.plugins.autosave.storeDraft();\r
+\r
+ // Never ask in fullscreen mode\r
+ if (ed.getParam("fullscreen_is_enabled"))\r
+ return;\r
+\r
+ // Setup a return message if the editor is dirty\r
+ if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))\r
+ msg = ed.getLang("autosave.unload_msg");\r
+ });\r
+\r
+ return msg;\r
+ }\r
+ }\r
+ });\r
+\r
+ tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);\r
+})(tinymce);\r
--- /dev/null
+tinyMCE.addI18n('en.autosave',{\r
+restore_content: "Restore auto-saved content",\r
+warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"\r
+});
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},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}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/ /gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.BBCodePlugin', {\r
+ init : function(ed, url) {\r
+ var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();\r
+\r
+ ed.onBeforeSetContent.add(function(ed, o) {\r
+ o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
+ });\r
+\r
+ ed.onPostProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ o.content = t['_' + dialect + '_bbcode2html'](o.content);\r
+\r
+ if (o.get)\r
+ o.content = t['_' + dialect + '_html2bbcode'](o.content);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'BBCode Plugin',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+\r
+ // HTML -> BBCode in PunBB dialect\r
+ _punbb_html2bbcode : function(s) {\r
+ s = tinymce.trim(s);\r
+\r
+ function rep(re, str) {\r
+ s = s.replace(re, str);\r
+ };\r
+\r
+ // example: <strong> to [b]\r
+ rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");\r
+ rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");\r
+ rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");\r
+ rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");\r
+ rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");\r
+ rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");\r
+ rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");\r
+ rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");\r
+ rep(/<font>(.*?)<\/font>/gi,"$1");\r
+ rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");\r
+ rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");\r
+ rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");\r
+ rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");\r
+ rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");\r
+ rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");\r
+ rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");\r
+ rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");\r
+ rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");\r
+ rep(/<\/(strong|b)>/gi,"[/b]");\r
+ rep(/<(strong|b)>/gi,"[b]");\r
+ rep(/<\/(em|i)>/gi,"[/i]");\r
+ rep(/<(em|i)>/gi,"[i]");\r
+ rep(/<\/u>/gi,"[/u]");\r
+ rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");\r
+ rep(/<u>/gi,"[u]");\r
+ rep(/<blockquote[^>]*>/gi,"[quote]");\r
+ rep(/<\/blockquote>/gi,"[/quote]");\r
+ rep(/<br \/>/gi,"\n");\r
+ rep(/<br\/>/gi,"\n");\r
+ rep(/<br>/gi,"\n");\r
+ rep(/<p>/gi,"");\r
+ rep(/<\/p>/gi,"\n");\r
+ rep(/ /gi," ");\r
+ rep(/"/gi,"\"");\r
+ rep(/</gi,"<");\r
+ rep(/>/gi,">");\r
+ rep(/&/gi,"&");\r
+\r
+ return s; \r
+ },\r
+\r
+ // BBCode -> HTML from PunBB dialect\r
+ _punbb_bbcode2html : function(s) {\r
+ s = tinymce.trim(s);\r
+\r
+ function rep(re, str) {\r
+ s = s.replace(re, str);\r
+ };\r
+\r
+ // example: [b] to <strong>\r
+ rep(/\n/gi,"<br />");\r
+ rep(/\[b\]/gi,"<strong>");\r
+ rep(/\[\/b\]/gi,"</strong>");\r
+ rep(/\[i\]/gi,"<em>");\r
+ rep(/\[\/i\]/gi,"</em>");\r
+ rep(/\[u\]/gi,"<u>");\r
+ rep(/\[\/u\]/gi,"</u>");\r
+ rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");\r
+ rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");\r
+ rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");\r
+ rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");\r
+ rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");\r
+ rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");\r
+\r
+ return s; \r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this,g;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(h,i){if(!i.ctrlKey){if(g){h.selection.setRng(g)}f._getMenu(h).showMenu(i.clientX,i.clientY);a.add(h.getDoc(),"click",function(j){e(h,j)});a.cancel(i)}});d.onRemove.add(function(){if(f._menu){f._menu.removeAll()}});function e(h,i){g=null;if(i&&i.button==2){g=h.selection.getRng();return}if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(h.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;\r
+\r
+ /**\r
+ * This plugin a context menu to TinyMCE editor instances.\r
+ *\r
+ * @class tinymce.plugins.ContextMenu\r
+ */\r
+ tinymce.create('tinymce.plugins.ContextMenu', {\r
+ /**\r
+ * Initializes the plugin, this will be executed after the plugin has been created.\r
+ * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+ * of the editor instance to intercept that event.\r
+ *\r
+ * @method init\r
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+ * @param {string} url Absolute URL to where the plugin is located.\r
+ */\r
+ init : function(ed) {\r
+ var t = this, lastRng;\r
+\r
+ t.editor = ed;\r
+\r
+ /**\r
+ * This event gets fired when the context menu is shown.\r
+ *\r
+ * @event onContextMenu\r
+ * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.\r
+ * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.\r
+ */\r
+ t.onContextMenu = new tinymce.util.Dispatcher(this);\r
+\r
+ ed.onContextMenu.add(function(ed, e) {\r
+ if (!e.ctrlKey) {\r
+ // Restore the last selection since it was removed\r
+ if (lastRng)\r
+ ed.selection.setRng(lastRng);\r
+\r
+ t._getMenu(ed).showMenu(e.clientX, e.clientY);\r
+ Event.add(ed.getDoc(), 'click', function(e) {\r
+ hide(ed, e);\r
+ });\r
+ Event.cancel(e);\r
+ }\r
+ });\r
+\r
+ ed.onRemove.add(function() {\r
+ if (t._menu)\r
+ t._menu.removeAll();\r
+ });\r
+\r
+ function hide(ed, e) {\r
+ lastRng = null;\r
+\r
+ // Since the contextmenu event moves\r
+ // the selection we need to store it away\r
+ if (e && e.button == 2) {\r
+ lastRng = ed.selection.getRng();\r
+ return;\r
+ }\r
+\r
+ if (t._menu) {\r
+ t._menu.removeAll();\r
+ t._menu.destroy();\r
+ Event.remove(ed.getDoc(), 'click', hide);\r
+ }\r
+ };\r
+\r
+ ed.onMouseDown.add(hide);\r
+ ed.onKeyDown.add(hide);\r
+ },\r
+\r
+ /**\r
+ * Returns information about the plugin as a name/value array.\r
+ * The current keys are longname, author, authorurl, infourl and version.\r
+ *\r
+ * @method getInfo\r
+ * @return {Object} Name/value array containing information about the plugin.\r
+ */\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Contextmenu',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ _getMenu : function(ed) {\r
+ var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;\r
+\r
+ if (m) {\r
+ m.removeAll();\r
+ m.destroy();\r
+ }\r
+\r
+ p1 = DOM.getPos(ed.getContentAreaContainer());\r
+ p2 = DOM.getPos(ed.getContainer());\r
+\r
+ m = ed.controlManager.createDropMenu('contextmenu', {\r
+ offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),\r
+ offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),\r
+ constrain : 1\r
+ });\r
+\r
+ t._menu = m;\r
+\r
+ m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);\r
+ m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);\r
+ m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});\r
+\r
+ if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {\r
+ m.addSeparator();\r
+ m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\r
+ m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\r
+ }\r
+\r
+ m.addSeparator();\r
+ m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\r
+\r
+ m.addSeparator();\r
+ am = m.addMenu({title : 'contextmenu.align'});\r
+ am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});\r
+ am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});\r
+ am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});\r
+ am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});\r
+\r
+ t.onContextMenu.dispatch(t, m, el, col);\r
+\r
+ return m;\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},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}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.Directionality', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ ed.addCommand('mceDirectionLTR', function() {\r
+ var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);\r
+\r
+ if (e) {\r
+ if (ed.dom.getAttrib(e, "dir") != "ltr")\r
+ ed.dom.setAttrib(e, "dir", "ltr");\r
+ else\r
+ ed.dom.setAttrib(e, "dir", "");\r
+ }\r
+\r
+ ed.nodeChanged();\r
+ });\r
+\r
+ ed.addCommand('mceDirectionRTL', function() {\r
+ var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);\r
+\r
+ if (e) {\r
+ if (ed.dom.getAttrib(e, "dir") != "rtl")\r
+ ed.dom.setAttrib(e, "dir", "rtl");\r
+ else\r
+ ed.dom.setAttrib(e, "dir", "");\r
+ }\r
+\r
+ ed.nodeChanged();\r
+ });\r
+\r
+ ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});\r
+ ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});\r
+\r
+ ed.onNodeChange.add(t._nodeChange, t);\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Directionality',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _nodeChange : function(ed, cm, n) {\r
+ var dom = ed.dom, dir;\r
+\r
+ n = dom.getParent(n, dom.isBlock);\r
+ if (!n) {\r
+ cm.setDisabled('ltr', 1);\r
+ cm.setDisabled('rtl', 1);\r
+ return;\r
+ }\r
+\r
+ dir = dom.getAttrib(n, 'dir');\r
+ cm.setActive('ltr', dir == "ltr");\r
+ cm.setDisabled('ltr', 0);\r
+ cm.setActive('rtl', dir == "rtl");\r
+ cm.setDisabled('rtl', 0);\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},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:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function(tinymce) {\r
+ tinymce.create('tinymce.plugins.EmotionsPlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceEmotion', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/emotions.htm',\r
+ width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),\r
+ height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Emotions',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);\r
+})(tinymce);
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#emotions_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/emotions.js"></script>\r
+</head>\r
+<body style="display: none">\r
+ <div align="center">\r
+ <div class="title">{#emotions_dlg.title}:<br /><br /></div>\r
+\r
+ <table border="0" cellspacing="0" cellpadding="4">\r
+ <tr>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td>\r
+ </tr>\r
+ <tr>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td>\r
+ </tr>\r
+ <tr>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td>\r
+ </tr>\r
+ <tr>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td>\r
+ <td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+</body>\r
+</html>\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var EmotionsDialog = {\r
+ init : function(ed) {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+ },\r
+\r
+ insert : function(file, title) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {\r
+ src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,\r
+ alt : ed.getLang(title),\r
+ title : ed.getLang(title),\r
+ border : 0\r
+ }));\r
+\r
+ tinyMCEPopup.close();\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.emotions_dlg',{\r
+title:"Insert emotion",\r
+desc:"Emotions",\r
+cool:"Cool",\r
+cry:"Cry",\r
+embarassed:"Embarassed",\r
+foot_in_mouth:"Foot in mouth",\r
+frown:"Frown",\r
+innocent:"Innocent",\r
+kiss:"Kiss",\r
+laughing:"Laughing",\r
+money_mouth:"Money mouth",\r
+sealed:"Sealed",\r
+smile:"Smile",\r
+surprised:"Surprised",\r
+tongue_out:"Tongue out",\r
+undecided:"Undecided",\r
+wink:"Wink",\r
+yell:"Yell"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#example_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/dialog.js"></script>\r
+</head>\r
+<body>\r
+\r
+<form onsubmit="ExampleDialog.insert();return false;" action="#">\r
+ <p>Here is a example dialog.</p>\r
+ <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>\r
+ <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ // Load plugin specific language pack\r
+ tinymce.PluginManager.requireLangPack('example');\r
+\r
+ tinymce.create('tinymce.plugins.ExamplePlugin', {\r
+ /**\r
+ * Initializes the plugin, this will be executed after the plugin has been created.\r
+ * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+ * of the editor instance to intercept that event.\r
+ *\r
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+ * @param {string} url Absolute URL to where the plugin is located.\r
+ */\r
+ init : function(ed, url) {\r
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');\r
+ ed.addCommand('mceExample', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/dialog.htm',\r
+ width : 320 + parseInt(ed.getLang('example.delta_width', 0)),\r
+ height : 120 + parseInt(ed.getLang('example.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url, // Plugin absolute URL\r
+ some_custom_arg : 'custom arg' // Custom argument\r
+ });\r
+ });\r
+\r
+ // Register example button\r
+ ed.addButton('example', {\r
+ title : 'example.desc',\r
+ cmd : 'mceExample',\r
+ image : url + '/img/example.gif'\r
+ });\r
+\r
+ // Add a node change handler, selects the button in the UI when a image is selected\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ cm.setActive('example', n.nodeName == 'IMG');\r
+ });\r
+ },\r
+\r
+ /**\r
+ * Creates control instances based in the incomming name. This method is normally not\r
+ * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons\r
+ * but you sometimes need to create more complex controls like listboxes, split buttons etc then this\r
+ * method can be used to create those.\r
+ *\r
+ * @param {String} n Name of the control to create.\r
+ * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.\r
+ * @return {tinymce.ui.Control} New control instance or null if no control was created.\r
+ */\r
+ createControl : function(n, cm) {\r
+ return null;\r
+ },\r
+\r
+ /**\r
+ * Returns information about the plugin as a name/value array.\r
+ * The current keys are longname, author, authorurl, infourl and version.\r
+ *\r
+ * @return {Object} Name/value array containing information about the plugin.\r
+ */\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Example plugin',\r
+ author : 'Some author',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',\r
+ version : "1.0"\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var ExampleDialog = {\r
+ init : function() {\r
+ var f = document.forms[0];\r
+\r
+ // Get the selected contents as text and place it in the input\r
+ f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});\r
+ f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');\r
+ },\r
+\r
+ insert : function() {\r
+ // Insert the contents from the input into the document\r
+ tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);\r
+ tinyMCEPopup.close();\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.example',{\r
+ desc : 'This is just a template button'\r
+});\r
--- /dev/null
+tinyMCE.addI18n('en.example_dlg',{\r
+ title : 'This is just a example title'\r
+});\r
--- /dev/null
+/* Hide the advanced tab */\r
+#advanced_tab {\r
+ display: none;\r
+}\r
+\r
+#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {\r
+ width: 280px;\r
+}\r
+\r
+#doctype, #docencoding {\r
+ width: 200px;\r
+}\r
+\r
+#langcode {\r
+ width: 30px;\r
+}\r
+\r
+#bgimage {\r
+ width: 220px; \r
+}\r
+\r
+#fontface {\r
+ width: 240px;\r
+}\r
+\r
+#leftmargin, #rightmargin, #topmargin, #bottommargin {\r
+ width: 50px;\r
+}\r
+\r
+.panel_wrapper div.current {\r
+ height: 400px;\r
+}\r
+\r
+#stylesheet, #style {\r
+ width: 240px;\r
+}\r
+\r
+/* Head list classes */\r
+\r
+.headlistwrapper {\r
+ width: 100%;\r
+}\r
+\r
+.addbutton, .removebutton, .moveupbutton, .movedownbutton {\r
+ border-top: 1px solid;\r
+ border-left: 1px solid;\r
+ border-bottom: 1px solid;\r
+ border-right: 1px solid;\r
+ border-color: #F0F0EE;\r
+ cursor: default;\r
+ display: block;\r
+ width: 20px;\r
+ height: 20px;\r
+}\r
+\r
+#doctypes {\r
+ width: 200px;\r
+}\r
+\r
+.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {\r
+ border: 1px solid #0A246A;\r
+ background-color: #B6BDD2;\r
+}\r
+\r
+.addbutton {\r
+ background-image: url('../images/add.gif');\r
+ float: left;\r
+ margin-right: 3px;\r
+}\r
+\r
+.removebutton {\r
+ background-image: url('../images/remove.gif');\r
+ float: left;\r
+}\r
+\r
+.moveupbutton {\r
+ background-image: url('../images/move_up.gif');\r
+ float: left;\r
+ margin-right: 3px;\r
+}\r
+\r
+.movedownbutton {\r
+ background-image: url('../images/move_down.gif');\r
+ float: left;\r
+}\r
+\r
+.selected {\r
+ border: 1px solid #0A246A;\r
+ background-color: #B6BDD2;\r
+}\r
+\r
+.toolbar {\r
+ width: 100%;\r
+}\r
+\r
+#headlist {\r
+ width: 100%;\r
+ margin-top: 3px;\r
+ font-size: 11px;\r
+}\r
+\r
+#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {\r
+ display: none;\r
+}\r
+\r
+#addmenu {\r
+ position: absolute;\r
+ border: 1px solid gray;\r
+ display: none;\r
+ z-index: 100;\r
+ background-color: white;\r
+}\r
+\r
+#addmenu a {\r
+ display: block;\r
+ width: 100%;\r
+ line-height: 20px;\r
+ text-decoration: none;\r
+ background-color: white;\r
+}\r
+\r
+#addmenu a:hover {\r
+ background-color: #B6BDD2;\r
+ color: black;\r
+}\r
+\r
+#addmenu span {\r
+ padding-left: 10px;\r
+ padding-right: 10px;\r
+}\r
+\r
+#updateElementPanel {\r
+ display: none;\r
+}\r
+\r
+#script_element .panel_wrapper div.current {\r
+ height: 108px;\r
+}\r
+\r
+#style_element .panel_wrapper div.current {\r
+ height: 108px;\r
+}\r
+\r
+#link_element .panel_wrapper div.current {\r
+ height: 140px;\r
+}\r
+\r
+#element_script_value {\r
+ width: 100%;\r
+ height: 100px;\r
+}\r
+\r
+#element_comment_value {\r
+ width: 100%;\r
+ height: 120px;\r
+}\r
+\r
+#element_style_value {\r
+ width: 100%;\r
+ height: 100px;\r
+}\r
+\r
+#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {\r
+ width: 250px;\r
+}\r
+\r
+.updateElementButton {\r
+ margin-top: 3px;\r
+}\r
+\r
+/* MSIE specific styles */\r
+\r
+* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {\r
+ width: 22px;\r
+ height: 22px;\r
+}\r
+\r
+textarea {\r
+ height: 55px;\r
+}\r
+\r
+.panel_wrapper div.current {height:420px;}
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c<e;c++){g=l[c].split("=");b=g[0].replace(/\s/,"");h=g[1];if(h){h=h.replace(/^\s+/,"").replace(/\s+$/,"");j=h.match(/^["'](.*)["']$/);if(j){h=j[1]}}else{h=b}d.dom.setAttrib(d.getBody(),"style",h)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.format=="raw"&&h.head){return}if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.FullPagePlugin', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceFullPageProperties', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/fullpage.htm',\r
+ width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),\r
+ height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url,\r
+ head_html : t.head\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});\r
+\r
+ ed.onBeforeSetContent.add(t._setContent, t);\r
+ ed.onSetContent.add(t._setBodyAttribs, t);\r
+ ed.onGetContent.add(t._getContent, t);\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Fullpage',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private plugin internal methods\r
+\r
+ _setBodyAttribs : function(ed, o) {\r
+ var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i);\r
+\r
+ if (attr && attr[1]) {\r
+ bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);\r
+\r
+ if (bdattr) {\r
+ for(i = 0, len = bdattr.length; i < len; i++) {\r
+ kv = bdattr[i].split('=');\r
+ k = kv[0].replace(/\s/,'');\r
+ v = kv[1];\r
+\r
+ if (v) {\r
+ v = v.replace(/^\s+/,'').replace(/\s+$/,'');\r
+ t = v.match(/^["'](.*)["']$/);\r
+\r
+ if (t)\r
+ v = t[1];\r
+ } else\r
+ v = k;\r
+\r
+ ed.dom.setAttrib(ed.getBody(), 'style', v);\r
+ }\r
+ }\r
+ }\r
+ },\r
+\r
+ _createSerializer : function() {\r
+ return new tinymce.dom.Serializer({\r
+ dom : this.editor.dom,\r
+ apply_source_formatting : true\r
+ });\r
+ },\r
+\r
+ _setContent : function(ed, o) {\r
+ var t = this, sp, ep, c = o.content, v, st = '';\r
+\r
+ // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate\r
+ if (o.format == 'raw' && t.head)\r
+ return;\r
+\r
+ if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))\r
+ return;\r
+\r
+ // Parse out head, body and footer\r
+ c = c.replace(/<(\/?)BODY/gi, '<$1body');\r
+ sp = c.indexOf('<body');\r
+\r
+ if (sp != -1) {\r
+ sp = c.indexOf('>', sp);\r
+ t.head = c.substring(0, sp + 1);\r
+\r
+ ep = c.indexOf('</body', sp);\r
+ if (ep == -1)\r
+ ep = c.indexOf('</body', ep);\r
+\r
+ o.content = c.substring(sp + 1, ep);\r
+ t.foot = c.substring(ep);\r
+\r
+ function low(s) {\r
+ return s.replace(/<\/?[A-Z]+/g, function(a) {\r
+ return a.toLowerCase();\r
+ })\r
+ };\r
+\r
+ t.head = low(t.head);\r
+ t.foot = low(t.foot);\r
+ } else {\r
+ t.head = '';\r
+ if (ed.getParam('fullpage_default_xml_pi'))\r
+ t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';\r
+\r
+ t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');\r
+ t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';\r
+\r
+ if (v = ed.getParam('fullpage_default_encoding'))\r
+ t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';\r
+\r
+ if (v = ed.getParam('fullpage_default_font_family'))\r
+ st += 'font-family: ' + v + ';';\r
+\r
+ if (v = ed.getParam('fullpage_default_font_size'))\r
+ st += 'font-size: ' + v + ';';\r
+\r
+ if (v = ed.getParam('fullpage_default_text_color'))\r
+ st += 'color: ' + v + ';';\r
+\r
+ t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';\r
+ t.foot = '\n</body>\n</html>';\r
+ }\r
+ },\r
+\r
+ _getContent : function(ed, o) {\r
+ var t = this;\r
+\r
+ if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))\r
+ o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#fullpage_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="js/fullpage.js"></script>\r
+ <link href="css/fullpage.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="advlink" style="display: none">\r
+ <form onsubmit="updateAction();return false;" name="fullpage" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>\r
+ <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="meta_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.meta_props}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td>\r
+ <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td>\r
+ <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td>\r
+ <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td>\r
+ <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td>\r
+ <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td>\r
+ <td>\r
+ <select id="metarobots" name="metarobots">\r
+ <option value="">{#not_set}</option> \r
+ <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>\r
+ <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>\r
+ <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>\r
+ <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.langprops}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td> \r
+ <td>\r
+ <select id="docencoding" name="docencoding"> \r
+ <option value="">{#not_set}</option>\r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label> </td>\r
+ <td>\r
+ <select id="doctypes" name="doctypes">\r
+ <option value="">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td>\r
+ <td><input type="text" id="langcode" name="langcode" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="langdir" name="langdir"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#fullpage_dlg.ltr}</option> \r
+ <option value="rtl">{#fullpage_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td>\r
+ <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="appearance_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.appearance_textprops}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td> \r
+ <td>\r
+ <select id="fontface" name="fontface" onchange="changedStyleField(this);">\r
+ <option value="">{#not_set}</option>\r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td> \r
+ <td>\r
+ <select id="fontsize" name="fontsize" onchange="changedStyleField(this);">\r
+ <option value="">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td>\r
+ <td id="textcolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.appearance_bgprops}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+ <td id="bgimage_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td>\r
+ <td id="bgcolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.appearance_marginprops}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td> \r
+ <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+ <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td> \r
+ <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td> \r
+ <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+ <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td> \r
+ <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.appearance_linkprops}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td>\r
+ <td id="link_color_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td>\r
+ <td id="visited_color_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td>\r
+ <td id="active_color_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td> </td>\r
+ <td> </td>\r
+\r
+<!-- <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td>\r
+ <td id="hover_color_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> -->\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.appearance_style}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td> \r
+ <td><table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>\r
+ <td id="stylesheet_browsercontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td> \r
+ <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <div id="addmenu">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr>\r
+ <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr>\r
+ <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr>\r
+ <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr>\r
+ <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr>\r
+ <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr>\r
+ <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr>\r
+ </table>\r
+ </div>\r
+\r
+ <fieldset>\r
+ <legend>{#fullpage_dlg.head_elements}</legend>\r
+\r
+ <div class="headlistwrapper">\r
+ <div class="toolbar">\r
+ <div style="float: left">\r
+ <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a>\r
+ <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a>\r
+ </div>\r
+ <div style="float: right">\r
+ <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a>\r
+ <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a>\r
+ </div>\r
+ <br style="clear: both" />\r
+ </div>\r
+ <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);">\r
+ <option value="title_0"><title>Some title bla bla bla</title></option>\r
+ <option value="meta_1"><meta name="keywords">Some bla bla bla</meta></option>\r
+ <option value="meta_2"><meta name="description">Some bla bla bla bla bla bla bla bla bla</meta></option>\r
+ <option value="script_3"><script language="javascript">...</script></option>\r
+ <option value="style_4"><style>...</style></option>\r
+ <option value="base_5"><base href="." /></option>\r
+ <option value="comment_6"><!-- ... --></option>\r
+ <option value="link_7"><link href="." /></option>\r
+ </select>\r
+ </div>\r
+ </fieldset>\r
+\r
+ <fieldset id="meta_element">\r
+ <legend>{#fullpage_dlg.meta_element}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td> \r
+ <td><select id="element_meta_type">\r
+ <option value="name">name</option>\r
+ <option value="http-equiv">http-equiv</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td> \r
+ <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td> \r
+ <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td>\r
+ </tr>\r
+ </table>\r
+\r
+ <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+\r
+ <fieldset id="title_element">\r
+ <legend>{#fullpage_dlg.title_element}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td> \r
+ <td><input id="element_title" name="element_title" type="text" value="" /></td>\r
+ </tr>\r
+ </table>\r
+\r
+ <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+\r
+ <fieldset id="script_element">\r
+ <legend>{#fullpage_dlg.script_element}</legend>\r
+\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>\r
+ <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="script_props_panel" class="panel current">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td> \r
+ <td><select id="element_script_type">\r
+ <option value="text/javascript">text/javascript</option>\r
+ <option value="text/jscript">text/jscript</option>\r
+ <option value="text/vbscript">text/vbscript</option>\r
+ <option value="text/vbs">text/vbs</option>\r
+ <option value="text/ecmascript">text/ecmascript</option>\r
+ <option value="text/xml">text/xml</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td> \r
+ <td><table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td>\r
+ <td id="script_src_pickcontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td> \r
+ <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td> \r
+ <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="script_value_panel" class="panel">\r
+ <textarea id="element_script_value"></textarea>\r
+ </div>\r
+ </div>\r
+\r
+ <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+\r
+ <fieldset id="style_element">\r
+ <legend>{#fullpage_dlg.style_element}</legend>\r
+\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>\r
+ <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="style_props_panel" class="panel current">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td> \r
+ <td><select id="element_style_type">\r
+ <option value="text/css">text/css</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td> \r
+ <td><select id="element_style_media"></select></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="style_value_panel" class="panel">\r
+ <textarea id="element_style_value"></textarea>\r
+ </div>\r
+ </div>\r
+\r
+ <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+\r
+ <fieldset id="base_element">\r
+ <legend>{#fullpage_dlg.base_element}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td> \r
+ <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td> \r
+ <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td>\r
+ </tr>\r
+ </table>\r
+\r
+ <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+\r
+ <fieldset id="link_element">\r
+ <legend>{#fullpage_dlg.link_element}</legend>\r
+\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li>\r
+ <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="link_general_panel" class="panel current">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td> \r
+ <td><table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td>\r
+ <td id="link_href_pickcontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td> \r
+ <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td> \r
+ <td><select id="element_link_type" name="element_link_type">\r
+ <option value="text/css">text/css</option>\r
+ <option value="text/javascript">text/javascript</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td> \r
+ <td><select id="element_link_media" name="element_link_media"></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td>\r
+ <td><select id="element_style_rel" name="element_style_rel"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="stylesheet">Stylesheet</option>\r
+ <option value="alternate">Alternate</option>\r
+ <option value="designates">Designates</option>\r
+ <option value="start">Start</option>\r
+ <option value="next">Next</option>\r
+ <option value="prev">Prev</option>\r
+ <option value="contents">Contents</option>\r
+ <option value="index">Index</option>\r
+ <option value="glossary">Glossary</option>\r
+ <option value="copyright">Copyright</option>\r
+ <option value="chapter">Chapter</option>\r
+ <option value="subsection">Subsection</option>\r
+ <option value="appendix">Appendix</option>\r
+ <option value="help">Help</option>\r
+ <option value="bookmark">Bookmark</option>\r
+ </select> \r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="link_advanced_panel" class="panel">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td> \r
+ <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td> \r
+ <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td> \r
+ <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td>\r
+ <td><select id="element_style_rev" name="element_style_rev"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="alternate">Alternate</option> \r
+ <option value="designates">Designates</option> \r
+ <option value="stylesheet">Stylesheet</option> \r
+ <option value="start">Start</option> \r
+ <option value="next">Next</option> \r
+ <option value="prev">Prev</option> \r
+ <option value="contents">Contents</option> \r
+ <option value="index">Index</option> \r
+ <option value="glossary">Glossary</option> \r
+ <option value="copyright">Copyright</option> \r
+ <option value="chapter">Chapter</option> \r
+ <option value="subsection">Subsection</option> \r
+ <option value="appendix">Appendix</option> \r
+ <option value="help">Help</option> \r
+ <option value="bookmark">Bookmark</option> \r
+ </select> \r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+ </div>\r
+\r
+ <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+\r
+ <fieldset id="comment_element">\r
+ <legend>{#fullpage_dlg.comment_element}</legend>\r
+\r
+ <textarea id="element_comment_value"></textarea>\r
+\r
+ <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="update" value="{#update}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+/**\r
+ * fullpage.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var doc;\r
+\r
+var defaultDocTypes = \r
+ 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +\r
+ 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +\r
+ 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +\r
+ 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +\r
+ 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +\r
+ 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +\r
+ 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';\r
+\r
+var defaultEncodings = \r
+ 'Western european (iso-8859-1)=iso-8859-1,' +\r
+ 'Central European (iso-8859-2)=iso-8859-2,' +\r
+ 'Unicode (UTF-8)=utf-8,' +\r
+ 'Chinese traditional (Big5)=big5,' +\r
+ 'Cyrillic (iso-8859-5)=iso-8859-5,' +\r
+ 'Japanese (iso-2022-jp)=iso-2022-jp,' +\r
+ 'Greek (iso-8859-7)=iso-8859-7,' +\r
+ 'Korean (iso-2022-kr)=iso-2022-kr,' +\r
+ 'ASCII (us-ascii)=us-ascii';\r
+\r
+var defaultMediaTypes = \r
+ 'all=all,' +\r
+ 'screen=screen,' +\r
+ 'print=print,' +\r
+ 'tty=tty,' +\r
+ 'tv=tv,' +\r
+ 'projection=projection,' +\r
+ 'handheld=handheld,' +\r
+ 'braille=braille,' +\r
+ 'aural=aural';\r
+\r
+var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';\r
+var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';\r
+\r
+function init() {\r
+ var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;\r
+\r
+ // Setup doctype select box\r
+ doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');\r
+ for (i=0; i<doctypes.length; i++) {\r
+ p = doctypes[i].split('=');\r
+\r
+ if (p.length > 1)\r
+ addSelectValue(f, 'doctypes', p[0], p[1]);\r
+ }\r
+\r
+ // Setup fonts select box\r
+ fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');\r
+ for (i=0; i<fonts.length; i++) {\r
+ p = fonts[i].split('=');\r
+\r
+ if (p.length > 1)\r
+ addSelectValue(f, 'fontface', p[0], p[1]);\r
+ }\r
+\r
+ // Setup fontsize select box\r
+ fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');\r
+ for (i=0; i<fonts.length; i++)\r
+ addSelectValue(f, 'fontsize', fonts[i], fonts[i]);\r
+\r
+ // Setup mediatype select boxs\r
+ mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');\r
+ for (i=0; i<mediaTypes.length; i++) {\r
+ p = mediaTypes[i].split('=');\r
+\r
+ if (p.length > 1) {\r
+ addSelectValue(f, 'element_style_media', p[0], p[1]);\r
+ addSelectValue(f, 'element_link_media', p[0], p[1]);\r
+ }\r
+ }\r
+\r
+ // Setup encodings select box\r
+ encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');\r
+ for (i=0; i<encodings.length; i++) {\r
+ p = encodings[i].split('=');\r
+\r
+ if (p.length > 1) {\r
+ addSelectValue(f, 'docencoding', p[0], p[1]);\r
+ addSelectValue(f, 'element_script_charset', p[0], p[1]);\r
+ addSelectValue(f, 'element_link_charset', p[0], p[1]);\r
+ }\r
+ }\r
+\r
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+ document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');\r
+ //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');\r
+ document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');\r
+ document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');\r
+ document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');\r
+ document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');\r
+ document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');\r
+ document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');\r
+ document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');\r
+\r
+ // Resize some elements\r
+ if (isVisible('stylesheetbrowser'))\r
+ document.getElementById('stylesheet').style.width = '220px';\r
+\r
+ if (isVisible('link_href_browser'))\r
+ document.getElementById('element_link_href').style.width = '230px';\r
+\r
+ if (isVisible('bgimage_browser'))\r
+ document.getElementById('bgimage').style.width = '210px';\r
+\r
+ // Add iframe\r
+ dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});\r
+ doc = dom.get('documentIframe').contentWindow.document;\r
+ h = tinyMCEPopup.getWindowArg('head_html');\r
+\r
+ // Preprocess the HTML disable scripts and urls\r
+ h = h.replace(/<script>/gi, '<script type="text/javascript">');\r
+ h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');\r
+ h = h.replace(/(src=|href=)/g, '_mce_$1');\r
+\r
+ // Write in the content in the iframe\r
+ doc.write(h + '</body></html>');\r
+ doc.close();\r
+\r
+ // Parse xml and doctype\r
+ xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);\r
+ xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);\r
+ docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' ');\r
+ f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);\r
+\r
+ // Parse title\r
+ if (e = doc.getElementsByTagName('title')[0])\r
+ el.metatitle.value = e.textContent || e.text;\r
+\r
+ // Parse meta\r
+ tinymce.each(doc.getElementsByTagName('meta'), function(n) {\r
+ var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';\r
+\r
+ e = el['meta' + na];\r
+\r
+ if (na == 'robots') {\r
+ selectByValue(f, 'metarobots', tinymce.trim(va), true, true);\r
+ return;\r
+ }\r
+\r
+ switch (eq.toLowerCase()) {\r
+ case "content-type":\r
+ tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);\r
+\r
+ // Override XML encoding\r
+ if (tmp != "")\r
+ xmlEnc = tmp;\r
+\r
+ return;\r
+ }\r
+\r
+ if (e)\r
+ e.value = va;\r
+ });\r
+\r
+ selectByValue(f, 'doctypes', docType, true, true);\r
+ selectByValue(f, 'docencoding', xmlEnc, true, true);\r
+ selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);\r
+\r
+ if (xmlVer != '')\r
+ el.xml_pi.checked = true;\r
+\r
+ // Parse appearance\r
+\r
+ // Parse primary stylesheet\r
+ tinymce.each(doc.getElementsByTagName("link"), function(l) {\r
+ var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';\r
+\r
+ if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {\r
+ f.stylesheet.value = l.getAttribute('_mce_href', 2) || '';\r
+ return false;\r
+ }\r
+ });\r
+\r
+ // Get from style elements\r
+ tinymce.each(doc.getElementsByTagName("style"), function(st) {\r
+ var tmp = parseStyleElement(st);\r
+\r
+ for (x=0; x<tmp.length; x++) {\r
+ if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])\r
+ f.visited_color.value = tmp[x].data['color'];\r
+\r
+ if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])\r
+ f.link_color.value = tmp[x].data['color'];\r
+\r
+ if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])\r
+ f.active_color.value = tmp[x].data['color'];\r
+ }\r
+ });\r
+\r
+ f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");\r
+ f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");\r
+ f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");\r
+ f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");\r
+ f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");\r
+ f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");\r
+\r
+ // Get from style info\r
+ style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));\r
+\r
+ if (style['font-family'])\r
+ selectByValue(f, 'fontface', style['font-family'], true, true);\r
+ else\r
+ selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);\r
+\r
+ if (style['font-size'])\r
+ selectByValue(f, 'fontsize', style['font-size'], true, true);\r
+ else\r
+ selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);\r
+\r
+ if (style['color'])\r
+ f.textcolor.value = convertRGBToHex(style['color']);\r
+\r
+ if (style['background-image'])\r
+ f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+\r
+ if (style['background-color'])\r
+ f.bgcolor.value = style['background-color'];\r
+\r
+ if (style['margin']) {\r
+ tmp = style['margin'].replace(/[^0-9 ]/g, '');\r
+ tmp = tmp.split(/ +/);\r
+ f.topmargin.value = tmp.length > 0 ? tmp[0] : '';\r
+ f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];\r
+ f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];\r
+ f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];\r
+ }\r
+\r
+ if (style['margin-left'])\r
+ f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');\r
+\r
+ if (style['margin-right'])\r
+ f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');\r
+\r
+ if (style['margin-top'])\r
+ f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');\r
+\r
+ if (style['margin-bottom'])\r
+ f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');\r
+\r
+ f.style.value = tinyMCEPopup.dom.serializeStyle(style);\r
+\r
+ // Update colors\r
+ updateColor('textcolor_pick', 'textcolor');\r
+ updateColor('bgcolor_pick', 'bgcolor');\r
+ updateColor('visited_color_pick', 'visited_color');\r
+ updateColor('active_color_pick', 'active_color');\r
+ updateColor('link_color_pick', 'link_color');\r
+}\r
+\r
+function getReItem(r, s, i) {\r
+ var c = r.exec(s);\r
+\r
+ if (c && c.length > i)\r
+ return c[i];\r
+\r
+ return '';\r
+}\r
+\r
+function updateAction() {\r
+ var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;\r
+\r
+ head = doc.getElementsByTagName('head')[0];\r
+\r
+ // Fix scripts without a type\r
+ nl = doc.getElementsByTagName('script');\r
+ for (i=0; i<nl.length; i++) {\r
+ if (tinyMCEPopup.dom.getAttrib(nl[i], '_mce_type') == '')\r
+ nl[i].setAttribute('_mce_type', 'text/javascript');\r
+ }\r
+\r
+ // Get primary stylesheet\r
+ nl = doc.getElementsByTagName("link");\r
+ for (i=0; i<nl.length; i++) {\r
+ l = nl[i];\r
+\r
+ tmp = tinyMCEPopup.dom.getAttrib(l, 'media');\r
+\r
+ if (tinyMCEPopup.dom.getAttrib(l, '_mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {\r
+ addlink = false;\r
+\r
+ if (f.stylesheet.value == '')\r
+ l.parentNode.removeChild(l);\r
+ else\r
+ l.setAttribute('_mce_href', f.stylesheet.value);\r
+\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Add new link\r
+ if (f.stylesheet.value != '') {\r
+ l = doc.createElement('link');\r
+\r
+ l.setAttribute('type', 'text/css');\r
+ l.setAttribute('_mce_href', f.stylesheet.value);\r
+ l.setAttribute('rel', 'stylesheet');\r
+\r
+ head.appendChild(l);\r
+ }\r
+\r
+ setMeta(head, 'keywords', f.metakeywords.value);\r
+ setMeta(head, 'description', f.metadescription.value);\r
+ setMeta(head, 'author', f.metaauthor.value);\r
+ setMeta(head, 'copyright', f.metacopyright.value);\r
+ setMeta(head, 'robots', getSelectValue(f, 'metarobots'));\r
+ setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));\r
+\r
+ doc.body.dir = getSelectValue(f, 'langdir');\r
+ doc.body.style.cssText = f.style.value;\r
+\r
+ doc.body.setAttribute('vLink', f.visited_color.value);\r
+ doc.body.setAttribute('link', f.link_color.value);\r
+ doc.body.setAttribute('text', f.textcolor.value);\r
+ doc.body.setAttribute('aLink', f.active_color.value);\r
+\r
+ doc.body.style.fontFamily = getSelectValue(f, 'fontface');\r
+ doc.body.style.fontSize = getSelectValue(f, 'fontsize');\r
+ doc.body.style.backgroundColor = f.bgcolor.value;\r
+\r
+ if (f.leftmargin.value != '')\r
+ doc.body.style.marginLeft = f.leftmargin.value + 'px';\r
+\r
+ if (f.rightmargin.value != '')\r
+ doc.body.style.marginRight = f.rightmargin.value + 'px';\r
+\r
+ if (f.bottommargin.value != '')\r
+ doc.body.style.marginBottom = f.bottommargin.value + 'px';\r
+\r
+ if (f.topmargin.value != '')\r
+ doc.body.style.marginTop = f.topmargin.value + 'px';\r
+\r
+ html = doc.getElementsByTagName('html')[0];\r
+ html.setAttribute('lang', f.langcode.value);\r
+ html.setAttribute('xml:lang', f.langcode.value);\r
+\r
+ if (f.bgimage.value != '')\r
+ doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";\r
+ else\r
+ doc.body.style.backgroundImage = '';\r
+\r
+ ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();\r
+ ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');\r
+\r
+ h = ser.serialize(doc.documentElement);\r
+ h = h.substring(0, h.lastIndexOf('</body>'));\r
+\r
+ if (h.indexOf('<title>') == -1)\r
+ h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');\r
+ else\r
+ h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');\r
+\r
+ if ((v = getSelectValue(f, 'doctypes')) != '')\r
+ h = v + '\n' + h;\r
+\r
+ if (f.xml_pi.checked) {\r
+ s = '<?xml version="1.0"';\r
+\r
+ if ((v = getSelectValue(f, 'docencoding')) != '')\r
+ s += ' encoding="' + v + '"';\r
+\r
+ s += '?>\n';\r
+ h = s + h;\r
+ }\r
+\r
+ h = h.replace(/type=\"\-mce\-/gi, 'type="');\r
+\r
+ tinyMCEPopup.editor.plugins.fullpage.head = h;\r
+ tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {});\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function changedStyleField(field) {\r
+}\r
+\r
+function setMeta(he, k, v) {\r
+ var nl, i, m;\r
+\r
+ nl = he.getElementsByTagName('meta');\r
+ for (i=0; i<nl.length; i++) {\r
+ if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {\r
+ if (v == '')\r
+ nl[i].parentNode.removeChild(nl[i]);\r
+ else\r
+ nl[i].setAttribute('content', "text/html; charset=" + v);\r
+\r
+ return;\r
+ }\r
+\r
+ if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {\r
+ if (v == '')\r
+ nl[i].parentNode.removeChild(nl[i]);\r
+ else\r
+ nl[i].setAttribute('content', v);\r
+ return;\r
+ }\r
+ }\r
+\r
+ if (v == '')\r
+ return;\r
+\r
+ m = doc.createElement('meta');\r
+\r
+ if (k == 'Content-Type')\r
+ m.httpEquiv = k;\r
+ else\r
+ m.setAttribute('name', k);\r
+\r
+ m.setAttribute('content', v);\r
+ he.appendChild(m);\r
+}\r
+\r
+function parseStyleElement(e) {\r
+ var v = e.innerHTML;\r
+ var p, i, r;\r
+\r
+ v = v.replace(/<!--/gi, '');\r
+ v = v.replace(/-->/gi, '');\r
+ v = v.replace(/[\n\r]/gi, '');\r
+ v = v.replace(/\s+/gi, ' ');\r
+\r
+ r = [];\r
+ p = v.split(/{|}/);\r
+\r
+ for (i=0; i<p.length; i+=2) {\r
+ if (p[i] != "")\r
+ r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};\r
+ }\r
+\r
+ return r;\r
+}\r
+\r
+function serializeStyleElement(d) {\r
+ var i, s, st;\r
+\r
+ s = '<!--\n';\r
+\r
+ for (i=0; i<d.length; i++) {\r
+ s += d[i].rule + ' {\n';\r
+\r
+ st = tinyMCE.serializeStyle(d[i].data);\r
+\r
+ if (st != '')\r
+ st += ';';\r
+\r
+ s += st.replace(/;/g, ';\n');\r
+ s += '}\n';\r
+\r
+ if (i != d.length - 1)\r
+ s += '\n';\r
+ }\r
+\r
+ s += '\n-->';\r
+\r
+ return s;\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.fullpage_dlg',{\r
+title:"Document properties",\r
+meta_tab:"General",\r
+appearance_tab:"Appearance",\r
+advanced_tab:"Advanced",\r
+meta_props:"Meta information",\r
+langprops:"Language and encoding",\r
+meta_title:"Title",\r
+meta_keywords:"Keywords",\r
+meta_description:"Description",\r
+meta_robots:"Robots",\r
+doctypes:"Doctype",\r
+langcode:"Language code",\r
+langdir:"Language direction",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+xml_pi:"XML declaration",\r
+encoding:"Character encoding",\r
+appearance_bgprops:"Background properties",\r
+appearance_marginprops:"Body margins",\r
+appearance_linkprops:"Link colors",\r
+appearance_textprops:"Text properties",\r
+bgcolor:"Background color",\r
+bgimage:"Background image",\r
+left_margin:"Left margin",\r
+right_margin:"Right margin",\r
+top_margin:"Top margin",\r
+bottom_margin:"Bottom margin",\r
+text_color:"Text color",\r
+font_size:"Font size",\r
+font_face:"Font face",\r
+link_color:"Link color",\r
+hover_color:"Hover color",\r
+visited_color:"Visited color",\r
+active_color:"Active color",\r
+textcolor:"Color",\r
+fontsize:"Font size",\r
+fontface:"Font family",\r
+meta_index_follow:"Index and follow the links",\r
+meta_index_nofollow:"Index and don't follow the links",\r
+meta_noindex_follow:"Do not index but follow the links",\r
+meta_noindex_nofollow:"Do not index and don\'t follow the links",\r
+appearance_style:"Stylesheet and style properties",\r
+stylesheet:"Stylesheet",\r
+style:"Style",\r
+author:"Author",\r
+copyright:"Copyright",\r
+add:"Add new element",\r
+remove:"Remove selected element",\r
+moveup:"Move selected element up",\r
+movedown:"Move selected element down",\r
+head_elements:"Head elements",\r
+info:"Information",\r
+add_title:"Title element",\r
+add_meta:"Meta element",\r
+add_script:"Script element",\r
+add_style:"Style element",\r
+add_link:"Link element",\r
+add_base:"Base element",\r
+add_comment:"Comment node",\r
+title_element:"Title element",\r
+script_element:"Script element",\r
+style_element:"Style element",\r
+base_element:"Base element",\r
+link_element:"Link element",\r
+meta_element:"Meta element",\r
+comment_element:"Comment",\r
+src:"Src",\r
+language:"Language",\r
+href:"Href",\r
+target:"Target",\r
+type:"Type",\r
+charset:"Charset",\r
+defer:"Defer",\r
+media:"Media",\r
+properties:"Properties",\r
+name:"Name",\r
+value:"Value",\r
+content:"Content",\r
+rel:"Rel",\r
+rev:"Rev",\r
+hreflang:"Href lang",\r
+general_props:"General",\r
+advanced_props:"Advanced"\r
+});
\ No newline at end of file
--- /dev/null
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var m=tinymce.DOM.getViewPort(),k=e.fullscreenEditor,j,l;j=k.dom.getSize(k.getContainer().firstChild);l=k.dom.getSize(k.getContainer().getElementsByTagName("iframe")[0]);k.theme.resizeTo(m.w-j.w+l.w,m.h-j.h+l.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var DOM = tinymce.DOM;\r
+\r
+ tinymce.create('tinymce.plugins.FullScreenPlugin', {\r
+ init : function(ed, url) {\r
+ var t = this, s = {}, vp;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceFullScreen', function() {\r
+ var win, de = DOM.doc.documentElement;\r
+\r
+ if (ed.getParam('fullscreen_is_enabled')) {\r
+ if (ed.getParam('fullscreen_new_window'))\r
+ closeFullscreen(); // Call to close in new window\r
+ else {\r
+ DOM.win.setTimeout(function() {\r
+ tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);\r
+ tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});\r
+ tinyMCE.remove(ed);\r
+ DOM.remove('mce_fullscreen_container');\r
+ de.style.overflow = ed.getParam('fullscreen_html_overflow');\r
+ DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));\r
+ DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));\r
+ tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings\r
+ }, 10);\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
+ if (ed.getParam('fullscreen_new_window')) {\r
+ win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);\r
+ try {\r
+ win.resizeTo(screen.availWidth, screen.availHeight);\r
+ } catch (e) {\r
+ // Ignore\r
+ }\r
+ } else {\r
+ tinyMCE.oldSettings = tinyMCE.settings; // Store old settings\r
+ s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';\r
+ s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);\r
+ vp = DOM.getViewPort();\r
+ s.fullscreen_scrollx = vp.x;\r
+ s.fullscreen_scrolly = vp.y;\r
+\r
+ // Fixes an Opera bug where the scrollbars doesn't reappear\r
+ if (tinymce.isOpera && s.fullscreen_overflow == 'visible')\r
+ s.fullscreen_overflow = 'auto';\r
+\r
+ // Fixes an IE bug where horizontal scrollbars would appear\r
+ if (tinymce.isIE && s.fullscreen_overflow == 'scroll')\r
+ s.fullscreen_overflow = 'auto';\r
+\r
+ // Fixes an IE bug where the scrollbars doesn't reappear\r
+ if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))\r
+ s.fullscreen_html_overflow = 'auto'; \r
+\r
+ if (s.fullscreen_overflow == '0px')\r
+ s.fullscreen_overflow = '';\r
+\r
+ DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');\r
+ de.style.overflow = 'hidden'; //Fix for IE6/7\r
+ vp = DOM.getViewPort();\r
+ DOM.win.scrollTo(0, 0);\r
+\r
+ if (tinymce.isIE)\r
+ vp.h -= 1;\r
+\r
+ n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});\r
+ DOM.add(n, 'div', {id : 'mce_fullscreen'});\r
+\r
+ tinymce.each(ed.settings, function(v, n) {\r
+ s[n] = v;\r
+ });\r
+\r
+ s.id = 'mce_fullscreen';\r
+ s.width = n.clientWidth;\r
+ s.height = n.clientHeight - 15;\r
+ s.fullscreen_is_enabled = true;\r
+ s.fullscreen_editor_id = ed.id;\r
+ s.theme_advanced_resizing = false;\r
+ s.save_onsavecallback = function() {\r
+ ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'});\r
+ ed.execCommand('mceSave');\r
+ };\r
+\r
+ tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {\r
+ s[k] = v;\r
+ });\r
+\r
+ if (s.theme_advanced_toolbar_location === 'external')\r
+ s.theme_advanced_toolbar_location = 'top';\r
+\r
+ t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);\r
+ t.fullscreenEditor.onInit.add(function() {\r
+ t.fullscreenEditor.setContent(ed.getContent());\r
+ t.fullscreenEditor.focus();\r
+ });\r
+\r
+ t.fullscreenEditor.render();\r
+\r
+ t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');\r
+ t.fullscreenElement.update();\r
+ //document.body.overflow = 'hidden';\r
+\r
+ t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {\r
+ var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;\r
+\r
+ // Get outer/inner size to get a delta size that can be used to calc the new iframe size\r
+ outerSize = fed.dom.getSize(fed.getContainer().firstChild);\r
+ innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);\r
+\r
+ fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);\r
+ });\r
+ }\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});\r
+\r
+ ed.onNodeChange.add(function(ed, cm) {\r
+ cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Fullscreen',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title></title>\r
+ <script type="text/javascript" src="../../tiny_mce.js"></script>\r
+ <script type="text/javascript">\r
+ function patchCallback(settings, key) {\r
+ if (settings[key])\r
+ settings[key] = "window.opener." + settings[key];\r
+ }\r
+\r
+ var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;\r
+\r
+ // Clone array\r
+ for (var n in paSe)\r
+ settings[n] = paSe[n];\r
+\r
+ // Override options for fullscreen\r
+ for (var n in paSe.fullscreen_settings)\r
+ settings[n] = paSe.fullscreen_settings[n];\r
+\r
+ // Patch callbacks, make them point to window.opener\r
+ patchCallback(settings, 'urlconverter_callback');\r
+ patchCallback(settings, 'insertlink_callback');\r
+ patchCallback(settings, 'insertimage_callback');\r
+ patchCallback(settings, 'setupcontent_callback');\r
+ patchCallback(settings, 'save_callback');\r
+ patchCallback(settings, 'onchange_callback');\r
+ patchCallback(settings, 'init_instance_callback');\r
+ patchCallback(settings, 'file_browser_callback');\r
+ patchCallback(settings, 'cleanup_callback');\r
+ patchCallback(settings, 'execcommand_callback');\r
+ patchCallback(settings, 'oninit');\r
+\r
+ // Set options\r
+ delete settings.id;\r
+ settings['mode'] = 'exact';\r
+ settings['elements'] = 'fullscreenarea';\r
+ settings['add_unload_trigger'] = false;\r
+ settings['ask'] = false;\r
+ settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();\r
+ settings['fullscreen_is_enabled'] = true;\r
+ settings['fullscreen_editor_id'] = oeID;\r
+ settings['theme_advanced_resizing'] = false;\r
+ settings['strict_loading_mode'] = true;\r
+\r
+ settings.save_onsavecallback = function() {\r
+ window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});\r
+ window.opener.tinyMCE.get(oeID).execCommand('mceSave');\r
+ window.close();\r
+ };\r
+\r
+ function unloadHandler(e) {\r
+ moveContent();\r
+ }\r
+\r
+ function moveContent() {\r
+ window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());\r
+ }\r
+\r
+ function closeFullscreen() {\r
+ moveContent();\r
+ window.close();\r
+ }\r
+\r
+ function doParentSubmit() {\r
+ moveContent();\r
+\r
+ if (window.opener.tinyMCE.selectedInstance.formElement.form)\r
+ window.opener.tinyMCE.selectedInstance.formElement.form.submit();\r
+\r
+ window.close();\r
+\r
+ return false;\r
+ }\r
+\r
+ function render() {\r
+ var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;\r
+\r
+ e.value = window.opener.tinyMCE.get(oeID).getContent();\r
+\r
+ vp = dom.getViewPort();\r
+ settings.width = vp.w;\r
+ settings.height = vp.h - 15;\r
+\r
+ tinymce.dom.Event.add(window, 'resize', function() {\r
+ var vp = dom.getViewPort();\r
+\r
+ tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);\r
+ });\r
+\r
+ tinyMCE.init(settings);\r
+ }\r
+\r
+ // Add onunload\r
+ tinymce.dom.Event.add(window, "beforeunload", unloadHandler);\r
+ </script>\r
+</head>\r
+<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">\r
+<form onsubmit="doParentSubmit();">\r
+<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>\r
+</form>\r
+\r
+<script type="text/javascript">\r
+ render();\r
+</script>\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.IESpell', {\r
+ init : function(ed, url) {\r
+ var t = this, sp;\r
+\r
+ if (!tinymce.isIE)\r
+ return;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceIESpell', function() {\r
+ try {\r
+ sp = new ActiveXObject("ieSpell.ieSpellExtension");\r
+ sp.CheckDocumentNode(ed.getDoc().documentElement);\r
+ } catch (e) {\r
+ if (e.number == -2146827859) {\r
+ ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {\r
+ if (s)\r
+ window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
+ });\r
+ } else\r
+ ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);\r
+ }\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'IESpell (IE Only)',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;\r
+\r
+ tinymce.create('tinymce.plugins.InlinePopups', {\r
+ init : function(ed, url) {\r
+ // Replace window manager\r
+ ed.onBeforeRenderUI.add(function() {\r
+ ed.windowManager = new tinymce.InlineWindowManager(ed);\r
+ DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'InlinePopups',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {\r
+ InlineWindowManager : function(ed) {\r
+ var t = this;\r
+\r
+ t.parent(ed);\r
+ t.zIndex = 300000;\r
+ t.count = 0;\r
+ t.windows = {};\r
+ },\r
+\r
+ open : function(f, p) {\r
+ var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u;\r
+\r
+ f = f || {};\r
+ p = p || {};\r
+\r
+ // Run native windows\r
+ if (!f.inline)\r
+ return t.parent(f, p);\r
+\r
+ // Only store selection if the type is a normal window\r
+ if (!f.type)\r
+ t.bookmark = ed.selection.getBookmark(1);\r
+\r
+ id = DOM.uniqueId();\r
+ vp = DOM.getViewPort();\r
+ f.width = parseInt(f.width || 320);\r
+ f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);\r
+ f.min_width = parseInt(f.min_width || 150);\r
+ f.min_height = parseInt(f.min_height || 100);\r
+ f.max_width = parseInt(f.max_width || 2000);\r
+ f.max_height = parseInt(f.max_height || 2000);\r
+ f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));\r
+ f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));\r
+ f.movable = f.resizable = true;\r
+ p.mce_width = f.width;\r
+ p.mce_height = f.height;\r
+ p.mce_inline = true;\r
+ p.mce_window_id = id;\r
+ p.mce_auto_focus = f.auto_focus;\r
+\r
+ // Transpose\r
+// po = DOM.getPos(ed.getContainer());\r
+// f.left -= po.x;\r
+// f.top -= po.y;\r
+\r
+ t.features = f;\r
+ t.params = p;\r
+ t.onOpen.dispatch(t, f, p);\r
+\r
+ if (f.type) {\r
+ opt += ' mceModal';\r
+\r
+ if (f.type)\r
+ opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);\r
+\r
+ f.resizable = false;\r
+ }\r
+\r
+ if (f.statusbar)\r
+ opt += ' mceStatusbar';\r
+\r
+ if (f.resizable)\r
+ opt += ' mceResizable';\r
+\r
+ if (f.minimizable)\r
+ opt += ' mceMinimizable';\r
+\r
+ if (f.maximizable)\r
+ opt += ' mceMaximizable';\r
+\r
+ if (f.movable)\r
+ opt += ' mceMovable';\r
+\r
+ // Create DOM objects\r
+ t._addAll(DOM.doc.body, \r
+ ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, \r
+ ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},\r
+ ['div', {id : id + '_top', 'class' : 'mceTop'}, \r
+ ['div', {'class' : 'mceLeft'}],\r
+ ['div', {'class' : 'mceCenter'}],\r
+ ['div', {'class' : 'mceRight'}],\r
+ ['span', {id : id + '_title'}, f.title || '']\r
+ ],\r
+\r
+ ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, \r
+ ['div', {id : id + '_left', 'class' : 'mceLeft'}],\r
+ ['span', {id : id + '_content'}],\r
+ ['div', {id : id + '_right', 'class' : 'mceRight'}]\r
+ ],\r
+\r
+ ['div', {id : id + '_bottom', 'class' : 'mceBottom'},\r
+ ['div', {'class' : 'mceLeft'}],\r
+ ['div', {'class' : 'mceCenter'}],\r
+ ['div', {'class' : 'mceRight'}],\r
+ ['span', {id : id + '_status'}, 'Content']\r
+ ],\r
+\r
+ ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+ ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+ ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+ ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],\r
+ ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],\r
+ ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]\r
+ ]\r
+ ]\r
+ );\r
+\r
+ DOM.setStyles(id, {top : -10000, left : -10000});\r
+\r
+ // Fix gecko rendering bug, where the editors iframe messed with window contents\r
+ if (tinymce.isGecko)\r
+ DOM.setStyle(id, 'overflow', 'auto');\r
+\r
+ // Measure borders\r
+ if (!f.type) {\r
+ dw += DOM.get(id + '_left').clientWidth;\r
+ dw += DOM.get(id + '_right').clientWidth;\r
+ dh += DOM.get(id + '_top').clientHeight;\r
+ dh += DOM.get(id + '_bottom').clientHeight;\r
+ }\r
+\r
+ // Resize window\r
+ DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});\r
+\r
+ u = f.url || f.file;\r
+ if (u) {\r
+ if (tinymce.relaxedDomain)\r
+ u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;\r
+\r
+ u = tinymce._addVer(u);\r
+ }\r
+\r
+ if (!f.type) {\r
+ DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});\r
+ DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});\r
+ DOM.setAttrib(id + '_ifr', 'src', u);\r
+ } else {\r
+ DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');\r
+\r
+ if (f.type == 'confirm')\r
+ DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');\r
+\r
+ DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});\r
+ DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));\r
+ }\r
+\r
+ // Register events\r
+ mdf = Event.add(id, 'mousedown', function(e) {\r
+ var n = e.target, w, vp;\r
+\r
+ w = t.windows[id];\r
+ t.focus(id);\r
+\r
+ if (n.nodeName == 'A' || n.nodeName == 'a') {\r
+ if (n.className == 'mceMax') {\r
+ w.oldPos = w.element.getXY();\r
+ w.oldSize = w.element.getSize();\r
+\r
+ vp = DOM.getViewPort();\r
+\r
+ // Reduce viewport size to avoid scrollbars\r
+ vp.w -= 2;\r
+ vp.h -= 2;\r
+\r
+ w.element.moveTo(vp.x, vp.y);\r
+ w.element.resizeTo(vp.w, vp.h);\r
+ DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});\r
+ DOM.addClass(id + '_wrapper', 'mceMaximized');\r
+ } else if (n.className == 'mceMed') {\r
+ // Reset to old size\r
+ w.element.moveTo(w.oldPos.x, w.oldPos.y);\r
+ w.element.resizeTo(w.oldSize.w, w.oldSize.h);\r
+ w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);\r
+\r
+ DOM.removeClass(id + '_wrapper', 'mceMaximized');\r
+ } else if (n.className == 'mceMove')\r
+ return t._startDrag(id, e, n.className);\r
+ else if (DOM.hasClass(n, 'mceResize'))\r
+ return t._startDrag(id, e, n.className.substring(13));\r
+ }\r
+ });\r
+\r
+ clf = Event.add(id, 'click', function(e) {\r
+ var n = e.target;\r
+\r
+ t.focus(id);\r
+\r
+ if (n.nodeName == 'A' || n.nodeName == 'a') {\r
+ switch (n.className) {\r
+ case 'mceClose':\r
+ t.close(null, id);\r
+ return Event.cancel(e);\r
+\r
+ case 'mceButton mceOk':\r
+ case 'mceButton mceCancel':\r
+ f.button_func(n.className == 'mceButton mceOk');\r
+ return Event.cancel(e);\r
+ }\r
+ }\r
+ });\r
+\r
+ // Add window\r
+ w = t.windows[id] = {\r
+ id : id,\r
+ mousedown_func : mdf,\r
+ click_func : clf,\r
+ element : new Element(id, {blocker : 1, container : ed.getContainer()}),\r
+ iframeElement : new Element(id + '_ifr'),\r
+ features : f,\r
+ deltaWidth : dw,\r
+ deltaHeight : dh\r
+ };\r
+\r
+ w.iframeElement.on('focus', function() {\r
+ t.focus(id);\r
+ });\r
+\r
+ // Setup blocker\r
+ if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {\r
+ DOM.add(DOM.doc.body, 'div', {\r
+ id : 'mceModalBlocker',\r
+ 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',\r
+ style : {zIndex : t.zIndex - 1}\r
+ });\r
+\r
+ DOM.show('mceModalBlocker'); // Reduces flicker in IE\r
+ } else\r
+ DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);\r
+\r
+ if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))\r
+ DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});\r
+\r
+ t.focus(id);\r
+ t._fixIELayout(id, 1);\r
+\r
+ // Focus ok button\r
+ if (DOM.get(id + '_ok'))\r
+ DOM.get(id + '_ok').focus();\r
+\r
+ t.count++;\r
+\r
+ return w;\r
+ },\r
+\r
+ focus : function(id) {\r
+ var t = this, w;\r
+\r
+ if (w = t.windows[id]) {\r
+ w.zIndex = this.zIndex++;\r
+ w.element.setStyle('zIndex', w.zIndex);\r
+ w.element.update();\r
+\r
+ id = id + '_wrapper';\r
+ DOM.removeClass(t.lastId, 'mceFocus');\r
+ DOM.addClass(id, 'mceFocus');\r
+ t.lastId = id;\r
+ }\r
+ },\r
+\r
+ _addAll : function(te, ne) {\r
+ var i, n, t = this, dom = tinymce.DOM;\r
+\r
+ if (is(ne, 'string'))\r
+ te.appendChild(dom.doc.createTextNode(ne));\r
+ else if (ne.length) {\r
+ te = te.appendChild(dom.create(ne[0], ne[1]));\r
+\r
+ for (i=2; i<ne.length; i++)\r
+ t._addAll(te, ne[i]);\r
+ }\r
+ },\r
+\r
+ _startDrag : function(id, se, ac) {\r
+ var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;\r
+\r
+ // Get positons and sizes\r
+// cp = DOM.getPos(t.editor.getContainer());\r
+ cp = {x : 0, y : 0};\r
+ vp = DOM.getViewPort();\r
+\r
+ // Reduce viewport size to avoid scrollbars while dragging\r
+ vp.w -= 2;\r
+ vp.h -= 2;\r
+\r
+ sex = se.screenX;\r
+ sey = se.screenY;\r
+ dx = dy = dw = dh = 0;\r
+\r
+ // Handle mouse up\r
+ mu = Event.add(d, 'mouseup', function(e) {\r
+ Event.remove(d, 'mouseup', mu);\r
+ Event.remove(d, 'mousemove', mm);\r
+\r
+ if (eb)\r
+ eb.remove();\r
+\r
+ we.moveBy(dx, dy);\r
+ we.resizeBy(dw, dh);\r
+ sz = we.getSize();\r
+ DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});\r
+ t._fixIELayout(id, 1);\r
+\r
+ return Event.cancel(e);\r
+ });\r
+\r
+ if (ac != 'Move')\r
+ startMove();\r
+\r
+ function startMove() {\r
+ if (eb)\r
+ return;\r
+\r
+ t._fixIELayout(id, 0);\r
+\r
+ // Setup event blocker\r
+ DOM.add(d.body, 'div', {\r
+ id : 'mceEventBlocker',\r
+ 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),\r
+ style : {zIndex : t.zIndex + 1}\r
+ });\r
+\r
+ if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))\r
+ DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});\r
+\r
+ eb = new Element('mceEventBlocker');\r
+ eb.update();\r
+\r
+ // Setup placeholder\r
+ p = we.getXY();\r
+ sz = we.getSize();\r
+ sx = cp.x + p.x - vp.x;\r
+ sy = cp.y + p.y - vp.y;\r
+ DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});\r
+ ph = new Element('mcePlaceHolder');\r
+ };\r
+\r
+ // Handle mouse move/drag\r
+ mm = Event.add(d, 'mousemove', function(e) {\r
+ var x, y, v;\r
+\r
+ startMove();\r
+\r
+ x = e.screenX - sex;\r
+ y = e.screenY - sey;\r
+\r
+ switch (ac) {\r
+ case 'ResizeW':\r
+ dx = x;\r
+ dw = 0 - x;\r
+ break;\r
+\r
+ case 'ResizeE':\r
+ dw = x;\r
+ break;\r
+\r
+ case 'ResizeN':\r
+ case 'ResizeNW':\r
+ case 'ResizeNE':\r
+ if (ac == "ResizeNW") {\r
+ dx = x;\r
+ dw = 0 - x;\r
+ } else if (ac == "ResizeNE")\r
+ dw = x;\r
+\r
+ dy = y;\r
+ dh = 0 - y;\r
+ break;\r
+\r
+ case 'ResizeS':\r
+ case 'ResizeSW':\r
+ case 'ResizeSE':\r
+ if (ac == "ResizeSW") {\r
+ dx = x;\r
+ dw = 0 - x;\r
+ } else if (ac == "ResizeSE")\r
+ dw = x;\r
+\r
+ dh = y;\r
+ break;\r
+\r
+ case 'mceMove':\r
+ dx = x;\r
+ dy = y;\r
+ break;\r
+ }\r
+\r
+ // Boundary check\r
+ if (dw < (v = w.features.min_width - sz.w)) {\r
+ if (dx !== 0)\r
+ dx += dw - v;\r
+\r
+ dw = v;\r
+ }\r
+ \r
+ if (dh < (v = w.features.min_height - sz.h)) {\r
+ if (dy !== 0)\r
+ dy += dh - v;\r
+\r
+ dh = v;\r
+ }\r
+\r
+ dw = Math.min(dw, w.features.max_width - sz.w);\r
+ dh = Math.min(dh, w.features.max_height - sz.h);\r
+ dx = Math.max(dx, vp.x - (sx + vp.x));\r
+ dy = Math.max(dy, vp.y - (sy + vp.y));\r
+ dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));\r
+ dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));\r
+\r
+ // Move if needed\r
+ if (dx + dy !== 0) {\r
+ if (sx + dx < 0)\r
+ dx = 0;\r
+ \r
+ if (sy + dy < 0)\r
+ dy = 0;\r
+\r
+ ph.moveTo(sx + dx, sy + dy);\r
+ }\r
+\r
+ // Resize if needed\r
+ if (dw + dh !== 0)\r
+ ph.resizeTo(sz.w + dw, sz.h + dh);\r
+\r
+ return Event.cancel(e);\r
+ });\r
+\r
+ return Event.cancel(se);\r
+ },\r
+\r
+ resizeBy : function(dw, dh, id) {\r
+ var w = this.windows[id];\r
+\r
+ if (w) {\r
+ w.element.resizeBy(dw, dh);\r
+ w.iframeElement.resizeBy(dw, dh);\r
+ }\r
+ },\r
+\r
+ close : function(win, id) {\r
+ var t = this, w, d = DOM.doc, ix = 0, fw, id;\r
+\r
+ id = t._findId(id || win);\r
+\r
+ // Probably not inline\r
+ if (!t.windows[id]) {\r
+ t.parent(win);\r
+ return;\r
+ }\r
+\r
+ t.count--;\r
+\r
+ if (t.count == 0)\r
+ DOM.remove('mceModalBlocker');\r
+\r
+ if (w = t.windows[id]) {\r
+ t.onClose.dispatch(t);\r
+ Event.remove(d, 'mousedown', w.mousedownFunc);\r
+ Event.remove(d, 'click', w.clickFunc);\r
+ Event.clear(id);\r
+ Event.clear(id + '_ifr');\r
+\r
+ DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak\r
+ w.element.remove();\r
+ delete t.windows[id];\r
+\r
+ // Find front most window and focus that\r
+ each (t.windows, function(w) {\r
+ if (w.zIndex > ix) {\r
+ fw = w;\r
+ ix = w.zIndex;\r
+ }\r
+ });\r
+\r
+ if (fw)\r
+ t.focus(fw.id);\r
+ }\r
+ },\r
+\r
+ setTitle : function(w, ti) {\r
+ var e;\r
+\r
+ w = this._findId(w);\r
+\r
+ if (e = DOM.get(w + '_title'))\r
+ e.innerHTML = DOM.encode(ti);\r
+ },\r
+\r
+ alert : function(txt, cb, s) {\r
+ var t = this, w;\r
+\r
+ w = t.open({\r
+ title : t,\r
+ type : 'alert',\r
+ button_func : function(s) {\r
+ if (cb)\r
+ cb.call(s || t, s);\r
+\r
+ t.close(null, w.id);\r
+ },\r
+ content : DOM.encode(t.editor.getLang(txt, txt)),\r
+ inline : 1,\r
+ width : 400,\r
+ height : 130\r
+ });\r
+ },\r
+\r
+ confirm : function(txt, cb, s) {\r
+ var t = this, w;\r
+\r
+ w = t.open({\r
+ title : t,\r
+ type : 'confirm',\r
+ button_func : function(s) {\r
+ if (cb)\r
+ cb.call(s || t, s);\r
+\r
+ t.close(null, w.id);\r
+ },\r
+ content : DOM.encode(t.editor.getLang(txt, txt)),\r
+ inline : 1,\r
+ width : 400,\r
+ height : 130\r
+ });\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _findId : function(w) {\r
+ var t = this;\r
+\r
+ if (typeof(w) == 'string')\r
+ return w;\r
+\r
+ each(t.windows, function(wo) {\r
+ var ifr = DOM.get(wo.id + '_ifr');\r
+\r
+ if (ifr && w == ifr.contentWindow) {\r
+ w = wo.id;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return w;\r
+ },\r
+\r
+ _fixIELayout : function(id, s) {\r
+ var w, img;\r
+\r
+ if (!tinymce.isIE6)\r
+ return;\r
+\r
+ // Fixes the bug where hover flickers and does odd things in IE6\r
+ each(['n','s','w','e','nw','ne','sw','se'], function(v) {\r
+ var e = DOM.get(id + '_resize_' + v);\r
+\r
+ DOM.setStyles(e, {\r
+ width : s ? e.clientWidth : '',\r
+ height : s ? e.clientHeight : '',\r
+ cursor : DOM.getStyle(e, 'cursor', 1)\r
+ });\r
+\r
+ DOM.setStyle(id + "_bottom", 'bottom', '-1px');\r
+\r
+ e = 0;\r
+ });\r
+\r
+ // Fixes graphics glitch\r
+ if (w = this.windows[id]) {\r
+ // Fixes rendering bug after resize\r
+ w.element.hide();\r
+ w.element.show();\r
+\r
+ // Forced a repaint of the window\r
+ //DOM.get(id).style.filter = '';\r
+\r
+ // IE has a bug where images used in CSS won't get loaded\r
+ // sometimes when the cache in the browser is disabled\r
+ // This fix tries to solve it by loading the images using the image object\r
+ each(DOM.select('div,a', id), function(e, i) {\r
+ if (e.currentStyle.backgroundImage != 'none') {\r
+ img = new Image();\r
+ img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');\r
+ }\r
+ });\r
+\r
+ DOM.get(id).style.filter = '';\r
+ }\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);\r
+})();\r
+\r
--- /dev/null
+/* Clearlooks 2 */
+
+/* Reset */
+.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
+
+/* General */
+.clearlooks2 {position:absolute; direction:ltr}
+.clearlooks2 .mceWrapper {position:static}
+.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
+.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
+.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
+
+/* Top */
+.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
+.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
+.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
+.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
+.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
+.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
+.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
+.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
+.clearlooks2 .mceFocus .mceTop span {color:#FFF}
+
+/* Middle */
+.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
+.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
+.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
+.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
+.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
+
+/* Bottom */
+.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
+.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
+.clearlooks2 .mceBottom div {top:0}
+.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
+.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
+.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
+.clearlooks2 .mceBottom span {display:none}
+.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
+.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
+.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
+.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
+.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
+
+/* Actions */
+.clearlooks2 a {width:29px; height:16px; top:3px;}
+.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
+.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
+.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
+.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
+.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
+.clearlooks2 .mceMovable .mceMove {display:block}
+.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
+.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
+.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
+.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
+.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
+.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
+.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
+
+/* Resize */
+.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
+.clearlooks2 .mceResizable .mceResize {display:block}
+.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
+.clearlooks2 .mceMinimizable .mceMin {display:block}
+.clearlooks2 .mceMaximizable .mceMax {display:block}
+.clearlooks2 .mceMaximized .mceMed {display:block}
+.clearlooks2 .mceMaximized .mceMax {display:none}
+.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
+.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
+.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
+.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
+.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
+.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
+.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
+.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
+
+/* Alert/Confirm */
+.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
+.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
+.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
+.clearlooks2 a:hover {font-weight:bold;}
+.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
+.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
+.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
+.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
+.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
+.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
\ No newline at end of file
--- /dev/null
+<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<title>Template for dialogs</title>\r
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" />\r
+</head>\r
+<body>\r
+\r
+<div class="mceEditor">\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:10px;">\r
+ <div class="mceWrapper">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Blured</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:420px;">\r
+ <div class="mceWrapper mceMovable mceFocus">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Focused</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;">\r
+ <div class="mceWrapper mceMovable mceFocus mceStatusbar">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;">\r
+ <div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar, Resizable</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;">\r
+ <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Resizable, Maximizable</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;">\r
+ <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Blurred, Maximizable, Statusbar, Resizable</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;">\r
+ <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Maximized, Maximizable, Minimizable</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;">\r
+ <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Blured</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>Content</span>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Statusbar text.</span>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceMin" href="#"></a>\r
+ <a class="mceMax" href="#"></a>\r
+ <a class="mceMed" href="#"></a>\r
+ <a class="mceClose" href="#"></a>\r
+ <a class="mceResize mceResizeN" href="#"></a>\r
+ <a class="mceResize mceResizeS" href="#"></a>\r
+ <a class="mceResize mceResizeW" href="#"></a>\r
+ <a class="mceResize mceResizeE" href="#"></a>\r
+ <a class="mceResize mceResizeNW" href="#"></a>\r
+ <a class="mceResize mceResizeNE" href="#"></a>\r
+ <a class="mceResize mceResizeSW" href="#"></a>\r
+ <a class="mceResize mceResizeSE" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;">\r
+ <div class="mceWrapper mceMovable mceFocus mceModal mceAlert">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Alert</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ </span>\r
+ <div class="mceRight"></div>\r
+ <div class="mceIcon"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceButton mceOk" href="#">Ok</a>\r
+ <a class="mceClose" href="#"></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;">\r
+ <div class="mceWrapper mceMovable mceFocus mceModal mceConfirm">\r
+ <div class="mceTop">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ <span>Confirm</span>\r
+ </div>\r
+\r
+ <div class="mceMiddle">\r
+ <div class="mceLeft"></div>\r
+ <span>\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ This is a very long error message. This is a very long error message.\r
+ </span>\r
+ <div class="mceRight"></div>\r
+ <div class="mceIcon"></div>\r
+ </div>\r
+\r
+ <div class="mceBottom">\r
+ <div class="mceLeft"></div>\r
+ <div class="mceCenter"></div>\r
+ <div class="mceRight"></div>\r
+ </div>\r
+\r
+ <a class="mceMove" href="#"></a>\r
+ <a class="mceButton mceOk" href="#">Ok</a>\r
+ <a class="mceButton mceCancel" href="#">Cancel</a>\r
+ <a class="mceClose" href="#"></a>\r
+ </div>\r
+ </div>\r
+</div>\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.InsertDateTime', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ ed.addCommand('mceInsertDate', function() {\r
+ var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));\r
+\r
+ ed.execCommand('mceInsertContent', false, str);\r
+ });\r
+\r
+ ed.addCommand('mceInsertTime', function() {\r
+ var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));\r
+\r
+ ed.execCommand('mceInsertContent', false, str);\r
+ });\r
+\r
+ ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});\r
+ ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Insert date/time',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _getDateTime : function(d, fmt) {\r
+ var ed = this.editor;\r
+\r
+ function addZeros(value, len) {\r
+ value = "" + value;\r
+\r
+ if (value.length < len) {\r
+ for (var i=0; i<(len-value.length); i++)\r
+ value = "0" + value;\r
+ }\r
+\r
+ return value;\r
+ };\r
+\r
+ fmt = fmt.replace("%D", "%m/%d/%y");\r
+ fmt = fmt.replace("%r", "%I:%M:%S %p");\r
+ fmt = fmt.replace("%Y", "" + d.getFullYear());\r
+ fmt = fmt.replace("%y", "" + d.getYear());\r
+ fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
+ fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
+ fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
+ fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
+ fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
+ fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
+ fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
+ fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);\r
+ fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);\r
+ fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);\r
+ fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);\r
+ fmt = fmt.replace("%%", "%");\r
+\r
+ return fmt;\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.Layer', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceInsertLayer', t._insertLayer, t);\r
+\r
+ ed.addCommand('mceMoveForward', function() {\r
+ t._move(1);\r
+ });\r
+\r
+ ed.addCommand('mceMoveBackward', function() {\r
+ t._move(-1);\r
+ });\r
+\r
+ ed.addCommand('mceMakeAbsolute', function() {\r
+ t._toggleAbsolute();\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});\r
+ ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});\r
+ ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});\r
+ ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});\r
+\r
+ ed.onInit.add(function() {\r
+ if (tinymce.isIE)\r
+ ed.getDoc().execCommand('2D-Position', false, true);\r
+ });\r
+\r
+ ed.onNodeChange.add(t._nodeChange, t);\r
+ ed.onVisualAid.add(t._visualAid, t);\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Layer',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _nodeChange : function(ed, cm, n) {\r
+ var le, p;\r
+\r
+ le = this._getParentLayer(n);\r
+ p = ed.dom.getParent(n, 'DIV,P,IMG');\r
+\r
+ if (!p) {\r
+ cm.setDisabled('absolute', 1);\r
+ cm.setDisabled('moveforward', 1);\r
+ cm.setDisabled('movebackward', 1);\r
+ } else {\r
+ cm.setDisabled('absolute', 0);\r
+ cm.setDisabled('moveforward', !le);\r
+ cm.setDisabled('movebackward', !le);\r
+ cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");\r
+ }\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _visualAid : function(ed, e, s) {\r
+ var dom = ed.dom;\r
+\r
+ tinymce.each(dom.select('div,p', e), function(e) {\r
+ if (/^(absolute|relative|static)$/i.test(e.style.position)) {\r
+ if (s)\r
+ dom.addClass(e, 'mceItemVisualAid');\r
+ else\r
+ dom.removeClass(e, 'mceItemVisualAid'); \r
+ }\r
+ });\r
+ },\r
+\r
+ _move : function(d) {\r
+ var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;\r
+\r
+ nl = [];\r
+ tinymce.walk(ed.getBody(), function(n) {\r
+ if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))\r
+ nl.push(n); \r
+ }, 'childNodes');\r
+\r
+ // Find z-indexes\r
+ for (i=0; i<nl.length; i++) {\r
+ z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;\r
+\r
+ if (ci < 0 && nl[i] == le)\r
+ ci = i;\r
+ }\r
+\r
+ if (d < 0) {\r
+ // Move back\r
+\r
+ // Try find a lower one\r
+ for (i=0; i<z.length; i++) {\r
+ if (z[i] < z[ci]) {\r
+ fi = i;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (fi > -1) {\r
+ nl[ci].style.zIndex = z[fi];\r
+ nl[fi].style.zIndex = z[ci];\r
+ } else {\r
+ if (z[ci] > 0)\r
+ nl[ci].style.zIndex = z[ci] - 1;\r
+ }\r
+ } else {\r
+ // Move forward\r
+\r
+ // Try find a higher one\r
+ for (i=0; i<z.length; i++) {\r
+ if (z[i] > z[ci]) {\r
+ fi = i;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (fi > -1) {\r
+ nl[ci].style.zIndex = z[fi];\r
+ nl[fi].style.zIndex = z[ci];\r
+ } else\r
+ nl[ci].style.zIndex = z[ci] + 1;\r
+ }\r
+\r
+ ed.execCommand('mceRepaint');\r
+ },\r
+\r
+ _getParentLayer : function(n) {\r
+ return this.editor.dom.getParent(n, function(n) {\r
+ return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);\r
+ });\r
+ },\r
+\r
+ _insertLayer : function() {\r
+ var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*'));\r
+\r
+ ed.dom.add(ed.getBody(), 'div', {\r
+ style : {\r
+ position : 'absolute',\r
+ left : p.x,\r
+ top : (p.y > 20 ? p.y : 20),\r
+ width : 100,\r
+ height : 100\r
+ },\r
+ 'class' : 'mceItemVisualAid'\r
+ }, ed.selection.getContent() || ed.getLang('layer.content'));\r
+ },\r
+\r
+ _toggleAbsolute : function() {\r
+ var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());\r
+\r
+ if (!le)\r
+ le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');\r
+\r
+ if (le) {\r
+ if (le.style.position.toLowerCase() == "absolute") {\r
+ ed.dom.setStyles(le, {\r
+ position : '',\r
+ left : '',\r
+ top : '',\r
+ width : '',\r
+ height : ''\r
+ });\r
+\r
+ ed.dom.removeClass(le, 'mceItemVisualAid');\r
+ } else {\r
+ if (le.style.left == "")\r
+ le.style.left = 20 + 'px';\r
+\r
+ if (le.style.top == "")\r
+ le.style.top = 20 + 'px';\r
+\r
+ if (le.style.width == "")\r
+ le.style.width = le.width ? (le.width + 'px') : '100px';\r
+\r
+ if (le.style.height == "")\r
+ le.style.height = le.height ? (le.height + 'px') : '100px';\r
+\r
+ le.style.position = "absolute";\r
+ ed.addVisual(ed.getBody());\r
+ }\r
+\r
+ ed.execCommand('mceRepaint');\r
+ ed.nodeChanged();\r
+ }\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('layer', tinymce.plugins.Layer);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.serializer;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"full"}},bold:{inline:"b"},italic:{inline:"i"},underline:{inline:"u"},strikethrough:{inline:"strike"},fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});d._setup();a.each("b,i,u,strike".split(","),function(f){var g=d.rules[f];if(!g){d.addRules(f)}});if(!d.rules.font){d.addRules("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.rules[f],g;if(h){a.each(h.attribs,function(j,i){if(i.name=="align"){g=true;return false}});if(!g){h.attribs.push({name:"align"})}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ *\r
+ * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align\r
+ * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash\r
+ *\r
+ * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are\r
+ * not apart of the newer specifications for HTML and XHTML.\r
+ */\r
+\r
+(function(tinymce) {\r
+ // Override inline_styles setting to force TinyMCE to produce deprecated contents\r
+ tinymce.onAddEditor.addToTop(function(tinymce, editor) {\r
+ editor.settings.inline_styles = false;\r
+ });\r
+\r
+ // Create the legacy ouput plugin\r
+ tinymce.create('tinymce.plugins.LegacyOutput', {\r
+ init : function(editor) {\r
+ editor.onInit.add(function() {\r
+ var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',\r
+ fontSizes = tinymce.explode(editor.settings.font_size_style_values),\r
+ serializer = editor.serializer;\r
+\r
+ // Override some internal formats to produce legacy elements and attributes\r
+ editor.formatter.register({\r
+ // Change alignment formats to use the deprecated align attribute\r
+ alignleft : {selector : alignElements, attributes : {align : 'left'}},\r
+ aligncenter : {selector : alignElements, attributes : {align : 'center'}},\r
+ alignright : {selector : alignElements, attributes : {align : 'right'}},\r
+ alignfull : {selector : alignElements, attributes : {align : 'full'}},\r
+\r
+ // Change the basic formatting elements to use deprecated element types\r
+ bold : {inline : 'b'},\r
+ italic : {inline : 'i'},\r
+ underline : {inline : 'u'},\r
+ strikethrough : {inline : 'strike'},\r
+\r
+ // Change font size and font family to use the deprecated font element\r
+ fontname : {inline : 'font', attributes : {face : '%value'}},\r
+ fontsize : {\r
+ inline : 'font',\r
+ attributes : {\r
+ size : function(vars) {\r
+ return tinymce.inArray(fontSizes, vars.value) + 1;\r
+ }\r
+ }\r
+ },\r
+\r
+ // Setup font elements for colors as well\r
+ forecolor : {inline : 'font', styles : {color : '%value'}},\r
+ hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}\r
+ });\r
+\r
+ // Force parsing of the serializer rules\r
+ serializer._setup();\r
+\r
+ // Check that deprecated elements are allowed if not add them\r
+ tinymce.each('b,i,u,strike'.split(','), function(name) {\r
+ var rule = serializer.rules[name];\r
+\r
+ if (!rule)\r
+ serializer.addRules(name);\r
+ });\r
+\r
+ // Add font element if it's missing\r
+ if (!serializer.rules["font"])\r
+ serializer.addRules("font[face|size|color|style]");\r
+\r
+ // Add the missing and depreacted align attribute for the serialization engine\r
+ tinymce.each(alignElements.split(','), function(name) {\r
+ var rule = serializer.rules[name], found;\r
+\r
+ if (rule) {\r
+ tinymce.each(rule.attribs, function(name, attr) {\r
+ if (attr.name == 'align') {\r
+ found = true;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (!found)\r
+ rule.attribs.push({name : 'align'});\r
+ }\r
+ });\r
+\r
+ // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes\r
+ editor.onNodeChange.add(function(editor, control_manager) {\r
+ var control, fontElm, fontName, fontSize;\r
+\r
+ // Find font element get it's name and size\r
+ fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');\r
+ if (fontElm) {\r
+ fontName = fontElm.face;\r
+ fontSize = fontElm.size;\r
+ }\r
+\r
+ // Select/unselect the font name in droplist\r
+ if (control = control_manager.get('fontselect')) {\r
+ control.select(function(value) {\r
+ return value == fontName;\r
+ });\r
+ }\r
+\r
+ // Select/unselect the font size in droplist\r
+ if (control = control_manager.get('fontsizeselect')) {\r
+ control.select(function(value) {\r
+ var index = tinymce.inArray(fontSizes, value.fontSize);\r
+\r
+ return index + 1 == fontSize;\r
+ });\r
+ }\r
+ });\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'LegacyOutput',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);\r
+})(tinymce);
\ No newline at end of file
--- /dev/null
+.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}\r
+.mceItemShockWave {background-image: url(../img/shockwave.gif);}\r
+.mceItemFlash {background-image:url(../img/flash.gif);}\r
+.mceItemQuickTime {background-image:url(../img/quicktime.gif);}\r
+.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);}\r
+.mceItemRealMedia {background-image:url(../img/realmedia.gif);}\r
--- /dev/null
+#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }\r
+#hspace, #vspace { width: 50px }\r
+#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }\r
+#flash_base, #flash_flashvars { width: 240px }\r
+#width, #height { width: 40px }\r
+#src, #media_type { width: 250px }\r
+#class { width: 120px }\r
+#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto }\r
+.panel_wrapper div.current { height: 390px; overflow: auto }\r
+#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }\r
+.mceAddSelectValue { background-color: #DDDDDD }\r
+#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }\r
+#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }\r
+#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }\r
+#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }\r
+#qt_qtsrc { width: 200px }\r
--- /dev/null
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,_mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,_mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{_mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({_mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.plugins.MediaPlugin', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+ \r
+ t.editor = ed;\r
+ t.url = url;\r
+\r
+ function isMediaElm(n) {\r
+ return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);\r
+ };\r
+\r
+ ed.onPreInit.add(function() {\r
+ // Force in _value parameter this extra parameter is required for older Opera versions\r
+ ed.serializer.addRules('param[name|value|_mce_value]');\r
+ });\r
+\r
+ // Register commands\r
+ ed.addCommand('mceMedia', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/media.htm',\r
+ width : 430 + parseInt(ed.getLang('media.delta_width', 0)),\r
+ height : 470 + parseInt(ed.getLang('media.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'});\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n));\r
+ });\r
+\r
+ ed.onInit.add(function() {\r
+ var lo = {\r
+ mceItemFlash : 'flash',\r
+ mceItemShockWave : 'shockwave',\r
+ mceItemWindowsMedia : 'windowsmedia',\r
+ mceItemQuickTime : 'quicktime',\r
+ mceItemRealMedia : 'realmedia'\r
+ };\r
+\r
+ ed.selection.onSetContent.add(function() {\r
+ t._spansToImgs(ed.getBody());\r
+ });\r
+\r
+ ed.selection.onBeforeSetContent.add(t._objectsToSpans, t);\r
+\r
+ if (ed.settings.content_css !== false)\r
+ ed.dom.loadCSS(url + "/css/content.css");\r
+\r
+ if (ed.theme && ed.theme.onResolveName) {\r
+ ed.theme.onResolveName.add(function(th, o) {\r
+ if (o.name == 'img') {\r
+ each(lo, function(v, k) {\r
+ if (ed.dom.hasClass(o.node, k)) {\r
+ o.name = v;\r
+ o.title = ed.dom.getAttrib(o.node, 'title');\r
+ return false;\r
+ }\r
+ });\r
+ }\r
+ });\r
+ }\r
+\r
+ if (ed && ed.plugins.contextmenu) {\r
+ ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {\r
+ if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) {\r
+ m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'});\r
+ }\r
+ });\r
+ }\r
+ });\r
+\r
+ ed.onBeforeSetContent.add(t._objectsToSpans, t);\r
+\r
+ ed.onSetContent.add(function() {\r
+ t._spansToImgs(ed.getBody());\r
+ });\r
+\r
+ ed.onPreProcess.add(function(ed, o) {\r
+ var dom = ed.dom;\r
+\r
+ if (o.set) {\r
+ t._spansToImgs(o.node);\r
+\r
+ each(dom.select('IMG', o.node), function(n) {\r
+ var p;\r
+\r
+ if (isMediaElm(n)) {\r
+ p = t._parse(n.title);\r
+ dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100));\r
+ dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100));\r
+ }\r
+ });\r
+ }\r
+\r
+ if (o.get) {\r
+ each(dom.select('IMG', o.node), function(n) {\r
+ var ci, cb, mt;\r
+\r
+ if (ed.getParam('media_use_script')) {\r
+ if (isMediaElm(n))\r
+ n.className = n.className.replace(/mceItem/g, 'mceTemp');\r
+\r
+ return;\r
+ }\r
+\r
+ switch (n.className) {\r
+ case 'mceItemFlash':\r
+ ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';\r
+ cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';\r
+ mt = 'application/x-shockwave-flash';\r
+ break;\r
+\r
+ case 'mceItemShockWave':\r
+ ci = '166b1bca-3f9c-11cf-8075-444553540000';\r
+ cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';\r
+ mt = 'application/x-director';\r
+ break;\r
+\r
+ case 'mceItemWindowsMedia':\r
+ ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6';\r
+ cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';\r
+ mt = 'application/x-mplayer2';\r
+ break;\r
+\r
+ case 'mceItemQuickTime':\r
+ ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b';\r
+ cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';\r
+ mt = 'video/quicktime';\r
+ break;\r
+\r
+ case 'mceItemRealMedia':\r
+ ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa';\r
+ cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';\r
+ mt = 'audio/x-pn-realaudio-plugin';\r
+ break;\r
+ }\r
+\r
+ if (ci) {\r
+ dom.replace(t._buildObj({\r
+ classid : ci,\r
+ codebase : cb,\r
+ type : mt\r
+ }, n), n);\r
+ }\r
+ });\r
+ }\r
+ });\r
+\r
+ ed.onPostProcess.add(function(ed, o) {\r
+ o.content = o.content.replace(/_mce_value=/g, 'value=');\r
+ });\r
+\r
+ function getAttr(s, n) {\r
+ n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s);\r
+\r
+ return n ? ed.dom.decode(n[1]) : '';\r
+ };\r
+\r
+ ed.onPostProcess.add(function(ed, o) {\r
+ if (ed.getParam('media_use_script')) {\r
+ o.content = o.content.replace(/<img[^>]+>/g, function(im) {\r
+ var cl = getAttr(im, 'class');\r
+\r
+ if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) {\r
+ at = t._parse(getAttr(im, 'title'));\r
+ at.width = getAttr(im, 'width');\r
+ at.height = getAttr(im, 'height');\r
+ im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>';\r
+ }\r
+\r
+ return im;\r
+ });\r
+ }\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Media',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+ _objectsToSpans : function(ed, o) {\r
+ var t = this, h = o.content;\r
+\r
+ h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) {\r
+ var o = t._parse(c);\r
+\r
+ return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />'\r
+ });\r
+\r
+ h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>');\r
+ h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>');\r
+ h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>');\r
+ h = h.replace(/<\/(object)([^>]*)>/gi, '</span>');\r
+ h = h.replace(/<\/embed>/gi, '');\r
+ h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'});\r
+ h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>');\r
+\r
+ o.content = h;\r
+ },\r
+\r
+ _buildObj : function(o, n) {\r
+ var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc;\r
+ \r
+ stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash';\r
+\r
+ p.width = o.width = dom.getAttrib(n, 'width') || 100;\r
+ p.height = o.height = dom.getAttrib(n, 'height') || 100;\r
+\r
+ if (p.src)\r
+ p.src = ed.convertURL(p.src, 'src', n);\r
+\r
+ if (stc) {\r
+ ob = dom.create('span', {\r
+ id : p.id,\r
+ _mce_name : 'object',\r
+ type : 'application/x-shockwave-flash',\r
+ data : p.src,\r
+ style : dom.getAttrib(n, 'style'),\r
+ width : o.width,\r
+ height : o.height\r
+ });\r
+ } else {\r
+ ob = dom.create('span', {\r
+ id : p.id,\r
+ _mce_name : 'object',\r
+ classid : "clsid:" + o.classid,\r
+ style : dom.getAttrib(n, 'style'),\r
+ codebase : o.codebase,\r
+ width : o.width,\r
+ height : o.height\r
+ });\r
+ }\r
+\r
+ each (p, function(v, k) {\r
+ if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) {\r
+ // Use url instead of src in IE for Windows media\r
+ if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url)\r
+ k = 'url';\r
+\r
+ if (v)\r
+ dom.add(ob, 'span', {_mce_name : 'param', name : k, '_mce_value' : v});\r
+ }\r
+ });\r
+\r
+ if (!stc)\r
+ dom.add(ob, 'span', tinymce.extend({_mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p));\r
+\r
+ return ob;\r
+ },\r
+\r
+ _spansToImgs : function(p) {\r
+ var t = this, dom = t.editor.dom, im, ci;\r
+\r
+ each(dom.select('span', p), function(n) {\r
+ // Convert object into image\r
+ if (dom.getAttrib(n, 'class') == 'mceItemObject') {\r
+ ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, '');\r
+\r
+ switch (ci) {\r
+ case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':\r
+ dom.replace(t._createImg('mceItemFlash', n), n);\r
+ break;\r
+\r
+ case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':\r
+ dom.replace(t._createImg('mceItemShockWave', n), n);\r
+ break;\r
+\r
+ case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':\r
+ case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':\r
+ case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':\r
+ dom.replace(t._createImg('mceItemWindowsMedia', n), n);\r
+ break;\r
+\r
+ case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':\r
+ dom.replace(t._createImg('mceItemQuickTime', n), n);\r
+ break;\r
+\r
+ case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':\r
+ dom.replace(t._createImg('mceItemRealMedia', n), n);\r
+ break;\r
+\r
+ default:\r
+ dom.replace(t._createImg('mceItemFlash', n), n);\r
+ }\r
+ \r
+ return;\r
+ }\r
+\r
+ // Convert embed into image\r
+ if (dom.getAttrib(n, 'class') == 'mceItemEmbed') {\r
+ switch (dom.getAttrib(n, 'type')) {\r
+ case 'application/x-shockwave-flash':\r
+ dom.replace(t._createImg('mceItemFlash', n), n);\r
+ break;\r
+\r
+ case 'application/x-director':\r
+ dom.replace(t._createImg('mceItemShockWave', n), n);\r
+ break;\r
+\r
+ case 'application/x-mplayer2':\r
+ dom.replace(t._createImg('mceItemWindowsMedia', n), n);\r
+ break;\r
+\r
+ case 'video/quicktime':\r
+ dom.replace(t._createImg('mceItemQuickTime', n), n);\r
+ break;\r
+\r
+ case 'audio/x-pn-realaudio-plugin':\r
+ dom.replace(t._createImg('mceItemRealMedia', n), n);\r
+ break;\r
+\r
+ default:\r
+ dom.replace(t._createImg('mceItemFlash', n), n);\r
+ }\r
+ } \r
+ });\r
+ },\r
+\r
+ _createImg : function(cl, n) {\r
+ var im, dom = this.editor.dom, pa = {}, ti = '', args;\r
+\r
+ args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; \r
+\r
+ // Create image\r
+ im = dom.create('img', {\r
+ src : this.url + '/img/trans.gif',\r
+ width : dom.getAttrib(n, 'width') || 100,\r
+ height : dom.getAttrib(n, 'height') || 100,\r
+ style : dom.getAttrib(n, 'style'),\r
+ 'class' : cl\r
+ });\r
+\r
+ // Setup base parameters\r
+ each(args, function(na) {\r
+ var v = dom.getAttrib(n, na);\r
+\r
+ if (v)\r
+ pa[na] = v;\r
+ });\r
+\r
+ // Add optional parameters\r
+ each(dom.select('span', n), function(n) {\r
+ if (dom.hasClass(n, 'mceItemParam'))\r
+ pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value');\r
+ });\r
+\r
+ // Use src not movie\r
+ if (pa.movie) {\r
+ pa.src = pa.movie;\r
+ delete pa.movie;\r
+ }\r
+\r
+ // No src try data\r
+ if (!pa.src) {\r
+ pa.src = pa.data;\r
+ delete pa.data;\r
+ }\r
+\r
+ // Merge with embed args\r
+ n = dom.select('.mceItemEmbed', n)[0];\r
+ if (n) {\r
+ each(args, function(na) {\r
+ var v = dom.getAttrib(n, na);\r
+\r
+ if (v && !pa[na])\r
+ pa[na] = v;\r
+ });\r
+ }\r
+\r
+ delete pa.width;\r
+ delete pa.height;\r
+\r
+ im.title = this._serialize(pa);\r
+\r
+ return im;\r
+ },\r
+\r
+ _parse : function(s) {\r
+ return tinymce.util.JSON.parse('{' + s + '}');\r
+ },\r
+\r
+ _serialize : function(o) {\r
+ return tinymce.util.JSON.serialize(o).replace(/[{}]/g, '');\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.\r
+ */\r
+\r
+function writeFlash(p) {\r
+ writeEmbed(\r
+ 'D27CDB6E-AE6D-11cf-96B8-444553540000',\r
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+ 'application/x-shockwave-flash',\r
+ p\r
+ );\r
+}\r
+\r
+function writeShockWave(p) {\r
+ writeEmbed(\r
+ '166B1BCA-3F9C-11CF-8075-444553540000',\r
+ 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',\r
+ 'application/x-director',\r
+ p\r
+ );\r
+}\r
+\r
+function writeQuickTime(p) {\r
+ writeEmbed(\r
+ '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',\r
+ 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',\r
+ 'video/quicktime',\r
+ p\r
+ );\r
+}\r
+\r
+function writeRealMedia(p) {\r
+ writeEmbed(\r
+ 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',\r
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+ 'audio/x-pn-realaudio-plugin',\r
+ p\r
+ );\r
+}\r
+\r
+function writeWindowsMedia(p) {\r
+ p.url = p.src;\r
+ writeEmbed(\r
+ '6BF52A52-394A-11D3-B153-00C04F79FAA6',\r
+ 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',\r
+ 'application/x-mplayer2',\r
+ p\r
+ );\r
+}\r
+\r
+function writeEmbed(cls, cb, mt, p) {\r
+ var h = '', n;\r
+\r
+ h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';\r
+ h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';\r
+ h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';\r
+ h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';\r
+ h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';\r
+ h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';\r
+ h += '>';\r
+\r
+ for (n in p)\r
+ h += '<param name="' + n + '" value="' + p[n] + '">';\r
+\r
+ h += '<embed type="' + mt + '"';\r
+\r
+ for (n in p)\r
+ h += n + '="' + p[n] + '" ';\r
+\r
+ h += '></embed></object>';\r
+\r
+ document.write(h);\r
+}\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var oldWidth, oldHeight, ed, url;\r
+\r
+if (url = tinyMCEPopup.getParam("media_external_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+\r
+function init() {\r
+ var pl = "", f, val;\r
+ var type = "flash", fe, i;\r
+\r
+ ed = tinyMCEPopup.editor;\r
+\r
+ tinyMCEPopup.resizeToInnerSize();\r
+ f = document.forms[0]\r
+\r
+ fe = ed.selection.getNode();\r
+ if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {\r
+ pl = fe.title;\r
+\r
+ switch (ed.dom.getAttrib(fe, 'class')) {\r
+ case 'mceItemFlash':\r
+ type = 'flash';\r
+ break;\r
+\r
+ case 'mceItemFlashVideo':\r
+ type = 'flv';\r
+ break;\r
+\r
+ case 'mceItemShockWave':\r
+ type = 'shockwave';\r
+ break;\r
+\r
+ case 'mceItemWindowsMedia':\r
+ type = 'wmp';\r
+ break;\r
+\r
+ case 'mceItemQuickTime':\r
+ type = 'qt';\r
+ break;\r
+\r
+ case 'mceItemRealMedia':\r
+ type = 'rmp';\r
+ break;\r
+ }\r
+\r
+ document.forms[0].insert.value = ed.getLang('update', 'Insert', true); \r
+ }\r
+\r
+ document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');\r
+ document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');\r
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+\r
+ var html = getMediaListHTML('medialist','src','media','media');\r
+ if (html == "")\r
+ document.getElementById("linklistrow").style.display = 'none';\r
+ else\r
+ document.getElementById("linklistcontainer").innerHTML = html;\r
+\r
+ // Resize some elements\r
+ if (isVisible('filebrowser'))\r
+ document.getElementById('src').style.width = '230px';\r
+\r
+ // Setup form\r
+ if (pl != "") {\r
+ pl = tinyMCEPopup.editor.plugins.media._parse(pl);\r
+\r
+ switch (type) {\r
+ case "flash":\r
+ setBool(pl, 'flash', 'play');\r
+ setBool(pl, 'flash', 'loop');\r
+ setBool(pl, 'flash', 'menu');\r
+ setBool(pl, 'flash', 'swliveconnect');\r
+ setStr(pl, 'flash', 'quality');\r
+ setStr(pl, 'flash', 'scale');\r
+ setStr(pl, 'flash', 'salign');\r
+ setStr(pl, 'flash', 'wmode');\r
+ setStr(pl, 'flash', 'base');\r
+ setStr(pl, 'flash', 'flashvars');\r
+ break;\r
+\r
+ case "qt":\r
+ setBool(pl, 'qt', 'loop');\r
+ setBool(pl, 'qt', 'autoplay');\r
+ setBool(pl, 'qt', 'cache');\r
+ setBool(pl, 'qt', 'controller');\r
+ setBool(pl, 'qt', 'correction');\r
+ setBool(pl, 'qt', 'enablejavascript');\r
+ setBool(pl, 'qt', 'kioskmode');\r
+ setBool(pl, 'qt', 'autohref');\r
+ setBool(pl, 'qt', 'playeveryframe');\r
+ setBool(pl, 'qt', 'tarsetcache');\r
+ setStr(pl, 'qt', 'scale');\r
+ setStr(pl, 'qt', 'starttime');\r
+ setStr(pl, 'qt', 'endtime');\r
+ setStr(pl, 'qt', 'tarset');\r
+ setStr(pl, 'qt', 'qtsrcchokespeed');\r
+ setStr(pl, 'qt', 'volume');\r
+ setStr(pl, 'qt', 'qtsrc');\r
+ break;\r
+\r
+ case "shockwave":\r
+ setBool(pl, 'shockwave', 'sound');\r
+ setBool(pl, 'shockwave', 'progress');\r
+ setBool(pl, 'shockwave', 'autostart');\r
+ setBool(pl, 'shockwave', 'swliveconnect');\r
+ setStr(pl, 'shockwave', 'swvolume');\r
+ setStr(pl, 'shockwave', 'swstretchstyle');\r
+ setStr(pl, 'shockwave', 'swstretchhalign');\r
+ setStr(pl, 'shockwave', 'swstretchvalign');\r
+ break;\r
+\r
+ case "wmp":\r
+ setBool(pl, 'wmp', 'autostart');\r
+ setBool(pl, 'wmp', 'enabled');\r
+ setBool(pl, 'wmp', 'enablecontextmenu');\r
+ setBool(pl, 'wmp', 'fullscreen');\r
+ setBool(pl, 'wmp', 'invokeurls');\r
+ setBool(pl, 'wmp', 'mute');\r
+ setBool(pl, 'wmp', 'stretchtofit');\r
+ setBool(pl, 'wmp', 'windowlessvideo');\r
+ setStr(pl, 'wmp', 'balance');\r
+ setStr(pl, 'wmp', 'baseurl');\r
+ setStr(pl, 'wmp', 'captioningid');\r
+ setStr(pl, 'wmp', 'currentmarker');\r
+ setStr(pl, 'wmp', 'currentposition');\r
+ setStr(pl, 'wmp', 'defaultframe');\r
+ setStr(pl, 'wmp', 'playcount');\r
+ setStr(pl, 'wmp', 'rate');\r
+ setStr(pl, 'wmp', 'uimode');\r
+ setStr(pl, 'wmp', 'volume');\r
+ break;\r
+\r
+ case "rmp":\r
+ setBool(pl, 'rmp', 'autostart');\r
+ setBool(pl, 'rmp', 'loop');\r
+ setBool(pl, 'rmp', 'autogotourl');\r
+ setBool(pl, 'rmp', 'center');\r
+ setBool(pl, 'rmp', 'imagestatus');\r
+ setBool(pl, 'rmp', 'maintainaspect');\r
+ setBool(pl, 'rmp', 'nojava');\r
+ setBool(pl, 'rmp', 'prefetch');\r
+ setBool(pl, 'rmp', 'shuffle');\r
+ setStr(pl, 'rmp', 'console');\r
+ setStr(pl, 'rmp', 'controls');\r
+ setStr(pl, 'rmp', 'numloop');\r
+ setStr(pl, 'rmp', 'scriptcallbacks');\r
+ break;\r
+ }\r
+\r
+ setStr(pl, null, 'src');\r
+ setStr(pl, null, 'id');\r
+ setStr(pl, null, 'name');\r
+ setStr(pl, null, 'vspace');\r
+ setStr(pl, null, 'hspace');\r
+ setStr(pl, null, 'bgcolor');\r
+ setStr(pl, null, 'align');\r
+ setStr(pl, null, 'width');\r
+ setStr(pl, null, 'height');\r
+\r
+ if ((val = ed.dom.getAttrib(fe, "width")) != "")\r
+ pl.width = f.width.value = val;\r
+\r
+ if ((val = ed.dom.getAttrib(fe, "height")) != "")\r
+ pl.height = f.height.value = val;\r
+\r
+ oldWidth = pl.width ? parseInt(pl.width) : 0;\r
+ oldHeight = pl.height ? parseInt(pl.height) : 0;\r
+ } else\r
+ oldWidth = oldHeight = 0;\r
+\r
+ selectByValue(f, 'media_type', type);\r
+ changedType(type);\r
+ updateColor('bgcolor_pick', 'bgcolor');\r
+\r
+ TinyMCE_EditableSelects.init();\r
+ generatePreview();\r
+}\r
+\r
+function insertMedia() {\r
+ var fe, f = document.forms[0], h;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ if (!AutoValidator.validate(f)) {\r
+ tinyMCEPopup.alert(ed.getLang('invalid_data'));\r
+ return false;\r
+ }\r
+\r
+ f.width.value = f.width.value == "" ? 100 : f.width.value;\r
+ f.height.value = f.height.value == "" ? 100 : f.height.value;\r
+\r
+ fe = ed.selection.getNode();\r
+ if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {\r
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+ case "flash":\r
+ fe.className = "mceItemFlash";\r
+ break;\r
+\r
+ case "flv":\r
+ fe.className = "mceItemFlashVideo";\r
+ break;\r
+\r
+ case "shockwave":\r
+ fe.className = "mceItemShockWave";\r
+ break;\r
+\r
+ case "qt":\r
+ fe.className = "mceItemQuickTime";\r
+ break;\r
+\r
+ case "wmp":\r
+ fe.className = "mceItemWindowsMedia";\r
+ break;\r
+\r
+ case "rmp":\r
+ fe.className = "mceItemRealMedia";\r
+ break;\r
+ }\r
+\r
+ if (fe.width != f.width.value || fe.height != f.height.value)\r
+ ed.execCommand('mceRepaint');\r
+\r
+ fe.title = serializeParameters();\r
+ fe.width = f.width.value;\r
+ fe.height = f.height.value;\r
+ fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');\r
+ fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');\r
+ fe.align = f.align.options[f.align.selectedIndex].value;\r
+ } else {\r
+ h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ;\r
+\r
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+ case "flash":\r
+ h += ' class="mceItemFlash"';\r
+ break;\r
+\r
+ case "flv":\r
+ h += ' class="mceItemFlashVideo"';\r
+ break;\r
+\r
+ case "shockwave":\r
+ h += ' class="mceItemShockWave"';\r
+ break;\r
+\r
+ case "qt":\r
+ h += ' class="mceItemQuickTime"';\r
+ break;\r
+\r
+ case "wmp":\r
+ h += ' class="mceItemWindowsMedia"';\r
+ break;\r
+\r
+ case "rmp":\r
+ h += ' class="mceItemRealMedia"';\r
+ break;\r
+ }\r
+\r
+ h += ' title="' + serializeParameters() + '"';\r
+ h += ' width="' + f.width.value + '"';\r
+ h += ' height="' + f.height.value + '"';\r
+ h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';\r
+\r
+ h += ' />';\r
+\r
+ ed.execCommand('mceInsertContent', false, h);\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function updatePreview() {\r
+ var f = document.forms[0], type;\r
+\r
+ f.width.value = f.width.value || '320';\r
+ f.height.value = f.height.value || '240';\r
+\r
+ type = getType(f.src.value);\r
+ selectByValue(f, 'media_type', type);\r
+ changedType(type);\r
+ generatePreview();\r
+}\r
+\r
+function getMediaListHTML() {\r
+ if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {\r
+ var html = "";\r
+\r
+ html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">';\r
+ html += '<option value="">---</option>';\r
+\r
+ for (var i=0; i<tinyMCEMediaList.length; i++)\r
+ html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';\r
+\r
+ html += '</select>';\r
+\r
+ return html;\r
+ }\r
+\r
+ return "";\r
+}\r
+\r
+function getType(v) {\r
+ var fo, i, c, el, x, f = document.forms[0];\r
+\r
+ fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');\r
+\r
+ // YouTube\r
+ if (v.match(/watch\?v=(.+)(.*)/)) {\r
+ f.width.value = '425';\r
+ f.height.value = '350';\r
+ f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];\r
+ return 'flash';\r
+ }\r
+\r
+ // Google video\r
+ if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {\r
+ f.width.value = '425';\r
+ f.height.value = '326';\r
+ f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';\r
+ return 'flash';\r
+ }\r
+\r
+ for (i=0; i<fo.length; i++) {\r
+ c = fo[i].split('=');\r
+\r
+ el = c[1].split(',');\r
+ for (x=0; x<el.length; x++)\r
+ if (v.indexOf('.' + el[x]) != -1)\r
+ return c[0];\r
+ }\r
+\r
+ return null;\r
+}\r
+\r
+function switchType(v) {\r
+ var t = getType(v), d = document, f = d.forms[0];\r
+\r
+ if (!t)\r
+ return;\r
+\r
+ selectByValue(d.forms[0], 'media_type', t);\r
+ changedType(t);\r
+\r
+ // Update qtsrc also\r
+ if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {\r
+ alert(ed.getLang("media_qt_stream_warn"));\r
+\r
+ if (f.qt_qtsrc.value == '')\r
+ f.qt_qtsrc.value = f.src.value;\r
+ }\r
+}\r
+\r
+function changedType(t) {\r
+ var d = document;\r
+\r
+ d.getElementById('flash_options').style.display = 'none';\r
+ d.getElementById('flv_options').style.display = 'none';\r
+ d.getElementById('qt_options').style.display = 'none';\r
+ d.getElementById('shockwave_options').style.display = 'none';\r
+ d.getElementById('wmp_options').style.display = 'none';\r
+ d.getElementById('rmp_options').style.display = 'none';\r
+\r
+ if (t)\r
+ d.getElementById(t + '_options').style.display = 'block';\r
+}\r
+\r
+function serializeParameters() {\r
+ var d = document, f = d.forms[0], s = '';\r
+\r
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+ case "flash":\r
+ s += getBool('flash', 'play', true);\r
+ s += getBool('flash', 'loop', true);\r
+ s += getBool('flash', 'menu', true);\r
+ s += getBool('flash', 'swliveconnect', false);\r
+ s += getStr('flash', 'quality');\r
+ s += getStr('flash', 'scale');\r
+ s += getStr('flash', 'salign');\r
+ s += getStr('flash', 'wmode');\r
+ s += getStr('flash', 'base');\r
+ s += getStr('flash', 'flashvars');\r
+ break;\r
+\r
+ case "qt":\r
+ s += getBool('qt', 'loop', false);\r
+ s += getBool('qt', 'autoplay', true);\r
+ s += getBool('qt', 'cache', false);\r
+ s += getBool('qt', 'controller', true);\r
+ s += getBool('qt', 'correction', false, 'none', 'full');\r
+ s += getBool('qt', 'enablejavascript', false);\r
+ s += getBool('qt', 'kioskmode', false);\r
+ s += getBool('qt', 'autohref', false);\r
+ s += getBool('qt', 'playeveryframe', false);\r
+ s += getBool('qt', 'targetcache', false);\r
+ s += getStr('qt', 'scale');\r
+ s += getStr('qt', 'starttime');\r
+ s += getStr('qt', 'endtime');\r
+ s += getStr('qt', 'target');\r
+ s += getStr('qt', 'qtsrcchokespeed');\r
+ s += getStr('qt', 'volume');\r
+ s += getStr('qt', 'qtsrc');\r
+ break;\r
+\r
+ case "shockwave":\r
+ s += getBool('shockwave', 'sound');\r
+ s += getBool('shockwave', 'progress');\r
+ s += getBool('shockwave', 'autostart');\r
+ s += getBool('shockwave', 'swliveconnect');\r
+ s += getStr('shockwave', 'swvolume');\r
+ s += getStr('shockwave', 'swstretchstyle');\r
+ s += getStr('shockwave', 'swstretchhalign');\r
+ s += getStr('shockwave', 'swstretchvalign');\r
+ break;\r
+\r
+ case "wmp":\r
+ s += getBool('wmp', 'autostart', true);\r
+ s += getBool('wmp', 'enabled', false);\r
+ s += getBool('wmp', 'enablecontextmenu', true);\r
+ s += getBool('wmp', 'fullscreen', false);\r
+ s += getBool('wmp', 'invokeurls', true);\r
+ s += getBool('wmp', 'mute', false);\r
+ s += getBool('wmp', 'stretchtofit', false);\r
+ s += getBool('wmp', 'windowlessvideo', false);\r
+ s += getStr('wmp', 'balance');\r
+ s += getStr('wmp', 'baseurl');\r
+ s += getStr('wmp', 'captioningid');\r
+ s += getStr('wmp', 'currentmarker');\r
+ s += getStr('wmp', 'currentposition');\r
+ s += getStr('wmp', 'defaultframe');\r
+ s += getStr('wmp', 'playcount');\r
+ s += getStr('wmp', 'rate');\r
+ s += getStr('wmp', 'uimode');\r
+ s += getStr('wmp', 'volume');\r
+ break;\r
+\r
+ case "rmp":\r
+ s += getBool('rmp', 'autostart', false);\r
+ s += getBool('rmp', 'loop', false);\r
+ s += getBool('rmp', 'autogotourl', true);\r
+ s += getBool('rmp', 'center', false);\r
+ s += getBool('rmp', 'imagestatus', true);\r
+ s += getBool('rmp', 'maintainaspect', false);\r
+ s += getBool('rmp', 'nojava', false);\r
+ s += getBool('rmp', 'prefetch', false);\r
+ s += getBool('rmp', 'shuffle', false);\r
+ s += getStr('rmp', 'console');\r
+ s += getStr('rmp', 'controls');\r
+ s += getStr('rmp', 'numloop');\r
+ s += getStr('rmp', 'scriptcallbacks');\r
+ break;\r
+ }\r
+\r
+ s += getStr(null, 'id');\r
+ s += getStr(null, 'name');\r
+ s += getStr(null, 'src');\r
+ s += getStr(null, 'align');\r
+ s += getStr(null, 'bgcolor');\r
+ s += getInt(null, 'vspace');\r
+ s += getInt(null, 'hspace');\r
+ s += getStr(null, 'width');\r
+ s += getStr(null, 'height');\r
+\r
+ s = s.length > 0 ? s.substring(0, s.length - 1) : s;\r
+\r
+ return s;\r
+}\r
+\r
+function setBool(pl, p, n) {\r
+ if (typeof(pl[n]) == "undefined")\r
+ return;\r
+\r
+ document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false';\r
+}\r
+\r
+function setStr(pl, p, n) {\r
+ var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];\r
+\r
+ if (typeof(pl[n]) == "undefined")\r
+ return;\r
+\r
+ if (e.type == "text")\r
+ e.value = pl[n];\r
+ else\r
+ selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);\r
+}\r
+\r
+function getBool(p, n, d, tv, fv) {\r
+ var v = document.forms[0].elements[p + "_" + n].checked;\r
+\r
+ tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";\r
+ fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";\r
+\r
+ return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',");\r
+}\r
+\r
+function getStr(p, n, d) {\r
+ var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];\r
+ var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;\r
+\r
+ if (n == 'src')\r
+ v = tinyMCEPopup.editor.convertURL(v, 'src', null);\r
+\r
+ return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");\r
+}\r
+\r
+function getInt(p, n, d) {\r
+ var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];\r
+ var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;\r
+\r
+ return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");\r
+}\r
+\r
+function jsEncode(s) {\r
+ s = s.replace(new RegExp('\\\\', 'g'), '\\\\');\r
+ s = s.replace(new RegExp('"', 'g'), '\\"');\r
+ s = s.replace(new RegExp("'", 'g'), "\\'");\r
+\r
+ return s;\r
+}\r
+\r
+function generatePreview(c) {\r
+ var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;\r
+\r
+ p.innerHTML = '<!-- x --->';\r
+\r
+ nw = parseInt(f.width.value);\r
+ nh = parseInt(f.height.value);\r
+\r
+ if (f.width.value != "" && f.height.value != "") {\r
+ if (f.constrain.checked) {\r
+ if (c == 'width' && oldWidth != 0) {\r
+ wp = nw / oldWidth;\r
+ nh = Math.round(wp * nh);\r
+ f.height.value = nh;\r
+ } else if (c == 'height' && oldHeight != 0) {\r
+ hp = nh / oldHeight;\r
+ nw = Math.round(hp * nw);\r
+ f.width.value = nw;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (f.width.value != "")\r
+ oldWidth = nw;\r
+\r
+ if (f.height.value != "")\r
+ oldHeight = nh;\r
+\r
+ // After constrain\r
+ pl = serializeParameters();\r
+\r
+ switch (f.media_type.options[f.media_type.selectedIndex].value) {\r
+ case "flash":\r
+ cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';\r
+ codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';\r
+ type = 'application/x-shockwave-flash';\r
+ break;\r
+\r
+ case "shockwave":\r
+ cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';\r
+ codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';\r
+ type = 'application/x-director';\r
+ break;\r
+\r
+ case "qt":\r
+ cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';\r
+ codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';\r
+ type = 'video/quicktime';\r
+ break;\r
+\r
+ case "wmp":\r
+ cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';\r
+ codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';\r
+ type = 'application/x-mplayer2';\r
+ break;\r
+\r
+ case "rmp":\r
+ cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';\r
+ codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';\r
+ type = 'audio/x-pn-realaudio-plugin';\r
+ break;\r
+ }\r
+\r
+ if (pl == '') {\r
+ p.innerHTML = '';\r
+ return;\r
+ }\r
+\r
+ pl = tinyMCEPopup.editor.plugins.media._parse(pl);\r
+\r
+ if (!pl.src) {\r
+ p.innerHTML = '';\r
+ return;\r
+ }\r
+\r
+ pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src);\r
+ pl.width = !pl.width ? 100 : pl.width;\r
+ pl.height = !pl.height ? 100 : pl.height;\r
+ pl.id = !pl.id ? 'obj' : pl.id;\r
+ pl.name = !pl.name ? 'eobj' : pl.name;\r
+ pl.align = !pl.align ? '' : pl.align;\r
+\r
+ // Avoid annoying warning about insecure items\r
+ if (!tinymce.isIE || document.location.protocol != 'https:') {\r
+ h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';\r
+\r
+ for (n in pl) {\r
+ h += '<param name="' + n + '" value="' + pl[n] + '">';\r
+\r
+ // Add extra url parameter if it's an absolute URL\r
+ if (n == 'src' && pl[n].indexOf('://') != -1)\r
+ h += '<param name="url" value="' + pl[n] + '" />';\r
+ }\r
+ }\r
+\r
+ h += '<embed type="' + type + '" ';\r
+\r
+ for (n in pl)\r
+ h += n + '="' + pl[n] + '" ';\r
+\r
+ h += '></embed>';\r
+\r
+ // Avoid annoying warning about insecure items\r
+ if (!tinymce.isIE || document.location.protocol != 'https:')\r
+ h += '</object>';\r
+\r
+ p.innerHTML = "<!-- x --->" + h;\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.media_dlg',{\r
+title:"Insert / edit embedded media",\r
+general:"General",\r
+advanced:"Advanced",\r
+file:"File/URL",\r
+list:"List",\r
+size:"Dimensions",\r
+preview:"Preview",\r
+constrain_proportions:"Constrain proportions",\r
+type:"Type",\r
+id:"Id",\r
+name:"Name",\r
+class_name:"Class",\r
+vspace:"V-Space",\r
+hspace:"H-Space",\r
+play:"Auto play",\r
+loop:"Loop",\r
+menu:"Show menu",\r
+quality:"Quality",\r
+scale:"Scale",\r
+align:"Align",\r
+salign:"SAlign",\r
+wmode:"WMode",\r
+bgcolor:"Background",\r
+base:"Base",\r
+flashvars:"Flashvars",\r
+liveconnect:"SWLiveConnect",\r
+autohref:"AutoHREF",\r
+cache:"Cache",\r
+hidden:"Hidden",\r
+controller:"Controller",\r
+kioskmode:"Kiosk mode",\r
+playeveryframe:"Play every frame",\r
+targetcache:"Target cache",\r
+correction:"No correction",\r
+enablejavascript:"Enable JavaScript",\r
+starttime:"Start time",\r
+endtime:"End time",\r
+href:"Href",\r
+qtsrcchokespeed:"Choke speed",\r
+target:"Target",\r
+volume:"Volume",\r
+autostart:"Auto start",\r
+enabled:"Enabled",\r
+fullscreen:"Fullscreen",\r
+invokeurls:"Invoke URLs",\r
+mute:"Mute",\r
+stretchtofit:"Stretch to fit",\r
+windowlessvideo:"Windowless video",\r
+balance:"Balance",\r
+baseurl:"Base URL",\r
+captioningid:"Captioning id",\r
+currentmarker:"Current marker",\r
+currentposition:"Current position",\r
+defaultframe:"Default frame",\r
+playcount:"Play count",\r
+rate:"Rate",\r
+uimode:"UI Mode",\r
+flash_options:"Flash options",\r
+qt_options:"Quicktime options",\r
+wmp_options:"Windows media player options",\r
+rmp_options:"Real media player options",\r
+shockwave_options:"Shockwave options",\r
+autogotourl:"Auto goto URL",\r
+center:"Center",\r
+imagestatus:"Image status",\r
+maintainaspect:"Maintain aspect",\r
+nojava:"No java",\r
+prefetch:"Prefetch",\r
+shuffle:"Shuffle",\r
+console:"Console",\r
+numloop:"Num loops",\r
+controls:"Controls",\r
+scriptcallbacks:"Script callbacks",\r
+swstretchstyle:"Stretch style",\r
+swstretchhalign:"Stretch H-Align",\r
+swstretchvalign:"Stretch V-Align",\r
+sound:"Sound",\r
+progress:"Progress",\r
+qtsrc:"QT Src",\r
+qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..",\r
+align_top:"Top",\r
+align_right:"Right",\r
+align_bottom:"Bottom",\r
+align_left:"Left",\r
+align_center:"Center",\r
+align_top_left:"Top left",\r
+align_top_right:"Top right",\r
+align_bottom_left:"Bottom left",\r
+align_bottom_right:"Bottom right",\r
+flv_options:"Flash video options",\r
+flv_scalemode:"Scale mode",\r
+flv_buffer:"Buffer",\r
+flv_startimage:"Start image",\r
+flv_starttime:"Start time",\r
+flv_defaultvolume:"Default volumne",\r
+flv_hiddengui:"Hidden GUI",\r
+flv_autostart:"Auto start",\r
+flv_loop:"Loop",\r
+flv_showscalemodes:"Show scale modes",\r
+flv_smoothvideo:"Smooth video",\r
+flv_jscallback:"JS Callback"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#media_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/media.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <link href="css/media.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body style="display: none">\r
+ <form onsubmit="insertMedia();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#media_dlg.general}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="media_type">{#media_dlg.type}</label></td>\r
+ <td>\r
+ <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">\r
+ <option value="flash">Flash</option>\r
+ <!-- <option value="flv">Flash video (FLV)</option> -->\r
+ <option value="qt">Quicktime</option>\r
+ <option value="shockwave">Shockwave</option>\r
+ <option value="wmp">Windows Media</option>\r
+ <option value="rmp">Real Media</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="src">{#media_dlg.file}</label></td>\r
+ <td>\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td>\r
+ <td id="filebrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr id="linklistrow">\r
+ <td><label for="linklist">{#media_dlg.list}</label></td>\r
+ <td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="width">{#media_dlg.size}</label></td>\r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>\r
+ <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>\r
+ <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend>{#media_dlg.preview}</legend>\r
+ <div id="prev"></div>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#media_dlg.advanced}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+ <tr>\r
+ <td><label for="id">{#media_dlg.id}</label></td>\r
+ <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>\r
+ <td><label for="name">{#media_dlg.name}</label></td>\r
+ <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="align">{#media_dlg.align}</label></td>\r
+ <td>\r
+ <select id="align" name="align" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="top">{#media_dlg.align_top}</option>\r
+ <option value="right">{#media_dlg.align_right}</option>\r
+ <option value="bottom">{#media_dlg.align_bottom}</option>\r
+ <option value="left">{#media_dlg.align_left}</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>\r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>\r
+ <td id="bgcolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="vspace">{#media_dlg.vspace}</label></td>\r
+ <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>\r
+ <td><label for="hspace">{#media_dlg.hspace}</label></td>\r
+ <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset id="flash_options">\r
+ <legend>{#media_dlg.flash_options}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="flash_quality">{#media_dlg.quality}</label></td>\r
+ <td>\r
+ <select id="flash_quality" name="flash_quality" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="high">high</option>\r
+ <option value="low">low</option>\r
+ <option value="autolow">autolow</option>\r
+ <option value="autohigh">autohigh</option>\r
+ <option value="best">best</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="flash_scale">{#media_dlg.scale}</label></td>\r
+ <td>\r
+ <select id="flash_scale" name="flash_scale" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="showall">showall</option>\r
+ <option value="noborder">noborder</option>\r
+ <option value="exactfit">exactfit</option>\r
+ <option value="noscale">noscale</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="flash_wmode">{#media_dlg.wmode}</label></td>\r
+ <td>\r
+ <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="window">window</option>\r
+ <option value="opaque">opaque</option>\r
+ <option value="transparent">transparent</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="flash_salign">{#media_dlg.salign}</label></td>\r
+ <td>\r
+ <select id="flash_salign" name="flash_salign" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="l">{#media_dlg.align_left}</option>\r
+ <option value="t">{#media_dlg.align_top}</option>\r
+ <option value="r">{#media_dlg.align_right}</option>\r
+ <option value="b">{#media_dlg.align_bottom}</option>\r
+ <option value="tl">{#media_dlg.align_top_left}</option>\r
+ <option value="tr">{#media_dlg.align_top_right}</option>\r
+ <option value="bl">{#media_dlg.align_bottom_left}</option>\r
+ <option value="br">{#media_dlg.align_bottom_right}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flash_play">{#media_dlg.play}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flash_loop">{#media_dlg.loop}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flash_menu">{#media_dlg.menu}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>\r
+ <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+\r
+ <table>\r
+ <tr>\r
+ <td><label for="flash_base">{#media_dlg.base}</label></td>\r
+ <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>\r
+ <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset id="flv_options">\r
+ <legend>{#media_dlg.flv_options}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>\r
+ <td>\r
+ <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="none">none</option>\r
+ <option value="double">double</option>\r
+ <option value="full">full</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>\r
+ <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>\r
+ <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>\r
+ <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>\r
+ <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>\r
+\r
+\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>\r
+ <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>\r
+ <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset id="qt_options">\r
+ <legend>{#media_dlg.qt_options}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_loop">{#media_dlg.loop}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_autoplay">{#media_dlg.play}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_cache">{#media_dlg.cache}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_controller">{#media_dlg.controller}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_correction">{#media_dlg.correction}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_autohref">{#media_dlg.autohref}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>\r
+ <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="qt_scale">{#media_dlg.scale}</label></td>\r
+ <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">\r
+ <option value="">{#not_set}</option> \r
+ <option value="tofit">tofit</option>\r
+ <option value="aspect">aspect</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td colspan="2"> </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="qt_starttime">{#media_dlg.starttime}</label></td>\r
+ <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="qt_endtime">{#media_dlg.endtime}</label></td>\r
+ <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="qt_target">{#media_dlg.target}</label></td>\r
+ <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="qt_href">{#media_dlg.href}</label></td>\r
+ <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>\r
+ <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="qt_volume">{#media_dlg.volume}</label></td>\r
+ <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>\r
+ <td colspan="4">\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>\r
+ <td id="qtsrcfilebrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset id="wmp_options">\r
+ <legend>{#media_dlg.wmp_options}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_mute">{#media_dlg.mute}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>\r
+ <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="wmp_balance">{#media_dlg.balance}</label></td>\r
+ <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>\r
+ <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>\r
+ <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>\r
+ <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>\r
+ <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>\r
+ <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>\r
+ <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="wmp_rate">{#media_dlg.rate}</label></td>\r
+ <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>\r
+ <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="wmp_volume">{#media_dlg.volume}</label></td>\r
+ <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset id="rmp_options">\r
+ <legend>{#media_dlg.rmp_options}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_loop">{#media_dlg.loop}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_center">{#media_dlg.center}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>\r
+ <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ \r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="rmp_console">{#media_dlg.console}</label></td>\r
+ <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="rmp_controls">{#media_dlg.controls}</label></td>\r
+ <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>\r
+ <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>\r
+\r
+ <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>\r
+ <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset id="shockwave_options">\r
+ <legend>{#media_dlg.shockwave_options}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>\r
+ <td>\r
+ <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">\r
+ <option value="none">{#not_set}</option>\r
+ <option value="meet">Meet</option>\r
+ <option value="fill">Fill</option>\r
+ <option value="stage">Stage</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>\r
+ <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>\r
+ <td>\r
+ <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">\r
+ <option value="none">{#not_set}</option>\r
+ <option value="left">{#media_dlg.align_left}</option>\r
+ <option value="center">{#media_dlg.align_center}</option>\r
+ <option value="right">{#media_dlg.align_right}</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>\r
+ <td>\r
+ <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">\r
+ <option value="none">{#not_set}</option>\r
+ <option value="meet">Meet</option>\r
+ <option value="fill">Fill</option>\r
+ <option value="stage">Stage</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>\r
+ <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>\r
+ <td><label for="shockwave_sound">{#media_dlg.sound}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+\r
+\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>\r
+ <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+\r
+ <td colspan="2">\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>\r
+ <td><label for="shockwave_progress">{#media_dlg.progress}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span _mce_bogus="1" class="mceItemHidden mceItemNbsp"> </span>':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.Nonbreaking', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceNonBreaking', function() {\r
+ ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span _mce_bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' ');\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'});\r
+\r
+ if (ed.getParam('nonbreaking_force_tab')) {\r
+ ed.onKeyDown.add(function(ed, e) {\r
+ if (tinymce.isIE && e.keyCode == 9) {\r
+ ed.execCommand('mceNonBreaking');\r
+ ed.execCommand('mceNonBreaking');\r
+ ed.execCommand('mceNonBreaking');\r
+ tinymce.dom.Event.cancel(e);\r
+ }\r
+ });\r
+ }\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Nonbreaking space',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+\r
+ // Private methods\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var Event = tinymce.dom.Event;\r
+\r
+ tinymce.create('tinymce.plugins.NonEditablePlugin', {\r
+ init : function(ed, url) {\r
+ var t = this, editClass, nonEditClass;\r
+\r
+ t.editor = ed;\r
+ editClass = ed.getParam("noneditable_editable_class", "mceEditable");\r
+ nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable");\r
+\r
+ ed.onNodeChange.addToTop(function(ed, cm, n) {\r
+ var sc, ec;\r
+\r
+ // Block if start or end is inside a non editable element\r
+ sc = ed.dom.getParent(ed.selection.getStart(), function(n) {\r
+ return ed.dom.hasClass(n, nonEditClass);\r
+ });\r
+\r
+ ec = ed.dom.getParent(ed.selection.getEnd(), function(n) {\r
+ return ed.dom.hasClass(n, nonEditClass);\r
+ });\r
+\r
+ // Block or unblock\r
+ if (sc || ec) {\r
+ t._setDisabled(1);\r
+ return false;\r
+ } else\r
+ t._setDisabled(0);\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Non editable elements',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ _block : function(ed, e) {\r
+ var k = e.keyCode;\r
+\r
+ // Don't block arrow keys, pg up/down, and F1-F12\r
+ if ((k > 32 && k < 41) || (k > 111 && k < 124))\r
+ return;\r
+\r
+ return Event.cancel(e);\r
+ },\r
+\r
+ _setDisabled : function(s) {\r
+ var t = this, ed = t.editor;\r
+\r
+ tinymce.each(ed.controlManager.controls, function(c) {\r
+ c.setDisabled(s);\r
+ });\r
+\r
+ if (s !== t.disabled) {\r
+ if (s) {\r
+ ed.onKeyDown.addToTop(t._block);\r
+ ed.onKeyPress.addToTop(t._block);\r
+ ed.onKeyUp.addToTop(t._block);\r
+ ed.onPaste.addToTop(t._block);\r
+ } else {\r
+ ed.onKeyDown.remove(t._block);\r
+ ed.onKeyPress.remove(t._block);\r
+ ed.onKeyUp.remove(t._block);\r
+ ed.onPaste.remove(t._block);\r
+ }\r
+\r
+ t.disabled = s;\r
+ }\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;}
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+d+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.PageBreakPlugin', {\r
+ init : function(ed, url) {\r
+ var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;\r
+\r
+ pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');\r
+\r
+ // Register commands\r
+ ed.addCommand('mcePageBreak', function() {\r
+ ed.execCommand('mceInsertContent', 0, pb);\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});\r
+\r
+ ed.onInit.add(function() {\r
+ if (ed.settings.content_css !== false)\r
+ ed.dom.loadCSS(url + "/css/content.css");\r
+\r
+ if (ed.theme.onResolveName) {\r
+ ed.theme.onResolveName.add(function(th, o) {\r
+ if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))\r
+ o.name = 'pagebreak';\r
+ });\r
+ }\r
+ });\r
+\r
+ ed.onClick.add(function(ed, e) {\r
+ e = e.target;\r
+\r
+ if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls))\r
+ ed.selection.select(e);\r
+ });\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls));\r
+ });\r
+\r
+ ed.onBeforeSetContent.add(function(ed, o) {\r
+ o.content = o.content.replace(pbRE, pb);\r
+ });\r
+\r
+ ed.onPostProcess.add(function(ed, o) {\r
+ if (o.get)\r
+ o.content = o.content.replace(/<img[^>]+>/g, function(im) {\r
+ if (im.indexOf('class="mcePageBreak') !== -1)\r
+ im = sep;\r
+\r
+ return im;\r
+ });\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'PageBreak',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){var c=tinymce.each,d=null,a={paste_auto_cleanup_on_paste:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(e,f){return e.getParam(f,a[f])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(e,f){var g=this;g.editor=e;g.url=f;g.onPreProcess=new tinymce.util.Dispatcher(g);g.onPostProcess=new tinymce.util.Dispatcher(g);g.onPreProcess.add(g._preProcess);g.onPostProcess.add(g._postProcess);g.onPreProcess.add(function(j,k){e.execCallback("paste_preprocess",j,k)});g.onPostProcess.add(function(j,k){e.execCallback("paste_postprocess",j,k)});e.pasteAsPlainText=false;function i(l,j){var k=e.dom;g.onPreProcess.dispatch(g,l);l.node=k.create("div",0,l.content);g.onPostProcess.dispatch(g,l);l.content=e.serializer.serialize(l.node,{getInner:1});if((!j)&&(e.pasteAsPlainText)){g._insertPlainText(e,k,l.content);if(!b(e,"paste_text_sticky")){e.pasteAsPlainText=false;e.controlManager.setActive("pastetext",false)}}else{if(/<(p|h[1-6]|ul|ol)/.test(l.content)){g._insertBlockContent(e,k,l.content)}else{g._insert(l.content)}}}e.addCommand("mceInsertClipboardContent",function(j,k){i(k,true)});if(!b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(k,j){var l=tinymce.util.Cookie;e.pasteAsPlainText=!e.pasteAsPlainText;e.controlManager.setActive("pastetext",e.pasteAsPlainText);if((e.pasteAsPlainText)&&(!l.get("tinymcePasteText"))){if(b(e,"paste_text_sticky")){e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}else{e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}if(!b(e,"paste_text_notifyalways")){l.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}e.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});e.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function h(s){var m,q,k,l=e.selection,p=e.dom,r=e.getBody(),j;if(e.pasteAsPlainText&&(s.clipboardData||p.doc.dataTransfer)){s.preventDefault();i({content:(s.clipboardData||p.doc.dataTransfer).getData("Text")},true);return}if(p.get("_mcePaste")){return}m=p.add(r,"div",{id:"_mcePaste","class":"mcePaste"},'\uFEFF<br _mce_bogus="1">');if(r!=e.getDoc().body){j=p.getPos(e.selection.getStart(),r).y}else{j=r.scrollTop}p.setStyles(m,{position:"absolute",left:-10000,top:j,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){k=p.doc.body.createTextRange();k.moveToElementText(m);k.execCommand("Paste");p.remove(m);if(m.innerHTML==="\uFEFF"){e.execCommand("mcePasteWord");s.preventDefault();return}i({content:m.innerHTML});return tinymce.dom.Event.cancel(s)}else{function o(n){n.preventDefault()}p.bind(e.getDoc(),"mousedown",o);p.bind(e.getDoc(),"keydown",o);q=e.selection.getRng();m=m.firstChild;k=e.getDoc().createRange();k.setStart(m,0);k.setEnd(m,1);l.setRng(k);window.setTimeout(function(){var t="",n=p.select("div.mcePaste");c(n,function(v){var u=v.firstChild;if(u&&u.nodeName=="DIV"&&u.style.marginTop&&u.style.backgroundColor){p.remove(u,1)}c(p.select("div.mcePaste",v),function(w){p.remove(w,1)});c(p.select("span.Apple-style-span",v),function(w){p.remove(w,1)});c(p.select("br[_mce_bogus]",v),function(w){p.remove(w)});t+=v.innerHTML});c(n,function(u){p.remove(u)});if(q){l.setRng(q)}i({content:t});p.unbind(e.getDoc(),"mousedown",o);p.unbind(e.getDoc(),"keydown",o)},0)}}if(b(e,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){e.onKeyDown.add(function(j,k){if(((tinymce.isMac?k.metaKey:k.ctrlKey)&&k.keyCode==86)||(k.shiftKey&&k.keyCode==45)){h(k)}})}else{e.onPaste.addToTop(function(j,k){return h(k)})}}if(b(e,"paste_block_drop")){e.onInit.add(function(){e.dom.bind(e.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(j){j.preventDefault();j.stopPropagation();return false})})}g._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(i,f){var l=this.editor,k=f.content,q=tinymce.grep,p=tinymce.explode,g=tinymce.trim,m,j;function e(h){c(h,function(o){if(o.constructor==RegExp){k=k.replace(o,"")}else{k=k.replace(o[0],o[1])}})}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(k)||f.wordContent){f.wordContent=true;e([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(l,"paste_convert_headers_to_strong")){k=k.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(l,"paste_convert_middot_lists")){e([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"]])}e([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{m=k.length;k=k.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(m!=k.length);if(b(l,"paste_retain_style_properties").replace(/^none$/i,"").length==0){k=k.replace(/<\/?span[^>]*>/gi,"")}else{e([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(u,h,t){var v=[],o=0,r=p(g(t).replace(/"/gi,"'"),";");c(r,function(s){var w,y,z=p(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":v[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":v[o++]="text-align:"+y;return;case"vert-align":v[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":v[o++]="color:"+y;return;case"mso-background":case"mso-highlight":v[o++]="background:"+y;return;case"mso-default-height":v[o++]="min-height:"+x(y);return;case"mso-default-width":v[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":v[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){v[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){v[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}v[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+v.join(";")+'"'}else{return h}}]])}}if(b(l,"paste_convert_headers_to_strong")){e([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}j=b(l,"paste_strip_class_attributes");if(j!=="none"){function n(r,o){if(j==="all"){return""}var h=q(p(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(s){return(/^(?!mso)/i.test(s))});return h.length?' class="'+h.join(" ")+'"':""}k=k.replace(/ class="([^"]+)"/gi,n);k=k.replace(/ class=(\w+)/gi,n)}if(b(l,"paste_remove_spans")){k=k.replace(/<\/?span[^>]*>/gi,"")}f.content=k},_postProcess:function(h,j){var g=this,f=g.editor,i=f.dom,e;if(j.wordContent){c(i.select("a",j.node),function(k){if(!k.href||k.href.indexOf("#_Toc")!=-1){i.remove(k,1)}});if(b(f,"paste_convert_middot_lists")){g._convertLists(h,j)}e=b(f,"paste_retain_style_properties");if((tinymce.is(e,"string"))&&(e!=="all")&&(e!=="*")){e=tinymce.explode(e.replace(/^none$/i,""));c(i.select("*",j.node),function(n){var o={},l=0,m,p,k;if(e){for(m=0;m<e.length;m++){p=e[m];k=i.getStyle(n,p);if(k){o[p]=k;l++}}}i.setAttrib(n,"style","");if(e&&l>0){i.setStyles(n,o)}else{if(n.nodeName=="SPAN"&&!n.className){i.remove(n,true)}}})}}if(b(f,"paste_remove_styles")||(b(f,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(i.select("*[style]",j.node),function(k){k.removeAttribute("style");k.removeAttribute("_mce_style")})}else{if(tinymce.isWebKit){c(i.select("*",j.node),function(k){k.removeAttribute("_mce_style")})}}},_convertLists:function(h,f){var j=h.editor.dom,i,m,e=-1,g,n=[],l,k;c(j.select("p",f.node),function(u){var r,v="",t,s,o,q;for(r=u.firstChild;r&&r.nodeType==3;r=r.nextSibling){v+=r.nodeValue}v=u.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(v)){t="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(v)){t="ol"}if(t){g=parseFloat(u.style.marginLeft||0);if(g>e){n.push(g)}if(!i||t!=l){i=j.create(t);j.insertAfter(i,u)}else{if(g>e){i=m.appendChild(j.create(t))}else{if(g<e){o=tinymce.inArray(n,g);q=j.getParents(i.parentNode,t);i=q[q.length-1-o]||i}}}c(j.select("span",u),function(w){var p=w.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(t=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){j.remove(w)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){j.remove(w)}}});s=u.innerHTML;if(t=="ul"){s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}m=i.appendChild(j.create("li",0,s));j.remove(u);e=g;l=t}else{i=e=0}});k=f.node.innerHTML;if(k.indexOf("__MCE_ITEM__")!=-1){f.node.innerHTML=k.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(l,h,m){var f,j,g=l.selection,q,n,e,o,i,k="mce_marker";function p(t){var s;if(tinymce.isIE){s=l.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(false);s.select()}else{g.select(t,1);g.collapse(false)}}this._insert('<span id="'+k+'"></span>',1);j=h.get(k);f=h.getParent(j,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(f&&!/TD|TH/.test(f.nodeName)){j=h.split(f,j);c(h.create("div",0,m).childNodes,function(r){q=j.parentNode.insertBefore(r.cloneNode(true),j)});p(q)}else{h.setOuterHTML(j,m);g.select(l.getBody(),1);g.collapse(0)}while(n=h.get(k)){h.remove(n)}n=g.getStart();e=h.getViewPort(l.getWin());o=l.dom.getPos(n).y;i=n.clientHeight;if(o<e.y||o+i>e.y+e.h){l.getDoc().body.scrollTop=o<e.y?o:o-e.h+25}},_insert:function(g,e){var f=this.editor,i=f.selection.getRng();if(!f.selection.isCollapsed()&&i.startContainer!=i.endContainer){f.getDoc().execCommand("Delete",false,null)}f.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,g,{skip_undo:e})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(h){c(h,function(i){if(i.constructor==RegExp){v=v.replace(i,"")}else{v=v.replace(i[0],i[1])}})}if((typeof(v)==="string")&&(v.length>0)){if(!d){d=("34,quot,38,amp,39,apos,60,lt,62,gt,"+j.serializer.settings.entities).split(",")}if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/&(#\d+|[a-z0-9]{1,10});/gi,function(i,h){if(h.charAt(0)==="#"){return String.fromCharCode(h.slice(1))}else{return((i=y(d,h))>0)?String.fromCharCode(d[i-1]):" "}}],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.encode(v);if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"<br />"]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"</p><p>"],[/\n/g,"<br />"]])}}if((l=v.indexOf("</p><p>"))!=-1){k=v.lastIndexOf("</p><p>");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t<u;t++){p+="</"+e[t].nodeName.toLowerCase()+">";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+'<span id="_plain_text_marker"> </span>');window.setTimeout(function(){var h=x.get("_plain_text_marker"),B,i,A,w;s.select(h,false);z.execCommand("Delete",false,null);h=null;B=s.getStart();i=x.getViewPort(n);A=x.getPos(B).y;w=B.clientHeight;if((A<i.y)||(A+w>i.y+i.h)){z.body.scrollTop=A<i.y?A:A-i.h+25}},0)}},_legacySupport:function(){var f=this,e=f.editor;e.addCommand("mcePasteWord",function(){e.windowManager.open({file:f.url+"/pasteword.htm",width:parseInt(b(e,"paste_dialog_width")),height:parseInt(b(e,"paste_dialog_height")),inline:1})});if(b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(){e.windowManager.open({file:f.url+"/pastetext.htm",width:parseInt(b(e,"paste_dialog_width")),height:parseInt(b(e,"paste_dialog_height")),inline:1})})}e.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var each = tinymce.each,\r
+ entities = null,\r
+ defs = {\r
+ paste_auto_cleanup_on_paste : true,\r
+ paste_block_drop : false,\r
+ paste_retain_style_properties : "none",\r
+ paste_strip_class_attributes : "mso",\r
+ paste_remove_spans : false,\r
+ paste_remove_styles : false,\r
+ paste_remove_styles_if_webkit : true,\r
+ paste_convert_middot_lists : true,\r
+ paste_convert_headers_to_strong : false,\r
+ paste_dialog_width : "450",\r
+ paste_dialog_height : "400",\r
+ paste_text_use_dialog : false,\r
+ paste_text_sticky : false,\r
+ paste_text_notifyalways : false,\r
+ paste_text_linebreaktype : "p",\r
+ paste_text_replacements : [\r
+ [/\u2026/g, "..."],\r
+ [/[\x93\x94\u201c\u201d]/g, '"'],\r
+ [/[\x60\x91\x92\u2018\u2019]/g, "'"]\r
+ ]\r
+ };\r
+\r
+ function getParam(ed, name) {\r
+ return ed.getParam(name, defs[name]);\r
+ }\r
+\r
+ tinymce.create('tinymce.plugins.PastePlugin', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+ t.url = url;\r
+\r
+ // Setup plugin events\r
+ t.onPreProcess = new tinymce.util.Dispatcher(t);\r
+ t.onPostProcess = new tinymce.util.Dispatcher(t);\r
+\r
+ // Register default handlers\r
+ t.onPreProcess.add(t._preProcess);\r
+ t.onPostProcess.add(t._postProcess);\r
+\r
+ // Register optional preprocess handler\r
+ t.onPreProcess.add(function(pl, o) {\r
+ ed.execCallback('paste_preprocess', pl, o);\r
+ });\r
+\r
+ // Register optional postprocess\r
+ t.onPostProcess.add(function(pl, o) {\r
+ ed.execCallback('paste_postprocess', pl, o);\r
+ });\r
+\r
+ // Initialize plain text flag\r
+ ed.pasteAsPlainText = false;\r
+\r
+ // This function executes the process handlers and inserts the contents\r
+ // force_rich overrides plain text mode set by user, important for pasting with execCommand\r
+ function process(o, force_rich) {\r
+ var dom = ed.dom;\r
+\r
+ // Execute pre process handlers\r
+ t.onPreProcess.dispatch(t, o);\r
+\r
+ // Create DOM structure\r
+ o.node = dom.create('div', 0, o.content);\r
+\r
+ // Execute post process handlers\r
+ t.onPostProcess.dispatch(t, o);\r
+\r
+ // Serialize content\r
+ o.content = ed.serializer.serialize(o.node, {getInner : 1});\r
+\r
+ // Plain text option active?\r
+ if ((!force_rich) && (ed.pasteAsPlainText)) {\r
+ t._insertPlainText(ed, dom, o.content);\r
+\r
+ if (!getParam(ed, "paste_text_sticky")) {\r
+ ed.pasteAsPlainText = false;\r
+ ed.controlManager.setActive("pastetext", false);\r
+ }\r
+ } else if (/<(p|h[1-6]|ul|ol)/.test(o.content)) {\r
+ // Handle insertion of contents containing block elements separately\r
+ t._insertBlockContent(ed, dom, o.content);\r
+ } else {\r
+ t._insert(o.content);\r
+ }\r
+ }\r
+\r
+ // Add command for external usage\r
+ ed.addCommand('mceInsertClipboardContent', function(u, o) {\r
+ process(o, true);\r
+ });\r
+\r
+ if (!getParam(ed, "paste_text_use_dialog")) {\r
+ ed.addCommand('mcePasteText', function(u, v) {\r
+ var cookie = tinymce.util.Cookie;\r
+\r
+ ed.pasteAsPlainText = !ed.pasteAsPlainText;\r
+ ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);\r
+\r
+ if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {\r
+ if (getParam(ed, "paste_text_sticky")) {\r
+ ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));\r
+ } else {\r
+ ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));\r
+ }\r
+\r
+ if (!getParam(ed, "paste_text_notifyalways")) {\r
+ cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});\r
+ ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});\r
+\r
+ // This function grabs the contents from the clipboard by adding a\r
+ // hidden div and placing the caret inside it and after the browser paste\r
+ // is done it grabs that contents and processes that\r
+ function grabContent(e) {\r
+ var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY;\r
+\r
+ // Check if browser supports direct plaintext access\r
+ if (ed.pasteAsPlainText && (e.clipboardData || dom.doc.dataTransfer)) {\r
+ e.preventDefault();\r
+ process({content : (e.clipboardData || dom.doc.dataTransfer).getData('Text')}, true);\r
+ return;\r
+ }\r
+\r
+ if (dom.get('_mcePaste'))\r
+ return;\r
+\r
+ // Create container to paste into\r
+ n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste'}, '\uFEFF<br _mce_bogus="1">');\r
+\r
+ // If contentEditable mode we need to find out the position of the closest element\r
+ if (body != ed.getDoc().body)\r
+ posY = dom.getPos(ed.selection.getStart(), body).y;\r
+ else\r
+ posY = body.scrollTop;\r
+\r
+ // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles\r
+ dom.setStyles(n, {\r
+ position : 'absolute',\r
+ left : -10000,\r
+ top : posY,\r
+ width : 1,\r
+ height : 1,\r
+ overflow : 'hidden'\r
+ });\r
+\r
+ if (tinymce.isIE) {\r
+ // Select the container\r
+ rng = dom.doc.body.createTextRange();\r
+ rng.moveToElementText(n);\r
+ rng.execCommand('Paste');\r
+\r
+ // Remove container\r
+ dom.remove(n);\r
+\r
+ // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due\r
+ // to IE security settings so we pass the junk though better than nothing right\r
+ if (n.innerHTML === '\uFEFF') {\r
+ ed.execCommand('mcePasteWord');\r
+ e.preventDefault();\r
+ return;\r
+ }\r
+\r
+ // Process contents\r
+ process({content : n.innerHTML});\r
+\r
+ // Block the real paste event\r
+ return tinymce.dom.Event.cancel(e);\r
+ } else {\r
+ function block(e) {\r
+ e.preventDefault();\r
+ };\r
+\r
+ // Block mousedown and click to prevent selection change\r
+ dom.bind(ed.getDoc(), 'mousedown', block);\r
+ dom.bind(ed.getDoc(), 'keydown', block);\r
+\r
+ or = ed.selection.getRng();\r
+\r
+ // Move caret into hidden div\r
+ n = n.firstChild;\r
+ rng = ed.getDoc().createRange();\r
+ rng.setStart(n, 0);\r
+ rng.setEnd(n, 1);\r
+ sel.setRng(rng);\r
+\r
+ // Wait a while and grab the pasted contents\r
+ window.setTimeout(function() {\r
+ var h = '', nl = dom.select('div.mcePaste');\r
+\r
+ // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string\r
+ each(nl, function(n) {\r
+ var child = n.firstChild;\r
+\r
+ // WebKit inserts a DIV container with lots of odd styles\r
+ if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {\r
+ dom.remove(child, 1);\r
+ }\r
+\r
+ // WebKit duplicates the divs so we need to remove them\r
+ each(dom.select('div.mcePaste', n), function(n) {\r
+ dom.remove(n, 1);\r
+ });\r
+\r
+ // Remove apply style spans\r
+ each(dom.select('span.Apple-style-span', n), function(n) {\r
+ dom.remove(n, 1);\r
+ });\r
+\r
+ // Remove bogus br elements\r
+ each(dom.select('br[_mce_bogus]', n), function(n) {\r
+ dom.remove(n);\r
+ });\r
+\r
+ h += n.innerHTML;\r
+ });\r
+\r
+ // Remove the nodes\r
+ each(nl, function(n) {\r
+ dom.remove(n);\r
+ });\r
+\r
+ // Restore the old selection\r
+ if (or)\r
+ sel.setRng(or);\r
+\r
+ process({content : h});\r
+\r
+ // Unblock events ones we got the contents\r
+ dom.unbind(ed.getDoc(), 'mousedown', block);\r
+ dom.unbind(ed.getDoc(), 'keydown', block);\r
+ }, 0);\r
+ }\r
+ }\r
+\r
+ // Check if we should use the new auto process method \r
+ if (getParam(ed, "paste_auto_cleanup_on_paste")) {\r
+ // Is it's Opera or older FF use key handler\r
+ if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {\r
+ ed.onKeyDown.add(function(ed, e) {\r
+ if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))\r
+ grabContent(e);\r
+ });\r
+ } else {\r
+ // Grab contents on paste event on Gecko and WebKit\r
+ ed.onPaste.addToTop(function(ed, e) {\r
+ return grabContent(e);\r
+ });\r
+ }\r
+ }\r
+\r
+ // Block all drag/drop events\r
+ if (getParam(ed, "paste_block_drop")) {\r
+ ed.onInit.add(function() {\r
+ ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ return false;\r
+ });\r
+ });\r
+ }\r
+\r
+ // Add legacy support\r
+ t._legacySupport();\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Paste text/word',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ _preProcess : function(pl, o) {\r
+ //console.log('Before preprocess:' + o.content);\r
+\r
+ var ed = this.editor,\r
+ h = o.content,\r
+ grep = tinymce.grep,\r
+ explode = tinymce.explode,\r
+ trim = tinymce.trim,\r
+ len, stripClass;\r
+\r
+ function process(items) {\r
+ each(items, function(v) {\r
+ // Remove or replace\r
+ if (v.constructor == RegExp)\r
+ h = h.replace(v, '');\r
+ else\r
+ h = h.replace(v[0], v[1]);\r
+ });\r
+ }\r
+\r
+ // Detect Word content and process it more aggressive\r
+ if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {\r
+ o.wordContent = true; // Mark the pasted contents as word specific content\r
+ //console.log('Word contents detected.');\r
+\r
+ // Process away some basic content\r
+ process([\r
+ /^\s*( )+/gi, // entities at the start of contents\r
+ /( |<br[^>]*>)+\s*$/gi // entities at the end of contents\r
+ ]);\r
+\r
+ if (getParam(ed, "paste_convert_headers_to_strong")) {\r
+ h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");\r
+ }\r
+\r
+ if (getParam(ed, "paste_convert_middot_lists")) {\r
+ process([\r
+ [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker\r
+ [/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol spans to item markers\r
+ ]);\r
+ }\r
+\r
+ process([\r
+ // Word comments like conditional comments etc\r
+ /<!--[\s\S]+?-->/gi,\r
+\r
+ // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags\r
+ /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,\r
+\r
+ // Convert <s> into <strike> for line-though\r
+ [/<(\/?)s>/gi, "<$1strike>"],\r
+\r
+ // Replace nsbp entites to char since it's easier to handle\r
+ [/ /gi, "\u00a0"]\r
+ ]);\r
+\r
+ // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.\r
+ // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.\r
+ do {\r
+ len = h.length;\r
+ h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");\r
+ } while (len != h.length);\r
+\r
+ // Remove all spans if no styles is to be retained\r
+ if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {\r
+ h = h.replace(/<\/?span[^>]*>/gi, "");\r
+ } else {\r
+ // We're keeping styles, so at least clean them up.\r
+ // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx\r
+\r
+ process([\r
+ // Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length\r
+ [/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,\r
+ function(str, spaces) {\r
+ return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";\r
+ }\r
+ ],\r
+\r
+ // Examine all styles: delete junk, transform some, and keep the rest\r
+ [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,\r
+ function(str, tag, style) {\r
+ var n = [],\r
+ i = 0,\r
+ s = explode(trim(style).replace(/"/gi, "'"), ";");\r
+\r
+ // Examine each style definition within the tag's style attribute\r
+ each(s, function(v) {\r
+ var name, value,\r
+ parts = explode(v, ":");\r
+\r
+ function ensureUnits(v) {\r
+ return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";\r
+ }\r
+\r
+ if (parts.length == 2) {\r
+ name = parts[0].toLowerCase();\r
+ value = parts[1].toLowerCase();\r
+\r
+ // Translate certain MS Office styles into their CSS equivalents\r
+ switch (name) {\r
+ case "mso-padding-alt":\r
+ case "mso-padding-top-alt":\r
+ case "mso-padding-right-alt":\r
+ case "mso-padding-bottom-alt":\r
+ case "mso-padding-left-alt":\r
+ case "mso-margin-alt":\r
+ case "mso-margin-top-alt":\r
+ case "mso-margin-right-alt":\r
+ case "mso-margin-bottom-alt":\r
+ case "mso-margin-left-alt":\r
+ case "mso-table-layout-alt":\r
+ case "mso-height":\r
+ case "mso-width":\r
+ case "mso-vertical-align-alt":\r
+ n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);\r
+ return;\r
+\r
+ case "horiz-align":\r
+ n[i++] = "text-align:" + value;\r
+ return;\r
+\r
+ case "vert-align":\r
+ n[i++] = "vertical-align:" + value;\r
+ return;\r
+\r
+ case "font-color":\r
+ case "mso-foreground":\r
+ n[i++] = "color:" + value;\r
+ return;\r
+\r
+ case "mso-background":\r
+ case "mso-highlight":\r
+ n[i++] = "background:" + value;\r
+ return;\r
+\r
+ case "mso-default-height":\r
+ n[i++] = "min-height:" + ensureUnits(value);\r
+ return;\r
+\r
+ case "mso-default-width":\r
+ n[i++] = "min-width:" + ensureUnits(value);\r
+ return;\r
+\r
+ case "mso-padding-between-alt":\r
+ n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);\r
+ return;\r
+\r
+ case "text-line-through":\r
+ if ((value == "single") || (value == "double")) {\r
+ n[i++] = "text-decoration:line-through";\r
+ }\r
+ return;\r
+\r
+ case "mso-zero-height":\r
+ if (value == "yes") {\r
+ n[i++] = "display:none";\r
+ }\r
+ return;\r
+ }\r
+\r
+ // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name\r
+ if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {\r
+ return;\r
+ }\r
+\r
+ // If it reached this point, it must be a valid CSS style\r
+ n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case\r
+ }\r
+ });\r
+\r
+ // If style attribute contained any valid styles the re-write it; otherwise delete style attribute.\r
+ if (i > 0) {\r
+ return tag + ' style="' + n.join(';') + '"';\r
+ } else {\r
+ return tag;\r
+ }\r
+ }\r
+ ]\r
+ ]);\r
+ }\r
+ }\r
+\r
+ // Replace headers with <strong>\r
+ if (getParam(ed, "paste_convert_headers_to_strong")) {\r
+ process([\r
+ [/<h[1-6][^>]*>/gi, "<p><strong>"],\r
+ [/<\/h[1-6][^>]*>/gi, "</strong></p>"]\r
+ ]);\r
+ }\r
+\r
+ // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").\r
+ // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.\r
+ stripClass = getParam(ed, "paste_strip_class_attributes");\r
+\r
+ if (stripClass !== "none") {\r
+ function removeClasses(match, g1) {\r
+ if (stripClass === "all")\r
+ return '';\r
+\r
+ var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),\r
+ function(v) {\r
+ return (/^(?!mso)/i.test(v));\r
+ }\r
+ );\r
+\r
+ return cls.length ? ' class="' + cls.join(" ") + '"' : '';\r
+ };\r
+\r
+ h = h.replace(/ class="([^"]+)"/gi, removeClasses);\r
+ h = h.replace(/ class=(\w+)/gi, removeClasses);\r
+ }\r
+\r
+ // Remove spans option\r
+ if (getParam(ed, "paste_remove_spans")) {\r
+ h = h.replace(/<\/?span[^>]*>/gi, "");\r
+ }\r
+\r
+ //console.log('After preprocess:' + h);\r
+\r
+ o.content = h;\r
+ },\r
+\r
+ /**\r
+ * Various post process items.\r
+ */\r
+ _postProcess : function(pl, o) {\r
+ var t = this, ed = t.editor, dom = ed.dom, styleProps;\r
+\r
+ if (o.wordContent) {\r
+ // Remove named anchors or TOC links\r
+ each(dom.select('a', o.node), function(a) {\r
+ if (!a.href || a.href.indexOf('#_Toc') != -1)\r
+ dom.remove(a, 1);\r
+ });\r
+\r
+ if (getParam(ed, "paste_convert_middot_lists")) {\r
+ t._convertLists(pl, o);\r
+ }\r
+\r
+ // Process styles\r
+ styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties\r
+\r
+ // Process only if a string was specified and not equal to "all" or "*"\r
+ if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {\r
+ styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));\r
+\r
+ // Retains some style properties\r
+ each(dom.select('*', o.node), function(el) {\r
+ var newStyle = {}, npc = 0, i, sp, sv;\r
+\r
+ // Store a subset of the existing styles\r
+ if (styleProps) {\r
+ for (i = 0; i < styleProps.length; i++) {\r
+ sp = styleProps[i];\r
+ sv = dom.getStyle(el, sp);\r
+\r
+ if (sv) {\r
+ newStyle[sp] = sv;\r
+ npc++;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Remove all of the existing styles\r
+ dom.setAttrib(el, 'style', '');\r
+\r
+ if (styleProps && npc > 0)\r
+ dom.setStyles(el, newStyle); // Add back the stored subset of styles\r
+ else // Remove empty span tags that do not have class attributes\r
+ if (el.nodeName == 'SPAN' && !el.className)\r
+ dom.remove(el, true);\r
+ });\r
+ }\r
+ }\r
+\r
+ // Remove all style information or only specifically on WebKit to avoid the style bug on that browser\r
+ if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {\r
+ each(dom.select('*[style]', o.node), function(el) {\r
+ el.removeAttribute('style');\r
+ el.removeAttribute('_mce_style');\r
+ });\r
+ } else {\r
+ if (tinymce.isWebKit) {\r
+ // We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />\r
+ // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles\r
+ each(dom.select('*', o.node), function(el) {\r
+ el.removeAttribute('_mce_style');\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ /**\r
+ * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.\r
+ */\r
+ _convertLists : function(pl, o) {\r
+ var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;\r
+\r
+ // Convert middot lists into real semantic lists\r
+ each(dom.select('p', o.node), function(p) {\r
+ var sib, val = '', type, html, idx, parents;\r
+\r
+ // Get text node value at beginning of paragraph\r
+ for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)\r
+ val += sib.nodeValue;\r
+\r
+ val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0');\r
+\r
+ // Detect unordered lists look for bullets\r
+ if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val))\r
+ type = 'ul';\r
+\r
+ // Detect ordered lists 1., a. or ixv.\r
+ if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(val))\r
+ type = 'ol';\r
+\r
+ // Check if node value matches the list pattern: o \r
+ if (type) {\r
+ margin = parseFloat(p.style.marginLeft || 0);\r
+\r
+ if (margin > lastMargin)\r
+ levels.push(margin);\r
+\r
+ if (!listElm || type != lastType) {\r
+ listElm = dom.create(type);\r
+ dom.insertAfter(listElm, p);\r
+ } else {\r
+ // Nested list element\r
+ if (margin > lastMargin) {\r
+ listElm = li.appendChild(dom.create(type));\r
+ } else if (margin < lastMargin) {\r
+ // Find parent level based on margin value\r
+ idx = tinymce.inArray(levels, margin);\r
+ parents = dom.getParents(listElm.parentNode, type);\r
+ listElm = parents[parents.length - 1 - idx] || listElm;\r
+ }\r
+ }\r
+\r
+ // Remove middot or number spans if they exists\r
+ each(dom.select('span', p), function(span) {\r
+ var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');\r
+\r
+ // Remove span with the middot or the number\r
+ if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html))\r
+ dom.remove(span);\r
+ else if (/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(html))\r
+ dom.remove(span);\r
+ });\r
+\r
+ html = p.innerHTML;\r
+\r
+ // Remove middot/list items\r
+ if (type == 'ul')\r
+ html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/, '');\r
+ else\r
+ html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, '');\r
+\r
+ // Create li and add paragraph data into the new li\r
+ li = listElm.appendChild(dom.create('li', 0, html));\r
+ dom.remove(p);\r
+\r
+ lastMargin = margin;\r
+ lastType = type;\r
+ } else\r
+ listElm = lastMargin = 0; // End list element\r
+ });\r
+\r
+ // Remove any left over makers\r
+ html = o.node.innerHTML;\r
+ if (html.indexOf('__MCE_ITEM__') != -1)\r
+ o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');\r
+ },\r
+\r
+ /**\r
+ * This method will split the current block parent and insert the contents inside the split position.\r
+ * This logic can be improved so text nodes at the start/end remain in the start/end block elements\r
+ */\r
+ _insertBlockContent : function(ed, dom, content) {\r
+ var parentBlock, marker, sel = ed.selection, last, elm, vp, y, elmHeight, markerId = 'mce_marker';\r
+\r
+ function select(n) {\r
+ var r;\r
+\r
+ if (tinymce.isIE) {\r
+ r = ed.getDoc().body.createTextRange();\r
+ r.moveToElementText(n);\r
+ r.collapse(false);\r
+ r.select();\r
+ } else {\r
+ sel.select(n, 1);\r
+ sel.collapse(false);\r
+ }\r
+ }\r
+\r
+ // Insert a marker for the caret position\r
+ this._insert('<span id="' + markerId + '"></span>', 1);\r
+ marker = dom.get(markerId);\r
+ parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td');\r
+\r
+ // If it's a parent block but not a table cell\r
+ if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) {\r
+ // Split parent block\r
+ marker = dom.split(parentBlock, marker);\r
+\r
+ // Insert nodes before the marker\r
+ each(dom.create('div', 0, content).childNodes, function(n) {\r
+ last = marker.parentNode.insertBefore(n.cloneNode(true), marker);\r
+ });\r
+\r
+ // Move caret after marker\r
+ select(last);\r
+ } else {\r
+ dom.setOuterHTML(marker, content);\r
+ sel.select(ed.getBody(), 1);\r
+ sel.collapse(0);\r
+ }\r
+\r
+ // Remove marker if it's left\r
+ while (elm = dom.get(markerId))\r
+ dom.remove(elm);\r
+\r
+ // Get element, position and height\r
+ elm = sel.getStart();\r
+ vp = dom.getViewPort(ed.getWin());\r
+ y = ed.dom.getPos(elm).y;\r
+ elmHeight = elm.clientHeight;\r
+\r
+ // Is element within viewport if not then scroll it into view\r
+ if (y < vp.y || y + elmHeight > vp.y + vp.h)\r
+ ed.getDoc().body.scrollTop = y < vp.y ? y : y - vp.h + 25;\r
+ },\r
+\r
+ /**\r
+ * Inserts the specified contents at the caret position.\r
+ */\r
+ _insert : function(h, skip_undo) {\r
+ var ed = this.editor, r = ed.selection.getRng();\r
+\r
+ // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.\r
+ if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)\r
+ ed.getDoc().execCommand('Delete', false, null);\r
+\r
+ // It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents\r
+ ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, h, {skip_undo : skip_undo});\r
+ },\r
+\r
+ /**\r
+ * Instead of the old plain text method which tried to re-create a paste operation, the\r
+ * new approach adds a plain text mode toggle switch that changes the behavior of paste.\r
+ * This function is passed the same input that the regular paste plugin produces.\r
+ * It performs additional scrubbing and produces (and inserts) the plain text.\r
+ * This approach leverages all of the great existing functionality in the paste\r
+ * plugin, and requires minimal changes to add the new functionality.\r
+ * Speednet - June 2009\r
+ */\r
+ _insertPlainText : function(ed, dom, h) {\r
+ var i, len, pos, rpos, node, breakElms, before, after,\r
+ w = ed.getWin(),\r
+ d = ed.getDoc(),\r
+ sel = ed.selection,\r
+ is = tinymce.is,\r
+ inArray = tinymce.inArray,\r
+ linebr = getParam(ed, "paste_text_linebreaktype"),\r
+ rl = getParam(ed, "paste_text_replacements");\r
+\r
+ function process(items) {\r
+ each(items, function(v) {\r
+ if (v.constructor == RegExp)\r
+ h = h.replace(v, "");\r
+ else\r
+ h = h.replace(v[0], v[1]);\r
+ });\r
+ };\r
+\r
+ if ((typeof(h) === "string") && (h.length > 0)) {\r
+ if (!entities)\r
+ entities = ("34,quot,38,amp,39,apos,60,lt,62,gt," + ed.serializer.settings.entities).split(",");\r
+\r
+ // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line\r
+ if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) {\r
+ process([\r
+ /[\n\r]+/g\r
+ ]);\r
+ } else {\r
+ // Otherwise just get rid of carriage returns (only need linefeeds)\r
+ process([\r
+ /\r+/g\r
+ ]);\r
+ }\r
+\r
+ process([\r
+ [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them\r
+ [/<br[^>]*>|<\/tr>/gi, "\n"], // Single linebreak for <br /> tags and table rows\r
+ [/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"], // Table cells get tabs betweem them\r
+ /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags\r
+ [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*)\r
+ [\r
+ // HTML entity\r
+ /&(#\d+|[a-z0-9]{1,10});/gi,\r
+\r
+ // Replace with actual character\r
+ function(e, s) {\r
+ if (s.charAt(0) === "#") {\r
+ return String.fromCharCode(s.slice(1));\r
+ }\r
+ else {\r
+ return ((e = inArray(entities, s)) > 0)? String.fromCharCode(entities[e-1]) : " ";\r
+ }\r
+ }\r
+ ],\r
+ [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars.\r
+ [/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks\r
+ /^\s+|\s+$/g // Trim the front & back\r
+ ]);\r
+\r
+ h = dom.encode(h);\r
+\r
+ // Delete any highlighted text before pasting\r
+ if (!sel.isCollapsed()) {\r
+ d.execCommand("Delete", false, null);\r
+ }\r
+\r
+ // Perform default or custom replacements\r
+ if (is(rl, "array") || (is(rl, "array"))) {\r
+ process(rl);\r
+ }\r
+ else if (is(rl, "string")) {\r
+ process(new RegExp(rl, "gi"));\r
+ }\r
+\r
+ // Treat paragraphs as specified in the config\r
+ if (linebr == "none") {\r
+ process([\r
+ [/\n+/g, " "]\r
+ ]);\r
+ }\r
+ else if (linebr == "br") {\r
+ process([\r
+ [/\n/g, "<br />"]\r
+ ]);\r
+ }\r
+ else {\r
+ process([\r
+ /^\s+|\s+$/g,\r
+ [/\n\n/g, "</p><p>"],\r
+ [/\n/g, "<br />"]\r
+ ]);\r
+ }\r
+\r
+ // This next piece of code handles the situation where we're pasting more than one paragraph of plain\r
+ // text, and we are pasting the content into the middle of a block node in the editor. The block\r
+ // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining).\r
+ // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the\r
+ // pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between\r
+ // "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and\r
+ // now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the\r
+ // plain text take the same style as the existing paragraph.)\r
+ if ((pos = h.indexOf("</p><p>")) != -1) {\r
+ rpos = h.lastIndexOf("</p><p>");\r
+ node = sel.getNode(); \r
+ breakElms = []; // Get list of elements to break \r
+\r
+ do {\r
+ if (node.nodeType == 1) {\r
+ // Don't break tables and break at body\r
+ if (node.nodeName == "TD" || node.nodeName == "BODY") {\r
+ break;\r
+ }\r
+\r
+ breakElms[breakElms.length] = node;\r
+ }\r
+ } while (node = node.parentNode);\r
+\r
+ // Are we in the middle of a block node?\r
+ if (breakElms.length > 0) {\r
+ before = h.substring(0, pos);\r
+ after = "";\r
+\r
+ for (i=0, len=breakElms.length; i<len; i++) {\r
+ before += "</" + breakElms[i].nodeName.toLowerCase() + ">";\r
+ after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">";\r
+ }\r
+\r
+ if (pos == rpos) {\r
+ h = before + after + h.substring(pos+7);\r
+ }\r
+ else {\r
+ h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Insert content at the caret, plus add a marker for repositioning the caret\r
+ ed.execCommand("mceInsertRawHTML", false, h + '<span id="_plain_text_marker"> </span>');\r
+\r
+ // Reposition the caret to the marker, which was placed immediately after the inserted content.\r
+ // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers.\r
+ // The second part of the code scrolls the content up if the caret is positioned off-screen.\r
+ // This is only necessary for WebKit browsers, but it doesn't hurt to use for all.\r
+ window.setTimeout(function() {\r
+ var marker = dom.get('_plain_text_marker'),\r
+ elm, vp, y, elmHeight;\r
+\r
+ sel.select(marker, false);\r
+ d.execCommand("Delete", false, null);\r
+ marker = null;\r
+\r
+ // Get element, position and height\r
+ elm = sel.getStart();\r
+ vp = dom.getViewPort(w);\r
+ y = dom.getPos(elm).y;\r
+ elmHeight = elm.clientHeight;\r
+\r
+ // Is element within viewport if not then scroll it into view\r
+ if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) {\r
+ d.body.scrollTop = y < vp.y ? y : y - vp.h + 25;\r
+ }\r
+ }, 0);\r
+ }\r
+ },\r
+\r
+ /**\r
+ * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.\r
+ */\r
+ _legacySupport : function() {\r
+ var t = this, ed = t.editor;\r
+\r
+ // Register command(s) for backwards compatibility\r
+ ed.addCommand("mcePasteWord", function() {\r
+ ed.windowManager.open({\r
+ file: t.url + "/pasteword.htm",\r
+ width: parseInt(getParam(ed, "paste_dialog_width")),\r
+ height: parseInt(getParam(ed, "paste_dialog_height")),\r
+ inline: 1\r
+ });\r
+ });\r
+\r
+ if (getParam(ed, "paste_text_use_dialog")) {\r
+ ed.addCommand("mcePasteText", function() {\r
+ ed.windowManager.open({\r
+ file : t.url + "/pastetext.htm",\r
+ width: parseInt(getParam(ed, "paste_dialog_width")),\r
+ height: parseInt(getParam(ed, "paste_dialog_height")),\r
+ inline : 1\r
+ });\r
+ });\r
+ }\r
+\r
+ // Register button for backwards compatibility\r
+ ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);\r
+})();\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var PasteTextDialog = {\r
+ init : function() {\r
+ this.resize();\r
+ },\r
+\r
+ insert : function() {\r
+ var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;\r
+\r
+ // Convert linebreaks into paragraphs\r
+ if (document.getElementById('linebreaks').checked) {\r
+ lines = h.split(/\r?\n/);\r
+ if (lines.length > 1) {\r
+ h = '';\r
+ tinymce.each(lines, function(row) {\r
+ h += '<p>' + row + '</p>';\r
+ });\r
+ }\r
+ }\r
+\r
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ resize : function() {\r
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
+\r
+ el = document.getElementById('content');\r
+\r
+ el.style.width = (vp.w - 20) + 'px';\r
+ el.style.height = (vp.h - 90) + 'px';\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var PasteWordDialog = {\r
+ init : function() {\r
+ var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';\r
+\r
+ // Create iframe\r
+ el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';\r
+ ifr = document.getElementById('iframe');\r
+ doc = ifr.contentWindow.document;\r
+\r
+ // Force absolute CSS urls\r
+ css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];\r
+ css = css.concat(tinymce.explode(ed.settings.content_css) || []);\r
+ tinymce.each(css, function(u) {\r
+ cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';\r
+ });\r
+\r
+ // Write content into iframe\r
+ doc.open();\r
+ doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');\r
+ doc.close();\r
+\r
+ doc.designMode = 'on';\r
+ this.resize();\r
+\r
+ window.setTimeout(function() {\r
+ ifr.contentWindow.focus();\r
+ }, 10);\r
+ },\r
+\r
+ insert : function() {\r
+ var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;\r
+\r
+ tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ resize : function() {\r
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;\r
+\r
+ el = document.getElementById('iframe');\r
+\r
+ if (el) {\r
+ el.style.width = (vp.w - 20) + 'px';\r
+ el.style.height = (vp.h - 90) + 'px';\r
+ }\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.paste_dlg',{\r
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",\r
+text_linebreaks:"Keep linebreaks",\r
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."\r
+});
\ No newline at end of file
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#paste.paste_text_desc}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/pastetext.js"></script>\r
+</head>\r
+<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">\r
+ <form name="source" onsubmit="return PasteTextDialog.insert();" action="#">\r
+ <div style="float: left" class="title">{#paste.paste_text_desc}</div>\r
+\r
+ <div style="float: right">\r
+ <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+\r
+ <div>{#paste_dlg.text_title}</div>\r
+\r
+ <textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" name="insert" value="{#insert}" id="insert" />\r
+ <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />\r
+ </div>\r
+ </form>\r
+</body> \r
+</html>
\ No newline at end of file
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#paste.paste_word_desc}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/pasteword.js"></script>\r
+</head>\r
+<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">\r
+ <form name="source" onsubmit="return PasteWordDialog.insert();" action="#">\r
+ <div class="title">{#paste.paste_word_desc}</div>\r
+\r
+ <div>{#paste_dlg.word_title}</div>\r
+\r
+ <div id="iframecontainer"></div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})();
\ No newline at end of file
--- /dev/null
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ tinymce.create('tinymce.plugins.Preview', {
+ init : function(ed, url) {
+ var t = this, css = tinymce.explode(ed.settings.content_css);
+
+ t.editor = ed;
+
+ // Force absolute CSS urls
+ tinymce.each(css, function(u, k) {
+ css[k] = ed.documentBaseURI.toAbsolute(u);
+ });
+
+ ed.addCommand('mcePreview', function() {
+ ed.windowManager.open({
+ file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
+ width : parseInt(ed.getParam("plugin_preview_width", "550")),
+ height : parseInt(ed.getParam("plugin_preview_height", "600")),
+ resizable : "yes",
+ scrollbars : "yes",
+ popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
+ inline : ed.getParam("plugin_preview_inline", 1)
+ }, {
+ base : ed.documentBaseURI.getURI()
+ });
+ });
+
+ ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'Preview',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
+})();
\ No newline at end of file
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<script language="javascript" src="../../tiny_mce_popup.js"></script>\r
+<script type="text/javascript" src="jscripts/embed.js"></script>\r
+<script type="text/javascript">\r
+tinyMCEPopup.onInit.add(function(ed) {\r
+ var dom = tinyMCEPopup.dom;\r
+\r
+ // Load editor content_css\r
+ tinymce.each(ed.settings.content_css.split(','), function(u) {\r
+ dom.loadCSS(ed.documentBaseURI.toAbsolute(u));\r
+ });\r
+\r
+ // Place contents inside div container\r
+ dom.setHTML('content', ed.getContent());\r
+});\r
+</script>\r
+<title>Example of a custom preview page</title>\r
+</head>\r
+<body>\r
+\r
+Editor contents: <br />\r
+<div id="content">\r
+<!-- Gets filled with editor contents -->\r
+</div>\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+/**\r
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.\r
+ */\r
+\r
+function writeFlash(p) {\r
+ writeEmbed(\r
+ 'D27CDB6E-AE6D-11cf-96B8-444553540000',\r
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+ 'application/x-shockwave-flash',\r
+ p\r
+ );\r
+}\r
+\r
+function writeShockWave(p) {\r
+ writeEmbed(\r
+ '166B1BCA-3F9C-11CF-8075-444553540000',\r
+ 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',\r
+ 'application/x-director',\r
+ p\r
+ );\r
+}\r
+\r
+function writeQuickTime(p) {\r
+ writeEmbed(\r
+ '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',\r
+ 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',\r
+ 'video/quicktime',\r
+ p\r
+ );\r
+}\r
+\r
+function writeRealMedia(p) {\r
+ writeEmbed(\r
+ 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',\r
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',\r
+ 'audio/x-pn-realaudio-plugin',\r
+ p\r
+ );\r
+}\r
+\r
+function writeWindowsMedia(p) {\r
+ p.url = p.src;\r
+ writeEmbed(\r
+ '6BF52A52-394A-11D3-B153-00C04F79FAA6',\r
+ 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',\r
+ 'application/x-mplayer2',\r
+ p\r
+ );\r
+}\r
+\r
+function writeEmbed(cls, cb, mt, p) {\r
+ var h = '', n;\r
+\r
+ h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';\r
+ h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';\r
+ h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';\r
+ h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';\r
+ h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';\r
+ h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';\r
+ h += '>';\r
+\r
+ for (n in p)\r
+ h += '<param name="' + n + '" value="' + p[n] + '">';\r
+\r
+ h += '<embed type="' + mt + '"';\r
+\r
+ for (n in p)\r
+ h += n + '="' + p[n] + '" ';\r
+\r
+ h += '></embed></object>';\r
+\r
+ document.write(h);\r
+}\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+<script type="text/javascript" src="jscripts/embed.js"></script>\r
+<script type="text/javascript"><!--\r
+document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');\r
+// -->\r
+</script>\r
+<title>{#preview.preview_desc}</title>\r
+</head>\r
+<body id="content">\r
+<script type="text/javascript">\r
+ document.write(tinyMCEPopup.editor.getContent());\r
+</script>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.Print', {\r
+ init : function(ed, url) {\r
+ ed.addCommand('mcePrint', function() {\r
+ ed.getWin().print();\r
+ });\r
+\r
+ ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'});\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Print',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('print', tinymce.plugins.Print);\r
+})();\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.Save', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceSave', t._save, t);\r
+ ed.addCommand('mceCancel', t._cancel, t);\r
+\r
+ // Register buttons\r
+ ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'});\r
+ ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'});\r
+\r
+ ed.onNodeChange.add(t._nodeChange, t);\r
+ ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave');\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Save',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _nodeChange : function(ed, cm, n) {\r
+ var ed = this.editor;\r
+\r
+ if (ed.getParam('save_enablewhendirty')) {\r
+ cm.setDisabled('save', !ed.isDirty());\r
+ cm.setDisabled('cancel', !ed.isDirty());\r
+ }\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _save : function() {\r
+ var ed = this.editor, formObj, os, i, elementId;\r
+\r
+ formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form');\r
+\r
+ if (ed.getParam("save_enablewhendirty") && !ed.isDirty())\r
+ return;\r
+\r
+ tinyMCE.triggerSave();\r
+\r
+ // Use callback instead\r
+ if (os = ed.getParam("save_onsavecallback")) {\r
+ if (ed.execCallback('save_onsavecallback', ed)) {\r
+ ed.startContent = tinymce.trim(ed.getContent({format : 'raw'}));\r
+ ed.nodeChanged();\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
+ if (formObj) {\r
+ ed.isNotDirty = true;\r
+\r
+ if (formObj.onsubmit == null || formObj.onsubmit() != false)\r
+ formObj.submit();\r
+\r
+ ed.nodeChanged();\r
+ } else\r
+ ed.windowManager.alert("Error: No form element found.");\r
+ },\r
+\r
+ _cancel : function() {\r
+ var ed = this.editor, os, h = tinymce.trim(ed.startContent);\r
+\r
+ // Use callback instead\r
+ if (os = ed.getParam("save_oncancelcallback")) {\r
+ ed.execCallback('save_oncancelcallback', ed);\r
+ return;\r
+ }\r
+\r
+ ed.setContent(h);\r
+ ed.undoManager.clear();\r
+ ed.nodeChanged();\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('save', tinymce.plugins.Save);\r
+})();
\ No newline at end of file
--- /dev/null
+.panel_wrapper {height:85px;}\r
+.panel_wrapper div.current {height:85px;}\r
+\r
+/* IE */\r
+* html .panel_wrapper {height:100px;}\r
+* html .panel_wrapper div.current {height:100px;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.SearchReplacePlugin', {\r
+ init : function(ed, url) {\r
+ function open(m) {\r
+ ed.windowManager.open({\r
+ file : url + '/searchreplace.htm',\r
+ width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),\r
+ height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),\r
+ inline : 1,\r
+ auto_focus : 0\r
+ }, {\r
+ mode : m,\r
+ search_string : ed.selection.getContent({format : 'text'}),\r
+ plugin_url : url\r
+ });\r
+ };\r
+\r
+ // Register commands\r
+ ed.addCommand('mceSearch', function() {\r
+ open('search');\r
+ });\r
+\r
+ ed.addCommand('mceReplace', function() {\r
+ open('replace');\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});\r
+ ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});\r
+\r
+ ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Search/Replace',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var SearchReplaceDialog = {\r
+ init : function(ed) {\r
+ var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");\r
+\r
+ this.switchMode(m);\r
+\r
+ f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");\r
+\r
+ // Focus input field\r
+ f[m + '_panel_searchstring'].focus();\r
+ },\r
+\r
+ switchMode : function(m) {\r
+ var f, lm = this.lastMode;\r
+\r
+ if (lm != m) {\r
+ f = document.forms[0];\r
+\r
+ if (lm) {\r
+ f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;\r
+ f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;\r
+ f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;\r
+ f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;\r
+ }\r
+\r
+ mcTabs.displayTab(m + '_tab', m + '_panel');\r
+ document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";\r
+ document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";\r
+ this.lastMode = m;\r
+ }\r
+ },\r
+\r
+ searchNext : function(a) {\r
+ var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;\r
+\r
+ // Get input\r
+ f = document.forms[0];\r
+ s = f[m + '_panel_searchstring'].value;\r
+ b = f[m + '_panel_backwardsu'].checked;\r
+ ca = f[m + '_panel_casesensitivebox'].checked;\r
+ rs = f['replace_panel_replacestring'].value;\r
+\r
+ if (s == '')\r
+ return;\r
+\r
+ function fix() {\r
+ // Correct Firefox graphics glitches\r
+ r = se.getRng().cloneRange();\r
+ ed.getDoc().execCommand('SelectAll', false, null);\r
+ se.setRng(r);\r
+ };\r
+\r
+ function replace() {\r
+ if (tinymce.isIE)\r
+ ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE\r
+ else\r
+ ed.getDoc().execCommand('InsertHTML', false, rs);\r
+ };\r
+\r
+ // IE flags\r
+ if (ca)\r
+ fl = fl | 4;\r
+\r
+ switch (a) {\r
+ case 'all':\r
+ // Move caret to beginning of text\r
+ ed.execCommand('SelectAll');\r
+ ed.selection.collapse(true);\r
+\r
+ if (tinymce.isIE) {\r
+ while (r.findText(s, b ? -1 : 1, fl)) {\r
+ r.scrollIntoView();\r
+ r.select();\r
+ replace();\r
+ fo = 1;\r
+\r
+ if (b) {\r
+ r.moveEnd("character", -(rs.length)); // Otherwise will loop forever\r
+ }\r
+ }\r
+\r
+ tinyMCEPopup.storeSelection();\r
+ } else {\r
+ while (w.find(s, ca, b, false, false, false, false)) {\r
+ replace();\r
+ fo = 1;\r
+ }\r
+ }\r
+\r
+ if (fo)\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));\r
+ else\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+\r
+ return;\r
+\r
+ case 'current':\r
+ if (!ed.selection.isCollapsed())\r
+ replace();\r
+\r
+ break;\r
+ }\r
+\r
+ se.collapse(b);\r
+ r = se.getRng();\r
+\r
+ // Whats the point\r
+ if (!s)\r
+ return;\r
+\r
+ if (tinymce.isIE) {\r
+ if (r.findText(s, b ? -1 : 1, fl)) {\r
+ r.scrollIntoView();\r
+ r.select();\r
+ } else\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+\r
+ tinyMCEPopup.storeSelection();\r
+ } else {\r
+ if (!w.find(s, ca, b, false, false, false, false))\r
+ tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));\r
+ else\r
+ fix();\r
+ }\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.searchreplace_dlg',{\r
+searchnext_desc:"Find again",\r
+notfound:"The search has been completed. The search string could not be found.",\r
+search_title:"Find",\r
+replace_title:"Find/Replace",\r
+allreplaced:"All occurrences of the search string were replaced.",\r
+findwhat:"Find what",\r
+replacewith:"Replace with",\r
+direction:"Direction",\r
+up:"Up",\r
+down:"Down",\r
+mcase:"Match case",\r
+findnext:"Find next",\r
+replace:"Replace",\r
+replaceall:"Replace all"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#searchreplace_dlg.replace_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="js/searchreplace.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/searchreplace.css" />\r
+</head>\r
+<body style="display:none;">\r
+<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>\r
+ <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="search_panel" class="panel">\r
+ <table border="0" cellspacing="0" cellpadding="2">\r
+ <tr>\r
+ <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>\r
+ <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellspacing="0" cellpadding="0" class="direction">\r
+ <tr>\r
+ <td><label>{#searchreplace_dlg.direction}</label></td>\r
+ <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>\r
+ <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>\r
+ <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>\r
+ <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>\r
+ <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+\r
+ <div id="replace_panel" class="panel">\r
+ <table border="0" cellspacing="0" cellpadding="2">\r
+ <tr>\r
+ <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>\r
+ <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>\r
+ <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellspacing="0" cellpadding="0" class="direction">\r
+ <tr>\r
+ <td><label>{#searchreplace_dlg.direction}</label></td>\r
+ <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>\r
+ <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>\r
+ <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>\r
+ <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td colspan="2">\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>\r
+ <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />\r
+ <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />\r
+ <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;}\r
--- /dev/null
+(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});e.onInit.add(function(){if(e.settings.content_css!==false){e.dom.loadCSS(f+"/css/content.css")}});e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBookmark();c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(o){var i,h,g,f,e,n="",k=this.editor,p=this._getSeparators(),j=k.dom,d=[];var l=k.selection,m=l.getBookmark();c(o,function(q){n+=(n?"|":"")+q});i=new RegExp("(["+p+"])("+n+")(["+p+"])","g");h=new RegExp("^("+n+")","g");g=new RegExp("("+n+")(["+p+"]?)$","g");f=new RegExp("^("+n+")(["+p+"]?)$","g");e=new RegExp("("+n+")(["+p+"])","g");this._walk(this.editor.getBody(),function(q){if(q.nodeType==3){d.push(q)}});c(d,function(r){var q;if(r.nodeType==3){q=r.nodeValue;if(i.test(q)||h.test(q)||g.test(q)||f.test(q)){q=j.encode(q);q=q.replace(e,'<span class="mceItemHiddenSpellWord">$1</span>$2');q=q.replace(g,'<span class="mceItemHiddenSpellWord">$1</span>$2');j.replace(j.create("span",{"class":"mceItemHidden"},q),r)}}});l.moveToBookmark(m)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){l=b.getPos(h.getContentAreaContainer());d=h.controlManager.createDropMenu("spellcheckermenu",{offset_x:l.x,offset_y:l.y,"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;\r
+\r
+ tinymce.create('tinymce.plugins.SpellcheckerPlugin', {\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Spellchecker',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ init : function(ed, url) {\r
+ var t = this, cm;\r
+\r
+ t.url = url;\r
+ t.editor = ed;\r
+ t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}");\r
+\r
+ if (t.rpcUrl == '{backend}') {\r
+ // Sniff if the browser supports native spellchecking (Don't know of a better way)\r
+ if (tinymce.isIE)\r
+ return;\r
+\r
+ t.hasSupport = true;\r
+\r
+ // Disable the context menu when spellchecking is active\r
+ ed.onContextMenu.addToTop(function(ed, e) {\r
+ if (t.active)\r
+ return false;\r
+ });\r
+ }\r
+\r
+ // Register commands\r
+ ed.addCommand('mceSpellCheck', function() {\r
+ if (t.rpcUrl == '{backend}') {\r
+ // Enable/disable native spellchecker\r
+ t.editor.getBody().spellcheck = t.active = !t.active;\r
+ return;\r
+ }\r
+\r
+ if (!t.active) {\r
+ ed.setProgressState(1);\r
+ t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {\r
+ if (r.length > 0) {\r
+ t.active = 1;\r
+ t._markWords(r);\r
+ ed.setProgressState(0);\r
+ ed.nodeChanged();\r
+ } else {\r
+ ed.setProgressState(0);\r
+\r
+ if (ed.getParam('spellchecker_report_no_misspellings', true))\r
+ ed.windowManager.alert('spellchecker.no_mpell');\r
+ }\r
+ });\r
+ } else\r
+ t._done();\r
+ });\r
+\r
+ ed.onInit.add(function() {\r
+ if (ed.settings.content_css !== false)\r
+ ed.dom.loadCSS(url + '/css/content.css');\r
+ });\r
+\r
+ ed.onClick.add(t._showMenu, t);\r
+ ed.onContextMenu.add(t._showMenu, t);\r
+ ed.onBeforeGetContent.add(function() {\r
+ if (t.active)\r
+ t._removeWords();\r
+ });\r
+\r
+ ed.onNodeChange.add(function(ed, cm) {\r
+ cm.setActive('spellchecker', t.active);\r
+ });\r
+\r
+ ed.onSetContent.add(function() {\r
+ t._done();\r
+ });\r
+\r
+ ed.onBeforeGetContent.add(function() {\r
+ t._done();\r
+ });\r
+\r
+ ed.onBeforeExecCommand.add(function(ed, cmd) {\r
+ if (cmd == 'mceFullScreen')\r
+ t._done();\r
+ });\r
+\r
+ // Find selected language\r
+ t.languages = {};\r
+ each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) {\r
+ if (k.indexOf('+') === 0) {\r
+ k = k.substring(1);\r
+ t.selectedLang = v;\r
+ }\r
+\r
+ t.languages[k] = v;\r
+ });\r
+ },\r
+\r
+ createControl : function(n, cm) {\r
+ var t = this, c, ed = t.editor;\r
+\r
+ if (n == 'spellchecker') {\r
+ // Use basic button if we use the native spellchecker\r
+ if (t.rpcUrl == '{backend}') {\r
+ // Create simple toggle button if we have native support\r
+ if (t.hasSupport)\r
+ c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});\r
+\r
+ return c;\r
+ }\r
+\r
+ c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});\r
+\r
+ c.onRenderMenu.add(function(c, m) {\r
+ m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+ each(t.languages, function(v, k) {\r
+ var o = {icon : 1}, mi;\r
+\r
+ o.onclick = function() {\r
+ mi.setSelected(1);\r
+ t.selectedItem.setSelected(0);\r
+ t.selectedItem = mi;\r
+ t.selectedLang = v;\r
+ };\r
+\r
+ o.title = k;\r
+ mi = m.add(o);\r
+ mi.setSelected(v == t.selectedLang);\r
+\r
+ if (v == t.selectedLang)\r
+ t.selectedItem = mi;\r
+ })\r
+ });\r
+\r
+ return c;\r
+ }\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _walk : function(n, f) {\r
+ var d = this.editor.getDoc(), w;\r
+\r
+ if (d.createTreeWalker) {\r
+ w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);\r
+\r
+ while ((n = w.nextNode()) != null)\r
+ f.call(this, n);\r
+ } else\r
+ tinymce.walk(n, f, 'childNodes');\r
+ },\r
+\r
+ _getSeparators : function() {\r
+ var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');\r
+\r
+ // Build word separator regexp\r
+ for (i=0; i<str.length; i++)\r
+ re += '\\' + str.charAt(i);\r
+\r
+ return re;\r
+ },\r
+\r
+ _getWords : function() {\r
+ var ed = this.editor, wl = [], tx = '', lo = {}, rawWords = [];\r
+\r
+ // Get area text\r
+ this._walk(ed.getBody(), function(n) {\r
+ if (n.nodeType == 3)\r
+ tx += n.nodeValue + ' ';\r
+ });\r
+\r
+ // split the text up into individual words\r
+ if (ed.getParam('spellchecker_word_pattern')) {\r
+ // look for words that match the pattern\r
+ rawWords = tx.match('(' + ed.getParam('spellchecker_word_pattern') + ')', 'gi');\r
+ } else {\r
+ // Split words by separator\r
+ tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');\r
+ tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));\r
+ rawWords = tx.split(' ');\r
+ }\r
+\r
+ // Build word array and remove duplicates\r
+ each(rawWords, function(v) {\r
+ if (!lo[v]) {\r
+ wl.push(v);\r
+ lo[v] = 1;\r
+ }\r
+ });\r
+\r
+ return wl;\r
+ },\r
+\r
+ _removeWords : function(w) {\r
+ var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark();\r
+\r
+ each(dom.select('span').reverse(), function(n) {\r
+ if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {\r
+ if (!w || dom.decode(n.innerHTML) == w)\r
+ dom.remove(n, 1);\r
+ }\r
+ });\r
+\r
+ se.moveToBookmark(b);\r
+ },\r
+\r
+ _markWords : function(wl) {\r
+ var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = [];\r
+ var se = ed.selection, b = se.getBookmark();\r
+\r
+ each(wl, function(v) {\r
+ w += (w ? '|' : '') + v;\r
+ });\r
+\r
+ r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g');\r
+ r2 = new RegExp('^(' + w + ')', 'g');\r
+ r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g');\r
+ r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g');\r
+ r5 = new RegExp('(' + w + ')([' + re + '])', 'g');\r
+\r
+ // Collect all text nodes\r
+ this._walk(this.editor.getBody(), function(n) {\r
+ if (n.nodeType == 3) {\r
+ nl.push(n);\r
+ }\r
+ });\r
+\r
+ // Wrap incorrect words in spans\r
+ each(nl, function(n) {\r
+ var v;\r
+\r
+ if (n.nodeType == 3) {\r
+ v = n.nodeValue;\r
+\r
+ if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) {\r
+ v = dom.encode(v);\r
+ v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');\r
+ v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');\r
+\r
+ dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n);\r
+ }\r
+ }\r
+ });\r
+\r
+ se.moveToBookmark(b);\r
+ },\r
+\r
+ _showMenu : function(ed, e) {\r
+ var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target;\r
+\r
+ e = 0; // Fixes IE memory leak\r
+\r
+ if (!m) {\r
+ p1 = DOM.getPos(ed.getContentAreaContainer());\r
+ //p2 = DOM.getPos(ed.getContainer());\r
+\r
+ m = ed.controlManager.createDropMenu('spellcheckermenu', {\r
+ offset_x : p1.x,\r
+ offset_y : p1.y,\r
+ 'class' : 'mceNoIcons'\r
+ });\r
+\r
+ t._menu = m;\r
+ }\r
+\r
+ if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) {\r
+ m.removeAll();\r
+ m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+ t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) {\r
+ var ignoreRpc;\r
+\r
+ m.removeAll();\r
+\r
+ if (r.length > 0) {\r
+ m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+ each(r, function(v) {\r
+ m.add({title : v, onclick : function() {\r
+ dom.replace(ed.getDoc().createTextNode(v), wordSpan);\r
+ t._checkDone();\r
+ }});\r
+ });\r
+\r
+ m.addSeparator();\r
+ } else\r
+ m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);\r
+\r
+ ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", '');\r
+ m.add({\r
+ title : 'spellchecker.ignore_word',\r
+ onclick : function() {\r
+ var word = wordSpan.innerHTML;\r
+\r
+ dom.remove(wordSpan, 1);\r
+ t._checkDone();\r
+\r
+ // tell the server if we need to\r
+ if (ignoreRpc) {\r
+ ed.setProgressState(1);\r
+ t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) {\r
+ ed.setProgressState(0);\r
+ });\r
+ }\r
+ }\r
+ });\r
+\r
+ m.add({\r
+ title : 'spellchecker.ignore_words',\r
+ onclick : function() {\r
+ var word = wordSpan.innerHTML;\r
+\r
+ t._removeWords(dom.decode(word));\r
+ t._checkDone();\r
+\r
+ // tell the server if we need to\r
+ if (ignoreRpc) {\r
+ ed.setProgressState(1);\r
+ t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) {\r
+ ed.setProgressState(0);\r
+ });\r
+ }\r
+ }\r
+ });\r
+\r
+\r
+ if (t.editor.getParam("spellchecker_enable_learn_rpc")) {\r
+ m.add({\r
+ title : 'spellchecker.learn_word',\r
+ onclick : function() {\r
+ var word = wordSpan.innerHTML;\r
+\r
+ dom.remove(wordSpan, 1);\r
+ t._checkDone();\r
+\r
+ ed.setProgressState(1);\r
+ t._sendRPC('learnWord', [t.selectedLang, word], function(r) {\r
+ ed.setProgressState(0);\r
+ });\r
+ }\r
+ });\r
+ }\r
+\r
+ m.update();\r
+ });\r
+\r
+ ed.selection.select(wordSpan);\r
+ p1 = dom.getPos(wordSpan);\r
+ m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y);\r
+\r
+ return tinymce.dom.Event.cancel(e);\r
+ } else\r
+ m.hideMenu();\r
+ },\r
+\r
+ _checkDone : function() {\r
+ var t = this, ed = t.editor, dom = ed.dom, o;\r
+\r
+ each(dom.select('span'), function(n) {\r
+ if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {\r
+ o = true;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (!o)\r
+ t._done();\r
+ },\r
+\r
+ _done : function() {\r
+ var t = this, la = t.active;\r
+\r
+ if (t.active) {\r
+ t.active = 0;\r
+ t._removeWords();\r
+\r
+ if (t._menu)\r
+ t._menu.hideMenu();\r
+\r
+ if (la)\r
+ t.editor.nodeChanged();\r
+ }\r
+ },\r
+\r
+ _sendRPC : function(m, p, cb) {\r
+ var t = this;\r
+\r
+ JSONRequest.sendRPC({\r
+ url : t.rpcUrl,\r
+ method : m,\r
+ params : p,\r
+ success : cb,\r
+ error : function(e, x) {\r
+ t.editor.setProgressState(0);\r
+ t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));\r
+ }\r
+ });\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);\r
+})();\r
--- /dev/null
+#text_font {width:250px;}\r
+#text_size {width:70px;}\r
+.mceAddSelectValue {background:#DDD;}\r
+select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;}\r
+#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;}\r
+#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;}\r
+#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;}\r
+.panel_wrapper div.current {padding-top:10px;height:230px;}\r
+.delim {border-left:1px solid gray;}\r
+.tdelim {border-bottom:1px solid gray;}\r
+#block_display {width:145px;}\r
+#list_type {width:115px;}\r
+.disabled {background:#EEE;}\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.StylePlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceStyleProps', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/props.htm',\r
+ width : 480 + parseInt(ed.getLang('style.delta_width', 0)),\r
+ height : 320 + parseInt(ed.getLang('style.delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url,\r
+ style_text : ed.selection.getNode().style.cssText\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceSetElementStyle', function(ui, v) {\r
+ if (e = ed.selection.getNode()) {\r
+ ed.dom.setAttrib(e, 'style', v);\r
+ ed.execCommand('mceRepaint');\r
+ }\r
+ });\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ cm.setDisabled('styleprops', n.nodeName === 'BODY');\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'});\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Style',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var defaultFonts = "" + \r
+ "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + \r
+ "Times New Roman, Times, serif=Times New Roman, Times, serif;" + \r
+ "Courier New, Courier, mono=Courier New, Courier, mono;" + \r
+ "Times New Roman, Times, serif=Times New Roman, Times, serif;" + \r
+ "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + \r
+ "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + \r
+ "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif";\r
+\r
+var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger";\r
+var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
+var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%";\r
+var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%";\r
+var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900";\r
+var defaultTextStyle = "normal;italic;oblique";\r
+var defaultVariant = "normal;small-caps";\r
+var defaultLineHeight = "normal";\r
+var defaultAttachment = "fixed;scroll";\r
+var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y";\r
+var defaultPosH = "left;center;right";\r
+var defaultPosV = "top;center;bottom";\r
+var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom";\r
+var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none";\r
+var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset";\r
+var defaultBorderWidth = "thin;medium;thick";\r
+var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none";\r
+\r
+function init() {\r
+ var ce = document.getElementById('container'), h;\r
+\r
+ ce.style.cssText = tinyMCEPopup.getWindowArg('style_text');\r
+\r
+ h = getBrowserHTML('background_image_browser','background_image','image','advimage');\r
+ document.getElementById("background_image_browser").innerHTML = h;\r
+\r
+ document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color');\r
+ document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color');\r
+ document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top');\r
+ document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right');\r
+ document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');\r
+ document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left');\r
+\r
+ fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true);\r
+ fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true);\r
+ fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true);\r
+ fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true);\r
+ fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true);\r
+ fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true);\r
+ fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true);\r
+ fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true);\r
+\r
+ fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true);\r
+ fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true);\r
+\r
+ fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true);\r
+\r
+ fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true);\r
+ fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true);\r
+\r
+ fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true);\r
+ fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true);\r
+ fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true);\r
+ fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true);\r
+ fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true);\r
+ fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true);\r
+ fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true);\r
+ fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true);\r
+ fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true);\r
+\r
+ fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true);\r
+ fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true);\r
+ fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true);\r
+\r
+ fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true);\r
+ fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true);\r
+ fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true);\r
+ fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true);\r
+\r
+ fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true);\r
+ fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true);\r
+ fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true);\r
+ fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true);\r
+\r
+ fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true);\r
+\r
+ fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true);\r
+ fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true);\r
+\r
+ fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true);\r
+ fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true);\r
+\r
+ fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true);\r
+\r
+ fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true);\r
+\r
+ fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true);\r
+ fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true);\r
+\r
+ TinyMCE_EditableSelects.init();\r
+ setupFormData();\r
+ showDisabledControls();\r
+}\r
+\r
+function setupFormData() {\r
+ var ce = document.getElementById('container'), f = document.forms[0], s, b, i;\r
+\r
+ // Setup text fields\r
+\r
+ selectByValue(f, 'text_font', ce.style.fontFamily, true, true);\r
+ selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true);\r
+ selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize));\r
+ selectByValue(f, 'text_weight', ce.style.fontWeight, true, true);\r
+ selectByValue(f, 'text_style', ce.style.fontStyle, true, true);\r
+ selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true);\r
+ selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight));\r
+ selectByValue(f, 'text_case', ce.style.textTransform, true, true);\r
+ selectByValue(f, 'text_variant', ce.style.fontVariant, true, true);\r
+ f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color);\r
+ updateColor('text_color_pick', 'text_color');\r
+ f.text_underline.checked = inStr(ce.style.textDecoration, 'underline');\r
+ f.text_overline.checked = inStr(ce.style.textDecoration, 'overline');\r
+ f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through');\r
+ f.text_blink.checked = inStr(ce.style.textDecoration, 'blink');\r
+\r
+ // Setup background fields\r
+\r
+ f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor);\r
+ updateColor('background_color_pick', 'background_color');\r
+ f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+ selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true);\r
+ selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true);\r
+ selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true);\r
+ selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0)));\r
+ selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true);\r
+ selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1)));\r
+\r
+ // Setup block fields\r
+\r
+ selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true);\r
+ selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing));\r
+ selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true);\r
+ selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing));\r
+ selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true);\r
+ selectByValue(f, 'block_text_align', ce.style.textAlign, true, true);\r
+ f.block_text_indent.value = getNum(ce.style.textIndent);\r
+ selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent));\r
+ selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true);\r
+ selectByValue(f, 'block_display', ce.style.display, true, true);\r
+\r
+ // Setup box fields\r
+\r
+ f.box_width.value = getNum(ce.style.width);\r
+ selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width));\r
+\r
+ f.box_height.value = getNum(ce.style.height);\r
+ selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height));\r
+\r
+ if (tinymce.isGecko)\r
+ selectByValue(f, 'box_float', ce.style.cssFloat, true, true);\r
+ else\r
+ selectByValue(f, 'box_float', ce.style.styleFloat, true, true);\r
+\r
+ selectByValue(f, 'box_clear', ce.style.clear, true, true);\r
+\r
+ setupBox(f, ce, 'box_padding', 'padding', '');\r
+ setupBox(f, ce, 'box_margin', 'margin', '');\r
+\r
+ // Setup border fields\r
+\r
+ setupBox(f, ce, 'border_style', 'border', 'Style');\r
+ setupBox(f, ce, 'border_width', 'border', 'Width');\r
+ setupBox(f, ce, 'border_color', 'border', 'Color');\r
+\r
+ updateColor('border_color_top_pick', 'border_color_top');\r
+ updateColor('border_color_right_pick', 'border_color_right');\r
+ updateColor('border_color_bottom_pick', 'border_color_bottom');\r
+ updateColor('border_color_left_pick', 'border_color_left');\r
+\r
+ f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value);\r
+ f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value);\r
+ f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value);\r
+ f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value);\r
+\r
+ // Setup list fields\r
+\r
+ selectByValue(f, 'list_type', ce.style.listStyleType, true, true);\r
+ selectByValue(f, 'list_position', ce.style.listStylePosition, true, true);\r
+ f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+\r
+ // Setup box fields\r
+\r
+ selectByValue(f, 'positioning_type', ce.style.position, true, true);\r
+ selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true);\r
+ selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true);\r
+ f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : "";\r
+\r
+ f.positioning_width.value = getNum(ce.style.width);\r
+ selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width));\r
+\r
+ f.positioning_height.value = getNum(ce.style.height);\r
+ selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height));\r
+\r
+ setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']);\r
+\r
+ s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1");\r
+ s = s.replace(/,/g, ' ');\r
+\r
+ if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) {\r
+ f.positioning_clip_top.value = getNum(getVal(s, 0));\r
+ selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));\r
+ f.positioning_clip_right.value = getNum(getVal(s, 1));\r
+ selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1)));\r
+ f.positioning_clip_bottom.value = getNum(getVal(s, 2));\r
+ selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2)));\r
+ f.positioning_clip_left.value = getNum(getVal(s, 3));\r
+ selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3)));\r
+ } else {\r
+ f.positioning_clip_top.value = getNum(getVal(s, 0));\r
+ selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0)));\r
+ f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value;\r
+ }\r
+\r
+// setupBox(f, ce, '', 'border', 'Color');\r
+}\r
+\r
+function getMeasurement(s) {\r
+ return s.replace(/^([0-9.]+)(.*)$/, "$2");\r
+}\r
+\r
+function getNum(s) {\r
+ if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s))\r
+ return s.replace(/[^0-9.]/g, '');\r
+\r
+ return s;\r
+}\r
+\r
+function inStr(s, n) {\r
+ return new RegExp(n, 'gi').test(s);\r
+}\r
+\r
+function getVal(s, i) {\r
+ var a = s.split(' ');\r
+\r
+ if (a.length > 1)\r
+ return a[i];\r
+\r
+ return "";\r
+}\r
+\r
+function setValue(f, n, v) {\r
+ if (f.elements[n].type == "text")\r
+ f.elements[n].value = v;\r
+ else\r
+ selectByValue(f, n, v, true, true);\r
+}\r
+\r
+function setupBox(f, ce, fp, pr, sf, b) {\r
+ if (typeof(b) == "undefined")\r
+ b = ['Top', 'Right', 'Bottom', 'Left'];\r
+\r
+ if (isSame(ce, pr, sf, b)) {\r
+ f.elements[fp + "_same"].checked = true;\r
+\r
+ setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));\r
+ f.elements[fp + "_top"].disabled = false;\r
+\r
+ f.elements[fp + "_right"].value = "";\r
+ f.elements[fp + "_right"].disabled = true;\r
+ f.elements[fp + "_bottom"].value = "";\r
+ f.elements[fp + "_bottom"].disabled = true;\r
+ f.elements[fp + "_left"].value = "";\r
+ f.elements[fp + "_left"].disabled = true;\r
+\r
+ if (f.elements[fp + "_top_measurement"]) {\r
+ selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));\r
+ f.elements[fp + "_left_measurement"].disabled = true;\r
+ f.elements[fp + "_bottom_measurement"].disabled = true;\r
+ f.elements[fp + "_right_measurement"].disabled = true;\r
+ }\r
+ } else {\r
+ f.elements[fp + "_same"].checked = false;\r
+\r
+ setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf]));\r
+ f.elements[fp + "_top"].disabled = false;\r
+\r
+ setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf]));\r
+ f.elements[fp + "_right"].disabled = false;\r
+\r
+ setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf]));\r
+ f.elements[fp + "_bottom"].disabled = false;\r
+\r
+ setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf]));\r
+ f.elements[fp + "_left"].disabled = false;\r
+\r
+ if (f.elements[fp + "_top_measurement"]) {\r
+ selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf]));\r
+ selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf]));\r
+ selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf]));\r
+ selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf]));\r
+ f.elements[fp + "_left_measurement"].disabled = false;\r
+ f.elements[fp + "_bottom_measurement"].disabled = false;\r
+ f.elements[fp + "_right_measurement"].disabled = false;\r
+ }\r
+ }\r
+}\r
+\r
+function isSame(e, pr, sf, b) {\r
+ var a = [], i, x;\r
+\r
+ if (typeof(b) == "undefined")\r
+ b = ['Top', 'Right', 'Bottom', 'Left'];\r
+\r
+ if (typeof(sf) == "undefined" || sf == null)\r
+ sf = "";\r
+\r
+ a[0] = e.style[pr + b[0] + sf];\r
+ a[1] = e.style[pr + b[1] + sf];\r
+ a[2] = e.style[pr + b[2] + sf];\r
+ a[3] = e.style[pr + b[3] + sf];\r
+\r
+ for (i=0; i<a.length; i++) {\r
+ if (a[i] == null)\r
+ return false;\r
+\r
+ for (x=0; x<a.length; x++) {\r
+ if (a[x] != a[i])\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+};\r
+\r
+function hasEqualValues(a) {\r
+ var i, x;\r
+\r
+ for (i=0; i<a.length; i++) {\r
+ if (a[i] == null)\r
+ return false;\r
+\r
+ for (x=0; x<a.length; x++) {\r
+ if (a[x] != a[i])\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+}\r
+\r
+function applyAction() {\r
+ var ce = document.getElementById('container'), ed = tinyMCEPopup.editor;\r
+\r
+ generateCSS();\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+ ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText)));\r
+}\r
+\r
+function updateAction() {\r
+ applyAction();\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function generateCSS() {\r
+ var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t;\r
+\r
+ ce.style.cssText = "";\r
+\r
+ // Build text styles\r
+ ce.style.fontFamily = f.text_font.value;\r
+ ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : "");\r
+ ce.style.fontStyle = f.text_style.value;\r
+ ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : "");\r
+ ce.style.textTransform = f.text_case.value;\r
+ ce.style.fontWeight = f.text_weight.value;\r
+ ce.style.fontVariant = f.text_variant.value;\r
+ ce.style.color = f.text_color.value;\r
+\r
+ s = "";\r
+ s += f.text_underline.checked ? " underline" : "";\r
+ s += f.text_overline.checked ? " overline" : "";\r
+ s += f.text_linethrough.checked ? " line-through" : "";\r
+ s += f.text_blink.checked ? " blink" : "";\r
+ s = s.length > 0 ? s.substring(1) : s;\r
+\r
+ if (f.text_none.checked)\r
+ s = "none";\r
+\r
+ ce.style.textDecoration = s;\r
+\r
+ // Build background styles\r
+\r
+ ce.style.backgroundColor = f.background_color.value;\r
+ ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : "";\r
+ ce.style.backgroundRepeat = f.background_repeat.value;\r
+ ce.style.backgroundAttachment = f.background_attachment.value;\r
+\r
+ if (f.background_hpos.value != "") {\r
+ s = "";\r
+ s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " ";\r
+ s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : "");\r
+ ce.style.backgroundPosition = s;\r
+ }\r
+\r
+ // Build block styles\r
+\r
+ ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : "");\r
+ ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : "");\r
+ ce.style.verticalAlign = f.block_vertical_alignment.value;\r
+ ce.style.textAlign = f.block_text_align.value;\r
+ ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : "");\r
+ ce.style.whiteSpace = f.block_whitespace.value;\r
+ ce.style.display = f.block_display.value;\r
+\r
+ // Build box styles\r
+\r
+ ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : "");\r
+ ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : "");\r
+ ce.style.styleFloat = f.box_float.value;\r
+\r
+ if (tinymce.isGecko)\r
+ ce.style.cssFloat = f.box_float.value;\r
+\r
+ ce.style.clear = f.box_clear.value;\r
+\r
+ if (!f.box_padding_same.checked) {\r
+ ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : "");\r
+ ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : "");\r
+ ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : "");\r
+ ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : "");\r
+ } else\r
+ ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); \r
+\r
+ if (!f.box_margin_same.checked) {\r
+ ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : "");\r
+ ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : "");\r
+ ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : "");\r
+ ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : "");\r
+ } else\r
+ ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); \r
+\r
+ // Build border styles\r
+\r
+ if (!f.border_style_same.checked) {\r
+ ce.style.borderTopStyle = f.border_style_top.value;\r
+ ce.style.borderRightStyle = f.border_style_right.value;\r
+ ce.style.borderBottomStyle = f.border_style_bottom.value;\r
+ ce.style.borderLeftStyle = f.border_style_left.value;\r
+ } else\r
+ ce.style.borderStyle = f.border_style_top.value;\r
+\r
+ if (!f.border_width_same.checked) {\r
+ ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
+ ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : "");\r
+ ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : "");\r
+ ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : "");\r
+ } else\r
+ ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : "");\r
+\r
+ if (!f.border_color_same.checked) {\r
+ ce.style.borderTopColor = f.border_color_top.value;\r
+ ce.style.borderRightColor = f.border_color_right.value;\r
+ ce.style.borderBottomColor = f.border_color_bottom.value;\r
+ ce.style.borderLeftColor = f.border_color_left.value;\r
+ } else\r
+ ce.style.borderColor = f.border_color_top.value;\r
+\r
+ // Build list styles\r
+\r
+ ce.style.listStyleType = f.list_type.value;\r
+ ce.style.listStylePosition = f.list_position.value;\r
+ ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : "";\r
+\r
+ // Build positioning styles\r
+\r
+ ce.style.position = f.positioning_type.value;\r
+ ce.style.visibility = f.positioning_visibility.value;\r
+\r
+ if (ce.style.width == "")\r
+ ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : "");\r
+\r
+ if (ce.style.height == "")\r
+ ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : "");\r
+\r
+ ce.style.zIndex = f.positioning_zindex.value;\r
+ ce.style.overflow = f.positioning_overflow.value;\r
+\r
+ if (!f.positioning_placement_same.checked) {\r
+ ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");\r
+ ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : "");\r
+ ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : "");\r
+ ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : "");\r
+ } else {\r
+ s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : "");\r
+ ce.style.top = s;\r
+ ce.style.right = s;\r
+ ce.style.bottom = s;\r
+ ce.style.left = s;\r
+ }\r
+\r
+ if (!f.positioning_clip_same.checked) {\r
+ s = "rect(";\r
+ s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " ";\r
+ s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " ";\r
+ s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " ";\r
+ s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto");\r
+ s += ")";\r
+\r
+ if (s != "rect(auto auto auto auto)")\r
+ ce.style.clip = s;\r
+ } else {\r
+ s = "rect(";\r
+ t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto";\r
+ s += t + " ";\r
+ s += t + " ";\r
+ s += t + " ";\r
+ s += t + ")";\r
+\r
+ if (s != "rect(auto auto auto auto)")\r
+ ce.style.clip = s;\r
+ }\r
+\r
+ ce.style.cssText = ce.style.cssText;\r
+}\r
+\r
+function isNum(s) {\r
+ return new RegExp('[0-9]+', 'g').test(s);\r
+}\r
+\r
+function showDisabledControls() {\r
+ var f = document.forms, i, a;\r
+\r
+ for (i=0; i<f.length; i++) {\r
+ for (a=0; a<f[i].elements.length; a++) {\r
+ if (f[i].elements[a].disabled)\r
+ tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled");\r
+ else\r
+ tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled");\r
+ }\r
+ }\r
+}\r
+\r
+function fillSelect(f, s, param, dval, sep, em) {\r
+ var i, ar, p, se;\r
+\r
+ f = document.forms[f];\r
+ sep = typeof(sep) == "undefined" ? ";" : sep;\r
+\r
+ if (em)\r
+ addSelectValue(f, s, "", "");\r
+\r
+ ar = tinyMCEPopup.getParam(param, dval).split(sep);\r
+ for (i=0; i<ar.length; i++) {\r
+ se = false;\r
+\r
+ if (ar[i].charAt(0) == '+') {\r
+ ar[i] = ar[i].substring(1);\r
+ se = true;\r
+ }\r
+\r
+ p = ar[i].split('=');\r
+\r
+ if (p.length > 1) {\r
+ addSelectValue(f, s, p[0], p[1]);\r
+\r
+ if (se)\r
+ selectByValue(f, s, p[1]);\r
+ } else {\r
+ addSelectValue(f, s, p[0], p[0]);\r
+\r
+ if (se)\r
+ selectByValue(f, s, p[0]);\r
+ }\r
+ }\r
+}\r
+\r
+function toggleSame(ce, pre) {\r
+ var el = document.forms[0].elements, i;\r
+\r
+ if (ce.checked) {\r
+ el[pre + "_top"].disabled = false;\r
+ el[pre + "_right"].disabled = true;\r
+ el[pre + "_bottom"].disabled = true;\r
+ el[pre + "_left"].disabled = true;\r
+\r
+ if (el[pre + "_top_measurement"]) {\r
+ el[pre + "_top_measurement"].disabled = false;\r
+ el[pre + "_right_measurement"].disabled = true;\r
+ el[pre + "_bottom_measurement"].disabled = true;\r
+ el[pre + "_left_measurement"].disabled = true;\r
+ }\r
+ } else {\r
+ el[pre + "_top"].disabled = false;\r
+ el[pre + "_right"].disabled = false;\r
+ el[pre + "_bottom"].disabled = false;\r
+ el[pre + "_left"].disabled = false;\r
+\r
+ if (el[pre + "_top_measurement"]) {\r
+ el[pre + "_top_measurement"].disabled = false;\r
+ el[pre + "_right_measurement"].disabled = false;\r
+ el[pre + "_bottom_measurement"].disabled = false;\r
+ el[pre + "_left_measurement"].disabled = false;\r
+ }\r
+ }\r
+\r
+ showDisabledControls();\r
+}\r
+\r
+function synch(fr, to) {\r
+ var f = document.forms[0];\r
+\r
+ f.elements[to].value = f.elements[fr].value;\r
+\r
+ if (f.elements[fr + "_measurement"])\r
+ selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value);\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.style_dlg',{\r
+title:"Edit CSS Style",\r
+apply:"Apply",\r
+text_tab:"Text",\r
+background_tab:"Background",\r
+block_tab:"Block",\r
+box_tab:"Box",\r
+border_tab:"Border",\r
+list_tab:"List",\r
+positioning_tab:"Positioning",\r
+text_props:"Text",\r
+text_font:"Font",\r
+text_size:"Size",\r
+text_weight:"Weight",\r
+text_style:"Style",\r
+text_variant:"Variant",\r
+text_lineheight:"Line height",\r
+text_case:"Case",\r
+text_color:"Color",\r
+text_decoration:"Decoration",\r
+text_overline:"overline",\r
+text_underline:"underline",\r
+text_striketrough:"strikethrough",\r
+text_blink:"blink",\r
+text_none:"none",\r
+background_color:"Background color",\r
+background_image:"Background image",\r
+background_repeat:"Repeat",\r
+background_attachment:"Attachment",\r
+background_hpos:"Horizontal position",\r
+background_vpos:"Vertical position",\r
+block_wordspacing:"Word spacing",\r
+block_letterspacing:"Letter spacing",\r
+block_vertical_alignment:"Vertical alignment",\r
+block_text_align:"Text align",\r
+block_text_indent:"Text indent",\r
+block_whitespace:"Whitespace",\r
+block_display:"Display",\r
+box_width:"Width",\r
+box_height:"Height",\r
+box_float:"Float",\r
+box_clear:"Clear",\r
+padding:"Padding",\r
+same:"Same for all",\r
+top:"Top",\r
+right:"Right",\r
+bottom:"Bottom",\r
+left:"Left",\r
+margin:"Margin",\r
+style:"Style",\r
+width:"Width",\r
+height:"Height",\r
+color:"Color",\r
+list_type:"Type",\r
+bullet_image:"Bullet image",\r
+position:"Position",\r
+positioning_type:"Type",\r
+visibility:"Visibility",\r
+zindex:"Z-index",\r
+overflow:"Overflow",\r
+placement:"Placement",\r
+clip:"Clip"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{#style_dlg.title}</title>
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>
+ <script type="text/javascript" src="js/props.js"></script>
+ <link href="css/props.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body id="styleprops" style="display: none">
+<form onsubmit="updateAction();return false;" action="#">
+<div class="tabs">
+ <ul>
+ <li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
+ <li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
+ <li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
+ <li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
+ <li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
+ <li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
+ <li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
+ </ul>
+</div>
+
+<div class="panel_wrapper">
+<div id="text_panel" class="panel current">
+ <table border="0" width="100%">
+ <tr>
+ <td><label for="text_font">{#style_dlg.text_font}</label></td>
+ <td colspan="3">
+ <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="text_size">{#style_dlg.text_size}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
+ <td> </td>
+ <td><select id="text_size_measurement" name="text_size_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td><label for="text_weight">{#style_dlg.text_weight}</label></td>
+ <td>
+ <select id="text_weight" name="text_weight"></select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="text_style">{#style_dlg.text_style}</label></td>
+ <td>
+ <select id="text_style" name="text_style" class="mceEditableSelect"></select>
+ </td>
+ <td><label for="text_variant">{#style_dlg.text_variant}</label></td>
+ <td>
+ <select id="text_variant" name="text_variant"></select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td>
+ <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
+ </td>
+ <td> </td>
+ <td><select id="text_lineheight_measurement" name="text_lineheight_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td><label for="text_case">{#style_dlg.text_case}</label></td>
+ <td>
+ <select id="text_case" name="text_case"></select>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="text_color">{#style_dlg.text_color}</label></td>
+ <td colspan="2">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
+ <td id="text_color_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
+ <td colspan="2">
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
+ <td><label for="text_underline">{#style_dlg.text_underline}</label></td>
+ </tr>
+ <tr>
+ <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
+ <td><label for="text_overline">{#style_dlg.text_overline}</label></td>
+ </tr>
+ <tr>
+ <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
+ <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
+ </tr>
+ <tr>
+ <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
+ <td><label for="text_blink">{#style_dlg.text_blink}</label></td>
+ </tr>
+ <tr>
+ <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td>
+ <td><label for="text_none">{#style_dlg.text_none}</label></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<div id="background_panel" class="panel">
+ <table border="0">
+ <tr>
+ <td><label for="background_color">{#style_dlg.background_color}</label></td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
+ <td id="background_color_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="background_image">{#style_dlg.background_image}</label></td>
+ <td><table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input id="background_image" name="background_image" type="text" /></td>
+ <td id="background_image_browser"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
+ <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
+ <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
+ <td> </td>
+ <td><select id="background_hpos_measurement" name="background_hpos_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
+ <td> </td>
+ <td><select id="background_vpos_measurement" name="background_vpos_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+</div>
+
+<div id="block_panel" class="panel">
+ <table border="0">
+ <tr>
+ <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
+ <td> </td>
+ <td><select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
+ <td> </td>
+ <td><select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
+ <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
+ <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
+ <td> </td>
+ <td><select id="block_text_indent_measurement" name="block_text_indent_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
+ <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="block_display">{#style_dlg.block_display}</label></td>
+ <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
+ </tr>
+ </table>
+</div>
+
+<div id="box_panel" class="panel">
+<table border="0">
+ <tr>
+ <td><label for="box_width">{#style_dlg.box_width}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
+ <td> </td>
+ <td><select id="box_width_measurement" name="box_width_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td> <label for="box_float">{#style_dlg.box_float}</label></td>
+ <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="box_height">{#style_dlg.box_height}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
+ <td> </td>
+ <td><select id="box_height_measurement" name="box_height_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td> <label for="box_clear">{#style_dlg.box_clear}</label></td>
+ <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
+ </tr>
+</table>
+<div style="float: left; width: 49%">
+ <fieldset>
+ <legend>{#style_dlg.padding}</legend>
+
+ <table border="0">
+ <tr>
+ <td> </td>
+ <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
+ </tr>
+ <tr>
+ <td><label for="box_padding_top">{#style_dlg.top}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
+ <td> </td>
+ <td><select id="box_padding_top_measurement" name="box_padding_top_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="box_padding_right">{#style_dlg.right}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="box_padding_left">{#style_dlg.left}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </fieldset>
+</div>
+
+<div style="float: right; width: 49%">
+ <fieldset>
+ <legend>{#style_dlg.margin}</legend>
+
+ <table border="0">
+ <tr>
+ <td> </td>
+ <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
+ </tr>
+ <tr>
+ <td><label for="box_margin_top">{#style_dlg.top}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
+ <td> </td>
+ <td><select id="box_margin_top_measurement" name="box_margin_top_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="box_margin_right">{#style_dlg.right}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="box_margin_left">{#style_dlg.left}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </fieldset>
+</div>
+<br style="clear: both" />
+</div>
+
+<div id="border_panel" class="panel">
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+ <td class="tdelim"> </td>
+ <td class="tdelim delim"> </td>
+ <td class="tdelim">{#style_dlg.style}</td>
+ <td class="tdelim delim"> </td>
+ <td class="tdelim">{#style_dlg.width}</td>
+ <td class="tdelim delim"> </td>
+ <td class="tdelim">{#style_dlg.color}</td>
+</tr>
+
+<tr>
+ <td> </td>
+ <td class="delim"> </td>
+ <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
+ <td class="delim"> </td>
+ <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
+ <td class="delim"> </td>
+ <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
+</tr>
+
+<tr>
+ <td>{#style_dlg.top}</td>
+ <td class="delim"> </td>
+ <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
+ <td> </td>
+ <td><select id="border_width_top_measurement" name="border_width_top_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
+ <td id="border_color_top_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>{#style_dlg.right}</td>
+ <td class="delim"> </td>
+ <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
+ <td> </td>
+ <td><select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
+ <td id="border_color_right_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>{#style_dlg.bottom}</td>
+ <td class="delim"> </td>
+ <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
+ <td> </td>
+ <td><select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
+ <td id="border_color_bottom_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>{#style_dlg.left}</td>
+ <td class="delim"> </td>
+ <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
+ <td> </td>
+ <td><select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td class="delim"> </td>
+ <td>
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
+ <td id="border_color_left_pickcontainer"> </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+</table>
+</div>
+
+<div id="list_panel" class="panel">
+ <table border="0">
+ <tr>
+ <td><label for="list_type">{#style_dlg.list_type}</label></td>
+ <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
+ <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="list_position">{#style_dlg.position}</label></td>
+ <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
+ </tr>
+ </table>
+</div>
+
+<div id="positioning_panel" class="panel">
+<table border="0">
+ <tr>
+ <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
+ <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
+ <td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td>
+ <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
+ </tr>
+
+ <tr>
+ <td><label for="positioning_width">{#style_dlg.width}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
+ <td> </td>
+ <td><select id="positioning_width_measurement" name="positioning_width_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td>
+ <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
+ </tr>
+
+ <tr>
+ <td><label for="positioning_height">{#style_dlg.height}</label></td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
+ <td> </td>
+ <td><select id="positioning_height_measurement" name="positioning_height_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ <td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td>
+ <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
+ </tr>
+</table>
+
+<div style="float: left; width: 49%">
+ <fieldset>
+ <legend>{#style_dlg.placement}</legend>
+
+ <table border="0">
+ <tr>
+ <td> </td>
+ <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.top}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
+ <td> </td>
+ <td><select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.right}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.bottom}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.left}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </fieldset>
+</div>
+
+<div style="float: right; width: 49%">
+ <fieldset>
+ <legend>{#style_dlg.clip}</legend>
+
+ <table border="0">
+ <tr>
+ <td> </td>
+ <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.top}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
+ <td> </td>
+ <td><select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.right}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.bottom}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>{#style_dlg.left}</td>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
+ <td> </td>
+ <td><select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </fieldset>
+</div>
+<br style="clear: both" />
+</div>
+</div>
+
+<div class="mceActionPanel">
+ <input type="submit" id="insert" name="insert" value="{#update}" />
+ <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
+</div>
+</form>
+
+<div style="display: none">
+ <div id="container"></div>
+</div>
+
+</body>
+</html>
--- /dev/null
+(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{for(m=j-1;m>=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;\r
+\r
+ tinymce.create('tinymce.plugins.TabFocusPlugin', {\r
+ init : function(ed, url) {\r
+ function tabCancel(ed, e) {\r
+ if (e.keyCode === 9)\r
+ return Event.cancel(e);\r
+ };\r
+\r
+ function tabHandler(ed, e) {\r
+ var x, i, f, el, v;\r
+\r
+ function find(d) {\r
+ f = DOM.getParent(ed.id, 'form');\r
+ el = f.elements;\r
+\r
+ if (f) {\r
+ each(el, function(e, i) {\r
+ if (e.id == ed.id) {\r
+ x = i;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (d > 0) {\r
+ for (i = x + 1; i < el.length; i++) {\r
+ if (el[i].type != 'hidden')\r
+ return el[i];\r
+ }\r
+ } else {\r
+ for (i = x - 1; i >= 0; i--) {\r
+ if (el[i].type != 'hidden')\r
+ return el[i];\r
+ }\r
+ }\r
+ }\r
+\r
+ return null;\r
+ };\r
+\r
+ if (e.keyCode === 9) {\r
+ v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));\r
+\r
+ if (v.length == 1) {\r
+ v[1] = v[0];\r
+ v[0] = ':prev';\r
+ }\r
+\r
+ // Find element to focus\r
+ if (e.shiftKey) {\r
+ if (v[0] == ':prev')\r
+ el = find(-1);\r
+ else\r
+ el = DOM.get(v[0]);\r
+ } else {\r
+ if (v[1] == ':next')\r
+ el = find(1);\r
+ else\r
+ el = DOM.get(v[1]);\r
+ }\r
+\r
+ if (el) {\r
+ if (ed = tinymce.get(el.id || el.name))\r
+ ed.focus();\r
+ else\r
+ window.setTimeout(function() {window.focus();el.focus();}, 10);\r
+\r
+ return Event.cancel(e);\r
+ }\r
+ }\r
+ };\r
+\r
+ ed.onKeyUp.add(tabCancel);\r
+\r
+ if (tinymce.isGecko) {\r
+ ed.onKeyPress.add(tabHandler);\r
+ ed.onKeyDown.add(tabCancel);\r
+ } else\r
+ ed.onKeyDown.add(tabHandler);\r
+\r
+ ed.onInit.add(function() {\r
+ each(DOM.select('a:first,a:last', ed.getContainer()), function(n) {\r
+ Event.add(n, 'focus', function() {ed.focus();});\r
+ });\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Tabfocus',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#table_dlg.cell_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/cell.js"></script>\r
+ <link href="css/cell.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="tablecell" style="display: none">\r
+ <form onsubmit="updateAction();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#table_dlg.general_props}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="align">{#table_dlg.align}</label></td>\r
+ <td>\r
+ <select id="align" name="align" class="mceFocus">\r
+ <option value="">{#not_set}</option>\r
+ <option value="center">{#table_dlg.align_middle}</option>\r
+ <option value="left">{#table_dlg.align_left}</option>\r
+ <option value="right">{#table_dlg.align_right}</option>\r
+ </select>\r
+ </td>\r
+ \r
+ <td><label for="celltype">{#table_dlg.cell_type}</label></td>\r
+ <td>\r
+ <select id="celltype" name="celltype">\r
+ <option value="td">{#table_dlg.td}</option>\r
+ <option value="th">{#table_dlg.th}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="valign">{#table_dlg.valign}</label></td>\r
+ <td>\r
+ <select id="valign" name="valign">\r
+ <option value="">{#not_set}</option>\r
+ <option value="top">{#table_dlg.align_top}</option>\r
+ <option value="middle">{#table_dlg.align_middle}</option>\r
+ <option value="bottom">{#table_dlg.align_bottom}</option>\r
+ </select>\r
+ </td>\r
+\r
+ <td><label for="scope">{#table_dlg.scope}</label></td>\r
+ <td>\r
+ <select id="scope" name="scope">\r
+ <option value="">{#not_set}</option>\r
+ <option value="col">{#table.col}</option>\r
+ <option value="row">{#table.row}</option>\r
+ <option value="rowgroup">{#table_dlg.rowgroup}</option>\r
+ <option value="colgroup">{#table_dlg.colgroup}</option>\r
+ </select>\r
+ </td>\r
+\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="width">{#table_dlg.width}</label></td>\r
+ <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>\r
+\r
+ <td><label for="height">{#table_dlg.height}</label></td>\r
+ <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>\r
+ </tr>\r
+\r
+ <tr id="styleSelectRow">\r
+ <td><label for="class">{#class_name}</label></td>\r
+ <td colspan="3">\r
+ <select id="class" name="class" class="mceEditableSelect">\r
+ <option value="" selected="selected">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#table_dlg.advanced_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="style">{#table_dlg.style}</label></td>\r
+ <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir" style="width: 200px"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#table_dlg.ltr}</option> \r
+ <option value="rtl">{#table_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" style="width: 200px" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>\r
+ <td id="backgroundimagebrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>\r
+ <td id="bordercolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
+ <td id="bgcolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <div>\r
+ <select id="action" name="action">\r
+ <option value="cell">{#table_dlg.cell_cell}</option>\r
+ <option value="row">{#table_dlg.cell_row}</option>\r
+ <option value="all">{#table_dlg.cell_all}</option>\r
+ </select>\r
+ </div>\r
+\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+/* CSS file for cell dialog in the table plugin */\r
+\r
+.panel_wrapper div.current {\r
+ height: 200px;\r
+}\r
+\r
+.advfield {\r
+ width: 200px;\r
+}\r
+\r
+#action {\r
+ margin-bottom: 3px;\r
+}\r
+\r
+#class {\r
+ width: 150px;\r
+}
\ No newline at end of file
--- /dev/null
+/* CSS file for row dialog in the table plugin */\r
+\r
+.panel_wrapper div.current {\r
+ height: 200px;\r
+}\r
+\r
+.advfield {\r
+ width: 200px;\r
+}\r
+\r
+#action {\r
+ margin-bottom: 3px;\r
+}\r
+\r
+#rowtype,#align,#valign,#class,#height {\r
+ width: 150px;\r
+}\r
+\r
+#height {\r
+ width: 50px; \r
+}\r
+\r
+.col2 {\r
+ padding-left: 20px;\r
+}\r
--- /dev/null
+/* CSS file for table dialog in the table plugin */\r
+\r
+.panel_wrapper div.current {\r
+ height: 245px;\r
+}\r
+\r
+.advfield {\r
+ width: 200px;\r
+}\r
+\r
+#class {\r
+ width: 150px;\r
+}\r
--- /dev/null
+(function(b){var c=b.each;function a(F,E,I){var e,J,B,n;r();n=E.getParent(I.getStart(),"th,td");if(n){J=D(n);B=G();n=v(J.x,J.y)}function w(L,K){L=L.cloneNode(K);L.removeAttribute("id");return L}function r(){var K=0;e=[];c(["thead","tbody","tfoot"],function(L){var M=E.select(L+" tr",F);c(M,function(N,O){O+=K;c(E.select("td,th",N),function(U,P){var Q,R,S,T;if(e[O]){while(e[O][P]){P++}}S=g(U,"rowspan");T=g(U,"colspan");for(R=O;R<O+S;R++){if(!e[R]){e[R]=[]}for(Q=P;Q<P+T;Q++){e[R][Q]={part:L,real:R==O&&Q==P,elm:U,rowspan:S,colspan:T}}}})});K+=M.length})}function v(K,M){var L;L=e[M];if(L){return L[K]}}function g(L,K){return parseInt(L.getAttribute(K)||1)}function h(K){return E.hasClass(K.elm,"mceSelected")||K==n}function j(){var K=[];c(F.rows,function(L){c(L.cells,function(M){if(E.hasClass(M,"mceSelected")||M==n.elm){K.push(L);return false}})});return K}function q(){var K=E.createRng();K.setStartAfter(F);K.setEndAfter(F);I.setRng(K);E.remove(F)}function d(K){var L;b.walk(K,function(N){var M;if(N.nodeType==3){c(E.getParents(N.parentNode,null,K).reverse(),function(O){O=w(O,false);if(!L){L=M=O}else{if(M){M.appendChild(O)}}M=O});if(M){M.innerHTML=b.isIE?" ":'<br _mce_bogus="1" />'}return false}},"childNodes");K=w(K,false);K.rowSpan=K.colSpan=1;if(L){K.appendChild(L)}else{if(!b.isIE){K.innerHTML='<br _mce_bogus="1" />'}}return K}function p(){var K=E.createRng();c(E.select("tr",F),function(L){if(L.cells.length==0){E.remove(L)}});if(E.select("tr",F).length==0){K.setStartAfter(F);K.setEndAfter(F);I.setRng(K);E.remove(F);return}c(E.select("thead,tbody,tfoot",F),function(L){if(L.rows.length==0){E.remove(L)}});r();row=e[Math.min(e.length-1,J.y)];if(row){I.select(row[Math.min(row.length-1,J.x)].elm,true);I.collapse(true)}}function s(Q,O,S,P){var N,L,K,M,R;N=e[O][Q].elm.parentNode;for(K=1;K<=S;K++){N=E.getNext(N,"tr");if(N){for(L=Q;L>=0;L--){R=e[O+K][L].elm;if(R.parentNode==N){for(M=1;M<=P;M++){E.insertAfter(d(R),R)}break}}if(L==-1){for(M=1;M<=P;M++){N.insertBefore(d(N.cells[0]),N.cells[0])}}}}}function A(){c(e,function(K,L){c(K,function(N,M){var Q,P,R,O;if(h(N)){N=N.elm;Q=g(N,"colspan");P=g(N,"rowspan");if(Q>1||P>1){N.colSpan=N.rowSpan=1;for(O=0;O<Q-1;O++){E.insertAfter(d(N),N)}s(M,L,P-1,Q)}}})})}function o(S,P,V){var N,M,U,T,R,O,Q,K,S,L;if(S){pos=D(S);N=pos.x;M=pos.y;U=N+(P-1);T=M+(V-1)}else{N=J.x;M=J.y;U=B.x;T=B.y}Q=v(N,M);K=v(U,T);if(Q&&K&&Q.part==K.part){A();r();Q=v(N,M).elm;Q.colSpan=(U-N)+1;Q.rowSpan=(T-M)+1;for(O=M;O<=T;O++){for(R=N;R<=U;R++){S=e[O][R].elm;if(S!=Q){L=b.grep(S.childNodes);c(L,function(X,W){if(X.nodeName!="BR"||W!=L.length-1){Q.appendChild(X)}});E.remove(S)}}}p()}}function k(N){var K,P,M,O,Q,R,L,S;c(e,function(T,U){c(T,function(W,V){if(h(W)){W=W.elm;Q=W.parentNode;R=w(Q,false);K=U;if(N){return false}}});if(N){return !K}});for(O=0;O<e[0].length;O++){P=e[K][O].elm;if(P!=M){if(!N){rowSpan=g(P,"rowspan");if(rowSpan>1){P.rowSpan=rowSpan+1;continue}}else{if(K>0&&e[K-1][O]){S=e[K-1][O].elm;rowSpan=g(S,"rowspan");if(rowSpan>1){S.rowSpan=rowSpan+1;continue}}}L=d(P);L.colSpan=P.colSpan;R.appendChild(L);M=P}}if(R.hasChildNodes()){if(!N){E.insertAfter(R,Q)}else{Q.parentNode.insertBefore(R,Q)}}}function f(L){var M,K;c(e,function(N,O){c(N,function(Q,P){if(h(Q)){M=P;if(L){return false}}});if(L){return !M}});c(e,function(Q,R){var N=Q[M].elm,O,P;if(N!=K){P=g(N,"colspan");O=g(N,"rowspan");if(P==1){if(!L){E.insertAfter(d(N),N);s(M,R,O-1,P)}else{N.parentNode.insertBefore(d(N),N);s(M,R,O-1,P)}}else{N.colSpan++}K=N}})}function m(){var K=[];c(e,function(L,M){c(L,function(O,N){if(h(O)&&b.inArray(K,N)===-1){c(e,function(R){var P=R[N].elm,Q;Q=g(P,"colspan");if(Q>1){P.colSpan=Q-1}else{E.remove(P)}});K.push(N)}})});p()}function l(){var L;function K(O){var N,P,M;N=E.getNext(O,"tr");c(O.cells,function(Q){var R=g(Q,"rowspan");if(R>1){Q.rowSpan=R-1;P=D(Q);s(P.x,P.y,1,1)}});P=D(O.cells[0]);c(e[P.y],function(Q){var R;Q=Q.elm;if(Q!=M){R=g(Q,"rowspan");if(R<=1){E.remove(Q)}else{Q.rowSpan=R-1}M=Q}})}L=j();c(L.reverse(),function(M){K(M)});p()}function C(){var K=j();E.remove(K);p();return K}function H(){var K=j();c(K,function(M,L){K[L]=w(M,true)});return K}function z(M,L){var N=j(),K=N[L?0:N.length-1],O=K.cells.length;c(e,function(Q){var P;O=0;c(Q,function(S,R){if(S.real){O+=S.colspan}if(S.elm.parentNode==K){P=1}});if(P){return false}});if(!L){M.reverse()}c(M,function(R){var Q=R.cells.length,P;for(i=0;i<Q;i++){P=R.cells[i];P.colSpan=P.rowSpan=1}for(i=Q;i<O;i++){R.appendChild(d(R.cells[Q-1]))}for(i=O;i<Q;i++){E.remove(R.cells[i])}if(L){K.parentNode.insertBefore(R,K)}else{E.insertAfter(R,K)}})}function D(K){var L;c(e,function(M,N){c(M,function(P,O){if(P.elm==K){L={x:O,y:N};return false}});return !L});return L}function u(K){J=D(K)}function G(){var M,L,K;L=K=0;c(e,function(N,O){c(N,function(Q,P){var S,R;if(h(Q)){Q=e[O][P];if(P>L){L=P}if(O>K){K=O}if(Q.real){S=Q.colspan-1;R=Q.rowspan-1;if(S){if(P+S>L){L=P+S}}if(R){if(O+R>K){K=O+R}}}}})});return{x:L,y:K}}function t(Q){var N,M,S,R,L,K,O,P;B=D(Q);if(J&&B){N=Math.min(J.x,B.x);M=Math.min(J.y,B.y);S=Math.max(J.x,B.x);R=Math.max(J.y,B.y);L=S;K=R;for(y=M;y<=K;y++){Q=e[y][N];if(!Q.real){if(N-(Q.colspan-1)<N){N-=Q.colspan-1}}}for(x=N;x<=L;x++){Q=e[M][x];if(!Q.real){if(M-(Q.rowspan-1)<M){M-=Q.rowspan-1}}}for(y=M;y<=R;y++){for(x=N;x<=S;x++){Q=e[y][x];if(Q.real){O=Q.colspan-1;P=Q.rowspan-1;if(O){if(x+O>L){L=x+O}}if(P){if(y+P>K){K=y+P}}}}}E.removeClass(E.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=M;y<=K;y++){for(x=N;x<=L;x++){E.addClass(e[y][x].elm,"mceSelected")}}}}b.extend(this,{deleteTable:q,split:A,merge:o,insertRow:k,insertCol:f,deleteCols:m,deleteRows:l,cutRows:C,copyRows:H,pasteRows:z,getPos:D,setStartCell:u,setEndCell:t})}b.create("tinymce.plugins.TablePlugin",{init:function(e,f){var d,j;function h(m){var l=e.selection,k=e.dom.getParent(m||l.getNode(),"table");if(k){return new a(k,e.dom,l)}}function g(){e.getBody().style.webkitUserSelect="";e.dom.removeClass(e.dom.select("td.mceSelected,th.mceSelected"),"mceSelected")}c([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(k){e.addButton(k[0],{title:k[1],cmd:k[2],ui:k[3]})});if(!b.isIE){e.onClick.add(function(k,l){l=l.target;if(l.nodeName==="TABLE"){k.selection.select(l)}})}e.onNodeChange.add(function(l,k,o){var m;o=l.selection.getStart();m=l.dom.getParent(o,"td,th,caption");k.setActive("table",o.nodeName==="TABLE"||!!m);if(m&&m.nodeName==="CAPTION"){m=0}k.setDisabled("delete_table",!m);k.setDisabled("delete_col",!m);k.setDisabled("delete_table",!m);k.setDisabled("delete_row",!m);k.setDisabled("col_after",!m);k.setDisabled("col_before",!m);k.setDisabled("row_after",!m);k.setDisabled("row_before",!m);k.setDisabled("row_props",!m);k.setDisabled("cell_props",!m);k.setDisabled("split_cells",!m);k.setDisabled("merge_cells",!m)});e.onInit.add(function(l){var k,o,p=l.dom,m;d=l.windowManager;l.onMouseDown.add(function(q,r){if(r.button!=2){g();o=p.getParent(r.target,"td,th");k=p.getParent(o,"table")}});p.bind(l.getDoc(),"mouseover",function(t){var r,q,s=t.target;if(o&&(m||s!=o)&&(s.nodeName=="TD"||s.nodeName=="TH")){q=p.getParent(s,"table");if(q==k){if(!m){m=h(q);m.setStartCell(o);l.getBody().style.webkitUserSelect="none"}m.setEndCell(s)}r=l.selection.getSel();if(r.removeAllRanges){r.removeAllRanges()}else{r.empty()}t.preventDefault()}});l.onMouseUp.add(function(z,A){var r,t=z.selection,B,C=t.getSel(),q,u,s,w;if(o){if(m){z.getBody().style.webkitUserSelect=""}function v(D,F){var E=new b.dom.TreeWalker(D,D);do{if(D.nodeType==3&&b.trim(D.nodeValue).length!=0){if(F){r.setStart(D,0)}else{r.setEnd(D,D.nodeValue.length)}return}if(D.nodeName=="BR"){if(F){r.setStartBefore(D)}else{r.setEndBefore(D)}return}}while(D=(F?E.next():E.prev()))}B=p.select("td.mceSelected,th.mceSelected");if(B.length>0){r=p.createRng();u=B[0];w=B[B.length-1];v(u,1);q=new b.dom.TreeWalker(u,p.getParent(B[0],"table"));do{if(u.nodeName=="TD"||u.nodeName=="TH"){if(!p.hasClass(u,"mceSelected")){break}s=u}}while(u=q.next());v(s);t.setRng(r)}z.nodeChanged();o=m=k=null}});l.onKeyUp.add(function(q,r){g()});if(l&&l.plugins.contextmenu){l.plugins.contextmenu.onContextMenu.add(function(s,q,u){var v,t=l.selection,r=t.getNode()||l.getBody();if(l.dom.getParent(u,"td")||l.dom.getParent(u,"th")||l.dom.select("td.mceSelected,th.mceSelected").length){q.removeAll();if(r.nodeName=="A"&&!l.dom.getAttrib(r,"name")){q.add({title:"advanced.link_desc",icon:"link",cmd:l.plugins.advlink?"mceAdvLink":"mceLink",ui:true});q.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});q.addSeparator()}if(r.nodeName=="IMG"&&r.className.indexOf("mceItem")==-1){q.add({title:"advanced.image_desc",icon:"image",cmd:l.plugins.advimage?"mceAdvImage":"mceImage",ui:true});q.addSeparator()}q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});q.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});q.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});q.addSeparator();v=q.addMenu({title:"table.cell"});v.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});v.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});v.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});v=q.addMenu({title:"table.row"});v.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});v.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});v.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});v.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});v.addSeparator();v.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});v.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});v.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!j);v.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!j);v=q.addMenu({title:"table.col"});v.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});v.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});v.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{q.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!b.isIE){function n(){var q;for(q=l.getBody().lastChild;q&&q.nodeType==3&&!q.nodeValue.length;q=q.previousSibling){}if(q&&q.nodeName=="TABLE"){l.dom.add(l.getBody(),"p",null,'<br mce_bogus="1" />')}}if(b.isGecko){l.onKeyDown.add(function(r,t){var q,s,u=r.dom;if(t.keyCode==37||t.keyCode==38){q=r.selection.getRng();s=u.getParent(q.startContainer,"table");if(s&&r.getBody().firstChild==s){if(isAtStart(q,s)){q=u.createRng();q.setStartBefore(s);q.setEndBefore(s);r.selection.setRng(q);t.preventDefault()}}}})}l.onKeyUp.add(n);l.onSetContent.add(n);l.onVisualAid.add(n);l.onPreProcess.add(function(q,s){var r=s.node.lastChild;if(r&&r.childNodes.length==1&&r.firstChild.nodeName=="BR"){q.dom.remove(r)}});n()}});c({mceTableSplitCells:function(k){k.split()},mceTableMergeCells:function(l){var m,n,k;k=e.dom.getParent(e.selection.getNode(),"th,td");if(k){m=k.rowSpan;n=k.colSpan}if(!e.dom.select("td.mceSelected,th.mceSelected").length){d.open({url:f+"/merge_cells.htm",width:240+parseInt(e.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(e.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:m,cols:n,onaction:function(o){l.merge(k,o.cols,o.rows)},plugin_url:f})}else{l.merge()}},mceTableInsertRowBefore:function(k){k.insertRow(true)},mceTableInsertRowAfter:function(k){k.insertRow()},mceTableInsertColBefore:function(k){k.insertCol(true)},mceTableInsertColAfter:function(k){k.insertCol()},mceTableDeleteCol:function(k){k.deleteCols()},mceTableDeleteRow:function(k){k.deleteRows()},mceTableCutRow:function(k){j=k.cutRows()},mceTableCopyRow:function(k){j=k.copyRows()},mceTablePasteRowBefore:function(k){k.pasteRows(j,true)},mceTablePasteRowAfter:function(k){k.pasteRows(j)},mceTableDelete:function(k){k.deleteTable()}},function(l,k){e.addCommand(k,function(){var m=h();if(m){l(m);e.execCommand("mceRepaint");g()}})});c({mceInsertTable:function(k){d.open({url:f+"/table.htm",width:400+parseInt(e.getLang("table.table_delta_width",0)),height:320+parseInt(e.getLang("table.table_delta_height",0)),inline:1},{plugin_url:f,action:k?k.action:0})},mceTableRowProps:function(){d.open({url:f+"/row.htm",width:400+parseInt(e.getLang("table.rowprops_delta_width",0)),height:295+parseInt(e.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:f})},mceTableCellProps:function(){d.open({url:f+"/cell.htm",width:400+parseInt(e.getLang("table.cellprops_delta_width",0)),height:295+parseInt(e.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:f})}},function(l,k){e.addCommand(k,function(m,n){l(n)})})}});b.PluginManager.add("table",b.plugins.TablePlugin)})(tinymce);
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function(tinymce) {\r
+ var each = tinymce.each;\r
+\r
+ /**\r
+ * Table Grid class.\r
+ */\r
+ function TableGrid(table, dom, selection) {\r
+ var grid, startPos, endPos, selectedCell;\r
+\r
+ buildGrid();\r
+ selectedCell = dom.getParent(selection.getStart(), 'th,td');\r
+ if (selectedCell) {\r
+ startPos = getPos(selectedCell);\r
+ endPos = findEndPos();\r
+ selectedCell = getCell(startPos.x, startPos.y);\r
+ }\r
+\r
+ function cloneNode(node, children) {\r
+ node = node.cloneNode(children);\r
+ node.removeAttribute('id');\r
+\r
+ return node;\r
+ }\r
+\r
+ function buildGrid() {\r
+ var startY = 0;\r
+\r
+ grid = [];\r
+\r
+ each(['thead', 'tbody', 'tfoot'], function(part) {\r
+ var rows = dom.select(part + ' tr', table);\r
+\r
+ each(rows, function(tr, y) {\r
+ y += startY;\r
+\r
+ each(dom.select('td,th', tr), function(td, x) {\r
+ var x2, y2, rowspan, colspan;\r
+\r
+ // Skip over existing cells produced by rowspan\r
+ if (grid[y]) {\r
+ while (grid[y][x])\r
+ x++;\r
+ }\r
+\r
+ // Get col/rowspan from cell\r
+ rowspan = getSpanVal(td, 'rowspan');\r
+ colspan = getSpanVal(td, 'colspan');\r
+\r
+ // Fill out rowspan/colspan right and down\r
+ for (y2 = y; y2 < y + rowspan; y2++) {\r
+ if (!grid[y2])\r
+ grid[y2] = [];\r
+\r
+ for (x2 = x; x2 < x + colspan; x2++) {\r
+ grid[y2][x2] = {\r
+ part : part,\r
+ real : y2 == y && x2 == x,\r
+ elm : td,\r
+ rowspan : rowspan,\r
+ colspan : colspan\r
+ };\r
+ }\r
+ }\r
+ });\r
+ });\r
+\r
+ startY += rows.length;\r
+ });\r
+ };\r
+\r
+ function getCell(x, y) {\r
+ var row;\r
+\r
+ row = grid[y];\r
+ if (row)\r
+ return row[x];\r
+ };\r
+\r
+ function getSpanVal(td, name) {\r
+ return parseInt(td.getAttribute(name) || 1);\r
+ };\r
+\r
+ function isCellSelected(cell) {\r
+ return dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell;\r
+ };\r
+\r
+ function getSelectedRows() {\r
+ var rows = [];\r
+\r
+ each(table.rows, function(row) {\r
+ each(row.cells, function(cell) {\r
+ if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {\r
+ rows.push(row);\r
+ return false;\r
+ }\r
+ });\r
+ });\r
+\r
+ return rows;\r
+ };\r
+\r
+ function deleteTable() {\r
+ var rng = dom.createRng();\r
+\r
+ rng.setStartAfter(table);\r
+ rng.setEndAfter(table);\r
+\r
+ selection.setRng(rng);\r
+\r
+ dom.remove(table);\r
+ };\r
+\r
+ function cloneCell(cell) {\r
+ var formatNode;\r
+\r
+ // Clone formats\r
+ tinymce.walk(cell, function(node) {\r
+ var curNode;\r
+\r
+ if (node.nodeType == 3) {\r
+ each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {\r
+ node = cloneNode(node, false);\r
+\r
+ if (!formatNode)\r
+ formatNode = curNode = node;\r
+ else if (curNode)\r
+ curNode.appendChild(node);\r
+\r
+ curNode = node;\r
+ });\r
+\r
+ // Add something to the inner node\r
+ if (curNode)\r
+ curNode.innerHTML = tinymce.isIE ? ' ' : '<br _mce_bogus="1" />';\r
+\r
+ return false;\r
+ }\r
+ }, 'childNodes');\r
+\r
+ cell = cloneNode(cell, false);\r
+ cell.rowSpan = cell.colSpan = 1;\r
+\r
+ if (formatNode) {\r
+ cell.appendChild(formatNode);\r
+ } else {\r
+ if (!tinymce.isIE)\r
+ cell.innerHTML = '<br _mce_bogus="1" />';\r
+ }\r
+\r
+ return cell;\r
+ };\r
+\r
+ function cleanup() {\r
+ var rng = dom.createRng();\r
+\r
+ // Empty rows\r
+ each(dom.select('tr', table), function(tr) {\r
+ if (tr.cells.length == 0)\r
+ dom.remove(tr);\r
+ });\r
+\r
+ // Empty table\r
+ if (dom.select('tr', table).length == 0) {\r
+ rng.setStartAfter(table);\r
+ rng.setEndAfter(table);\r
+ selection.setRng(rng);\r
+ dom.remove(table);\r
+ return;\r
+ }\r
+\r
+ // Empty header/body/footer\r
+ each(dom.select('thead,tbody,tfoot', table), function(part) {\r
+ if (part.rows.length == 0)\r
+ dom.remove(part);\r
+ });\r
+\r
+ // Restore selection to start position if it still exists\r
+ buildGrid();\r
+\r
+ // Restore the selection to the closest table position\r
+ row = grid[Math.min(grid.length - 1, startPos.y)];\r
+ if (row) {\r
+ selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);\r
+ selection.collapse(true);\r
+ }\r
+ };\r
+\r
+ function fillLeftDown(x, y, rows, cols) {\r
+ var tr, x2, r, c, cell;\r
+\r
+ tr = grid[y][x].elm.parentNode;\r
+ for (r = 1; r <= rows; r++) {\r
+ tr = dom.getNext(tr, 'tr');\r
+\r
+ if (tr) {\r
+ // Loop left to find real cell\r
+ for (x2 = x; x2 >= 0; x2--) {\r
+ cell = grid[y + r][x2].elm;\r
+\r
+ if (cell.parentNode == tr) {\r
+ // Append clones after\r
+ for (c = 1; c <= cols; c++)\r
+ dom.insertAfter(cloneCell(cell), cell);\r
+\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (x2 == -1) {\r
+ // Insert nodes before first cell\r
+ for (c = 1; c <= cols; c++)\r
+ tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);\r
+ }\r
+ }\r
+ }\r
+ };\r
+\r
+ function split() {\r
+ each(grid, function(row, y) {\r
+ each(row, function(cell, x) {\r
+ var colSpan, rowSpan, newCell, i;\r
+\r
+ if (isCellSelected(cell)) {\r
+ cell = cell.elm;\r
+ colSpan = getSpanVal(cell, 'colspan');\r
+ rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+ if (colSpan > 1 || rowSpan > 1) {\r
+ cell.colSpan = cell.rowSpan = 1;\r
+\r
+ // Insert cells right\r
+ for (i = 0; i < colSpan - 1; i++)\r
+ dom.insertAfter(cloneCell(cell), cell);\r
+\r
+ fillLeftDown(x, y, rowSpan - 1, colSpan);\r
+ }\r
+ }\r
+ });\r
+ });\r
+ };\r
+\r
+ function merge(cell, cols, rows) {\r
+ var startX, startY, endX, endY, x, y, startCell, endCell, cell, children;\r
+\r
+ // Use specified cell and cols/rows\r
+ if (cell) {\r
+ pos = getPos(cell);\r
+ startX = pos.x;\r
+ startY = pos.y;\r
+ endX = startX + (cols - 1);\r
+ endY = startY + (rows - 1);\r
+ } else {\r
+ // Use selection\r
+ startX = startPos.x;\r
+ startY = startPos.y;\r
+ endX = endPos.x;\r
+ endY = endPos.y;\r
+ }\r
+\r
+ // Find start/end cells\r
+ startCell = getCell(startX, startY);\r
+ endCell = getCell(endX, endY);\r
+\r
+ // Check if the cells exists and if they are of the same part for example tbody = tbody\r
+ if (startCell && endCell && startCell.part == endCell.part) {\r
+ // Split and rebuild grid\r
+ split();\r
+ buildGrid();\r
+\r
+ // Set row/col span to start cell\r
+ startCell = getCell(startX, startY).elm;\r
+ startCell.colSpan = (endX - startX) + 1;\r
+ startCell.rowSpan = (endY - startY) + 1;\r
+\r
+ // Remove other cells and add it's contents to the start cell\r
+ for (y = startY; y <= endY; y++) {\r
+ for (x = startX; x <= endX; x++) {\r
+ cell = grid[y][x].elm;\r
+\r
+ if (cell != startCell) {\r
+ // Move children to startCell\r
+ children = tinymce.grep(cell.childNodes);\r
+ each(children, function(node, i) {\r
+ // Jump over last BR element\r
+ if (node.nodeName != 'BR' || i != children.length - 1)\r
+ startCell.appendChild(node);\r
+ });\r
+\r
+ // Remove cell\r
+ dom.remove(cell);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Remove empty rows etc and restore caret location\r
+ cleanup();\r
+ }\r
+ };\r
+\r
+ function insertRow(before) {\r
+ var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell;\r
+\r
+ // Find first/last row\r
+ each(grid, function(row, y) {\r
+ each(row, function(cell, x) {\r
+ if (isCellSelected(cell)) {\r
+ cell = cell.elm;\r
+ rowElm = cell.parentNode;\r
+ newRow = cloneNode(rowElm, false);\r
+ posY = y;\r
+\r
+ if (before)\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (before)\r
+ return !posY;\r
+ });\r
+\r
+ for (x = 0; x < grid[0].length; x++) {\r
+ cell = grid[posY][x].elm;\r
+\r
+ if (cell != lastCell) {\r
+ if (!before) {\r
+ rowSpan = getSpanVal(cell, 'rowspan');\r
+ if (rowSpan > 1) {\r
+ cell.rowSpan = rowSpan + 1;\r
+ continue;\r
+ }\r
+ } else {\r
+ // Check if cell above can be expanded\r
+ if (posY > 0 && grid[posY - 1][x]) {\r
+ otherCell = grid[posY - 1][x].elm;\r
+ rowSpan = getSpanVal(otherCell, 'rowspan');\r
+ if (rowSpan > 1) {\r
+ otherCell.rowSpan = rowSpan + 1;\r
+ continue;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Insert new cell into new row\r
+ newCell = cloneCell(cell)\r
+ newCell.colSpan = cell.colSpan;\r
+ newRow.appendChild(newCell);\r
+\r
+ lastCell = cell;\r
+ }\r
+ }\r
+\r
+ if (newRow.hasChildNodes()) {\r
+ if (!before)\r
+ dom.insertAfter(newRow, rowElm);\r
+ else\r
+ rowElm.parentNode.insertBefore(newRow, rowElm);\r
+ }\r
+ };\r
+\r
+ function insertCol(before) {\r
+ var posX, lastCell;\r
+\r
+ // Find first/last column\r
+ each(grid, function(row, y) {\r
+ each(row, function(cell, x) {\r
+ if (isCellSelected(cell)) {\r
+ posX = x;\r
+\r
+ if (before)\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (before)\r
+ return !posX;\r
+ });\r
+\r
+ each(grid, function(row, y) {\r
+ var cell = row[posX].elm, rowSpan, colSpan;\r
+\r
+ if (cell != lastCell) {\r
+ colSpan = getSpanVal(cell, 'colspan');\r
+ rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+ if (colSpan == 1) {\r
+ if (!before) {\r
+ dom.insertAfter(cloneCell(cell), cell);\r
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);\r
+ } else {\r
+ cell.parentNode.insertBefore(cloneCell(cell), cell);\r
+ fillLeftDown(posX, y, rowSpan - 1, colSpan);\r
+ }\r
+ } else\r
+ cell.colSpan++;\r
+\r
+ lastCell = cell;\r
+ }\r
+ });\r
+ };\r
+\r
+ function deleteCols() {\r
+ var cols = [];\r
+\r
+ // Get selected column indexes\r
+ each(grid, function(row, y) {\r
+ each(row, function(cell, x) {\r
+ if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {\r
+ each(grid, function(row) {\r
+ var cell = row[x].elm, colSpan;\r
+\r
+ colSpan = getSpanVal(cell, 'colspan');\r
+\r
+ if (colSpan > 1)\r
+ cell.colSpan = colSpan - 1;\r
+ else\r
+ dom.remove(cell);\r
+ });\r
+\r
+ cols.push(x);\r
+ }\r
+ });\r
+ });\r
+\r
+ cleanup();\r
+ };\r
+\r
+ function deleteRows() {\r
+ var rows;\r
+\r
+ function deleteRow(tr) {\r
+ var nextTr, pos, lastCell;\r
+\r
+ nextTr = dom.getNext(tr, 'tr');\r
+\r
+ // Move down row spanned cells\r
+ each(tr.cells, function(cell) {\r
+ var rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+ if (rowSpan > 1) {\r
+ cell.rowSpan = rowSpan - 1;\r
+ pos = getPos(cell);\r
+ fillLeftDown(pos.x, pos.y, 1, 1);\r
+ }\r
+ });\r
+\r
+ // Delete cells\r
+ pos = getPos(tr.cells[0]);\r
+ each(grid[pos.y], function(cell) {\r
+ var rowSpan;\r
+\r
+ cell = cell.elm;\r
+\r
+ if (cell != lastCell) {\r
+ rowSpan = getSpanVal(cell, 'rowspan');\r
+\r
+ if (rowSpan <= 1)\r
+ dom.remove(cell);\r
+ else\r
+ cell.rowSpan = rowSpan - 1;\r
+\r
+ lastCell = cell;\r
+ }\r
+ });\r
+ };\r
+\r
+ // Get selected rows and move selection out of scope\r
+ rows = getSelectedRows();\r
+\r
+ // Delete all selected rows\r
+ each(rows.reverse(), function(tr) {\r
+ deleteRow(tr);\r
+ });\r
+\r
+ cleanup();\r
+ };\r
+\r
+ function cutRows() {\r
+ var rows = getSelectedRows();\r
+\r
+ dom.remove(rows);\r
+ cleanup();\r
+\r
+ return rows;\r
+ };\r
+\r
+ function copyRows() {\r
+ var rows = getSelectedRows();\r
+\r
+ each(rows, function(row, i) {\r
+ rows[i] = cloneNode(row, true);\r
+ });\r
+\r
+ return rows;\r
+ };\r
+\r
+ function pasteRows(rows, before) {\r
+ var selectedRows = getSelectedRows(),\r
+ targetRow = selectedRows[before ? 0 : selectedRows.length - 1],\r
+ targetCellCount = targetRow.cells.length;\r
+\r
+ // Calc target cell count\r
+ each(grid, function(row) {\r
+ var match;\r
+\r
+ targetCellCount = 0;\r
+ each(row, function(cell, x) {\r
+ if (cell.real)\r
+ targetCellCount += cell.colspan;\r
+\r
+ if (cell.elm.parentNode == targetRow)\r
+ match = 1;\r
+ });\r
+\r
+ if (match)\r
+ return false;\r
+ });\r
+\r
+ if (!before)\r
+ rows.reverse();\r
+\r
+ each(rows, function(row) {\r
+ var cellCount = row.cells.length, cell;\r
+\r
+ // Remove col/rowspans\r
+ for (i = 0; i < cellCount; i++) {\r
+ cell = row.cells[i];\r
+ cell.colSpan = cell.rowSpan = 1;\r
+ }\r
+\r
+ // Needs more cells\r
+ for (i = cellCount; i < targetCellCount; i++)\r
+ row.appendChild(cloneCell(row.cells[cellCount - 1]));\r
+\r
+ // Needs less cells\r
+ for (i = targetCellCount; i < cellCount; i++)\r
+ dom.remove(row.cells[i]);\r
+\r
+ // Add before/after\r
+ if (before)\r
+ targetRow.parentNode.insertBefore(row, targetRow);\r
+ else\r
+ dom.insertAfter(row, targetRow);\r
+ });\r
+ };\r
+\r
+ function getPos(target) {\r
+ var pos;\r
+\r
+ each(grid, function(row, y) {\r
+ each(row, function(cell, x) {\r
+ if (cell.elm == target) {\r
+ pos = {x : x, y : y};\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return !pos;\r
+ });\r
+\r
+ return pos;\r
+ };\r
+\r
+ function setStartCell(cell) {\r
+ startPos = getPos(cell);\r
+ };\r
+\r
+ function findEndPos() {\r
+ var pos, maxX, maxY;\r
+\r
+ maxX = maxY = 0;\r
+\r
+ each(grid, function(row, y) {\r
+ each(row, function(cell, x) {\r
+ var colSpan, rowSpan;\r
+\r
+ if (isCellSelected(cell)) {\r
+ cell = grid[y][x];\r
+\r
+ if (x > maxX)\r
+ maxX = x;\r
+\r
+ if (y > maxY)\r
+ maxY = y;\r
+\r
+ if (cell.real) {\r
+ colSpan = cell.colspan - 1;\r
+ rowSpan = cell.rowspan - 1;\r
+\r
+ if (colSpan) {\r
+ if (x + colSpan > maxX)\r
+ maxX = x + colSpan;\r
+ }\r
+\r
+ if (rowSpan) {\r
+ if (y + rowSpan > maxY)\r
+ maxY = y + rowSpan;\r
+ }\r
+ }\r
+ }\r
+ });\r
+ });\r
+\r
+ return {x : maxX, y : maxY};\r
+ };\r
+\r
+ function setEndCell(cell) {\r
+ var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;\r
+\r
+ endPos = getPos(cell);\r
+\r
+ if (startPos && endPos) {\r
+ // Get start/end positions\r
+ startX = Math.min(startPos.x, endPos.x);\r
+ startY = Math.min(startPos.y, endPos.y);\r
+ endX = Math.max(startPos.x, endPos.x);\r
+ endY = Math.max(startPos.y, endPos.y);\r
+\r
+ // Expand end positon to include spans\r
+ maxX = endX;\r
+ maxY = endY;\r
+\r
+ // Expand startX\r
+ for (y = startY; y <= maxY; y++) {\r
+ cell = grid[y][startX];\r
+\r
+ if (!cell.real) {\r
+ if (startX - (cell.colspan - 1) < startX)\r
+ startX -= cell.colspan - 1;\r
+ }\r
+ }\r
+\r
+ // Expand startY\r
+ for (x = startX; x <= maxX; x++) {\r
+ cell = grid[startY][x];\r
+\r
+ if (!cell.real) {\r
+ if (startY - (cell.rowspan - 1) < startY)\r
+ startY -= cell.rowspan - 1;\r
+ }\r
+ }\r
+\r
+ // Find max X, Y\r
+ for (y = startY; y <= endY; y++) {\r
+ for (x = startX; x <= endX; x++) {\r
+ cell = grid[y][x];\r
+\r
+ if (cell.real) {\r
+ colSpan = cell.colspan - 1;\r
+ rowSpan = cell.rowspan - 1;\r
+\r
+ if (colSpan) {\r
+ if (x + colSpan > maxX)\r
+ maxX = x + colSpan;\r
+ }\r
+\r
+ if (rowSpan) {\r
+ if (y + rowSpan > maxY)\r
+ maxY = y + rowSpan;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Remove current selection\r
+ dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');\r
+\r
+ // Add new selection\r
+ for (y = startY; y <= maxY; y++) {\r
+ for (x = startX; x <= maxX; x++)\r
+ dom.addClass(grid[y][x].elm, 'mceSelected');\r
+ }\r
+ }\r
+ };\r
+\r
+ // Expose to public\r
+ tinymce.extend(this, {\r
+ deleteTable : deleteTable,\r
+ split : split,\r
+ merge : merge,\r
+ insertRow : insertRow,\r
+ insertCol : insertCol,\r
+ deleteCols : deleteCols,\r
+ deleteRows : deleteRows,\r
+ cutRows : cutRows,\r
+ copyRows : copyRows,\r
+ pasteRows : pasteRows,\r
+ getPos : getPos,\r
+ setStartCell : setStartCell,\r
+ setEndCell : setEndCell\r
+ });\r
+ };\r
+\r
+ tinymce.create('tinymce.plugins.TablePlugin', {\r
+ init : function(ed, url) {\r
+ var winMan, clipboardRows;\r
+\r
+ function createTableGrid(node) {\r
+ var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');\r
+\r
+ if (tblElm)\r
+ return new TableGrid(tblElm, ed.dom, selection);\r
+ };\r
+\r
+ function cleanup() {\r
+ // Restore selection possibilities\r
+ ed.getBody().style.webkitUserSelect = '';\r
+ ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');\r
+ };\r
+\r
+ // Register buttons\r
+ each([\r
+ ['table', 'table.desc', 'mceInsertTable', true],\r
+ ['delete_table', 'table.del', 'mceTableDelete'],\r
+ ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],\r
+ ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],\r
+ ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],\r
+ ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],\r
+ ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],\r
+ ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],\r
+ ['row_props', 'table.row_desc', 'mceTableRowProps', true],\r
+ ['cell_props', 'table.cell_desc', 'mceTableCellProps', true],\r
+ ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],\r
+ ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]\r
+ ], function(c) {\r
+ ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});\r
+ });\r
+\r
+ // Select whole table is a table border is clicked\r
+ if (!tinymce.isIE) {\r
+ ed.onClick.add(function(ed, e) {\r
+ e = e.target;\r
+\r
+ if (e.nodeName === 'TABLE')\r
+ ed.selection.select(e);\r
+ });\r
+ }\r
+\r
+ // Handle node change updates\r
+ ed.onNodeChange.add(function(ed, cm, n) {\r
+ var p;\r
+\r
+ n = ed.selection.getStart();\r
+ p = ed.dom.getParent(n, 'td,th,caption');\r
+ cm.setActive('table', n.nodeName === 'TABLE' || !!p);\r
+\r
+ // Disable table tools if we are in caption\r
+ if (p && p.nodeName === 'CAPTION')\r
+ p = 0;\r
+\r
+ cm.setDisabled('delete_table', !p);\r
+ cm.setDisabled('delete_col', !p);\r
+ cm.setDisabled('delete_table', !p);\r
+ cm.setDisabled('delete_row', !p);\r
+ cm.setDisabled('col_after', !p);\r
+ cm.setDisabled('col_before', !p);\r
+ cm.setDisabled('row_after', !p);\r
+ cm.setDisabled('row_before', !p);\r
+ cm.setDisabled('row_props', !p);\r
+ cm.setDisabled('cell_props', !p);\r
+ cm.setDisabled('split_cells', !p);\r
+ cm.setDisabled('merge_cells', !p);\r
+ });\r
+\r
+ ed.onInit.add(function(ed) {\r
+ var startTable, startCell, dom = ed.dom, tableGrid;\r
+\r
+ winMan = ed.windowManager;\r
+\r
+ // Add cell selection logic\r
+ ed.onMouseDown.add(function(ed, e) {\r
+ if (e.button != 2) {\r
+ cleanup();\r
+\r
+ startCell = dom.getParent(e.target, 'td,th');\r
+ startTable = dom.getParent(startCell, 'table');\r
+ }\r
+ });\r
+\r
+ dom.bind(ed.getDoc(), 'mouseover', function(e) {\r
+ var sel, table, target = e.target;\r
+\r
+ if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {\r
+ table = dom.getParent(target, 'table');\r
+ if (table == startTable) {\r
+ if (!tableGrid) {\r
+ tableGrid = createTableGrid(table);\r
+ tableGrid.setStartCell(startCell);\r
+\r
+ ed.getBody().style.webkitUserSelect = 'none';\r
+ }\r
+\r
+ tableGrid.setEndCell(target);\r
+ }\r
+\r
+ // Remove current selection\r
+ sel = ed.selection.getSel();\r
+\r
+ if (sel.removeAllRanges)\r
+ sel.removeAllRanges();\r
+ else\r
+ sel.empty();\r
+\r
+ e.preventDefault();\r
+ }\r
+ });\r
+\r
+ ed.onMouseUp.add(function(ed, e) {\r
+ var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;\r
+\r
+ // Move selection to startCell\r
+ if (startCell) {\r
+ if (tableGrid)\r
+ ed.getBody().style.webkitUserSelect = '';\r
+\r
+ function setPoint(node, start) {\r
+ var walker = new tinymce.dom.TreeWalker(node, node);\r
+\r
+ do {\r
+ // Text node\r
+ if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {\r
+ if (start)\r
+ rng.setStart(node, 0);\r
+ else\r
+ rng.setEnd(node, node.nodeValue.length);\r
+\r
+ return;\r
+ }\r
+\r
+ // BR element\r
+ if (node.nodeName == 'BR') {\r
+ if (start)\r
+ rng.setStartBefore(node);\r
+ else\r
+ rng.setEndBefore(node);\r
+\r
+ return;\r
+ }\r
+ } while (node = (start ? walker.next() : walker.prev()));\r
+ };\r
+\r
+ // Try to expand text selection as much as we can only Gecko supports cell selection\r
+ selectedCells = dom.select('td.mceSelected,th.mceSelected');\r
+ if (selectedCells.length > 0) {\r
+ rng = dom.createRng();\r
+ node = selectedCells[0];\r
+ endNode = selectedCells[selectedCells.length - 1];\r
+\r
+ setPoint(node, 1);\r
+ walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));\r
+\r
+ do {\r
+ if (node.nodeName == 'TD' || node.nodeName == 'TH') {\r
+ if (!dom.hasClass(node, 'mceSelected'))\r
+ break;\r
+\r
+ lastNode = node;\r
+ }\r
+ } while (node = walker.next());\r
+\r
+ setPoint(lastNode);\r
+\r
+ sel.setRng(rng);\r
+ }\r
+\r
+ ed.nodeChanged();\r
+ startCell = tableGrid = startTable = null;\r
+ }\r
+ });\r
+\r
+ ed.onKeyUp.add(function(ed, e) {\r
+ cleanup();\r
+ });\r
+\r
+ // Add context menu\r
+ if (ed && ed.plugins.contextmenu) {\r
+ ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {\r
+ var sm, se = ed.selection, el = se.getNode() || ed.getBody();\r
+\r
+ if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {\r
+ m.removeAll();\r
+\r
+ if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {\r
+ m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});\r
+ m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});\r
+ m.addSeparator();\r
+ }\r
+\r
+ if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {\r
+ m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});\r
+ m.addSeparator();\r
+ }\r
+\r
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});\r
+ m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});\r
+ m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});\r
+ m.addSeparator();\r
+\r
+ // Cell menu\r
+ sm = m.addMenu({title : 'table.cell'});\r
+ sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});\r
+ sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});\r
+ sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});\r
+\r
+ // Row menu\r
+ sm = m.addMenu({title : 'table.row'});\r
+ sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});\r
+ sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});\r
+ sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});\r
+ sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});\r
+ sm.addSeparator();\r
+ sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});\r
+ sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});\r
+ sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);\r
+ sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);\r
+\r
+ // Column menu\r
+ sm = m.addMenu({title : 'table.col'});\r
+ sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});\r
+ sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});\r
+ sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});\r
+ } else\r
+ m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});\r
+ });\r
+ }\r
+\r
+ // Fixes an issue on Gecko where it's impossible to place the caret behind a table\r
+ // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled\r
+ if (!tinymce.isIE) {\r
+ function fixTableCaretPos() {\r
+ var last;\r
+\r
+ // Skip empty text nodes form the end\r
+ for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;\r
+\r
+ if (last && last.nodeName == 'TABLE')\r
+ ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');\r
+ };\r
+\r
+ // Fixes an bug where it's impossible to place the caret before a table in Gecko\r
+ // this fix solves it by detecting when the caret is at the beginning of such a table\r
+ // and then manually moves the caret infront of the table\r
+ if (tinymce.isGecko) {\r
+ ed.onKeyDown.add(function(ed, e) {\r
+ var rng, table, dom = ed.dom;\r
+\r
+ // On gecko it's not possible to place the caret before a table\r
+ if (e.keyCode == 37 || e.keyCode == 38) {\r
+ rng = ed.selection.getRng();\r
+ table = dom.getParent(rng.startContainer, 'table');\r
+\r
+ if (table && ed.getBody().firstChild == table) {\r
+ if (isAtStart(rng, table)) {\r
+ rng = dom.createRng();\r
+\r
+ rng.setStartBefore(table);\r
+ rng.setEndBefore(table);\r
+\r
+ ed.selection.setRng(rng);\r
+\r
+ e.preventDefault();\r
+ }\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ ed.onKeyUp.add(fixTableCaretPos);\r
+ ed.onSetContent.add(fixTableCaretPos);\r
+ ed.onVisualAid.add(fixTableCaretPos);\r
+\r
+ ed.onPreProcess.add(function(ed, o) {\r
+ var last = o.node.lastChild;\r
+\r
+ if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')\r
+ ed.dom.remove(last);\r
+ });\r
+\r
+ fixTableCaretPos();\r
+ }\r
+ });\r
+\r
+ // Register action commands\r
+ each({\r
+ mceTableSplitCells : function(grid) {\r
+ grid.split();\r
+ },\r
+\r
+ mceTableMergeCells : function(grid) {\r
+ var rowSpan, colSpan, cell;\r
+\r
+ cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');\r
+ if (cell) {\r
+ rowSpan = cell.rowSpan;\r
+ colSpan = cell.colSpan;\r
+ }\r
+\r
+ if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {\r
+ winMan.open({\r
+ url : url + '/merge_cells.htm',\r
+ width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),\r
+ height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ rows : rowSpan,\r
+ cols : colSpan,\r
+ onaction : function(data) {\r
+ grid.merge(cell, data.cols, data.rows);\r
+ },\r
+ plugin_url : url\r
+ });\r
+ } else\r
+ grid.merge();\r
+ },\r
+\r
+ mceTableInsertRowBefore : function(grid) {\r
+ grid.insertRow(true);\r
+ },\r
+\r
+ mceTableInsertRowAfter : function(grid) {\r
+ grid.insertRow();\r
+ },\r
+\r
+ mceTableInsertColBefore : function(grid) {\r
+ grid.insertCol(true);\r
+ },\r
+\r
+ mceTableInsertColAfter : function(grid) {\r
+ grid.insertCol();\r
+ },\r
+\r
+ mceTableDeleteCol : function(grid) {\r
+ grid.deleteCols();\r
+ },\r
+\r
+ mceTableDeleteRow : function(grid) {\r
+ grid.deleteRows();\r
+ },\r
+\r
+ mceTableCutRow : function(grid) {\r
+ clipboardRows = grid.cutRows();\r
+ },\r
+\r
+ mceTableCopyRow : function(grid) {\r
+ clipboardRows = grid.copyRows();\r
+ },\r
+\r
+ mceTablePasteRowBefore : function(grid) {\r
+ grid.pasteRows(clipboardRows, true);\r
+ },\r
+\r
+ mceTablePasteRowAfter : function(grid) {\r
+ grid.pasteRows(clipboardRows);\r
+ },\r
+\r
+ mceTableDelete : function(grid) {\r
+ grid.deleteTable();\r
+ }\r
+ }, function(func, name) {\r
+ ed.addCommand(name, function() {\r
+ var grid = createTableGrid();\r
+\r
+ if (grid) {\r
+ func(grid);\r
+ ed.execCommand('mceRepaint');\r
+ cleanup();\r
+ }\r
+ });\r
+ });\r
+\r
+ // Register dialog commands\r
+ each({\r
+ mceInsertTable : function(val) {\r
+ winMan.open({\r
+ url : url + '/table.htm',\r
+ width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),\r
+ height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url,\r
+ action : val ? val.action : 0\r
+ });\r
+ },\r
+\r
+ mceTableRowProps : function() {\r
+ winMan.open({\r
+ url : url + '/row.htm',\r
+ width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),\r
+ height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ },\r
+\r
+ mceTableCellProps : function() {\r
+ winMan.open({\r
+ url : url + '/cell.htm',\r
+ width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),\r
+ height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ }\r
+ }, function(func, name) {\r
+ ed.addCommand(name, function(ui, val) {\r
+ func(val);\r
+ });\r
+ });\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);\r
+})(tinymce);
\ No newline at end of file
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var ed;\r
+\r
+function init() {\r
+ ed = tinyMCEPopup.editor;\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+ document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\r
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')\r
+\r
+ var inst = ed;\r
+ var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th");\r
+ var formObj = document.forms[0];\r
+ var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));\r
+\r
+ // Get table cell data\r
+ var celltype = tdElm.nodeName.toLowerCase();\r
+ var align = ed.dom.getAttrib(tdElm, 'align');\r
+ var valign = ed.dom.getAttrib(tdElm, 'valign');\r
+ var width = trimSize(getStyle(tdElm, 'width', 'width'));\r
+ var height = trimSize(getStyle(tdElm, 'height', 'height'));\r
+ var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));\r
+ var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));\r
+ var className = ed.dom.getAttrib(tdElm, 'class');\r
+ var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
+ var id = ed.dom.getAttrib(tdElm, 'id');\r
+ var lang = ed.dom.getAttrib(tdElm, 'lang');\r
+ var dir = ed.dom.getAttrib(tdElm, 'dir');\r
+ var scope = ed.dom.getAttrib(tdElm, 'scope');\r
+\r
+ // Setup form\r
+ addClassesToList('class', 'table_cell_styles');\r
+ TinyMCE_EditableSelects.init();\r
+\r
+ if (!ed.dom.hasClass(tdElm, 'mceSelected')) {\r
+ formObj.bordercolor.value = bordercolor;\r
+ formObj.bgcolor.value = bgcolor;\r
+ formObj.backgroundimage.value = backgroundimage;\r
+ formObj.width.value = width;\r
+ formObj.height.value = height;\r
+ formObj.id.value = id;\r
+ formObj.lang.value = lang;\r
+ formObj.style.value = ed.dom.serializeStyle(st);\r
+ selectByValue(formObj, 'align', align);\r
+ selectByValue(formObj, 'valign', valign);\r
+ selectByValue(formObj, 'class', className, true, true);\r
+ selectByValue(formObj, 'celltype', celltype);\r
+ selectByValue(formObj, 'dir', dir);\r
+ selectByValue(formObj, 'scope', scope);\r
+\r
+ // Resize some elements\r
+ if (isVisible('backgroundimagebrowser'))\r
+ document.getElementById('backgroundimage').style.width = '180px';\r
+\r
+ updateColor('bordercolor_pick', 'bordercolor');\r
+ updateColor('bgcolor_pick', 'bgcolor');\r
+ } else\r
+ tinyMCEPopup.dom.hide('action');\r
+}\r
+\r
+function updateAction() {\r
+ var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+ el = ed.selection.getStart();\r
+ tdElm = ed.dom.getParent(el, "td,th");\r
+ trElm = ed.dom.getParent(el, "tr");\r
+ tableElm = ed.dom.getParent(el, "table");\r
+\r
+ // Cell is selected\r
+ if (ed.dom.hasClass(tdElm, 'mceSelected')) {\r
+ // Update all selected sells\r
+ tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) {\r
+ updateCell(td);\r
+ });\r
+\r
+ ed.addVisual();\r
+ ed.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ ed.execCommand('mceBeginUndoLevel');\r
+\r
+ switch (getSelectValue(formObj, 'action')) {\r
+ case "cell":\r
+ var celltype = getSelectValue(formObj, 'celltype');\r
+ var scope = getSelectValue(formObj, 'scope');\r
+\r
+ function doUpdate(s) {\r
+ if (s) {\r
+ updateCell(tdElm);\r
+\r
+ ed.addVisual();\r
+ ed.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+ }\r
+ };\r
+\r
+ if (ed.getParam("accessibility_warnings", 1)) {\r
+ if (celltype == "th" && scope == "")\r
+ tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);\r
+ else\r
+ doUpdate(1);\r
+\r
+ return;\r
+ }\r
+\r
+ updateCell(tdElm);\r
+ break;\r
+\r
+ case "row":\r
+ var cell = trElm.firstChild;\r
+\r
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
+ cell = nextCell(cell);\r
+\r
+ do {\r
+ cell = updateCell(cell, true);\r
+ } while ((cell = nextCell(cell)) != null);\r
+\r
+ break;\r
+\r
+ case "all":\r
+ var rows = tableElm.getElementsByTagName("tr");\r
+\r
+ for (var i=0; i<rows.length; i++) {\r
+ var cell = rows[i].firstChild;\r
+\r
+ if (cell.nodeName != "TD" && cell.nodeName != "TH")\r
+ cell = nextCell(cell);\r
+\r
+ do {\r
+ cell = updateCell(cell, true);\r
+ } while ((cell = nextCell(cell)) != null);\r
+ }\r
+\r
+ break;\r
+ }\r
+\r
+ ed.addVisual();\r
+ ed.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function nextCell(elm) {\r
+ while ((elm = elm.nextSibling) != null) {\r
+ if (elm.nodeName == "TD" || elm.nodeName == "TH")\r
+ return elm;\r
+ }\r
+\r
+ return null;\r
+}\r
+\r
+function updateCell(td, skip_id) {\r
+ var inst = ed;\r
+ var formObj = document.forms[0];\r
+ var curCellType = td.nodeName.toLowerCase();\r
+ var celltype = getSelectValue(formObj, 'celltype');\r
+ var doc = inst.getDoc();\r
+ var dom = ed.dom;\r
+\r
+ if (!skip_id)\r
+ td.setAttribute('id', formObj.id.value);\r
+\r
+ td.setAttribute('align', formObj.align.value);\r
+ td.setAttribute('vAlign', formObj.valign.value);\r
+ td.setAttribute('lang', formObj.lang.value);\r
+ td.setAttribute('dir', getSelectValue(formObj, 'dir'));\r
+ td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));\r
+ td.setAttribute('scope', formObj.scope.value);\r
+ ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class'));\r
+\r
+ // Clear deprecated attributes\r
+ ed.dom.setAttrib(td, 'width', '');\r
+ ed.dom.setAttrib(td, 'height', '');\r
+ ed.dom.setAttrib(td, 'bgColor', '');\r
+ ed.dom.setAttrib(td, 'borderColor', '');\r
+ ed.dom.setAttrib(td, 'background', '');\r
+\r
+ // Set styles\r
+ td.style.width = getCSSSize(formObj.width.value);\r
+ td.style.height = getCSSSize(formObj.height.value);\r
+ if (formObj.bordercolor.value != "") {\r
+ td.style.borderColor = formObj.bordercolor.value;\r
+ td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;\r
+ td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;\r
+ } else\r
+ td.style.borderColor = '';\r
+\r
+ td.style.backgroundColor = formObj.bgcolor.value;\r
+\r
+ if (formObj.backgroundimage.value != "")\r
+ td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";\r
+ else\r
+ td.style.backgroundImage = '';\r
+\r
+ if (curCellType != celltype) {\r
+ // changing to a different node type\r
+ var newCell = doc.createElement(celltype);\r
+\r
+ for (var c=0; c<td.childNodes.length; c++)\r
+ newCell.appendChild(td.childNodes[c].cloneNode(1));\r
+\r
+ for (var a=0; a<td.attributes.length; a++)\r
+ ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));\r
+\r
+ td.parentNode.replaceChild(newCell, td);\r
+ td = newCell;\r
+ }\r
+\r
+ dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));\r
+\r
+ return td;\r
+}\r
+\r
+function changedBackgroundImage() {\r
+ var formObj = document.forms[0];\r
+ var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
+\r
+ formObj.style.value = ed.dom.serializeStyle(st);\r
+}\r
+\r
+function changedSize() {\r
+ var formObj = document.forms[0];\r
+ var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+ var width = formObj.width.value;\r
+ if (width != "")\r
+ st['width'] = getCSSSize(width);\r
+ else\r
+ st['width'] = "";\r
+\r
+ var height = formObj.height.value;\r
+ if (height != "")\r
+ st['height'] = getCSSSize(height);\r
+ else\r
+ st['height'] = "";\r
+\r
+ formObj.style.value = ed.dom.serializeStyle(st);\r
+}\r
+\r
+function changedColor() {\r
+ var formObj = document.forms[0];\r
+ var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+ st['background-color'] = formObj.bgcolor.value;\r
+ st['border-color'] = formObj.bordercolor.value;\r
+\r
+ formObj.style.value = ed.dom.serializeStyle(st);\r
+}\r
+\r
+function changedStyle() {\r
+ var formObj = document.forms[0];\r
+ var st = ed.dom.parseStyle(formObj.style.value);\r
+\r
+ if (st['background-image'])\r
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+ else\r
+ formObj.backgroundimage.value = '';\r
+\r
+ if (st['width'])\r
+ formObj.width.value = trimSize(st['width']);\r
+\r
+ if (st['height'])\r
+ formObj.height.value = trimSize(st['height']);\r
+\r
+ if (st['background-color']) {\r
+ formObj.bgcolor.value = st['background-color'];\r
+ updateColor('bgcolor_pick','bgcolor');\r
+ }\r
+\r
+ if (st['border-color']) {\r
+ formObj.bordercolor.value = st['border-color'];\r
+ updateColor('bordercolor_pick','bordercolor');\r
+ }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var MergeCellsDialog = {\r
+ init : function() {\r
+ var f = document.forms[0];\r
+\r
+ f.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);\r
+ f.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);\r
+ },\r
+\r
+ merge : function() {\r
+ var func, f = document.forms[0];\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ func = tinyMCEPopup.getWindowArg('onaction');\r
+\r
+ func({\r
+ cols : f.numcols.value,\r
+ rows : f.numrows.value\r
+ });\r
+\r
+ tinyMCEPopup.close();\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+function init() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+\r
+ var inst = tinyMCEPopup.editor;\r
+ var dom = inst.dom;\r
+ var trElm = dom.getParent(inst.selection.getStart(), "tr");\r
+ var formObj = document.forms[0];\r
+ var st = dom.parseStyle(dom.getAttrib(trElm, "style"));\r
+\r
+ // Get table row data\r
+ var rowtype = trElm.parentNode.nodeName.toLowerCase();\r
+ var align = dom.getAttrib(trElm, 'align');\r
+ var valign = dom.getAttrib(trElm, 'valign');\r
+ var height = trimSize(getStyle(trElm, 'height', 'height'));\r
+ var className = dom.getAttrib(trElm, 'class');\r
+ var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));\r
+ var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
+ var id = dom.getAttrib(trElm, 'id');\r
+ var lang = dom.getAttrib(trElm, 'lang');\r
+ var dir = dom.getAttrib(trElm, 'dir');\r
+\r
+ selectByValue(formObj, 'rowtype', rowtype);\r
+\r
+ // Any cells selected\r
+ if (dom.select('td.mceSelected,th.mceSelected', trElm).length == 0) {\r
+ // Setup form\r
+ addClassesToList('class', 'table_row_styles');\r
+ TinyMCE_EditableSelects.init();\r
+\r
+ formObj.bgcolor.value = bgcolor;\r
+ formObj.backgroundimage.value = backgroundimage;\r
+ formObj.height.value = height;\r
+ formObj.id.value = id;\r
+ formObj.lang.value = lang;\r
+ formObj.style.value = dom.serializeStyle(st);\r
+ selectByValue(formObj, 'align', align);\r
+ selectByValue(formObj, 'valign', valign);\r
+ selectByValue(formObj, 'class', className, true, true);\r
+ selectByValue(formObj, 'dir', dir);\r
+\r
+ // Resize some elements\r
+ if (isVisible('backgroundimagebrowser'))\r
+ document.getElementById('backgroundimage').style.width = '180px';\r
+\r
+ updateColor('bgcolor_pick', 'bgcolor');\r
+ } else\r
+ tinyMCEPopup.dom.hide('action');\r
+}\r
+\r
+function updateAction() {\r
+ var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];\r
+ var action = getSelectValue(formObj, 'action');\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+ trElm = dom.getParent(inst.selection.getStart(), "tr");\r
+ tableElm = dom.getParent(inst.selection.getStart(), "table");\r
+\r
+ // Update all selected rows\r
+ if (dom.select('td.mceSelected,th.mceSelected', trElm).length > 0) {\r
+ tinymce.each(tableElm.rows, function(tr) {\r
+ var i;\r
+\r
+ for (i = 0; i < tr.cells.length; i++) {\r
+ if (dom.hasClass(tr.cells[i], 'mceSelected')) {\r
+ updateRow(tr, true);\r
+ return;\r
+ }\r
+ }\r
+ });\r
+\r
+ inst.addVisual();\r
+ inst.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ inst.execCommand('mceBeginUndoLevel');\r
+\r
+ switch (action) {\r
+ case "row":\r
+ updateRow(trElm);\r
+ break;\r
+\r
+ case "all":\r
+ var rows = tableElm.getElementsByTagName("tr");\r
+\r
+ for (var i=0; i<rows.length; i++)\r
+ updateRow(rows[i], true);\r
+\r
+ break;\r
+\r
+ case "odd":\r
+ case "even":\r
+ var rows = tableElm.getElementsByTagName("tr");\r
+\r
+ for (var i=0; i<rows.length; i++) {\r
+ if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))\r
+ updateRow(rows[i], true, true);\r
+ }\r
+\r
+ break;\r
+ }\r
+\r
+ inst.addVisual();\r
+ inst.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function updateRow(tr_elm, skip_id, skip_parent) {\r
+ var inst = tinyMCEPopup.editor;\r
+ var formObj = document.forms[0];\r
+ var dom = inst.dom;\r
+ var curRowType = tr_elm.parentNode.nodeName.toLowerCase();\r
+ var rowtype = getSelectValue(formObj, 'rowtype');\r
+ var doc = inst.getDoc();\r
+\r
+ // Update row element\r
+ if (!skip_id)\r
+ tr_elm.setAttribute('id', formObj.id.value);\r
+\r
+ tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));\r
+ tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));\r
+ tr_elm.setAttribute('lang', formObj.lang.value);\r
+ tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));\r
+ tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));\r
+ dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));\r
+\r
+ // Clear deprecated attributes\r
+ tr_elm.setAttribute('background', '');\r
+ tr_elm.setAttribute('bgColor', '');\r
+ tr_elm.setAttribute('height', '');\r
+\r
+ // Set styles\r
+ tr_elm.style.height = getCSSSize(formObj.height.value);\r
+ tr_elm.style.backgroundColor = formObj.bgcolor.value;\r
+\r
+ if (formObj.backgroundimage.value != "")\r
+ tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";\r
+ else\r
+ tr_elm.style.backgroundImage = '';\r
+\r
+ // Setup new rowtype\r
+ if (curRowType != rowtype && !skip_parent) {\r
+ // first, clone the node we are working on\r
+ var newRow = tr_elm.cloneNode(1);\r
+\r
+ // next, find the parent of its new destination (creating it if necessary)\r
+ var theTable = dom.getParent(tr_elm, "table");\r
+ var dest = rowtype;\r
+ var newParent = null;\r
+ for (var i = 0; i < theTable.childNodes.length; i++) {\r
+ if (theTable.childNodes[i].nodeName.toLowerCase() == dest)\r
+ newParent = theTable.childNodes[i];\r
+ }\r
+\r
+ if (newParent == null) {\r
+ newParent = doc.createElement(dest);\r
+\r
+ if (dest == "thead") {\r
+ if (theTable.firstChild.nodeName == 'CAPTION')\r
+ inst.dom.insertAfter(newParent, theTable.firstChild);\r
+ else\r
+ theTable.insertBefore(newParent, theTable.firstChild);\r
+ } else\r
+ theTable.appendChild(newParent);\r
+ }\r
+\r
+ // append the row to the new parent\r
+ newParent.appendChild(newRow);\r
+\r
+ // remove the original\r
+ tr_elm.parentNode.removeChild(tr_elm);\r
+\r
+ // set tr_elm to the new node\r
+ tr_elm = newRow;\r
+ }\r
+\r
+ dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText)));\r
+}\r
+\r
+function changedBackgroundImage() {\r
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedStyle() {\r
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ if (st['background-image'])\r
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");\r
+ else\r
+ formObj.backgroundimage.value = '';\r
+\r
+ if (st['height'])\r
+ formObj.height.value = trimSize(st['height']);\r
+\r
+ if (st['background-color']) {\r
+ formObj.bgcolor.value = st['background-color'];\r
+ updateColor('bgcolor_pick','bgcolor');\r
+ }\r
+}\r
+\r
+function changedSize() {\r
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ var height = formObj.height.value;\r
+ if (height != "")\r
+ st['height'] = getCSSSize(height);\r
+ else\r
+ st['height'] = "";\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedColor() {\r
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ st['background-color'] = formObj.bgcolor.value;\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom;\r
+\r
+function insertTable() {\r
+ var formObj = document.forms[0];\r
+ var inst = tinyMCEPopup.editor, dom = inst.dom;\r
+ var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules;\r
+ var html = '', capEl, elm;\r
+ var cellLimit, rowLimit, colLimit;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ if (!AutoValidator.validate(formObj)) {\r
+ tinyMCEPopup.alert(inst.getLang('invalid_data'));\r
+ return false;\r
+ }\r
+\r
+ elm = dom.getParent(inst.selection.getNode(), 'table');\r
+\r
+ // Get form data\r
+ cols = formObj.elements['cols'].value;\r
+ rows = formObj.elements['rows'].value;\r
+ border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;\r
+ cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";\r
+ cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";\r
+ align = getSelectValue(formObj, "align");\r
+ frame = getSelectValue(formObj, "tframe");\r
+ rules = getSelectValue(formObj, "rules");\r
+ width = formObj.elements['width'].value;\r
+ height = formObj.elements['height'].value;\r
+ bordercolor = formObj.elements['bordercolor'].value;\r
+ bgcolor = formObj.elements['bgcolor'].value;\r
+ className = getSelectValue(formObj, "class");\r
+ id = formObj.elements['id'].value;\r
+ summary = formObj.elements['summary'].value;\r
+ style = formObj.elements['style'].value;\r
+ dir = formObj.elements['dir'].value;\r
+ lang = formObj.elements['lang'].value;\r
+ background = formObj.elements['backgroundimage'].value;\r
+ caption = formObj.elements['caption'].checked;\r
+\r
+ cellLimit = tinyMCEPopup.getParam('table_cell_limit', false);\r
+ rowLimit = tinyMCEPopup.getParam('table_row_limit', false);\r
+ colLimit = tinyMCEPopup.getParam('table_col_limit', false);\r
+\r
+ // Validate table size\r
+ if (colLimit && cols > colLimit) {\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
+ return false;\r
+ } else if (rowLimit && rows > rowLimit) {\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
+ return false;\r
+ } else if (cellLimit && cols * rows > cellLimit) {\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
+ return false;\r
+ }\r
+\r
+ // Update table\r
+ if (action == "update") {\r
+ inst.execCommand('mceBeginUndoLevel');\r
+\r
+ dom.setAttrib(elm, 'cellPadding', cellpadding, true);\r
+ dom.setAttrib(elm, 'cellSpacing', cellspacing, true);\r
+ dom.setAttrib(elm, 'border', border);\r
+ dom.setAttrib(elm, 'align', align);\r
+ dom.setAttrib(elm, 'frame', frame);\r
+ dom.setAttrib(elm, 'rules', rules);\r
+ dom.setAttrib(elm, 'class', className);\r
+ dom.setAttrib(elm, 'style', style);\r
+ dom.setAttrib(elm, 'id', id);\r
+ dom.setAttrib(elm, 'summary', summary);\r
+ dom.setAttrib(elm, 'dir', dir);\r
+ dom.setAttrib(elm, 'lang', lang);\r
+\r
+ capEl = inst.dom.select('caption', elm)[0];\r
+\r
+ if (capEl && !caption)\r
+ capEl.parentNode.removeChild(capEl);\r
+\r
+ if (!capEl && caption) {\r
+ capEl = elm.ownerDocument.createElement('caption');\r
+\r
+ if (!tinymce.isIE)\r
+ capEl.innerHTML = '<br _mce_bogus="1"/>';\r
+\r
+ elm.insertBefore(capEl, elm.firstChild);\r
+ }\r
+\r
+ if (width && inst.settings.inline_styles) {\r
+ dom.setStyle(elm, 'width', width);\r
+ dom.setAttrib(elm, 'width', '');\r
+ } else {\r
+ dom.setAttrib(elm, 'width', width, true);\r
+ dom.setStyle(elm, 'width', '');\r
+ }\r
+\r
+ // Remove these since they are not valid XHTML\r
+ dom.setAttrib(elm, 'borderColor', '');\r
+ dom.setAttrib(elm, 'bgColor', '');\r
+ dom.setAttrib(elm, 'background', '');\r
+\r
+ if (height && inst.settings.inline_styles) {\r
+ dom.setStyle(elm, 'height', height);\r
+ dom.setAttrib(elm, 'height', '');\r
+ } else {\r
+ dom.setAttrib(elm, 'height', height, true);\r
+ dom.setStyle(elm, 'height', '');\r
+ }\r
+\r
+ if (background != '')\r
+ elm.style.backgroundImage = "url('" + background + "')";\r
+ else\r
+ elm.style.backgroundImage = '';\r
+\r
+/* if (tinyMCEPopup.getParam("inline_styles")) {\r
+ if (width != '')\r
+ elm.style.width = getCSSSize(width);\r
+ }*/\r
+\r
+ if (bordercolor != "") {\r
+ elm.style.borderColor = bordercolor;\r
+ elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;\r
+ elm.style.borderWidth = border == "" ? "1px" : border;\r
+ } else\r
+ elm.style.borderColor = '';\r
+\r
+ elm.style.backgroundColor = bgcolor;\r
+ elm.style.height = getCSSSize(height);\r
+\r
+ inst.addVisual();\r
+\r
+ // Fix for stange MSIE align bug\r
+ //elm.outerHTML = elm.outerHTML;\r
+\r
+ inst.nodeChanged();\r
+ inst.execCommand('mceEndUndoLevel');\r
+\r
+ // Repaint if dimensions changed\r
+ if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)\r
+ inst.execCommand('mceRepaint');\r
+\r
+ tinyMCEPopup.close();\r
+ return true;\r
+ }\r
+\r
+ // Create new table\r
+ html += '<table';\r
+\r
+ html += makeAttrib('id', id);\r
+ html += makeAttrib('border', border);\r
+ html += makeAttrib('cellpadding', cellpadding);\r
+ html += makeAttrib('cellspacing', cellspacing);\r
+ html += makeAttrib('_mce_new', '1');\r
+\r
+ if (width && inst.settings.inline_styles) {\r
+ if (style)\r
+ style += '; ';\r
+\r
+ // Force px\r
+ if (/^[0-9\.]+$/.test(width))\r
+ width += 'px';\r
+\r
+ style += 'width: ' + width;\r
+ } else\r
+ html += makeAttrib('width', width);\r
+\r
+/* if (height) {\r
+ if (style)\r
+ style += '; ';\r
+\r
+ style += 'height: ' + height;\r
+ }*/\r
+\r
+ //html += makeAttrib('height', height);\r
+ //html += makeAttrib('bordercolor', bordercolor);\r
+ //html += makeAttrib('bgcolor', bgcolor);\r
+ html += makeAttrib('align', align);\r
+ html += makeAttrib('frame', frame);\r
+ html += makeAttrib('rules', rules);\r
+ html += makeAttrib('class', className);\r
+ html += makeAttrib('style', style);\r
+ html += makeAttrib('summary', summary);\r
+ html += makeAttrib('dir', dir);\r
+ html += makeAttrib('lang', lang);\r
+ html += '>';\r
+\r
+ if (caption) {\r
+ if (!tinymce.isIE)\r
+ html += '<caption><br _mce_bogus="1"/></caption>';\r
+ else\r
+ html += '<caption></caption>';\r
+ }\r
+\r
+ for (var y=0; y<rows; y++) {\r
+ html += "<tr>";\r
+\r
+ for (var x=0; x<cols; x++) {\r
+ if (!tinymce.isIE)\r
+ html += '<td><br _mce_bogus="1"/></td>';\r
+ else\r
+ html += '<td></td>';\r
+ }\r
+\r
+ html += "</tr>";\r
+ }\r
+\r
+ html += "</table>";\r
+\r
+ inst.execCommand('mceBeginUndoLevel');\r
+\r
+ // Move table\r
+ if (inst.settings.fix_table_elements) {\r
+ var patt = '';\r
+\r
+ inst.focus();\r
+ inst.selection.setContent('<br class="_mce_marker" />');\r
+\r
+ tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {\r
+ if (patt)\r
+ patt += ',';\r
+\r
+ patt += n + ' ._mce_marker';\r
+ });\r
+\r
+ tinymce.each(inst.dom.select(patt), function(n) {\r
+ inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);\r
+ });\r
+\r
+ dom.setOuterHTML(dom.select('br._mce_marker')[0], html);\r
+ } else\r
+ inst.execCommand('mceInsertContent', false, html);\r
+\r
+ tinymce.each(dom.select('table[_mce_new]'), function(node) {\r
+ var td = dom.select('td', node);\r
+\r
+ inst.selection.select(td[0], true);\r
+ inst.selection.collapse();\r
+\r
+ dom.setAttrib(node, '_mce_new', '');\r
+ });\r
+\r
+ inst.addVisual();\r
+ inst.execCommand('mceEndUndoLevel');\r
+\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function makeAttrib(attrib, value) {\r
+ var formObj = document.forms[0];\r
+ var valueElm = formObj.elements[attrib];\r
+\r
+ if (typeof(value) == "undefined" || value == null) {\r
+ value = "";\r
+\r
+ if (valueElm)\r
+ value = valueElm.value;\r
+ }\r
+\r
+ if (value == "")\r
+ return "";\r
+\r
+ // XML encode it\r
+ value = value.replace(/&/g, '&');\r
+ value = value.replace(/\"/g, '"');\r
+ value = value.replace(/</g, '<');\r
+ value = value.replace(/>/g, '>');\r
+\r
+ return ' ' + attrib + '="' + value + '"';\r
+}\r
+\r
+function init() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+ document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');\r
+ document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');\r
+ document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');\r
+\r
+ var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', '');\r
+ var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";\r
+ var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame;\r
+ var inst = tinyMCEPopup.editor, dom = inst.dom;\r
+ var formObj = document.forms[0];\r
+ var elm = dom.getParent(inst.selection.getNode(), "table");\r
+\r
+ action = tinyMCEPopup.getWindowArg('action');\r
+\r
+ if (!action)\r
+ action = elm ? "update" : "insert";\r
+\r
+ if (elm && action != "insert") {\r
+ var rowsAr = elm.rows;\r
+ var cols = 0;\r
+ for (var i=0; i<rowsAr.length; i++)\r
+ if (rowsAr[i].cells.length > cols)\r
+ cols = rowsAr[i].cells.length;\r
+\r
+ cols = cols;\r
+ rows = rowsAr.length;\r
+\r
+ st = dom.parseStyle(dom.getAttrib(elm, "style"));\r
+ border = trimSize(getStyle(elm, 'border', 'borderWidth'));\r
+ cellpadding = dom.getAttrib(elm, 'cellpadding', "");\r
+ cellspacing = dom.getAttrib(elm, 'cellspacing', "");\r
+ width = trimSize(getStyle(elm, 'width', 'width'));\r
+ height = trimSize(getStyle(elm, 'height', 'height'));\r
+ bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));\r
+ bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));\r
+ align = dom.getAttrib(elm, 'align', align);\r
+ frame = dom.getAttrib(elm, 'frame');\r
+ rules = dom.getAttrib(elm, 'rules');\r
+ className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, ''));\r
+ id = dom.getAttrib(elm, 'id');\r
+ summary = dom.getAttrib(elm, 'summary');\r
+ style = dom.serializeStyle(st);\r
+ dir = dom.getAttrib(elm, 'dir');\r
+ lang = dom.getAttrib(elm, 'lang');\r
+ background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
+ formObj.caption.checked = elm.getElementsByTagName('caption').length > 0;\r
+\r
+ orgTableWidth = width;\r
+ orgTableHeight = height;\r
+\r
+ action = "update";\r
+ formObj.insert.value = inst.getLang('update');\r
+ }\r
+\r
+ addClassesToList('class', "table_styles");\r
+ TinyMCE_EditableSelects.init();\r
+\r
+ // Update form\r
+ selectByValue(formObj, 'align', align);\r
+ selectByValue(formObj, 'tframe', frame);\r
+ selectByValue(formObj, 'rules', rules);\r
+ selectByValue(formObj, 'class', className, true, true);\r
+ formObj.cols.value = cols;\r
+ formObj.rows.value = rows;\r
+ formObj.border.value = border;\r
+ formObj.cellpadding.value = cellpadding;\r
+ formObj.cellspacing.value = cellspacing;\r
+ formObj.width.value = width;\r
+ formObj.height.value = height;\r
+ formObj.bordercolor.value = bordercolor;\r
+ formObj.bgcolor.value = bgcolor;\r
+ formObj.id.value = id;\r
+ formObj.summary.value = summary;\r
+ formObj.style.value = style;\r
+ formObj.dir.value = dir;\r
+ formObj.lang.value = lang;\r
+ formObj.backgroundimage.value = background;\r
+\r
+ updateColor('bordercolor_pick', 'bordercolor');\r
+ updateColor('bgcolor_pick', 'bgcolor');\r
+\r
+ // Resize some elements\r
+ if (isVisible('backgroundimagebrowser'))\r
+ document.getElementById('backgroundimage').style.width = '180px';\r
+\r
+ // Disable some fields in update mode\r
+ if (action == "update") {\r
+ formObj.cols.disabled = true;\r
+ formObj.rows.disabled = true;\r
+ }\r
+}\r
+\r
+function changedSize() {\r
+ var formObj = document.forms[0];\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+/* var width = formObj.width.value;\r
+ if (width != "")\r
+ st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : "";\r
+ else\r
+ st['width'] = "";*/\r
+\r
+ var height = formObj.height.value;\r
+ if (height != "")\r
+ st['height'] = getCSSSize(height);\r
+ else\r
+ st['height'] = "";\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedBackgroundImage() {\r
+ var formObj = document.forms[0];\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ st['background-image'] = "url('" + formObj.backgroundimage.value + "')";\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedBorder() {\r
+ var formObj = document.forms[0];\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ // Update border width if the element has a color\r
+ if (formObj.border.value != "" && formObj.bordercolor.value != "")\r
+ st['border-width'] = formObj.border.value + "px";\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedColor() {\r
+ var formObj = document.forms[0];\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ st['background-color'] = formObj.bgcolor.value;\r
+\r
+ if (formObj.bordercolor.value != "") {\r
+ st['border-color'] = formObj.bordercolor.value;\r
+\r
+ // Add border-width if it's missing\r
+ if (!st['border-width'])\r
+ st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";\r
+ }\r
+\r
+ formObj.style.value = dom.serializeStyle(st);\r
+}\r
+\r
+function changedStyle() {\r
+ var formObj = document.forms[0];\r
+ var st = dom.parseStyle(formObj.style.value);\r
+\r
+ if (st['background-image'])\r
+ formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");\r
+ else\r
+ formObj.backgroundimage.value = '';\r
+\r
+ if (st['width'])\r
+ formObj.width.value = trimSize(st['width']);\r
+\r
+ if (st['height'])\r
+ formObj.height.value = trimSize(st['height']);\r
+\r
+ if (st['background-color']) {\r
+ formObj.bgcolor.value = st['background-color'];\r
+ updateColor('bgcolor_pick','bgcolor');\r
+ }\r
+\r
+ if (st['border-color']) {\r
+ formObj.bordercolor.value = st['border-color'];\r
+ updateColor('bordercolor_pick','bordercolor');\r
+ }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.table_dlg',{\r
+general_tab:"General",\r
+advanced_tab:"Advanced",\r
+general_props:"General properties",\r
+advanced_props:"Advanced properties",\r
+rowtype:"Row in table part",\r
+title:"Insert/Modify table",\r
+width:"Width",\r
+height:"Height",\r
+cols:"Cols",\r
+rows:"Rows",\r
+cellspacing:"Cellspacing",\r
+cellpadding:"Cellpadding",\r
+border:"Border",\r
+align:"Alignment",\r
+align_default:"Default",\r
+align_left:"Left",\r
+align_right:"Right",\r
+align_middle:"Center",\r
+row_title:"Table row properties",\r
+cell_title:"Table cell properties",\r
+cell_type:"Cell type",\r
+valign:"Vertical alignment",\r
+align_top:"Top",\r
+align_bottom:"Bottom",\r
+bordercolor:"Border color",\r
+bgcolor:"Background color",\r
+merge_cells_title:"Merge table cells",\r
+id:"Id",\r
+style:"Style",\r
+langdir:"Language direction",\r
+langcode:"Language code",\r
+mime:"Target MIME type",\r
+ltr:"Left to right",\r
+rtl:"Right to left",\r
+bgimage:"Background image",\r
+summary:"Summary",\r
+td:"Data",\r
+th:"Header",\r
+cell_cell:"Update current cell",\r
+cell_row:"Update all cells in row",\r
+cell_all:"Update all cells in table",\r
+row_row:"Update current row",\r
+row_odd:"Update odd rows in table",\r
+row_even:"Update even rows in table",\r
+row_all:"Update all rows in table",\r
+thead:"Table Head",\r
+tbody:"Table Body",\r
+tfoot:"Table Foot",\r
+scope:"Scope",\r
+rowgroup:"Row Group",\r
+colgroup:"Col Group",\r
+col_limit:"You've exceeded the maximum number of columns of {$cols}.",\r
+row_limit:"You've exceeded the maximum number of rows of {$rows}.",\r
+cell_limit:"You've exceeded the maximum number of cells of {$cells}.",\r
+missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",\r
+caption:"Table caption",\r
+frame:"Frame",\r
+frame_none:"none",\r
+frame_groups:"groups",\r
+frame_rows:"rows",\r
+frame_cols:"cols",\r
+frame_all:"all",\r
+rules:"Rules",\r
+rules_void:"void",\r
+rules_above:"above",\r
+rules_below:"below",\r
+rules_hsides:"hsides",\r
+rules_lhs:"lhs",\r
+rules_rhs:"rhs",\r
+rules_vsides:"vsides",\r
+rules_box:"box",\r
+rules_border:"border"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#table_dlg.merge_cells_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="js/merge_cells.js"></script>\r
+</head>\r
+<body style="margin: 8px">\r
+<form onsubmit="MergeCellsDialog.merge();return false;" action="#">\r
+ <fieldset>\r
+ <legend>{#table_dlg.merge_cells_title}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">\r
+ <tr>\r
+ <td>{#table_dlg.cols}:</td>\r
+ <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td>{#table_dlg.rows}:</td>\r
+ <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#table_dlg.row_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/row.js"></script>\r
+ <link href="css/row.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="tablerow" style="display: none">\r
+ <form onsubmit="updateAction();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#table_dlg.general_props}</legend>\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td><label for="rowtype">{#table_dlg.rowtype}</label></td>\r
+ <td class="col2">\r
+ <select id="rowtype" name="rowtype" class="mceFocus">\r
+ <option value="thead">{#table_dlg.thead}</option>\r
+ <option value="tbody">{#table_dlg.tbody}</option>\r
+ <option value="tfoot">{#table_dlg.tfoot}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="align">{#table_dlg.align}</label></td>\r
+ <td class="col2">\r
+ <select id="align" name="align">\r
+ <option value="">{#not_set}</option>\r
+ <option value="center">{#table_dlg.align_middle}</option>\r
+ <option value="left">{#table_dlg.align_left}</option>\r
+ <option value="right">{#table_dlg.align_right}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="valign">{#table_dlg.valign}</label></td>\r
+ <td class="col2">\r
+ <select id="valign" name="valign">\r
+ <option value="">{#not_set}</option>\r
+ <option value="top">{#table_dlg.align_top}</option>\r
+ <option value="middle">{#table_dlg.align_middle}</option>\r
+ <option value="bottom">{#table_dlg.align_bottom}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr id="styleSelectRow">\r
+ <td><label for="class">{#class_name}</label></td>\r
+ <td class="col2">\r
+ <select id="class" name="class" class="mceEditableSelect">\r
+ <option value="" selected="selected">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="height">{#table_dlg.height}</label></td>\r
+ <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#table_dlg.advanced_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="style">{#table_dlg.style}</label></td>\r
+ <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir" style="width: 200px"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#table_dlg.ltr}</option> \r
+ <option value="rtl">{#table_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" style="width: 200px" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>\r
+ <td id="backgroundimagebrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
+ <td id="bgcolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <div>\r
+ <select id="action" name="action">\r
+ <option value="row">{#table_dlg.row_row}</option>\r
+ <option value="odd">{#table_dlg.row_odd}</option>\r
+ <option value="even">{#table_dlg.row_even}</option>\r
+ <option value="all">{#table_dlg.row_all}</option>\r
+ </select>\r
+ </div>\r
+\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#table_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/table.js"></script>\r
+ <link href="css/table.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body id="table" style="display: none">\r
+ <form onsubmit="insertTable();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li>\r
+ <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#table_dlg.general_props}</legend>\r
+ <table border="0" cellpadding="4" cellspacing="0" width="100%">\r
+ <tr>\r
+ <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td>\r
+ <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td>\r
+ <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td>\r
+ <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td>\r
+ <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>\r
+ <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td>\r
+ <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td>\r
+ <td><select id="align" name="align">\r
+ <option value="">{#not_set}</option>\r
+ <option value="center">{#table_dlg.align_middle}</option>\r
+ <option value="left">{#table_dlg.align_left}</option>\r
+ <option value="right">{#table_dlg.align_right}</option>\r
+ </select></td>\r
+ <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td>\r
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>\r
+ </tr>\r
+ <tr id="width_row">\r
+ <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td>\r
+ <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>\r
+ <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td>\r
+ <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>\r
+ </tr>\r
+ <tr id="styleSelectRow">\r
+ <td><label id="classlabel" for="class">{#class_name}</label></td>\r
+ <td colspan="3">\r
+ <select id="class" name="class" class="mceEditableSelect">\r
+ <option value="" selected="selected">{#not_set}</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="column1"><label for="caption">{#table_dlg.caption}</label></td> \r
+ <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="advanced_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#table_dlg.advanced_props}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="column1"><label for="id">{#table_dlg.id}</label></td> \r
+ <td><input id="id" name="id" type="text" value="" class="advfield" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="summary">{#table_dlg.summary}</label></td> \r
+ <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label for="style">{#table_dlg.style}</label></td>\r
+ <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" class="advfield" />\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>\r
+ <td id="backgroundimagebrowsercontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="tframe">{#table_dlg.frame}</label></td> \r
+ <td>\r
+ <select id="tframe" name="tframe" class="advfield"> \r
+ <option value="">{#not_set}</option>\r
+ <option value="void">{#table_dlg.rules_void}</option>\r
+ <option value="above">{#table_dlg.rules_above}</option> \r
+ <option value="below">{#table_dlg.rules_below}</option> \r
+ <option value="hsides">{#table_dlg.rules_hsides}</option> \r
+ <option value="lhs">{#table_dlg.rules_lhs}</option> \r
+ <option value="rhs">{#table_dlg.rules_rhs}</option> \r
+ <option value="vsides">{#table_dlg.rules_vsides}</option> \r
+ <option value="box">{#table_dlg.rules_box}</option> \r
+ <option value="border">{#table_dlg.rules_border}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="rules">{#table_dlg.rules}</label></td> \r
+ <td>\r
+ <select id="rules" name="rules" class="advfield"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="none">{#table_dlg.frame_none}</option>\r
+ <option value="groups">{#table_dlg.frame_groups}</option>\r
+ <option value="rows">{#table_dlg.frame_rows}</option>\r
+ <option value="cols">{#table_dlg.frame_cols}</option>\r
+ <option value="all">{#table_dlg.frame_all}</option>\r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> \r
+ <td>\r
+ <select id="dir" name="dir" class="advfield"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#table_dlg.ltr}</option> \r
+ <option value="rtl">{#table_dlg.rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>\r
+ <td id="bordercolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> \r
+ <td>\r
+ <table border="0" cellpadding="0" cellspacing="0">\r
+ <tr>\r
+ <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>\r
+ <td id="bgcolor_pickcontainer"> </td>\r
+ </tr>\r
+ </table>\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>blank_page</title>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+ <script type="text/javascript">\r
+ parent.TemplateDialog.loadCSSFiles(document);\r
+ </script>\r
+</head>\r
+<body id="mceTemplatePreview" class="mceContentBody">\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+#frmbody {\r
+ padding: 10px;\r
+ background-color: #FFF;\r
+ border: 1px solid #CCC;\r
+}\r
+\r
+.frmRow {\r
+ margin-bottom: 10px;\r
+}\r
+\r
+#templatesrc {\r
+ border: none;\r
+ width: 320px;\r
+ height: 240px;\r
+}\r
+\r
+.title {\r
+ padding-bottom: 5px;\r
+}\r
+\r
+.mceActionPanel {\r
+ padding-top: 5px;\r
+}\r
--- /dev/null
+(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.plugins.TemplatePlugin', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceTemplate', function(ui) {\r
+ ed.windowManager.open({\r
+ file : url + '/template.htm',\r
+ width : ed.getParam('template_popup_width', 750),\r
+ height : ed.getParam('template_popup_height', 600),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceInsertTemplate', t._insertTemplate, t);\r
+\r
+ // Register buttons\r
+ ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'});\r
+\r
+ ed.onPreProcess.add(function(ed, o) {\r
+ var dom = ed.dom;\r
+\r
+ each(dom.select('div', o.node), function(e) {\r
+ if (dom.hasClass(e, 'mceTmpl')) {\r
+ each(dom.select('*', e), function(e) {\r
+ if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))\r
+ e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));\r
+ });\r
+\r
+ t._replaceVals(e);\r
+ }\r
+ });\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Template plugin',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://www.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ _insertTemplate : function(ui, v) {\r
+ var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent();\r
+\r
+ h = v.content;\r
+\r
+ each(t.editor.getParam('template_replace_values'), function(v, k) {\r
+ if (typeof(v) != 'function')\r
+ h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);\r
+ });\r
+\r
+ el = dom.create('div', null, h);\r
+\r
+ // Find template element within div\r
+ n = dom.select('.mceTmpl', el);\r
+ if (n && n.length > 0) {\r
+ el = dom.create('div', null);\r
+ el.appendChild(n[0].cloneNode(true));\r
+ }\r
+\r
+ function hasClass(n, c) {\r
+ return new RegExp('\\b' + c + '\\b', 'g').test(n.className);\r
+ };\r
+\r
+ each(dom.select('*', el), function(n) {\r
+ // Replace cdate\r
+ if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|')))\r
+ n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format")));\r
+\r
+ // Replace mdate\r
+ if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|')))\r
+ n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format")));\r
+\r
+ // Replace selection\r
+ if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|')))\r
+ n.innerHTML = sel;\r
+ });\r
+\r
+ t._replaceVals(el);\r
+\r
+ ed.execCommand('mceInsertContent', false, el.innerHTML);\r
+ ed.addVisual();\r
+ },\r
+\r
+ _replaceVals : function(e) {\r
+ var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values');\r
+\r
+ each(dom.select('*', e), function(e) {\r
+ each(vl, function(v, k) {\r
+ if (dom.hasClass(e, k)) {\r
+ if (typeof(vl[k]) == 'function')\r
+ vl[k](e);\r
+ }\r
+ });\r
+ });\r
+ },\r
+\r
+ _getDateTime : function(d, fmt) {\r
+ if (!fmt)\r
+ return "";\r
+\r
+ function addZeros(value, len) {\r
+ var i;\r
+\r
+ value = "" + value;\r
+\r
+ if (value.length < len) {\r
+ for (i=0; i<(len-value.length); i++)\r
+ value = "0" + value;\r
+ }\r
+\r
+ return value;\r
+ }\r
+\r
+ fmt = fmt.replace("%D", "%m/%d/%y");\r
+ fmt = fmt.replace("%r", "%I:%M:%S %p");\r
+ fmt = fmt.replace("%Y", "" + d.getFullYear());\r
+ fmt = fmt.replace("%y", "" + d.getYear());\r
+ fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
+ fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
+ fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
+ fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
+ fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
+ fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
+ fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
+ fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]);\r
+ fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]);\r
+ fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]);\r
+ fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]);\r
+ fmt = fmt.replace("%%", "%");\r
+\r
+ return fmt;\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var TemplateDialog = {\r
+ preInit : function() {\r
+ var url = tinyMCEPopup.getParam("template_external_list_url");\r
+\r
+ if (url != null)\r
+ document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');\r
+ },\r
+\r
+ init : function() {\r
+ var ed = tinyMCEPopup.editor, tsrc, sel, x, u;\r
+\r
+ tsrc = ed.getParam("template_templates", false);\r
+ sel = document.getElementById('tpath');\r
+\r
+ // Setup external template list\r
+ if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {\r
+ for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)\r
+ tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});\r
+ }\r
+\r
+ for (x=0; x<tsrc.length; x++)\r
+ sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));\r
+\r
+ this.resize();\r
+ this.tsrc = tsrc;\r
+ },\r
+\r
+ resize : function() {\r
+ var w, h, e;\r
+\r
+ if (!self.innerWidth) {\r
+ w = document.body.clientWidth - 50;\r
+ h = document.body.clientHeight - 160;\r
+ } else {\r
+ w = self.innerWidth - 50;\r
+ h = self.innerHeight - 170;\r
+ }\r
+\r
+ e = document.getElementById('templatesrc');\r
+\r
+ if (e) {\r
+ e.style.height = Math.abs(h) + 'px';\r
+ e.style.width = Math.abs(w - 5) + 'px';\r
+ }\r
+ },\r
+\r
+ loadCSSFiles : function(d) {\r
+ var ed = tinyMCEPopup.editor;\r
+\r
+ tinymce.each(ed.getParam("content_css", '').split(','), function(u) {\r
+ d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');\r
+ });\r
+ },\r
+\r
+ selectTemplate : function(u, ti) {\r
+ var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;\r
+\r
+ if (!u)\r
+ return;\r
+\r
+ d.body.innerHTML = this.templateHTML = this.getFileContents(u);\r
+\r
+ for (x=0; x<tsrc.length; x++) {\r
+ if (tsrc[x].title == ti)\r
+ document.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';\r
+ }\r
+ },\r
+\r
+ insert : function() {\r
+ tinyMCEPopup.execCommand('mceInsertTemplate', false, {\r
+ content : this.templateHTML,\r
+ selection : tinyMCEPopup.editor.selection.getContent()\r
+ });\r
+\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ getFileContents : function(u) {\r
+ var x, d, t = 'text/plain';\r
+\r
+ function g(s) {\r
+ x = 0;\r
+\r
+ try {\r
+ x = new ActiveXObject(s);\r
+ } catch (s) {\r
+ }\r
+\r
+ return x;\r
+ };\r
+\r
+ x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();\r
+\r
+ // Synchronous AJAX load file\r
+ x.overrideMimeType && x.overrideMimeType(t);\r
+ x.open("GET", u, false);\r
+ x.send(null);\r
+\r
+ return x.responseText;\r
+ }\r
+};\r
+\r
+TemplateDialog.preInit();\r
+tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);\r
--- /dev/null
+tinyMCE.addI18n('en.template_dlg',{\r
+title:"Templates",\r
+label:"Template",\r
+desc_label:"Description",\r
+desc:"Insert predefined template content",\r
+select:"Select a template",\r
+preview:"Preview",\r
+warning:"Warning: Updating a template with a different one may cause data loss.",\r
+mdate_format:"%Y-%m-%d %H:%M:%S",\r
+cdate_format:"%Y-%m-%d %H:%M:%S",\r
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",\r
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",\r
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",\r
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"\r
+});
\ No newline at end of file
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#template_dlg.title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/template.js"></script>\r
+ <link href="css/template.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+<body onresize="TemplateDialog.resize();"> \r
+ <form onsubmit="TemplateDialog.insert();return false;">\r
+ <div id="frmbody">\r
+ <div class="title">{#template_dlg.desc}</div>\r
+ <div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label>\r
+ <select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus">\r
+ <option value="">{#template_dlg.select}...</option>\r
+ </select>\r
+ <span id="warning"></span></div>\r
+ <div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label>\r
+ <span id="tmpldesc"></span></div>\r
+ <fieldset>\r
+ <legend>{#template_dlg.preview}</legend>\r
+ <iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe>\r
+ </fieldset>\r
+ </div>\r
+ \r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+ </form>\r
+</body> \r
+</html> \r
--- /dev/null
+<?php\r
+
+/*\r
+TinyBrowser 1.41 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+(author website - http://www.lunarvis.com)\r
+\r
+ This program is free software: you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation, either version 3 of the License, or\r
+ (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+*/\r
+\r
+// switch off error handling, to use custom handler\r
+error_reporting(0); \r
+\r
+// set script time out higher, to help with thumbnail generation\r
+set_time_limit(240);\r
+\r
+$tinybrowser = array();\r
+\r
+// Session control and security check - to enable please uncomment\r
+if(isset($_GET['sessidpass'])) session_id($_GET['sessidpass']); // workaround for Flash session bug\r
+session_start();\r
+$tinybrowser['sessioncheck'] = 'upload_dir'; //name of session variable to check\r
+\r
+// Random string used to secure Flash upload if session control not enabled - be sure to change!\r
+$tinybrowser['obfuscate'] = 'yeah';\r
+\r
+// Set default language (ISO 639-1 code)\r
+$tinybrowser['language'] = 'fr';\r
+\r
+// Set the integration type (TinyMCE is default)\r
+$tinybrowser['integration'] = 'tinymce'; // Possible values: 'tinymce', 'fckeditor'\r
+\r
+// Default is rtrim($_SERVER['DOCUMENT_ROOT'],'/') (suitable when using absolute paths, but can be set to '' if using relative paths)\r
+$tinybrowser['docroot'] = rtrim($_SERVER['DOCUMENT_ROOT'],'/');
+//$tinybrowser['docroot'] = '';\r
+\r
+// Folder permissions for Unix servers only\r
+$tinybrowser['unixpermissions'] = 0777;\r
+\r
+// File upload paths (set to absolute by default)\r
+
+$tinybrowser['path']['image'] = $_SESSION["upload_dir"].'/images/'; // Image files location - also creates a '_thumbs' subdirectory within this path to hold the image thumbnails\r
+$tinybrowser['path']['media'] = $_SESSION["upload_dir"].'/media/'; // Media files location\r
+$tinybrowser['path']['file'] = $_SESSION["upload_dir"].'/files/'; // Other files location
+
+/*
+$tinybrowser['path']['image'] = $pz_user_dir."/images/";\r$tinybrowser['path']['media'] = $pz_user_dir."/media";\r$tinybrowser['path']['file'] = $pz_user_dir."/files";\r
+*/
+
+// File link paths - these are the paths that get passed back to TinyMCE or your application (set to equal the upload path by default)\r
+$tinybrowser['link']['image'] = $tinybrowser['path']['image']; // Image links\r
+$tinybrowser['link']['media'] = $tinybrowser['path']['media']; // Media links\r
+$tinybrowser['link']['file'] = $tinybrowser['path']['file']; // Other file links\r
+\r
+// File upload size limit (0 is unlimited)\r
+$tinybrowser['maxsize']['image'] = 0; // Image file maximum size\r
+$tinybrowser['maxsize']['media'] = 0; // Media file maximum size\r
+$tinybrowser['maxsize']['file'] = 0; // Other file maximum size\r
+\r
+// Image automatic resize on upload (0 is no resize)\r
+$tinybrowser['imageresize']['width'] = 0;\r
+$tinybrowser['imageresize']['height'] = 0;\r
+\r
+// Image thumbnail source (set to 'path' by default - shouldn't need changing)\r
+$tinybrowser['thumbsrc'] = 'path'; // Possible values: path, link\r
+\r
+// Image thumbnail size in pixels\r
+$tinybrowser['thumbsize'] = 80;\r
+\r
+// Image and thumbnail quality, higher is better (1 to 99)\r
+$tinybrowser['imagequality'] = 80; // only used when resizing or rotating\r
+$tinybrowser['thumbquality'] = 80;\r
+\r
+// Date format, as per php date function\r
+$tinybrowser['dateformat'] = 'd/m/Y H:i';\r
+\r
+// Permitted file extensions\r
+$tinybrowser['filetype']['image'] = '*.jpg, *.jpeg, *.gif, *.png'; // Image file types\r
+$tinybrowser['filetype']['media'] = '*.swf, *.dcr, *.mov, *.qt, *.mpg, *.mp3, *.mp4, *.mpeg, *.avi, *.wmv, *.wm, *.asf, *.asx, *.wmx, *.wvx, *.rm, *.ra, *.ram'; // Media file types\r
+$tinybrowser['filetype']['file'] = '*.*'; // Other file types\r
+\r
+// Prohibited file extensions\r
+$tinybrowser['prohibited'] = array('php','php3','php4','php5','phtml','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','dll','reg','cgi', 'sh', 'py','asa','asax','config','com','inc');\r
+\r
+// Default file sort\r
+$tinybrowser['order']['by'] = 'name'; // Possible values: name, size, type, modified\r
+$tinybrowser['order']['type'] = 'asc'; // Possible values: asc, desc\r
+\r
+// Default image view method\r
+$tinybrowser['view']['image'] = 'thumb'; // Possible values: thumb, detail\r
+\r
+// File Pagination - split results into pages (0 is none)\r
+$tinybrowser['pagination'] = 0;\r
+\r
+// TinyMCE dialog.css file location, relative to tinybrowser.php (can be set to absolute link)\r
+$tinybrowser['tinymcecss'] = '../../themes/advanced/skins/default/dialog.css';\r
+\r
+// TinyBrowser pop-up window size\r
+$tinybrowser['window']['width'] = 770;\r
+$tinybrowser['window']['height'] = 480;\r
+\r
+// Assign Permissions for Upload, Edit, Delete & Folders\r
+$tinybrowser['allowupload'] = true;\r
+$tinybrowser['allowedit'] = true;\r
+$tinybrowser['allowdelete'] = true;\r
+$tinybrowser['allowfolders'] = true;\r
+\r
+// Clean filenames on upload\r
+$tinybrowser['cleanfilename'] = true;\r
+\r
+// Set default action for edit page\r
+$tinybrowser['defaultaction'] = 'delete'; // Possible values: delete, rename, move\r
+\r
+// Set delay for file process script, only required if server response is slow\r
+$tinybrowser['delayprocess'] = 0; // Value in seconds\r
+?>\r
--- /dev/null
+<?php\r
+require_once("../config_tinybrowser.php");\r
+\r
+header ("Content-type: text/css");\r
+?>\r
+html { \r
+overflow: -moz-scrollbars-vertical !important; \r
+}\r
+.panel_wrapper div.currentmod {\r
+display:block;\r
+width:100%; \r
+overflow-x:hidden;\r
+}\r
+.tabs li.right {\r
+float:right;\r
+margin:0;\r
+}\r
+.tabs span {\r
+font-size: 10px;\r
+}\r
+fieldset {\r
+padding-bottom: 10px;\r
+}\r
+form {\r
+margin: 0;\r
+padding: 0;\r
+font-size: 11px;\r
+}\r
+form.custom select, form.custom input {\r
+margin: 0 7px 0 0;\r
+padding: 0;\r
+}\r
+form.custom input {\r
+height: 14px;\r
+padding: 2px 0 0 2px;\r
+}\r
+form.custom select {\r
+margin-top: 1px;\r
+padding: 0;\r
+}\r
+form.custom label {\r
+margin-right: 2px;\r
+}\r
+.del {\r
+margin: 0;\r
+padding: 0;\r
+border: none;\r
+width: 13px !important; /* for IE */ \r
+height: 13px !important; /* for IE */\r
+vertical-align: middle;\r
+}\r
+.rad {\r
+margin: 0;\r
+padding: 0;\r
+margin-left: 2px !important;\r
+border: none;\r
+background: none;\r
+vertical-align: middle;\r
+}\r
+img {\r
+vertical-align: middle !important;\r
+}\r
+button {\r
+vertical-align: top;\r
+font-size: 11px;\r
+background-color: #d5d5d5;\r
+border: 1px solid #666666;\r
+padding: 1px 2px;\r
+}\r
+*+html button { padding: 0; } /*IE7+ */\r
+* html button { padding: 0; } /*IE6- */\r
+button:hover {\r
+background-color:#8cca83;\r
+cursor: hand;\r
+}\r
+button.edit:hover {\r
+background-color:#ff9999;\r
+}\r
+.tabularwrapper {\r
+margin: 5px;\r
+}\r
+table.browse {\r
+clear: both;\r
+width: 100%;\r
+border: 1px solid #b7babc;\r
+border-right: 0;\r
+border-collapse: collapse;\r
+overflow: hidden;\r
+}\r
+table.browse th, table.browse td {\r
+font-size: 10px;\r
+text-align: left;\r
+padding: 0 7px;\r
+color: #0b333c;\r
+border-right: 1px solid #b7babc;\r
+line-height: 22px;\r
+}\r
+table.browse th {\r
+background-image: url(../img/back.png);\r
+background-repeat: repeat-x;\r
+background-position: bottom left;\r
+border-bottom: 1px solid #b7babc;\r
+}\r
+table.browse th a {\r
+color: #0b333c;\r
+display: block;\r
+width: 100%;\r
+text-decoration: none;\r
+background-repeat: no-repeat;\r
+background-position: center right;\r
+background-image: none;\r
+}\r
+table.browse th a.asc {\r
+background-image: url(../img/asc.gif);\r
+}\r
+table.browse th a.desc {\r
+background-image: url(../img/desc.gif);\r
+}\r
+table.browse tr.r0 td {\r
+ background-color: #FFFFFF;\r
+}\r
+table.browse tr.r1 td {\r
+ background-color: #f5f5f5;\r
+}\r
+table.browse tr.over td, table.browse th.over {\r
+background-color: #b2e1ff;\r
+background-image: none;\r
+}\r
+.img-browser {\r
+margin: 5px;\r
+border: 1px solid #e2e2e2;\r
+float: left;\r
+clear: none;\r
+text-align: center;\r
+height: <?php echo $tinybrowser['thumbsize']+40; ?>px;\r
+width: <?php echo $tinybrowser['thumbsize']+25; ?>px;\r
+font-size: <?php echo $tinybrowser['thumbsize']; ?>px;\r
+}\r
+*+html .img-browser { width: <?php echo $tinybrowser['thumbsize']+28; ?>px; } /*IE7+ */\r
+* html .img-browser { width: <?php echo $tinybrowser['thumbsize']+28; ?>px; } /*IE6- */\r
+.img-browser img {\r
+border: 0;\r
+vertical-align: middle;\r
+margin-top: -20px;\r
+}\r
+*+html .img-browser img { margin-top: 0; } /*IE7+ */\r
+* html .img-browser img { margin-top: 0; } /*IE6- */\r
+.img-browser a {\r
+display: block;\r
+width: 100%;\r
+height: 100%;\r
+text-decoration: none;\r
+}\r
+.img-browser a:hover {\r
+background-color: #b2e1ff;\r
+}\r
+.filename {\r
+font-family: Tahoma,Arial,Helvetica,sans-serif;\r
+clear:both;\r
+font-size: 11px;\r
+line-height: 13px;\r
+overflow: hidden;\r
+width: <?php echo $tinybrowser['thumbsize']+20; ?>px;\r
+height: 28px;\r
+margin-top: -6px;\r
+padding-left: 3px;\r
+}\r
+a.imghover {\r
+padding-left: 22px;\r
+display: block;\r
+position: relative; \r
+z-index: 30;\r
+background-image: url(../img/preview.gif);\r
+background-repeat: no-repeat;\r
+background-position: 0 4px;\r
+}\r
+a.imghover img {\r
+position: absolute; \r
+z-index: 31;\r
+background-color: #fff;\r
+padding: 4px;\r
+border: 1px solid #888888;\r
+display: none; \r
+}\r
+a.imghover:hover img {\r
+top: -5px; \r
+left: 140px; \r
+display: block;\r
+}\r
+.pushleft {\r
+padding: 4px 5px;\r
+float: left;\r
+text-align: left;\r
+}\r
+.pushright {\r
+padding: 4px 5px;\r
+float: right;\r
+text-align: right;\r
+}\r
+a {\r
+outline: none;\r
+border: 0;\r
+}\r
+.alertsuccess, .alertfailure, .alertinfo {\r
+position: relative;\r
+clear: both;\r
+margin: 0 auto;\r
+padding: 4px 4px 4px 4px;\r
+width: 98%;\r
+text-align: center;\r
+border-style: solid;\r
+border-width: 1px;\r
+}\r
+.alertsuccess {\r
+border-color: #00C000;\r
+background-color: #BBFFBB;\r
+}\r
+.alertfailure {\r
+border-color: #CC0000;\r
+background-color: #FFBBBB;\r
+}\r
+.alertinfo {\r
+border-color: #1133DD;\r
+background-color: #AACCFF;\r
+}\r
+\r
--- /dev/null
+/* Generic */\r
+body {\r
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
+background:#F0F0EE;\r
+padding:0;\r
+margin:8px 8px 0 8px;\r
+}\r
+\r
+html {background:#F0F0EE;}\r
+textarea {resize:none;outline:none;}\r
+a:link, a:visited {color:black;}\r
+a:hover {color:#2B6FB6;}\r
+\r
+/* Forms */\r
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
+legend {color:#2B6FB6; font-weight:bold;}\r
+input {background:#FFF; border:1px solid #CCC;}\r
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+input, select, textarea {border:1px solid #808080;}\r
+\r
+/* Tabs classes */\r
+.tabs {width:100%; height:18px; line-height:normal; background:url(../img/tabs.gif) repeat-x 0 -72px;}\r
+.tabs ul {margin:0; padding:0; list-style:none;}\r
+.tabs li {float:left; background:url(../img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
+.tabs li.current {background:url(../img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
+.tabs span {float:left; display:block; background:url(../img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
+.tabs .current span {background:url(../img/tabs.gif) no-repeat right -54px;}\r
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
+\r
+/* Panels */\r
+.panel_wrapper div.panel {display:none;}\r
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
--- /dev/null
+<?php\r
+require_once('config_tinybrowser.php');\r
+// Set language\r
+if(isset($tinybrowser['language']) && file_exists('langs/'.$tinybrowser['language'].'.php'))\r
+ {\r
+ require_once('langs/'.$tinybrowser['language'].'.php'); \r
+ }\r
+else\r
+ {\r
+ require_once('langs/en.php'); // Falls back to English\r
+ }\r
+require_once('fns_tinybrowser.php');\r
+\r
+// Check session, if it exists\r
+if(session_id() != '')\r
+ {\r
+ if(!isset($_SESSION[$tinybrowser['sessioncheck']]))\r
+ {\r
+ echo TB_DENIED;\r
+ exit;\r
+ }\r
+ }\r
+ \r
+if(!$tinybrowser['allowedit'] && !$tinybrowser['allowdelete'])\r
+ {\r
+ echo TB_EDDENIED;\r
+ exit;\r
+ }\r
+\r
+// Assign file operation variables\r
+$validtypes = array('image','media','file');\r
+$typenow = ((isset($_GET['type']) && in_array($_GET['type'],$validtypes)) ? $_GET['type'] : 'image');\r
+$foldernow = str_replace(array('../','..\\','./','.\\'),'',($tinybrowser['allowfolders'] && isset($_REQUEST['folder']) ? urldecode($_REQUEST['folder']) : ''));\r
+$destfolder = (isset($_POST['destination']) ? $tinybrowser['path'][$typenow].urldecode($_POST['destination']) : '');\r
+$destfoldernow = (isset($_POST['destination']) ? urldecode($_POST['destination']) : $foldernow);\r
+\r
+// Assign edit and thumbnail path\r
+$editpath = $tinybrowser['path'][$typenow].$foldernow;\r
+$thumbpath = $tinybrowser[$tinybrowser['thumbsrc']][$typenow].$foldernow;\r
+\r
+// Assign browsing options\r
+$sortbynow = (isset($_REQUEST['sortby']) ? $_REQUEST['sortby'] : $tinybrowser['order']['by']);\r
+$sorttypenow = (isset($_REQUEST['sorttype']) ? $_REQUEST['sorttype'] : $tinybrowser['order']['type']);\r
+$sorttypeflip = ($sorttypenow == 'asc' ? 'desc' : 'asc'); \r
+$viewtypenow = 'detail';\r
+$findnow = (isset($_REQUEST['find']) && !empty($_REQUEST['find']) ? $_REQUEST['find'] : false);\r
+$actionnow = (isset($_REQUEST['action']) ? $_REQUEST['action'] : $tinybrowser['defaultaction'] );\r
+$showpagenow = (isset($_REQUEST['showpage']) ? $_REQUEST['showpage'] : 0);\r
+\r
+// Assign url pass variables\r
+$passfolder = '&folder='.urlencode($foldernow);\r
+$passfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? '&feid='.$_GET['feid'] : '');\r
+$passaction = '&action='.$actionnow;\r
+$passsortby = '&sortby='.$sortbynow.'&sorttype='.$sorttypenow;\r
+\r
+// Assign sort parameters for column header links\r
+$sortbyget = array();\r
+$sortbyget['name'] = '&sortby=name';\r
+$sortbyget['size'] = '&sortby=size'; \r
+$sortbyget['type'] = '&sortby=type'; \r
+$sortbyget['modified'] = '&sortby=modified';\r
+$sortbyget['dimensions'] = '&sortby=dimensions'; \r
+$sortbyget[$sortbynow] .= '&sorttype='.$sorttypeflip;\r
+\r
+// Assign css style for current sort type column\r
+$thclass = array();\r
+$thclass['name'] = '';\r
+$thclass['size'] = ''; \r
+$thclass['type'] = ''; \r
+$thclass['modified'] = '';\r
+$thclass['dimensions'] = ''; \r
+$thclass[$sortbynow] = ' class="'.$sorttypenow.'"';\r
+\r
+// Initalise alert array\r
+$notify = array(\r
+ 'type' => array(),\r
+ 'message' => array()\r
+);\r
+$deleteqty = 0;\r
+$renameqty = 0;\r
+$resizeqty = 0;\r
+$rotateqty = 0;\r
+$moveqty = 0;\r
+$errorqty = 0;\r
+ \r
+// Set when rotating images to force thumbnail refresh\r
+$imagerefresh ='';\r
+\r
+// Delete any checked files\r
+if(isset($_POST['deletefile']))\r
+ {\r
+ foreach($_POST['deletefile'] as $delthis => $val)\r
+ {\r
+ $delthisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$delthis];\r
+ if (file_exists($delthisfile) && unlink($delthisfile)) $deleteqty++; else $errorqty++;\r
+ if($typenow=='image')\r
+ {\r
+ $delthisthumb = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$delthis];\r
+ if (file_exists($delthisthumb)) unlink($delthisthumb);\r
+ }\r
+ }\r
+ }\r
+ \r
+// Rename any files with changed name\r
+if(isset($_POST['renamefile']))\r
+ {\r
+ foreach($_POST['renamefile'] as $namethis => $newname)\r
+ {\r
+ if($_POST['actionfile'][$namethis] != $newname.$_POST['renameext'][$namethis])\r
+ {\r
+ $namethisfilefrom = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$namethis];\r
+ $namethisfileto = $tinybrowser['docroot'].$editpath.clean_filename($newname.$_POST['renameext'][$namethis]);\r
+ if (file_exists($namethisfilefrom) && rename($namethisfilefrom,$namethisfileto)) $renameqty++; else $errorqty++;\r
+ if($typenow=='image')\r
+ {\r
+ $namethisthumbfrom = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$namethis];\r
+ $namethisthumbto = $tinybrowser['docroot'].$editpath.'_thumbs/_'.clean_filename($newname.$_POST['renameext'][$namethis]);\r
+ if (file_exists($namethisthumbfrom)) rename($namethisthumbfrom,$namethisthumbto);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+// Move any checked files\r
+if(isset($_POST['movefile']))\r
+ {\r
+ foreach($_POST['movefile'] as $movethis => $val)\r
+ {\r
+ $movethisfile = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$movethis];\r
+ $movefiledest = $tinybrowser['docroot'].$destfolder.$_POST['actionfile'][$movethis];\r
+ if (!file_exists($movefiledest) && file_exists($movethisfile) && copy($movethisfile,$movefiledest))\r
+ {\r
+ $moveqty++;\r
+ unlink($movethisfile);\r
+ if($typenow=='image')\r
+ {\r
+ $movethisthumb = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$movethis];\r
+ $movethumbdest = $tinybrowser['docroot'].$destfolder.'_thumbs/_'.$_POST['actionfile'][$movethis];\r
+ if (file_exists($movethisthumb) && copy($movethisthumb,$movethumbdest)) unlink($movethisthumb);\r
+ }\r
+ }\r
+ else $errorqty++;\r
+ }\r
+ }\r
+ \r
+// Resize any files with new size\r
+if(isset($_POST['resizefile']))\r
+ {\r
+ foreach($_POST['resizefile'] as $sizethis => $newsize)\r
+ {\r
+ $newsize = intval($newsize);\r
+ if($newsize)\r
+ {\r
+ // detect silly sizes\r
+ if($newsize > $tinybrowser['thumbsize'])\r
+ {\r
+ // do image resize\r
+ $targetimg = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$sizethis];\r
+ if (file_exists($targetimg))\r
+ {\r
+ $mime = getimagesize($targetimg);\r
+ if($_POST['resizetype'][$sizethis]=='width')\r
+ {\r
+ $rw = $newsize;\r
+ $rh = $mime[1];\r
+ }\r
+ else\r
+ {\r
+ $rw = $mime[0];\r
+ $rh = $newsize;\r
+ }\r
+ $im = convert_image($targetimg,$mime['mime']);\r
+ resizeimage($im,$rw,$rh,$targetimg,$tinybrowser['imagequality'],$mime['mime']);\r
+ imagedestroy($im);\r
+ $resizeqty++;\r
+ }\r
+ else $errorqty++;\r
+ }\r
+ else $errorqty++;\r
+ }\r
+ }\r
+ }\r
+\r
+// Rotate any selected files\r
+if(isset($_POST['rotatefile']))\r
+ {\r
+ $imagerefresh = '?refresh='.uniqid('');\r
+ foreach($_POST['rotatefile'] as $rotatethis => $direction)\r
+ {\r
+ if($direction != 'none')\r
+ {\r
+ $targetimg = $tinybrowser['docroot'].$editpath.$_POST['actionfile'][$rotatethis];\r
+ if (file_exists($targetimg))\r
+ {\r
+ // rotate image\r
+ if($direction == 'clock') $degree=270; else $degree=90;\r
+ $mime = getimagesize($targetimg);\r
+ $im = convert_image($targetimg,$mime['mime']);\r
+ \r
+ // additional processing for png / gif transparencies (credit to Dirk Bohl)\r
+ if($mime['mime'] == 'image/x-png' || $mime['mime'] == 'image/png')\r
+ {\r
+ imagealphablending($newim, false);\r
+ imagesavealpha($newim, true);\r
+ }\r
+ elseif($mime['mime'] == 'image/gif')\r
+ {\r
+ $originaltransparentcolor = imagecolortransparent( $im );\r
+ if($originaltransparentcolor >= 0 && $originaltransparentcolor < imagecolorstotal( $im ))\r
+ {\r
+ $transparentcolor = imagecolorsforindex( $im, $originaltransparentcolor );\r
+ $newtransparentcolor = imagecolorallocate($newim,$transparentcolor['red'],$transparentcolor['green'],$transparentcolor['blue']);\r
+ imagefill( $newim, 0, 0, $newtransparentcolor );\r
+ imagecolortransparent( $newim, $newtransparentcolor );\r
+ }\r
+ }\r
+ $newim = imagerotate($im, $degree, 0);\r
+ imagedestroy($im);\r
+ \r
+ if($mime['mime'] == 'image/pjpeg' || $mime['mime'] == 'image/jpeg')\r
+ imagejpeg ($newim,$targetimg,$tinybrowser['imagequality']);\r
+ elseif($mime['mime'] == 'image/x-png' || $mime['mime'] == 'image/png')\r
+ imagepng ($newim,$targetimg,substr($tinybrowser['imagequality'],0,1));\r
+ elseif($mime['mime'] == 'image/gif')\r
+ imagegif ($newim,$targetimg);\r
+ imagedestroy($newim);\r
+ $rotateqty++;\r
+\r
+ // delete and recreate thumbnail image\r
+ $targetthumb = $tinybrowser['docroot'].$editpath.'_thumbs/_'.$_POST['actionfile'][$rotatethis];\r
+ if (file_exists($targetthumb)) unlink($targetthumb);\r
+ $mime = getimagesize($targetimg);\r
+ $im = convert_image($targetimg,$mime['mime']);\r
+ resizeimage($im,$tinybrowser['thumbsize'],$tinybrowser['thumbsize'],$targetthumb,$tinybrowser['thumbquality'],$mime['mime']);\r
+ imagedestroy($im);\r
+ }\r
+ else $errorqty++;\r
+ }\r
+ }\r
+ }\r
+\r
+// Read directory contents and populate $file array\r
+$dh = opendir($tinybrowser['docroot'].$editpath);\r
+$file = array();\r
+while (($filename = readdir($dh)) !== false)\r
+ {\r
+ // get file extension\r
+ $nameparts = explode('.',$filename);\r
+ $ext = end($nameparts);\r
+\r
+ // filter directories and prohibited file types\r
+ if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$editpath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext))))\r
+ {\r
+ // search file name if search term entered\r
+ if($findnow) $exists = strpos(strtolower($filename),strtolower($findnow));\r
+\r
+ // assign file details to array, for all files or those that match search\r
+ if(!$findnow || ($findnow && $exists !== false))\r
+ {\r
+ $file['name'][] = $filename;\r
+ $file['sortname'][] = strtolower($filename);\r
+ $file['modified'][] = filemtime($tinybrowser['docroot'].$editpath.$filename);\r
+ $file['size'][] = filesize($tinybrowser['docroot'].$editpath.$filename);\r
+\r
+ // image specific info or general\r
+ if($typenow=='image' && $imginfo = getimagesize($tinybrowser['docroot'].$editpath.$filename))\r
+ {\r
+ $file['width'][] = $imginfo[0];\r
+ $file['height'][] = $imginfo[1];\r
+ $file['dimensions'][] = $imginfo[0] + $imginfo[1];\r
+ $file['type'][] = $imginfo['mime'];\r
+ }\r
+ else\r
+ {\r
+ $file['width'][] = 'N/A';\r
+ $file['height'][] = 'N/A';\r
+ $file['dimensions'][] = 'N/A';\r
+ $file['type'][] = returnMIMEType($filename);\r
+ }\r
+ }\r
+ }\r
+ }\r
+closedir($dh);\r
+\r
+// Assign directory structure to array\r
+$editdirs=array();\r
+dirtree($editdirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);\r
+\r
+// generate alert if files deleted\r
+if($deleteqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGDELETE, $deleteqty);\r
+ }\r
+// generate alert if files renamed\r
+elseif($renameqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGRENAME, $renameqty);\r
+ }\r
+// generate alert if files renamed\r
+elseif($moveqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGMOVE, $moveqty);\r
+ }\r
+// generate alert if images resized\r
+elseif($resizeqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGRESIZE, $resizeqty);\r
+ }\r
+// generate alert if images rotated\r
+elseif($rotateqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGROTATE, $rotateqty);\r
+ }\r
+ \r
+// generate alert if file errors encountered\r
+if($errorqty>0)\r
+ {\r
+ $notify['type'][]='failure';\r
+ $notify['message'][]=sprintf(TB_MSGEDITERR, $errorqty);\r
+ }\r
+\r
+// determine sort order\r
+$sortorder = ($sorttypenow == 'asc' ? SORT_ASC : SORT_DESC);\r
+$num_of_files = (isset($file['name']) ? count($file['name']) : 0);\r
+\r
+if($num_of_files>0)\r
+ {\r
+ // sort files by selected order\r
+ sortfileorder($sortbynow,$sortorder,$file);\r
+ }\r
+\r
+// determine pagination\r
+if($tinybrowser['pagination']>0)\r
+ {\r
+ $showpagestart = ($showpagenow ? ($_REQUEST['showpage']*$tinybrowser['pagination'])-$tinybrowser['pagination'] : 0);\r
+ $showpageend = $showpagestart+$tinybrowser['pagination'];\r
+ if($showpageend>$num_of_files) $showpageend = $num_of_files;\r
+ }\r
+else\r
+ {\r
+ $showpagestart = 0;\r
+ $showpageend = $num_of_files;\r
+ }\r
+?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+<title>TinyBrowser :: <?php echo TB_EDIT; ?></title>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<meta http-equiv="Pragma" content="no-cache" />\r
+<?php\r
+if(empty($passfeid) && $tinybrowser['integration']=='tinymce')\r
+ {\r
+ ?><link rel="stylesheet" type="text/css" media="all" href="<?php echo $tinybrowser['tinymcecss']; ?>" /><?php \r
+ }\r
+else\r
+ {\r
+ ?><link rel="stylesheet" type="text/css" media="all" href="css/stylefull_tinybrowser.css" /><?php \r
+ }\r
+?>\r
+<link rel="stylesheet" type="text/css" media="all" href="css/style_tinybrowser.css.php" />\r
+<script language="javascript" type="text/javascript" src="js/tinybrowser.js.php"></script>\r
+</head>\r
+<body onload="rowHighlight();">\r
+<?php\r
+if(count($notify['type'])>0) alert($notify);\r
+form_open('foldertab',false,'edit.php','?type='.$typenow.$passfeid);\r
+?>\r
+<div class="tabs">\r
+<ul>\r
+<li id="browse_tab"><span><a href="tinybrowser.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_BROWSE; ?></a></span></li>\r
+<?php\r
+if($tinybrowser['allowupload']) \r
+ {\r
+ ?><li id="upload_tab"><span><a href="upload.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_UPLOAD; ?></a></span></li>\r
+ <?php \r
+ } ?>\r
+<li id="edit_tab" class="current"><span><a href="edit.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_EDIT; ?></a></span></li>\r
+<?php\r
+if($tinybrowser['allowfolders'])\r
+ {\r
+ ?><li id="folders_tab"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li><?php\r
+ }\r
+// Display folder select, if multiple exist\r
+if(count($editdirs)>1)\r
+ {\r
+ ?><li id="folder_tab" class="right"><span><?php\r
+ form_select($editdirs,'folder',TB_FOLDERCURR,urlencode($foldernow),true);\r
+ form_hidden_input('sortby',$sortbynow);\r
+ form_hidden_input('sorttype',$sorttypenow);\r
+ form_hidden_input('showpage',$showpagenow);\r
+ form_hidden_input('action',$actionnow);\r
+ ?></span></li><?php\r
+ }\r
+?>\r
+</ul>\r
+</div>\r
+</form>\r
+<div class="panel_wrapper">\r
+<div id="general_panel" class="panel currentmod">\r
+<fieldset>\r
+<legend><?php echo TB_EDITFILES; ?></legend>\r
+<?php\r
+form_open('edit','custom','edit.php','?type='.$typenow.$passfolder.$passfeid);\r
+?>\r
+<div class="pushleft">\r
+<?php\r
+\r
+// Assign edit actions based on file type and permissions\r
+$select = array();\r
+if($tinybrowser['allowdelete']) $select[] = array('delete',TB_DELETE);\r
+if($tinybrowser['allowedit']) $select[] = array('rename',TB_RENAME);\r
+if($tinybrowser['allowfolders']) $select[] = array('move',TB_MOVE);\r
+if($typenow=='image' && $tinybrowser['allowedit'])\r
+ {\r
+ $select[] = array('resize',TB_RESIZE);\r
+ $select[] = array('rotate',TB_ROTATE);\r
+ }\r
+form_select($select,'action',TB_ACTION,$actionnow,true);\r
+\r
+// Show page select if pagination is set\r
+if($tinybrowser['pagination']>0)\r
+ {\r
+ $pagelimit = ceil($num_of_files/$tinybrowser['pagination'])+1;\r
+ $page = array();\r
+ for($i=1;$i<$pagelimit;$i++)\r
+ {\r
+ $page[] = array($i,TB_PAGE.' '.$i);\r
+ }\r
+ if($i>2) form_select($page,'showpage',SHOW,$showpagenow,true);\r
+ }\r
+?></div><div class="pushright"><?php\r
+\r
+form_hidden_input('sortby',$sortbynow);\r
+form_hidden_input('sorttype',$sorttypenow);\r
+form_text_input('find',false,$findnow,25,50);\r
+form_submit_button('search',TB_SEARCH,'');\r
+?></div><?php\r
+\r
+form_open('actionform','custom','edit.php','?type='.$typenow.$passfolder.$passfeid);\r
+\r
+if($actionnow=='move')\r
+ { ?><div class="pushleft"><?php\r
+ form_select($editdirs,'destination',TB_FOLDERDEST,urlencode($destfoldernow),false);\r
+ ?></div><?php\r
+ } \r
+\r
+if($typenow=='image')\r
+ {\r
+ $selectresize = array(\r
+ array('width',TB_WIDTH),\r
+ array('height',TB_HEIGHT)\r
+ );\r
+ }\r
+\r
+switch($actionnow) \r
+ {\r
+ case 'delete':\r
+ $actionhead = TB_DELETE;\r
+ break;\r
+ case 'rename':\r
+ $actionhead = TB_RENAME;\r
+ break;\r
+ case 'resize':\r
+ $actionhead = TB_RESIZE;\r
+ break;\r
+ case 'rotate':\r
+ $actionhead = TB_ROTATE;\r
+ break;\r
+ case 'move':\r
+ $actionhead = TB_MOVE;\r
+ break;\r
+ default:\r
+ // do nothing\r
+ }\r
+?><div class="tabularwrapper"><table class="browse"><tr>\r
+<th><a href="?type=<?php echo $typenow.$passaction.$passfolder.$passfeid.$sortbyget['name']; ?>"<?php echo $thclass['name']; ?>><?php echo TB_FILENAME; ?></a></th>\r
+<th><a href="?type=<?php echo $typenow.$passaction.$passfolder.$passfeid.$sortbyget['size']; ?>"<?php echo $thclass['size']; ?>><?php echo TB_SIZE; ?></a></th>\r
+<th><a href="?type=<?php echo $typenow.$passaction.$passfolder.$passfeid.$sortbyget['type']; ?>"<?php echo $thclass['type']; ?>><?php echo TB_TYPE; ?></th>\r
+<th class="nohvr"><?php echo $actionhead; ?></th></tr>\r
+<?php\r
+\r
+for($i=$showpagestart;$i<$showpageend;$i++)\r
+ {\r
+ $alt = (IsOdd($i) ? 'r1' : 'r0');\r
+ echo '<tr class="'.$alt.'">';\r
+ if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="return false;" title="'.$file['name'][$i].' '.TB_DIMENSIONS.': '.$file['width'][$i].' x '.$file['height'][$i].' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'"><img src="'.$thumbpath.'_thumbs/_'.$file['name'][$i].$imagerefresh.'" alt="" />' .truncate_text($file['name'][$i],30).'</a></td>';\r
+ else echo '<td title="'.$file['name'][$i].' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i]).'">'.truncate_text($file['name'][$i],30).'</td>';\r
+ echo '<td>'.bytestostring($file['size'][$i],1).'</td><td>'.$file['type'][$i].'</td>'\r
+ .'<td>';\r
+ form_hidden_input('actionfile['.$i.']',$file['name'][$i]);\r
+ switch($actionnow) \r
+ {\r
+ case 'delete':\r
+ echo '<input class="del" type="checkbox" name="deletefile['.$i.']" value="1" />'; \r
+ break;\r
+ case 'rename':\r
+ // get file extension\r
+ $nameparts = explode('.',$file['name'][$i]);\r
+ $ext = end($nameparts);\r
+ form_hidden_input('renameext['.$i.']',$ext);\r
+ form_text_input('renamefile['.$i.']',false,basename($file['name'][$i],$ext),30,120); echo $ext;\r
+ break;\r
+ case 'resize':\r
+ form_text_input('resizefile['.$i.']',false,'',4,4); form_select($selectresize,'resizetype['.$i.']',false,'',false);\r
+ break;\r
+ case 'rotate':\r
+ echo '<img src="img/rotate_c.gif" alt="'.TB_ROTATECW.'" /><input class="rad" type="radio" name="rotatefile['.$i.']" value="clock"><img src="img/rotate_ac.gif" alt="'.TB_ROTATECCW.'" /><input class="rad" type="radio" name="rotatefile['.$i.']" value="anticlock">'.TB_NONE.'<input class="rad" type="radio" name="rotatefile['.$i.']" value="none" checked>';\r
+ break;\r
+ case 'move':\r
+ echo '<input class="del" type="checkbox" name="movefile['.$i.']" value="1" />';\r
+ break;\r
+ default:\r
+ // do nothing\r
+ }\r
+ echo "</td></tr>\n";\r
+ }\r
+\r
+echo "</table></div>\n".'<div class="pushright">';\r
+if($tinybrowser['allowdelete'] || $tinybrowser['allowedit'])\r
+ {\r
+ form_hidden_input('sortby',$sortbynow);\r
+ form_hidden_input('sorttype',$sorttypenow);\r
+ form_hidden_input('find',$findnow);\r
+ form_hidden_input('showpage',$showpagenow);\r
+ form_hidden_input('action',$actionnow);\r
+ form_submit_button('commit',$actionhead.' '.TB_FILES,'edit');\r
+ }\r
+?>\r
+</div></fieldset></div></div>\r
+</body>\r
+</html>\r
--- /dev/null
+<?php\r
+// *************************CREATE FOLDER**********************************\r
+function createfolder($dir,$perm) {\r
+is_dir(dirname($dir)) || createfolder(dirname($dir), $perm);\r
+ return is_dir($dir) || @mkdir($dir, $perm);\r
+}\r
+\r
+// *************************VALIDATE FILE EXTENSIONS**********************************\r
+function validateExtension($extension, $types) {\r
+if(in_array($extension,$types)) return false; else return true;\r
+}\r
+\r
+//*************************************Display Alert Notifications*********************************\r
+function alert(&$notify){\r
+$alert_num = count($notify['type']);\r
+for($i=0;$i<$alert_num;$i++)\r
+ {\r
+ ?><div class="alert<?php echo $notify['type'][$i]; ?>"><?php echo $notify['message'][$i]; ?></div><br /><?php\r
+ }\r
+}\r
+\r
+// *************************SORT FILE ARRAY BY SELECTED ORDER**********************************\r
+function sortfileorder(&$sortbynow,&$sortorder,&$file) {\r
+\r
+switch($sortbynow) \r
+ {\r
+ case 'name':\r
+ array_multisort($file['sortname'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['modified'], $sortorder, $file['size'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder);\r
+ break;\r
+ case 'size':\r
+ array_multisort($file['size'], $sortorder, $file['sortname'], SORT_ASC, $file['name'], SORT_ASC, $file['type'], $sortorder, $file['modified'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder);\r
+ break;\r
+ case 'type':\r
+ array_multisort($file['type'], $sortorder, $file['sortname'], SORT_ASC, $file['name'], SORT_ASC, $file['size'], $sortorder, $file['modified'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder);\r
+ break;\r
+ case 'modified':\r
+ array_multisort($file['modified'], $sortorder, $file['name'], $sortorder, $file['name'], $sortorder, $file['type'], $sortorder, $file['size'], $sortorder, $file['dimensions'], $sortorder, $file['width'], $sortorder, $file['height'], $sortorder);\r
+ break;\r
+ case 'dimensions':\r
+ array_multisort($file['dimensions'], $sortorder, $file['width'], $sortorder, $file['sortname'], SORT_ASC, $file['name'], SORT_ASC, $file['modified'], $sortorder, $file['type'], $sortorder, $file['size'], $sortorder, $file['height'], $sortorder);\r
+ break;\r
+ default:\r
+ // do nothing\r
+ }\r
+}\r
+\r
+// **************************RESIZE IMAGE TO GIVEN SIZE*****************************************\r
+function resizeimage($im,$maxwidth,$maxheight,$urlandname,$comp,$imagetype){\r
+$width = imagesx($im);\r
+$height = imagesy($im);\r
+if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))\r
+ {\r
+ if($maxwidth && $width > $maxwidth)\r
+ {\r
+ $widthratio = $maxwidth/$width;\r
+ $resizewidth=true;\r
+ } \r
+ else $resizewidth=false;\r
+\r
+ if($maxheight && $height > $maxheight)\r
+ {\r
+ $heightratio = $maxheight/$height;\r
+ $resizeheight=true;\r
+ } \r
+ else $resizeheight=false;\r
+\r
+ if($resizewidth && $resizeheight)\r
+ {\r
+ if($widthratio < $heightratio) $ratio = $widthratio;\r
+ else $ratio = $heightratio;\r
+ }\r
+ elseif($resizewidth)\r
+ {\r
+ $ratio = $widthratio;\r
+ }\r
+ elseif($resizeheight)\r
+ {\r
+ $ratio = $heightratio;\r
+ }\r
+ $newwidth = $width * $ratio;\r
+ $newheight = $height * $ratio;\r
+ if(function_exists('imagecopyresampled') && $imagetype !='image/gif')\r
+ {\r
+ $newim = imagecreatetruecolor($newwidth, $newheight);\r
+ }\r
+ else\r
+ {\r
+ $newim = imagecreate($newwidth, $newheight);\r
+ }\r
+\r
+ // additional processing for png / gif transparencies (credit to Dirk Bohl)\r
+ if($imagetype == 'image/x-png' || $imagetype == 'image/png')\r
+ {\r
+ imagealphablending($newim, false);\r
+ imagesavealpha($newim, true);\r
+ }\r
+ elseif($imagetype == 'image/gif')\r
+ {\r
+ $originaltransparentcolor = imagecolortransparent( $im );\r
+ if($originaltransparentcolor >= 0 && $originaltransparentcolor < imagecolorstotal( $im ))\r
+ {\r
+ $transparentcolor = imagecolorsforindex( $im, $originaltransparentcolor );\r
+ $newtransparentcolor = imagecolorallocate($newim,$transparentcolor['red'],$transparentcolor['green'],$transparentcolor['blue']);\r
+ imagefill( $newim, 0, 0, $newtransparentcolor );\r
+ imagecolortransparent( $newim, $newtransparentcolor );\r
+ }\r
+ }\r
+\r
+ imagecopyresampled($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\r
+ \r
+ if($imagetype == 'image/pjpeg' || $imagetype == 'image/jpeg')\r
+ {\r
+ imagejpeg ($newim,$urlandname,$comp);\r
+ }\r
+ elseif($imagetype == 'image/x-png' || $imagetype == 'image/png')\r
+ {\r
+ imagepng ($newim,$urlandname,substr($comp,0,1));\r
+ }\r
+ elseif($imagetype == 'image/gif')\r
+ {\r
+ imagegif ($newim,$urlandname);\r
+ }\r
+ imagedestroy ($newim);\r
+ }\r
+else\r
+ {\r
+ if($imagetype == 'image/pjpeg' || $imagetype == 'image/jpeg')\r
+ {\r
+ imagejpeg ($im,$urlandname,$comp);\r
+ }\r
+ elseif($imagetype == 'image/x-png' || $imagetype == 'image/png')\r
+ {\r
+ imagepng ($im,$urlandname,substr($comp,0,1));\r
+ }\r
+ elseif($imagetype == 'image/gif')\r
+ {\r
+ imagegif ($im,$urlandname);\r
+ }\r
+ }\r
+}\r
+\r
+// **************************CHECK IMAGE TYPE AND CONVERT TO TEMP TYPE*****************************\r
+function convert_image($imagetemp,$imagetype){\r
+\r
+if($imagetype == 'image/pjpeg' || $imagetype == 'image/jpeg')\r
+ {\r
+ $cim1 = imagecreatefromjpeg($imagetemp);\r
+ }\r
+elseif($imagetype == 'image/x-png' || $imagetype == 'image/png')\r
+ {\r
+ $cim1 = imagecreatefrompng($imagetemp);\r
+ imagealphablending($cim1, false);\r
+ imagesavealpha($cim1, true);\r
+ }\r
+elseif($imagetype == 'image/gif')\r
+ {\r
+ $cim1 = imagecreatefromgif($imagetemp);\r
+ }\r
+return $cim1;\r
+}\r
+\r
+// **************************GENERATE FORM OPEN*****************************\r
+function form_open($name,$class,$url,$parameters){\r
+?><form name="<?php echo $name; ?>" class="<?php echo $class; ?>" method="post" action="<?php echo $url.$parameters; ?>">\r
+<?php\r
+}\r
+\r
+// **************************GENERATE FORM SELECT ELEMENT*****************************\r
+function form_select($options,$name,$label,$current,$auto){\r
+if ($label) {?><label for="<?php echo $name; ?>"><?php echo $label; ?></label><?php } \r
+?><select name="<?php echo $name; ?>" <?php if ($auto) {?>onchange="this.form.submit();"<?php }?>>\r
+<?php\r
+$loopnum = count($options); \r
+for($i=0;$i<$loopnum;$i++)\r
+ {\r
+ $selected = ($options[$i][0] == $current ? ' selected' : ''); \r
+ echo '<option value="'.$options[$i][0].'"'.$selected.'>'.$options[$i][1].'</option>';\r
+ }\r
+?></select><?php\r
+}\r
+\r
+// **************************GENERATE FORM HIDDEN ELEMENT*****************************\r
+function form_hidden_input($name,$value) {\r
+?><input type="hidden" name="<?php echo $name; ?>" value="<?php echo $value; ?>" />\r
+<?php\r
+}\r
+\r
+// **************************GENERATE FORM TEXT ELEMENT*****************************\r
+function form_text_input($name,$label,$value,$size,$maxlength) {\r
+if ($label) {?><label for="<?php echo $name; ?>"><?php echo $label; ?></label><?php } ?>\r
+<input type="text" name="<?php echo $name; ?>" size="<?php echo $size; ?>" maxlength="<?php echo $maxlength; ?>" value="<?php echo $value; ?>" /><?php\r
+}\r
+\r
+// **************************GENERATE FORM SUBMIT BUTTON*****************************\r
+function form_submit_button($name,$label,$class) {\r
+?><button <?php if ($class) {?>class="<?php echo $class; ?>"<?php } ?>type="submit" name="<?php echo $name; ?>"><?php echo $label; ?></button>\r
+</form>\r
+<?php\r
+}\r
+\r
+//********************************Returns True if Number is Odd**************************************\r
+function IsOdd($num)\r
+{\r
+return (1 - ($num & 1));\r
+}\r
+\r
+//********************************Truncate Text to Given Length If Required***************************\r
+function truncate_text($textstring,$length){\r
+ if (strlen($textstring) > $length)\r
+ {\r
+ $textstring = substr($textstring,0,$length).'...';\r
+ }\r
+ return $textstring;\r
+}\r
+\r
+/**\r
+ * Present a size (in bytes) as a human-readable value\r
+ * \r
+ * @param int $size size (in bytes)\r
+ * @param int $precision number of digits after the decimal point\r
+ * @return string\r
+ */\r
+function bytestostring($size, $precision = 0) {\r
+ $sizes = array('YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B');\r
+ $total = count($sizes);\r
+\r
+ while($total-- && $size > 1024) $size /= 1024;\r
+ return round($size, $precision).' '.$sizes[$total];\r
+}\r
+\r
+//function to clean a filename string so it is a valid filename\r
+function clean_filename($filename){\r
+ $filename = preg_replace('/^\W+|\W+$/', '', $filename); // remove all non-alphanumeric chars at begin & end of string\r
+ $filename = preg_replace('/\s+/', '_', $filename); // compress internal whitespace and replace with _\r
+ return strtolower(preg_replace('/\W-/', '', $filename)); // remove all non-alphanumeric chars except _ and -\r
+\r
+}\r
+\r
+//********************************Return File MIME Type***************************\r
+function returnMIMEType($filename)\r
+ {\r
+ preg_match("|\.([a-z0-9]{2,4})$|i", $filename, $fileSuffix);\r
+\r
+ switch(strtolower($fileSuffix[1]))\r
+ {\r
+ case 'js' :\r
+ return 'application/x-javascript';\r
+\r
+ case 'json' :\r
+ return 'application/json';\r
+\r
+ case 'jpg' :\r
+ case 'jpeg' :\r
+ case 'jpe' :\r
+ return 'image/jpg';\r
+\r
+ case 'png' :\r
+ case 'gif' :\r
+ case 'bmp' :\r
+ case 'tiff' :\r
+ return 'image/'.strtolower($fileSuffix[1]);\r
+\r
+ case 'css' :\r
+ return 'text/css';\r
+\r
+ case 'xml' :\r
+ return 'application/xml';\r
+\r
+ case 'doc' :\r
+ case 'docx' :\r
+ return 'application/msword';\r
+\r
+ case 'xls' :\r
+ case 'xlt' :\r
+ case 'xlm' :\r
+ case 'xld' :\r
+ case 'xla' :\r
+ case 'xlc' :\r
+ case 'xlw' :\r
+ case 'xll' :\r
+ return 'application/vnd.ms-excel';\r
+\r
+ case 'ppt' :\r
+ case 'pps' :\r
+ return 'application/vnd.ms-powerpoint';\r
+\r
+ case 'rtf' :\r
+ return 'application/rtf';\r
+\r
+ case 'pdf' :\r
+ return 'application/pdf';\r
+\r
+ case 'html' :\r
+ case 'htm' :\r
+ case 'php' :\r
+ return 'text/html';\r
+\r
+ case 'txt' :\r
+ return 'text/plain';\r
+\r
+ case 'mpeg' :\r
+ case 'mpg' :\r
+ case 'mpe' :\r
+ return 'video/mpeg';\r
+\r
+ case 'mp3' :\r
+ return 'audio/mpeg3';\r
+\r
+ case 'wav' :\r
+ return 'audio/wav';\r
+\r
+ case 'aiff' :\r
+ case 'aif' :\r
+ return 'audio/aiff';\r
+\r
+ case 'avi' :\r
+ return 'video/msvideo';\r
+\r
+ case 'wmv' :\r
+ return 'video/x-ms-wmv';\r
+\r
+ case 'mov' :\r
+ return 'video/quicktime';\r
+\r
+ case 'zip' :\r
+ return 'application/zip';\r
+\r
+ case 'tar' :\r
+ return 'application/x-tar';\r
+\r
+ case 'swf' :\r
+ return 'application/x-shockwave-flash';\r
+\r
+ default :\r
+ if(function_exists('mime_content_type'))\r
+ {\r
+ $fileSuffix = mime_content_type($filename);\r
+ }\r
+\r
+ return 'unknown/' . trim($fileSuffix[0], '.');\r
+ }\r
+ }\r
+\r
+//************************Return Array of Directory Structure***************************\r
+function dirtree(&$alldirs,$types='*.*',$root='',$tree='',$branch='',$level=0) {\r
+\r
+// filter file types according to type\r
+$filetypes = explode(',',preg_replace('{[ \t]+}', '',$types));\r
+\r
+if($level==0 && is_dir($root.$tree.$branch))\r
+ {\r
+ $filenum=0;\r
+ foreach($filetypes as $filetype)\r
+ {\r
+ $filenum = $filenum + count(glob($root.$tree.$branch.sql_regcase($filetype),GLOB_NOSORT));\r
+ }\r
+ $treeparts = explode('/',rtrim($tree,'/'));\r
+ $topname = end($treeparts);\r
+ $alldirs[] = array($branch,rtrim($topname,'/').' ('.$filenum.')',rtrim($topname,'/'),rtrim($topname,'/'),$filenum,filemtime($root.$tree.$branch));\r
+ }\r
+$level++;\r
+\r
+$dh = opendir($root.$tree.$branch);\r
+while (($dirname = readdir($dh)) !== false)\r
+ {\r
+ if($dirname != '.' && $dirname != '..' && is_dir($root.$tree.$branch.$dirname) && $dirname != '_thumbs')\r
+ {\r
+ $filenum=0;\r
+ foreach($filetypes as $filetype)\r
+ {\r
+ $filenum = $filenum + count(glob($root.$tree.$branch.$dirname.'/'.sql_regcase($filetype),GLOB_NOSORT));\r
+ }\r
+ $indent = '';\r
+ for($i=0;$i<$level;$i++) { $indent .= ' '; }\r
+ if(strlen($indent)>0) $indent .= '→ ';\r
+ $alldirs[] = array(urlencode($branch.$dirname.'/'),$indent.$dirname.' ('.$filenum.')',$indent.$dirname,$dirname,$filenum,filemtime($root.$tree.$branch.$dirname));\r
+ dirtree($alldirs,$types,$root,$tree,$branch.$dirname.'/',$level);\r
+ }\r
+ }\r
+closedir($dh);\r
+$level--;\r
+}\r
+\r
+/* user defined error handling function. */\r
+function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars)\r
+{\r
+ // timestamp for the error entry.\r
+ $dt = date('Y-m-d H:i:s (T)');\r
+\r
+ // define an assoc array of error string\r
+ // in reality the only entries we should\r
+ // consider are E_WARNING, E_NOTICE, E_USER_ERROR,\r
+ // E_USER_WARNING and E_USER_NOTICE.\r
+ $errortype = array (\r
+ E_ERROR => 'Error',\r
+ E_WARNING => 'Warning',\r
+ E_PARSE => 'Parsing Error',\r
+ E_NOTICE => 'Notice',\r
+ E_CORE_ERROR => 'Core Error',\r
+ E_CORE_WARNING => 'Core Warning',\r
+ E_COMPILE_ERROR => 'Compile Error',\r
+ E_COMPILE_WARNING => 'Compile Warning',\r
+ E_USER_ERROR => 'User Error',\r
+ E_USER_WARNING => 'User Warning',\r
+ E_USER_NOTICE => 'User Notice',\r
+ E_STRICT => 'Runtime Notice'\r
+ );\r
+ // set of errors for which a var trace will be saved.\r
+ $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE);\r
+\r
+ if($errno != E_STRICT) // exclude Runtime Notices\r
+ {\r
+ $err = $dt. "\t";\r
+ $err .= $errno.' '.$errortype[$errno]. "\t";\r
+ $err .= $errmsg. "\t";\r
+ $err .= 'File: '.basename($filename). "\t";\r
+ $err .= 'Line: '.$linenum. "\t";\r
+\r
+ if (in_array($errno, $user_errors))\r
+ {\r
+ $err .= 'Trace: '.wddx_serialize_value($vars, 'Variables'). "\t";\r
+ }\r
+ $err .= "\n";\r
+\r
+ // save to the error log file, and e-mail me if there is a critical user error.\r
+ error_log($err, 3, 'error.log');\r
+ }\r
+}\r
+$old_error_handler = set_error_handler('userErrorHandler');\r
+\r
+?>\r
--- /dev/null
+<?php\r
+require_once('config_tinybrowser.php');\r
+// Set language\r
+if(isset($tinybrowser['language']) && file_exists('langs/'.$tinybrowser['language'].'.php'))\r
+ {\r
+ require_once('langs/'.$tinybrowser['language'].'.php'); \r
+ }\r
+else\r
+ {\r
+ require_once('langs/en.php'); // Falls back to English\r
+ }\r
+require_once('fns_tinybrowser.php');\r
+\r
+// Check session, if it exists\r
+if(session_id() != '')\r
+ {\r
+ if(!isset($_SESSION[$tinybrowser['sessioncheck']]))\r
+ {\r
+ echo TB_DENIED;\r
+ exit;\r
+ }\r
+ }\r
+ \r
+if(!$tinybrowser['allowfolders'])\r
+ {\r
+ echo TB_FODENIED;\r
+ exit;\r
+ }\r
+\r
+// Assign request / get / post variables\r
+$validtypes = array('image','media','file');\r
+$typenow = ((isset($_GET['type']) && in_array($_GET['type'],$validtypes)) ? $_GET['type'] : 'image');\r
+$foldernow = str_replace(array('../','..\\','./','.\\'),'',($tinybrowser['allowfolders'] && isset($_REQUEST['folder']) ? urldecode($_REQUEST['folder']) : ''));\r
+$dirpath = $tinybrowser['path'][$typenow];\r
+$passfolder = '&folder='.urlencode($foldernow);\r
+$passfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? '&feid='.$_GET['feid'] : '');\r
+\r
+\r
+\r
+// Assign browsing options\r
+$actionnow = (isset($_POST['editaction']) ? $_POST['editaction'] : 'create' );\r
+\r
+// Initalise alert array\r
+$notify = array(\r
+ 'type' => array(),\r
+ 'message' => array()\r
+);\r
+$createqty = 0;\r
+$deleteqty = 0;\r
+$renameqty = 0;\r
+$errorqty = 0;\r
+ \r
+// Create any child folders with entered name\r
+if(isset($_POST['createfolder']))\r
+ {\r
+ foreach($_POST['createfolder'] as $parent => $newfolder)\r
+ {\r
+ if($newfolder != '')\r
+ {\r
+ $createthisfolder = $tinybrowser['docroot'].$dirpath.urldecode($_POST['actionfolder'][$parent]).clean_filename($newfolder);\r
+ if (!file_exists($createthisfolder) && createfolder($createthisfolder,$tinybrowser['unixpermissions'])) $createqty++; else $errorqty++;\r
+ if($typenow=='image')\r
+ {\r
+ createfolder($createthisfolder.'/_thumbs/',$tinybrowser['unixpermissions']);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+// Delete any checked folders\r
+if(isset($_POST['deletefolder']))\r
+ {\r
+ foreach($_POST['deletefolder'] as $delthis => $val)\r
+ {\r
+ if($typenow=='image')\r
+ {\r
+ $delthisthumbdir = $tinybrowser['docroot'].$dirpath.urldecode($_POST['actionfolder'][$delthis]).'_thumbs/';\r
+ if (is_dir($delthisthumbdir)) rmdir($delthisthumbdir);\r
+ }\r
+ $delthisdir = $tinybrowser['docroot'].$dirpath.urldecode($_POST['actionfolder'][$delthis]);\r
+ if (is_dir($delthisdir) && rmdir($delthisdir)) $deleteqty++; else $errorqty++;\r
+ if($foldernow==urldecode($_POST['actionfolder'][$delthis]))\r
+ {\r
+ $foldernow = '';\r
+ $passfolder = '';\r
+ }\r
+ }\r
+\r
+ }\r
+ \r
+// Rename any folders with changed name\r
+if(isset($_POST['renamefolder']))\r
+ {\r
+ foreach($_POST['renamefolder'] as $namethis => $newname)\r
+ {\r
+ $urlparts = explode('/',rtrim(urldecode($_POST['actionfolder'][$namethis]),'/'));\r
+ if(array_pop($urlparts) != $newname)\r
+ {\r
+ $namethisfolderfrom = $tinybrowser['docroot'].$dirpath.urldecode($_POST['actionfolder'][$namethis]);\r
+ $renameurl = implode('/',$urlparts).'/'.clean_filename($newname).'/';\r
+ $namethisfolderto = $tinybrowser['docroot'].$dirpath.$renameurl;\r
+ if (is_dir($namethisfolderfrom) && rename($namethisfolderfrom,$namethisfolderto)) $renameqty++; else $errorqty++;\r
+ if($foldernow==urldecode($_POST['actionfolder'][$namethis]))\r
+ {\r
+ $foldernow = ltrim($renameurl,'/');\r
+ $passfolder = '&folder='.urlencode(ltrim($renameurl,'/'));\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+// Assign directory structure to array\r
+$dirs=array();\r
+dirtree($dirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);\r
+\r
+// generate alert if folders deleted\r
+if($createqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGCREATE, $createqty);\r
+ }\r
+// generate alert if folders deleted\r
+elseif($deleteqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGDELETE, $deleteqty);\r
+ }\r
+// generate alert if folders renamed\r
+elseif($renameqty>0)\r
+ {\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGRENAME, $renameqty);\r
+ }\r
+ \r
+// generate alert if file errors encountered\r
+if($errorqty>0)\r
+ {\r
+ $notify['type'][]='failure';\r
+ $notify['message'][]=sprintf(TB_MSGEDITERR, $errorqty);\r
+ }\r
+ \r
+// count folders\r
+$num_of_folders = (isset($dirs) ? count($dirs) : 0);\r
+\r
+?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+<title>TinyBrowser :: <?php echo TB_FOLDERS; ?></title>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<meta http-equiv="Pragma" content="no-cache" />\r
+<?php\r
+if($passfeid == '' && $tinybrowser['integration']=='tinymce')\r
+ {\r
+ ?><link rel="stylesheet" type="text/css" media="all" href="<?php echo $tinybrowser['tinymcecss']; ?>" /><?php \r
+ }\r
+else\r
+ {\r
+ ?><link rel="stylesheet" type="text/css" media="all" href="css/stylefull_tinybrowser.css" /><?php \r
+ }\r
+?>\r
+<link rel="stylesheet" type="text/css" media="all" href="css/style_tinybrowser.css.php" />\r
+<script language="javascript" type="text/javascript" src="js/tinybrowser.js.php"></script>\r
+</head>\r
+<body onload="rowHighlight();">\r
+<?php\r
+if(count($notify['type'])>0) alert($notify);\r
+form_open('foldertab',false,'folders.php','?type='.$typenow.$passfeid);\r
+?>\r
+<div class="tabs">\r
+<ul>\r
+<li id="browse_tab"><span><a href="tinybrowser.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_BROWSE; ?></a></span></li>\r
+<?php\r
+if($tinybrowser['allowupload']) \r
+ {\r
+ ?><li id="upload_tab"><span><a href="upload.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_UPLOAD; ?></a></span></li>\r
+ <?php \r
+ }\r
+if($tinybrowser['allowfolders'])\r
+ {\r
+ ?><li id="edit_tab"><span><a href="edit.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_EDIT; ?></a></span></li>\r
+ <?php\r
+ }\r
+?><li id="folders_tab" class="current"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li>\r
+</ul>\r
+</div>\r
+</form>\r
+<div class="panel_wrapper">\r
+<div id="general_panel" class="panel currentmod">\r
+<fieldset>\r
+<legend><?php echo TB_FOLDERS; ?></legend>\r
+<?php\r
+form_open('edit','custom','folders.php','?type='.$typenow.$passfolder.$passfeid);\r
+?>\r
+<div class="pushleft">\r
+<?php\r
+\r
+// Assign edit actions based on file type and permissions\r
+$select = array();\r
+if($tinybrowser['allowfolders']) $select[] = array('create',TB_CREATE);\r
+if($tinybrowser['allowdelete']) $select[] = array('delete',TB_DELETE);\r
+if($tinybrowser['allowedit']) $select[] = array('rename',TB_RENAME);\r
+\r
+form_select($select,'editaction',TB_ACTION,$actionnow,true);\r
+?></form></div><?php\r
+\r
+form_open('actionform','custom','folders.php','?type='.$typenow.$passfolder.$passfeid);\r
+\r
+if($actionnow=='move')\r
+ { ?><div class="pushleft"><?php\r
+ form_select($editdirs,'destination',TB_FOLDERDEST,urlencode($foldernow),false);\r
+ ?></div><?php\r
+ } \r
+\r
+switch($actionnow) \r
+ {\r
+ case 'delete':\r
+ $actionhead = TB_DELETE;\r
+ break;\r
+ case 'rename':\r
+ $actionhead = TB_RENAME;\r
+ break;\r
+ case 'create':\r
+ $actionhead = TB_CREATE;\r
+ break;\r
+ default:\r
+ // do nothing\r
+ }\r
+?><div class="tabularwrapper"><table class="browse"><tr>\r
+<th class="nohvr"><?php echo TB_FOLDERNAME; ?></th>\r
+<th class="nohvr"><?php echo TB_FILES; ?></th>\r
+<th class="nohvr"><?php echo TB_DATE; ?></th>\r
+<th class="nohvr"><?php echo $actionhead; ?></th></tr>\r
+<?php\r
+\r
+for($i=0;$i<$num_of_folders;$i++)\r
+ {\r
+ $disable = ($i == 0 ? true : false);\r
+ $alt = (IsOdd($i) ? 'r1' : 'r0');\r
+ echo '<tr class="'.$alt.'">';\r
+ echo '<td>'.$dirs[$i][2].'</td>';\r
+ echo '<td>'.$dirs[$i][4].'</td><td>'.date($tinybrowser['dateformat'],$dirs[$i][5]).'</td>'\r
+ .'<td>';\r
+ form_hidden_input('actionfolder['.$i.']',$dirs[$i][0]);\r
+ switch($actionnow) \r
+ {\r
+ case 'create':\r
+ echo '→ ';\r
+ form_text_input('createfolder['.$i.']',false,'',30,120);\r
+ break;\r
+ case 'delete':\r
+ $disabledel = ($dirs[$i][4] > 0 ? ' DISABLED' : '');\r
+ if(!$disable) echo '<input class="del" type="checkbox" name="deletefolder['.$i.']" value="1"'.$disabledel.' />';\r
+ break;\r
+ case 'rename':\r
+ if(!$disable) form_text_input('renamefolder['.$i.']',false,$dirs[$i][3],30,120);\r
+ break;\r
+ default:\r
+ // do nothing\r
+ }\r
+ echo "</td></tr>\n";\r
+ }\r
+\r
+echo "</table></div>\n".'<div class="pushright">';\r
+if($tinybrowser['allowdelete'] && $tinybrowser['allowedit'])\r
+ {\r
+ form_hidden_input('editaction',$actionnow);\r
+ form_submit_button('commit',$actionhead.' '.TB_FOLDERS,'edit');\r
+ }\r
+?>\r
+</div></fieldset></div></div>\r
+</body>\r
+</html>\r
--- /dev/null
+/**
+ * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
+ *
+ * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
\ No newline at end of file
--- /dev/null
+<?php
+$mainpage = (strpos(basename($_SERVER['HTTP_REFERER']),'tinybrowser.php') === 0 ? true : false);
+require_once('../config_tinybrowser.php');
+
+if($mainpage && !isset($_GET['feid']) && $tinybrowser['integration'] == 'tinymce')
+ {?>
+ function selectURL(url)
+ {
+ document.passform.fileurl.value = url;
+ FileBrowserDialogue.mySubmit();
+ }
+ var FileBrowserDialogue = {
+ init : function () {
+ // Here goes your code for setting your custom things onLoad.
+ rowHighlight();
+ },
+ mySubmit : function () {
+ var URL = document.passform.fileurl.value;
+ var win = tinyMCEPopup.getWindowArg("window");
+
+ // insert information now
+ win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = URL;
+
+ // for image browsers: update image dimensions
+ if (typeof(win.ImageDialog) != "undefined" && document.URL.indexOf('type=image') != -1)
+ {
+ if (win.ImageDialog.getImageData) win.ImageDialog.getImageData();
+ if (win.ImageDialog.showPreviewImage) win.ImageDialog.showPreviewImage(URL);
+ }
+
+ // close popup window
+ tinyMCEPopup.close();
+ }
+ }
+ tinyMCEPopup.onInit.add(FileBrowserDialogue.init, FileBrowserDialogue);
+ <?php
+ }
+elseif($mainpage && !isset($_GET['feid']) && $tinybrowser['integration'] == 'fckeditor')
+ {?>
+ function selectURL(url){
+ // window.opener.SetUrl( url, width, height, alt);
+ window.opener.SetUrl( url ) ;
+ window.close() ;
+ }
+ <?php
+ }
+elseif($mainpage && $_GET['feid'] != '')
+ {?>
+ function selectURL(url) {
+ opener.document.getElementById("<?php echo $_GET['feid']; ?>").value = url;
+ // Set img source of element id, if img id exists (format is elementid + "img")
+ if (
+ typeof(opener.document.getElementById("<?php echo $_GET['feid']; ?>img")) != "undefined"
+ && opener.document.getElementById("<?php echo $_GET['feid']; ?>img") != null
+ && opener.document.getElementById("<?php echo $_GET['feid']; ?>img").src.length != 0
+ )
+ {
+ opener.document.getElementById("<?php echo $_GET['feid']; ?>img").src = url;
+ }
+ self.close();
+ }
+ <?php
+ }
+?>
+
+rowHighlight = function() {
+var x = document.getElementsByTagName('tr');
+for (var i=0;i<x.length;i++)
+ {
+ x[i].onmouseover = function () {this.className = "over " + this.className;}
+ x[i].onmouseout = function () {this.className = this.className.replace("over", ""); this.className = this.className.replace(" ", "");}
+ }
+var y = document.getElementsByTagName('th');
+for (var ii=0;ii<y.length;ii++)
+ {
+ y[ii].onmouseover = function () {if(this.className != "nohvr") this.className = "over " + this.className;}
+ y[ii].onmouseout = function () {this.className = this.className.replace("over", ""); this.className = this.className.replace(" ", "");}
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.40 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'cs'\r
+Author: J. Frank\r
+*/\r
+ define("TB_BROWSE", "Prohlížet");\r
+ define("TB_EDIT", "Editovat");\r
+ define("TB_UPLOAD", "Nahrát");\r
+ define("TB_FOLDERS", "Složky");\r
+ define("TB_FOLDERNAME", "Název složky");\r
+ define("TB_FOLDERCURR", "Aktuální složka ");\r
+ define("TB_FOLDERDEST", "Cíl: ");\r
+ define("TB_VIEW", "Zobrazit: ");\r
+ define("TB_SHOW", "Ukázat: ");\r
+ define("TB_PAGE", "Strana");\r
+ define("TB_FILENAME", "Název souboru");\r
+ define("TB_SIZE", "Velikost");\r
+ define("TB_DIMENSIONS", "Rozměry");\r
+ define("TB_TYPE", "Typ");\r
+ define("TB_DATE", "Soubor modifikován");\r
+ define("TB_SEARCH", "Hledat");\r
+ define("TB_MOVE", "Přesunout");\r
+ define("TB_FILES", "Soubory");\r
+ define("TB_BROWSEFILES", "Prohlížet soubory");\r
+ define("TB_DETAILS", "Detaily");\r
+ define("TB_THUMBS", "Náhledy");\r
+ define("TB_EDITFILES", "Editovat soubory");\r
+ define("TB_ACTION", "Akce");\r
+ define("TB_CREATE", "Vytvořit");\r
+ define("TB_DELETE", "Vymazat");\r
+ define("TB_RENAME", "Přejmenovat");\r
+ define("TB_ROTATE", "Převrátit");\r
+ define("TB_RESIZE", "Změnit velikost");\r
+ define("TB_UPLOADFILES", "Nahrát soubory");\r
+ define("TB_PROGRESS", "");\r
+ define("TB_REMOVE", "Vyjmout");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "šířka");\r
+ define("TB_HEIGHT", "výška");\r
+ define("TB_NONE", "Nic");\r
+ define("TB_TYPEIMG", "Obrázky");\r
+ define("TB_TYPEMEDIA", "Multimédia");\r
+ define("TB_TYPEFILE", "Všechny soubory");\r
+ define("TB_ROTATECW", "Otočit 90 stupňů doprava");\r
+ define("TB_ROTATECCW", "Otočit 90 stupňů doleva");\r
+ define("TB_MSGNEWTHUMBS", "%s nový náhled byl vygenerován.");\r
+ define("TB_MSGMKDIR", "The '%s' složka byla úspěšně vytvořena.");\r
+ define("TB_MSGMKDIRFAIL", "Nelze vytvořit '%s' složku - prosím zkontrolujte práva přístupu.");\r
+ define("TB_MSGDELETE", "%s soubory byly úspěšně vymazány.");\r
+ define("TB_MSGRENAME", "%s soubory byly úspěšně přejmenovány.");\r
+ define("TB_MSGRESIZE", "%s obrázkům byla úspěšně změněna velikost.");\r
+ define("TB_MSGROTATE", "%s obrázky byly úspěšně otočeny.");\r
+ define("TB_MSGEDITERR", "%s soubory hlási chybu během požadované operace.");\r
+ define("TB_MSGUPGOOD", "%s soubory byly úspěšně nahrány.");\r
+ define("TB_MSGUPBAD", "%s soubory nebyly nahrány k vůli bezpečnostním omezením.");\r
+ define("TB_MSGUPDUP", "%s soubory nebyly nahrány, pravděpodobně již existují, vymažte je nebo změnte jejich názvy.");\r
+ define("TB_MSGUPFAIL", "Nahrání selhalo, prosím zkontroluje oprávnění pro '%s'.");\r
+ define("TB_MSGMAXSIZE", "soubor je větší než je maximální povolená hranice.");\r
+ define("TB_TTLMAXSIZE", "Špatná velikost souboru");\r
+ define("TB_DENIED", "Potřebujete povolení pro vstup na tutu stránku");\r
+ define("TB_UPDENIED", "Potřebujete povolení pro upload souborů.");\r
+ define("TB_EDDENIED", "Potřebujete povolení pro změnu nebo mazání souborů.");\r
+ define("TB_MSGCREATE", "%s Složky byly úspěšně vytvořeny.");\r
+ \r
+ \r
+\r
+ \r
+\r
+?>\r
--- /dev/null
+<?php\r
+/*\r
+TinyBrowser 1.40 - En TinyMCE fil browser (C) 2008 Bryn Jones\r
+Default Language 'da'\r
+Forfatter: Peter Bentsen\r
+email: peter.bentsen [at] gmail [dot] com\r
+*/\r
+ define("TB_BROWSE", "Gennemse");\r
+ define("TB_EDIT", "Editér");\r
+ define("TB_UPLOAD", "Upload");\r
+ define("TB_FOLDERS", "Mapper");\r
+ define("TB_FOLDERNAME", "Mappe Navn");\r
+ define("TB_FOLDERCURR", "Aktuelle Mappe: ");\r
+ define("TB_FOLDERDEST", "Destination: ");\r
+ define("TB_VIEW", "Vis som:");\r
+ define("TB_SHOW", "Vis:");\r
+ define("TB_PAGE", "Side");\r
+ define("TB_FILENAME", "Fil Navn");\r
+ define("TB_SIZE", "Størrelse");\r
+ define("TB_DIMENSIONS", "Mål");\r
+ define("TB_TYPE", "Type");\r
+ define("TB_DATE", "Dato Ændret");\r
+ define("TB_SEARCH", "Søg");\r
+ define("TB_FILES", "Filer");\r
+ define("TB_BROWSEFILES", "Gennemse Filer");\r
+ define("TB_DETAILS", "Detaljer");\r
+ define("TB_THUMBS", "Miniaturer");\r
+ define("TB_EDITFILES", "Rediger Filer");\r
+ define("TB_ACTION", "Aktion");\r
+ define("TB_CREATE", "Opret");\r
+ define("TB_DELETE", "Slet");\r
+ define("TB_RENAME", "Omdøb");\r
+ define("TB_ROTATE", "Roter");\r
+ define("TB_RESIZE", "Ændre størrelse");\r
+ define("TB_MOVE", "Flyt");\r
+ define("TB_UPLOADFILES", "Upload Filer");\r
+ define("TB_PROGRESS", "Progression");\r
+ define("TB_REMOVE", "Fjern");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "bredde");\r
+ define("TB_HEIGHT", "højde");\r
+ define("TB_NONE", "Ingen");\r
+ define("TB_TYPEIMG", "Billeder");\r
+ define("TB_TYPEMEDIA", "Media");\r
+ define("TB_TYPEFILE", "Alle Filer");\r
+ define("TB_ROTATECW", "Roter 90 grader med uret");\r
+ define("TB_ROTATECCW", "Roter 90 grader mod uret");\r
+ define("TB_MSGNEWTHUMBS", "%s nye billede thumbnails er blevet genereret.");\r
+ define("TB_MSGMKDIR", "'%s' biblioteket er skabt med succes.");\r
+ define("TB_MSGMKDIRFAIL", "Kunne ikke oprette '%s' mappen - Kontroller dine tilladelser.");\r
+ define("TB_MSGCREATE", "%s mapperne er blevet oprettet med succes.");\r
+ define("TB_MSGDELETE", "%s filer er blevet slettet.");\r
+ define("TB_MSGRENAME", "%s filer er med succes er blevet omdøbt.");\r
+ define("TB_MSGMOVE", "%s filer er med succes er blevet flyttet.");\r
+ define("TB_MSGRESIZE", "%s billeder er med succes er blevet tilpasset.");\r
+ define("TB_MSGROTATE", "%s billeder er med succes er blevet roteret.");\r
+ define("TB_MSGEDITERR", "%s filer stødt på fejl under den ønskede handling.");\r
+ define("TB_MSGUPGOOD", "%s filer er blevet uploadet.");\r
+ define("TB_MSGUPBAD", "%s filer ikke er blevet uploadet, på grund af sikkerhedsmæssige begrænsninger.");\r
+ define("TB_MSGUPDUP", "%s filer ikke er blevet uploadet, da de findes i forvejen - du skal slette eller omdøbe originale filer.");\r
+ define("TB_MSGUPFAIL", "Fil Upload mislykkedes - Kontroller dine tilladelser til '%s'.");\r
+ define("TB_MSGMAXSIZE", "kan ikke sættes i kø til upload, da størrelsen overstiger den maksimale grænse på");\r
+ define("TB_TTLMAXSIZE", "Filstørrelse Fejl");\r
+ define("TB_DENIED", "Det kræve tilladelse for at se denne side.");\r
+ define("TB_UPDENIED", "Det kræver upload tilladelse for at se denne side.");\r
+ define("TB_EDDENIED", "Det kræve, redigere eller slette tilladelser for at se denne side.");\r
+ define("TB_FODENIED", "Det kræver mappe redigerings tilladelse for at se denne side.");\r
+\r
+?>
\ No newline at end of file
--- /dev/null
+<?php\r
+/*\r
+TinyBrowser 1.41 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language 'de'\r
+Author: Konrad Richter\r
+email: webmaster[at]korinet[dot]de\r
+*/\r
+define("TB_BROWSE", "Durchsuchen");\r
+define("TB_EDIT", "Bearbeiten");\r
+define("TB_UPLOAD", "Hochladen");\r
+define("TB_FOLDERS", "Ordner");\r
+define("TB_FOLDERNAME", "Ordner Name");\r
+define("TB_FOLDERCURR", "Aktueller Ordner: ");\r
+define("TB_FOLDERDEST", "Zielordner: ");\r
+define("TB_VIEW", "Zeige: ");\r
+define("TB_SHOW", "Zeigen: ");\r
+define("TB_PAGE", "Seite");\r
+define("TB_FILENAME", "Dateiname");\r
+define("TB_SIZE", "Größe");\r
+define("TB_DIMENSIONS", "Abmessungen");\r
+define("TB_TYPE", "Datei Typ");\r
+define("TB_DATE", "Letzte Änderung");\r
+define("TB_SEARCH", "Suchen");\r
+define("TB_FILES", "Dateien");\r
+define("TB_BROWSEFILES", "Vorhandene Dateien");\r
+define("TB_DETAILS", "Details");\r
+define("TB_THUMBS", "Vorschau");\r
+define("TB_EDITFILES", "Dateien bearbeiten");\r
+define("TB_ACTION", "Aktion: ");\r
+define("TB_CREATE", "Erstellen");\r
+define("TB_DELETE", "Löschen");\r
+define("TB_RENAME", "Umbenennen");\r
+define("TB_ROTATE", "Drehen");\r
+define("TB_RESIZE", "Größe ändern");\r
+define("TB_MOVE", "Verschieben");\r
+define("TB_UPLOADFILES", "Dateien hochladen");\r
+define("TB_PROGRESS", "Fortschritt");\r
+define("TB_REMOVE", "Löschen");\r
+define("TB_BYTES", "bytes");\r
+define("TB_WIDTH", "Breite");\r
+define("TB_HEIGHT", "Höhe");\r
+define("TB_NONE", "Keine");\r
+define("TB_TYPEIMG", "Bilder");\r
+define("TB_TYPEMEDIA", "Medien");\r
+define("TB_TYPEFILE", "Alle Dateien");\r
+define("TB_ROTATECW", "Drehung 90 Grad im Uhrzeigersinn");\r
+define("TB_ROTATECCW", "Drehung 90 Grad gegen den Uhrzeigersinn");\r
+define("TB_MSGNEWTHUMBS", "%s neue Vorschaubilder wurden generiert.");\r
+define("TB_MSGMKDIR", "Das Verzeichnis '%s' wurde erfolgreich angelegt.");\r
+define("TB_MSGMKDIRFAIL", "Verzeichnis '%s' konnte nicht angelegt werden - Überprüfen Sie die Schreibrechte.");\r
+define("TB_MSGCREATE", "%s Ornder wurde(n) erfolgreich erstellt.");\r
+define("TB_MSGDELETE", "%s Dateie(n) wurde(n) erfolgreich gelöscht.");\r
+define("TB_MSGRENAME", "%s Dateie(n) wurde(n) erfolgreich umbenannt.");\r
+define("TB_MSGMOVE", "%s Datei(n) wurde(n) erfolgreich verschoben.");\r
+define("TB_MSGRESIZE", "%s Dateie(n) wurde(n) erfolgreich geändert.");\r
+define("TB_MSGROTATE", "%s Dateie(n) wurde(n) erfolgreich gedreht.");\r
+define("TB_MSGEDITERR", "%s Dateie(n) wurde(n) fehlerhaft verarbeitet.");\r
+define("TB_MSGUPGOOD", "%s Dateie(n) wurde(n) erfolgreich hochgeladen.");\r
+define("TB_MSGUPBAD", "%s Dateie(n) konnten aufgrund von Sicherheitseinschränkungen nicht bearbeitet werden.");\r
+define("TB_MSGUPDUP", "%s Dateien konnten nicht hochgeladen werden, sollte(n) diese schon existieren, löschen oder benennen Sie die entspr. Datei(en) um.");\r
+define("TB_MSGUPFAIL", "Dateiupload fehlgeschlagen - prüfen Sie die Schreibrechte für '%s'.");\r
+define("TB_MSGMAXSIZE", " kann nicht zum hochladen vorgemerkt werden, da die Datei-Größe das maximum überschreitet: ");\r
+define("TB_TTLMAXSIZE", "Datei ist zu groß");\r
+define("TB_DENIED", "Sie haben keine Berechtigung, um diese Seite anzuzeigen.");\r
+define("TB_UPDENIED", "Sie benötigen Berechtigungen zum Hochladen von Dateien, um diese Seite anzuzeigen.");\r
+define("TB_EDDENIED", "Sie benötigen Berechtigungen zum Bearbeiten/Löschen von Dateien, um diese Seite anzuzeigen.");\r
+define("TB_FODENIED", "Sie benötigen Berechtigungen zum Bearbeiten von Ordnern, um diese Seite anzuzeigen.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.41 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'en'\r
+Author: Bryn Jones\r
+email: bryn[at]lunarvis[dot]com\r
+*/\r
+ define("TB_BROWSE", "Browse");\r
+ define("TB_EDIT", "Edit");\r
+ define("TB_UPLOAD", "Upload");\r
+ define("TB_FOLDERS", "Folders");\r
+ define("TB_FOLDERNAME", "Folder Name");\r
+ define("TB_FOLDERCURR", "Current Folder: ");\r
+ define("TB_FOLDERDEST", "Destination: ");\r
+ define("TB_VIEW", "View As: ");\r
+ define("TB_SHOW", "Show: ");\r
+ define("TB_PAGE", "Page");\r
+ define("TB_FILENAME", "File Name");\r
+ define("TB_SIZE", "Size");\r
+ define("TB_DIMENSIONS", "Dimensions");\r
+ define("TB_TYPE", "Type");\r
+ define("TB_DATE", "Date Modified");\r
+ define("TB_SEARCH", "Search");\r
+ define("TB_FILES", "Files");\r
+ define("TB_BROWSEFILES", "Browse Files");\r
+ define("TB_DETAILS", "Details");\r
+ define("TB_THUMBS", "Thumbnails");\r
+ define("TB_EDITFILES", "Edit Files");\r
+ define("TB_ACTION", "Action: ");\r
+ define("TB_CREATE", "Create");\r
+ define("TB_DELETE", "Delete");\r
+ define("TB_RENAME", "Rename");\r
+ define("TB_ROTATE", "Rotate");\r
+ define("TB_RESIZE", "Resize");\r
+ define("TB_MOVE", "Move");\r
+ define("TB_UPLOADFILES", "Upload Files");\r
+ define("TB_PROGRESS", "Progress");\r
+ define("TB_REMOVE", "Remove");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "width");\r
+ define("TB_HEIGHT", "height");\r
+ define("TB_NONE", "None");\r
+ define("TB_TYPEIMG", "Images");\r
+ define("TB_TYPEMEDIA", "Media");\r
+ define("TB_TYPEFILE", "All Files");\r
+ define("TB_ROTATECW", "Rotate 90 degrees clockwise");\r
+ define("TB_ROTATECCW", "Rotate 90 degrees anti-clockwise");\r
+ define("TB_MSGNEWTHUMBS", "%s new image thumbnails have been generated.");\r
+ define("TB_MSGMKDIR", "The '%s' directory has been successfully created.");\r
+ define("TB_MSGMKDIRFAIL", "Unable to create the '%s' directory - please check your permissions.");\r
+ define("TB_MSGCREATE", "%s folders have been successfully created.");\r
+ define("TB_MSGDELETE", "%s files have been successfully deleted.");\r
+ define("TB_MSGRENAME", "%s files have been successfully renamed.");\r
+ define("TB_MSGMOVE", "%s files have been successfully moved.");\r
+ define("TB_MSGRESIZE", "%s images have been successfully resized.");\r
+ define("TB_MSGROTATE", "%s images have been successfully rotated.");\r
+ define("TB_MSGEDITERR", "%s files encountered errors during the requested operation.");\r
+ define("TB_MSGUPGOOD", "%s files have been successfully uploaded.");\r
+ define("TB_MSGUPBAD", "%s files have not been uploaded, due to security restrictions.");\r
+ define("TB_MSGUPDUP", "%s files have not been uploaded, as they already exist - please delete or rename original files.");\r
+ define("TB_MSGUPFAIL", "File upload failed - please check your permissions for '%s' and also your php.ini settings.");\r
+ define("TB_MSGMAXSIZE", "cannot be queued for upload as the size exceeds the maximum limit of");\r
+ define("TB_TTLMAXSIZE", "File Size Error");\r
+ define("TB_DENIED", "You require permission to view this page.");\r
+ define("TB_UPDENIED", "You require upload permission to view this page.");\r
+ define("TB_EDDENIED", "You require edit or delete permissions to view this page.");\r
+ define("TB_FODENIED", "You require folder maintenance permissions to view this page.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/*
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones
+Default Language 'en'
+Author: Bryn Jones. Fran Iglesias
+email: bryn[at]lunarvis[dot]com franiglesias[at]mac[dot]com
+*/
+ define("TB_BROWSE", "Navegar");
+ define("TB_EDIT", "Editar");
+ define("TB_UPLOAD", "Subir");
+ define("TB_VIEW", "Ver como: ");
+ define("TB_SHOW", "Mostrar: ");
+ define("TB_PAGE", "Página");
+ define("TB_FILENAME", "Nombre de archivo");
+ define("TB_SIZE", "Tamaño");
+ define("TB_DIMENSIONS", "Dimensiones");
+ define("TB_TYPE", "Tipo");
+ define("TB_DATE", "Modificación");
+ define("TB_SEARCH", "Buscar");
+ define("TB_FILES", "Archivos");
+ define("TB_BROWSEFILES", "Navegar por archivos");
+ define("TB_DETAILS", "Detalles");
+ define("TB_THUMBS", "Previos");
+ define("TB_EDITFILES", "Editar archivos");
+ define("TB_ACTION", "Acción");
+ define("TB_DELETE", "Borrar");
+ define("TB_RENAME", "Cambiar nombre");
+ define("TB_ROTATE", "Rotar");
+ define("TB_RESIZE", "Cambiar tamaño");
+ define("TB_UPLOADFILES", "Subir archivos");
+ define("TB_PROGRESS", "Progreso");
+ define("TB_REMOVE", "Quitar");
+ define("TB_BYTES", "bytes");
+ define("TB_WIDTH", "ancho");
+ define("TB_HEIGHT", "alto");
+ define("TB_NONE", "Nada");
+ define("TB_TYPEIMG", "Imégenes");
+ define("TB_TYPEMEDIA", "Medios");
+ define("TB_TYPEFILE", "Todos");
+ define("TB_ROTATECW", "Rotar 90 grados derecha");
+ define("TB_ROTATECCW", "Rotar 90 grados izquierda");
+ define("TB_MSGNEWTHUMBS", "%s se han generado previos de la imagen.");
+ define("TB_MSGMKDIR", "El directorio '%s' ha podido ser creado.");
+ define("TB_MSGMKDIRFAIL", "Incapaz de crear el directorio '%s'. Por favor, comprueba los permisos.");
+ define("TB_MSGDELETE", "%s archivos han sido borrados.");
+ define("TB_MSGRENAME", "%s archivos han cambiado de nombre.");
+ define("TB_MSGRESIZE", "%s imágenes han sido escaladas.");
+ define("TB_MSGROTATE", "%s imágenes han sido rotadas.");
+ define("TB_MSGEDITERR", "%s archivos han tenido errores en las operaciones solicitadas.");
+ define("TB_MSGUPGOOD", "%s archivos han sido cargados.");
+ define("TB_MSGUPBAD", "%s archivos no se han subido por restrucciones de seguridad.");
+ define("TB_MSGUPDUP", "%s archivos no se han subido porque ya existían - por favor, cambia su nombre o bárralos.");
+ define("TB_MSGUPFAIL", "No se ha podido subir el archivo. Comprueba los permisos de '%s'.");
+ define("TB_MSGMAXSIZE", "no se ha podido poner en cola para subir porque el tamaño es mayor del límite de");
+ define("TB_TTLMAXSIZE", "Error del tamaño de archivo");
+ define("TB_DENIED", "Necesitas permiso para ver esta página.");
+ define("TB_UPDENIED", "Necesitas permisos de subida de archivos para ver esta página.");
+ define("TB_EDDENIED", "Necesitas permisos de edición o borrado para ver esta página.");
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/*
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones
+Language 'fi'
+Author: Iisakki Pirilä - Markus Sällinen
+email: iisakki[at]piuha[dot]fi
+*/
+define("TB_BROWSE", "Selaa");
+define("TB_EDIT", "Muokkaa");
+define("TB_UPLOAD", "Lataa palvelimelle");
+define("TB_FOLDERS", "Kansiot");
+define("TB_FOLDERNAME", "Kansion nimi");
+define("TB_FOLDERCURR", "Nykyinen kansio: ");
+define("TB_FOLDERDEST", "Kohde: ");
+define("TB_VIEW", "Näytä: ");
+define("TB_SHOW", "Näytä: ");
+define("TB_PAGE", "Sivu");
+define("TB_FILENAME", "Tiedostonimi");
+define("TB_SIZE", "Koko");
+define("TB_DIMENSIONS", "Kuvakoko");
+define("TB_TYPE", "Tyyppi");
+define("TB_DATE", "Muokattu");
+define("TB_SEARCH", "Etsi");
+define("TB_FILES", "tiedostot");
+define("TB_BROWSEFILES", "Selaa tiedostoja");
+define("TB_DETAILS", "Tarkat tiedot");
+define("TB_THUMBS", "Esikatselukuvat");
+define("TB_EDITFILES", "Muokkaa tiedostoja");
+define("TB_ACTION", "Toiminto");
+define("TB_CREATE", "Luo");
+define("TB_DELETE", "Poista");
+define("TB_RENAME", "Nimeä uudelleen");
+define("TB_ROTATE", "Käännä");
+define("TB_RESIZE", "Muuta kokoa");
+define("TB_MOVE", "Siirrä");
+define("TB_UPLOADFILES", "Lataa tiedostoja");
+define("TB_PROGRESS", "Vaihe");
+define("TB_REMOVE", "Poista");
+define("TB_BYTES", "tavua");
+define("TB_WIDTH", "leveys");
+define("TB_HEIGHT", "korkeus");
+define("TB_NONE", "Ei mitään");
+define("TB_TYPEIMG", "Kuvat");
+define("TB_TYPEMEDIA", "Mediatiedostot");
+define("TB_TYPEFILE", "Kaikki tiedostot");
+define("TB_ROTATECW", "Käännä 90 astetta myötäpäivään");
+define("TB_ROTATECCW", "Käännä 90 astetta vastapäivään");
+define("TB_MSGNEWTHUMBS", "%s uutta esikatselukuvaa luotu.");
+define("TB_MSGMKDIR", "Kansion '%s' luominen onnistui.");
+define("TB_MSGMKDIRFAIL", "Kansion '%s' luominen epäonnistui - tarkista oikeudet.");
+define("TB_MSGCREATE", "%s kansiota on luotu oninstuneesti.");
+define("TB_MSGDELETE", "%s tiedoston poistaminen onnistui.");
+define("TB_MSGRENAME", "%s tiedoston uudelleennimeäminen onnistui.");
+define("TB_MSGMOVE", "%s tiedostoa on siirretty onnistuneesti");
+define("TB_MSGRESIZE", "%s kuvan koon muuttaminen onnistui.");
+define("TB_MSGROTATE", "%s kuvan kääntäminen onnistui.");
+define("TB_MSGEDITERR", "Toiminto epäonnistui %s tiedostolle.");
+define("TB_MSGUPGOOD", "%s tiedoston lataaminen palvelimelle onnistui.");
+define("TB_MSGUPBAD", "%s tiedostoa ei ladattu palvelimelle tietoturvarajoitusten vuoksi.");
+define("TB_MSGUPDUP", "%s tiedostoa ei ladattu palvelimelle, koska samanniminen tiedosto on jo olemassa. Poista tai nimeä uudelleen alkuperäinen tiedosto.");
+define("TB_MSGUPFAIL", "Tiedoston lataaminen epäonnistui. Tarkista oikeudet kohteeseen '%s'.");
+define("TB_MSGMAXSIZE", "ei voida ladata palvelimelle, koska tiedoston koko ylittää ylärajan");
+define("TB_TTLMAXSIZE", "Tiedostokoossa virhe");
+define("TB_DENIED", "Tämä sivu vaatii käyttöoikeuden.");
+define("TB_UPDENIED", "Tämä sivu vaatii latausoikeudet.");
+define("TB_EDDENIED", "Tämä sivu vaatii muokkaus- tai poisto- oikeudet.");
+define("TB_FODENIED", "Tämä sivu vaatii kansioiden hallintaoikeudet.");
+?>
\ No newline at end of file
--- /dev/null
+<?php\r
+/*\r
+Default Language 'fr'\r
+Traductions for TinyBrowser 1.4 Beta.\r
+Based on the 1.3 files, with folders traductions adds\r
+Author: Stéphane Rouillé , Ligne13 Web Agency\r
+email: stephane@ligne13.com\r
+*/\r
+define("TB_BROWSE", "Ouvrir...");\r
+define("TB_EDIT", "Editer");\r
+define("TB_UPLOAD", "Upload");\r
+define("TB_VIEW", "Affichage: ");\r
+define("TB_SHOW", "Montrer: ");\r
+define("TB_PAGE", "Page");\r
+define("TB_FILENAME", "Nom");\r
+define("TB_SIZE", "Taille");\r
+define("TB_DIMENSIONS", "Dimensions");\r
+define("TB_TYPE", "Type");\r
+define("TB_DATE", "Date Modification");\r
+define("TB_SEARCH", "Rechercher");\r
+define("TB_FILES", "Fichiers");\r
+define("TB_FOLDERS", "Dossiers");\r
+define("TB_BROWSEFILES", "Ouvrir Fichiers");\r
+define("TB_DETAILS", "Détails");\r
+define("TB_THUMBS", "Vignettes");\r
+define("TB_EDITFILES", "Editer Fichiers");\r
+define("TB_ACTION", "Action");\r
+define("TB_DELETE", "Supprimer");\r
+define("TB_RENAME", "Renommer");\r
+define("TB_ROTATE", "Pivoter");\r
+define("TB_MOVE", "Deplacer");\r
+define("TB_RESIZE", "Redimensionner");\r
+define("TB_UPLOADFILES", "Upload Fichiers");\r
+define("TB_PROGRESS", "Progression");\r
+define("TB_REMOVE", "Retirer");\r
+define("TB_BYTES", "bytes");\r
+define("TB_WIDTH", "largeur");\r
+define("TB_HEIGHT", "hauteur");\r
+define("TB_NONE", "Auncun");\r
+define("TB_TYPEIMG", "Images");\r
+define("TB_TYPEMEDIA", "Media");\r
+define("TB_TYPEFILE", "Tous Fichiers");\r
+define("TB_ROTATECW", "Rotation 90 degrés horaire");\r
+define("TB_ROTATECCW", "Rotation 90 degrés anti-horaire");\r
+define("TB_CREATE", "Créer");\r
+define("TB_FOLDERNAME", "Nom du dossier");\r
+define("TB_MSGCREATE", "Le dossier a bien été crée.");\r
+define("TB_FOLDERCURR", "Dossier actuel ");\r
+define("TB_MSGNEWTHUMBS", "%s nouvelles vignettes créées.");\r
+define("TB_MSGMKDIR", "Le '%s' répertoire a été créé avec succès.");\r
+define("TB_MSGMKDIRFAIL", "Impossible de créer le répertoire '%s' - vérifier vos permissions.");\r
+define("TB_MSGDELETE", "%s fichiers ont été supprimés avec succès.");\r
+define("TB_MSGRENAME", "%s fichiers ont été renommés avec succès.");\r
+define("TB_MSGRESIZE", "%s fichiers ont été redimensionnés avec succès.");\r
+define("TB_MSGROTATE", "%s images ont été pivotées avec succès.");\r
+define("TB_MSGEDITERR", "%s fichiers en état erreur pendant l'opération.");\r
+define("TB_MSGUPGOOD", "%s fichiers ont été uploadés avec succès.");\r
+define("TB_MSGUPBAD", "%s fichiers n'ont pas été uploadés, à cause des restrictions de sécurité.");\r
+define("TB_MSGUPDUP", "%s fichiers n'ont pas été uploadés car ils existent déjà - merci de supprimer ou renommer le fichier original.");\r
+define("TB_MSGUPFAIL", "Echec d'pload de fichier - verifier vos permissions pour '%s'.");\r
+define("TB_MSGMAXSIZE", "ne peut placer en liste: limite de taille de fichier maximum dépassé");\r
+define("TB_TTLMAXSIZE", "Erreur de taille de fichier");\r
+define("TB_DENIED", "Vous devez posséder la permission pour voir cette page.");\r
+define("TB_UPDENIED", "Vous devez posséder la permission upload pour voir cette page.");\r
+define("TB_EDDENIED", "Vous devez posséder la permission edition ou suppression pour voir cette page.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language 'hr'\r
+Author: Saša Tomislav Mataić\r
+email: stmataic[at]gmail[dot]com\r
+*/\r
+ define("TB_BROWSE", "Pretraži");\r
+ define("TB_EDIT", "Uredi");\r
+ define("TB_UPLOAD", "Pošalji");\r
+ define("TB_VIEW", "Vrste pregleda: ");\r
+ define("TB_SHOW", "Prikaži: ");\r
+ define("TB_PAGE", "Stranica");\r
+ define("TB_FILENAME", "Naziv datoteke");\r
+ define("TB_SIZE", "Veličina");\r
+ define("TB_DIMENSIONS", "Dimenzije");\r
+ define("TB_TYPE", "Tip");\r
+ define("TB_DATE", "Datum promjene");\r
+ define("TB_SEARCH", "Traži");\r
+ define("TB_FILES", "datoteke");\r
+ define("TB_BROWSEFILES", "Pretraži datoteke");\r
+ define("TB_DETAILS", "Detalji");\r
+ define("TB_THUMBS", "Sličice");\r
+ define("TB_EDITFILES", "Uredi datoteke");\r
+ define("TB_ACTION", "Akcija");\r
+ define("TB_DELETE", "Obriši");\r
+ define("TB_RENAME", "Preimenuj");\r
+ define("TB_ROTATE", "Rotiraj");\r
+ define("TB_RESIZE", "Promijeni veličinu");\r
+ define("TB_UPLOADFILES", "Pošalji datoteke");\r
+ define("TB_PROGRESS", "Napredak");\r
+ define("TB_REMOVE", "Makni");\r
+ define("TB_BYTES", "bytova");\r
+ define("TB_WIDTH", "širina");\r
+ define("TB_HEIGHT", "visina");\r
+ define("TB_NONE", "Ništa");\r
+ define("TB_TYPEIMG", "Slike");\r
+ define("TB_TYPEMEDIA", "Razno");\r
+ define("TB_TYPEFILE", "Sve datotke");\r
+ define("TB_ROTATECW", "Rotiraj 90 stupnjeva u smjeru kazaljki na satu");\r
+ define("TB_ROTATECCW", "Rotiraj 90 stupnjeva suprotno od smjera kazaljki na satu");\r
+ define("TB_MSGNEWTHUMBS", "Generirano %s novih sličica.");\r
+ define("TB_MSGMKDIR", "Uspješno kreirana mapa '%s'.");\r
+ define("TB_MSGMKDIRFAIL", "Nemoguće kreirati mapu '%s' - provjerite permissione.");\r
+ define("TB_MSGDELETE", "%s datoteka uspješno obrisano.");\r
+ define("TB_MSGRENAME", "%s datoteka uspješno preimenovano.");\r
+ define("TB_MSGRESIZE", "%s slika uspješno promijenjene dimenzije.");\r
+ define("TB_MSGROTATE", "%s slika uspješno rotirano.");\r
+ define("TB_MSGEDITERR", "%s datoteka nije moglo biti promijenjeno.");\r
+ define("TB_MSGUPGOOD", "%s datoteka uspješno poslano.");\r
+ define("TB_MSGUPBAD", "%s datoteka nije bilo poslano zbog sigurnosnih postavki.");\r
+ define("TB_MSGUPDUP", "%s datoteka nije bilo poslano, istoimene datoteke već postoje - obrišite ili preimenujte postojeće datoteke.");\r
+ define("TB_MSGUPFAIL", "Neuspjelo slanje datoteka - provjerite dozvole za '%s'.");\r
+ define("TB_MSGMAXSIZE", "nemoguće poslati jer ukupna veličina premašuje maksimalnu veličinu od");\r
+ define("TB_TTLMAXSIZE", "Greška u veličini datoteke");\r
+ define("TB_DENIED", "Potrebna vam je dozvola za pregled ove stranice.");\r
+ define("TB_UPDENIED", "Potrebna vam je dozvola za slanje datoteka za pregled ove stranice.");\r
+ define("TB_EDDENIED", "Potrebna vam je dozvola za uređivanje za pregled ove stranice.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.40 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'en'\r
+Author: Bryn Jones\r
+email: bryn[at]lunarvis[dot]com\r
+*/\r
+ define("TB_BROWSE", "Tallózás");\r
+ define("TB_EDIT", "Szerkesztés");\r
+ define("TB_UPLOAD", "Feltöltés");\r
+ define("TB_FOLDERS", "Mappák");\r
+ define("TB_FOLDERNAME", "Mappa neve");\r
+ define("TB_FOLDERCURR", "Aktuális mappa: ");\r
+ define("TB_FOLDERDEST", "Cél: ");\r
+ define("TB_VIEW", "Megtekintés mint: ");\r
+ define("TB_SHOW", "Mutat: ");\r
+ define("TB_PAGE", "Oldal");\r
+ define("TB_FILENAME", "Fájl név");\r
+ define("TB_SIZE", "Méret");\r
+ define("TB_DIMENSIONS", "Méretek");\r
+ define("TB_TYPE", "Típus");\r
+ define("TB_DATE", "Módosítás dátuma");\r
+ define("TB_SEARCH", "Keresés");\r
+ define("TB_FILES", "Fájlok");\r
+ define("TB_BROWSEFILES", "Fájlok tallózása");\r
+ define("TB_DETAILS", "Részletek");\r
+ define("TB_THUMBS", "Miniatűrök");\r
+ define("TB_EDITFILES", "Fájlok szerkesztése");\r
+ define("TB_ACTION", "Művelet: ");\r
+ define("TB_CREATE", "Létrehozás");\r
+ define("TB_DELETE", "Törlés");\r
+ define("TB_RENAME", "Átnevezés");\r
+ define("TB_ROTATE", "Forgatás");\r
+ define("TB_RESIZE", "Méretezés");\r
+ define("TB_MOVE", "Mozgatás");\r
+ define("TB_UPLOADFILES", "Fájlok feltöltése");\r
+ define("TB_PROGRESS", "Folyamat");\r
+ define("TB_REMOVE", "Eltávolítás");\r
+ define("TB_BYTES", "byteok");\r
+ define("TB_WIDTH", "szélesség");\r
+ define("TB_HEIGHT", "magasság");\r
+ define("TB_NONE", "Semmi");\r
+ define("TB_TYPEIMG", "Képek");\r
+ define("TB_TYPEMEDIA", "Média");\r
+ define("TB_TYPEFILE", "Minden fájl");\r
+ define("TB_ROTATECW", "Forgatás 90 fokkal óramutató járása szerint");\r
+ define("TB_ROTATECCW", "Forgatás 90 fokkal óramutató járással ellentétesen");\r
+ define("TB_MSGNEWTHUMBS", "%s új miniatűr lett generálva.");\r
+ define("TB_MSGMKDIR", "A(z) '%s' könyvtár létrehozva");\r
+ define("TB_MSGMKDIRFAIL", "Nem lehetséges a(z) '%s' könyvtár létrehozása, ellenőrizd a jogokat!");\r
+ define("TB_MSGCREATE", "%s mappa sikeresen létrehozva.");\r
+ define("TB_MSGDELETE", "%s fájl sikeresen törölve.");\r
+ define("TB_MSGRENAME", "%s fájl sikeresen átnevezve.");\r
+ define("TB_MSGMOVE", "%s fájl sikeresen mozgatva.");\r
+ define("TB_MSGRESIZE", "%s fájl sikeresen méretezve.");\r
+ define("TB_MSGROTATE", "%s kép sikeresen forgatva.");\r
+ define("TB_MSGEDITERR", "%s fájlnál hiba lépett fel a folgolgozáskor.");\r
+ define("TB_MSGUPGOOD", "%s fájl feltöltése sikeres.");\r
+ define("TB_MSGUPBAD", "%s fájl nem lett feltöltve biztonsági korlátozások miatt.");\r
+ define("TB_MSGUPDUP", "%s fájl nem lett feltöltve, mert már létezik ilyen. A meglévőt nevezd át vagy töröld!");\r
+ define("TB_MSGUPFAIL", "Fájl feltöltés sikeretelen, ellenőrizd a jogokat: '%s'.");\r
+ define("TB_MSGMAXSIZE", "nem vehető fel a feltöltési listába, mert a mérete nagyobb a megengedettnél: ");\r
+ define("TB_TTLMAXSIZE", "Fájl méret hiba");\r
+ define("TB_DENIED", "Nincs jogosultságod az oldal megjelenítéséhez.");\r
+ define("TB_UPDENIED", "Feltöltési jogosultsággal kell rendelkezned ennek az oldalanak a megtekintéséhez.");\r
+ define("TB_EDDENIED", "Szerkesztési jogosultsággal kell rendelkezned ennek az oldalanak a megtekintéséhez.");\r
+ define("TB_FODENIED", "Könyvtárkezelési jogosultsággal kell rendelkezned ennek az oldalanak a megtekintéséhez");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'en'\r
+Author: Bryn Jones\r
+email: bryn[at]lunarvis[dot]com\r
+*/\r
+ define("TB_BROWSE", "Sfoglia");\r
+ define("TB_GALLERY", "Galleria");\r
+ define("TB_EDIT", "Modifica");\r
+ define("TB_UPLOAD", "Upload");\r
+ define("TB_FOLDERS", "Folders");\r
+ define("TB_FOLDERNAME", "Nome Cartella");\r
+ define("TB_FOLDERCURR", "Cartella attuale: ");\r
+ define("TB_FOLDERDEST", "Destinazione: "); \r
+ define("TB_VIEW", "Vedi come: ");\r
+ define("TB_SHOW", "Mostra: ");\r
+ define("TB_PAGE", "Pagina");\r
+ define("TB_FILENAME", "Nome file");\r
+ define("TB_SIZE", "Dim. (KB)");\r
+ define("TB_DIMENSIONS", "Dimensioni img");\r
+ define("TB_TYPE", "Tipo");\r
+ define("TB_DATE", "Data Modifica");\r
+ define("TB_SEARCH", "Cerca");\r
+ define("TB_FILES", "Files");\r
+ define("TB_BROWSEFILES", "Sfoglia");\r
+ define("TB_DETAILS", "Dettagli");\r
+ define("TB_THUMBS", "Anteprime");\r
+ define("TB_EDITFILES", "Modifica Files");\r
+ define("TB_ACTION", "Azione");\r
+ define("TB_CREATE", "Create"); \r
+ define("TB_DELETE", "Cancella");\r
+ define("TB_RENAME", "Rinomina");\r
+ define("TB_ROTATE", "Ruota");\r
+ define("TB_RESIZE", "Ridimensiona");\r
+ define("TB_UPLOADFILES", "Upload Files");\r
+ define("TB_PROGRESS", "Progresso");\r
+ define("TB_REMOVE", "Rimuovi");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "larghezza");\r
+ define("TB_HEIGHT", "altezza");\r
+ define("TB_NONE", "Nessuno");\r
+ define("TB_TYPEIMG", "Immagini");\r
+ define("TB_TYPEMEDIA", "Media");\r
+ define("TB_TYPEFILE", "Tutti i files");\r
+ define("TB_ROTATECW", "Ruota 90° orario");\r
+ define("TB_ROTATECCW", "Ruota 90° antiorario");\r
+ define("TB_MSGNEWTHUMBS", "%s nuove anteprime sono state generate.");\r
+ define("TB_MSGMKDIR", "Le '%s' cartelle sono state create.");\r
+ define("TB_MSGMKDIRFAIL", "Impossibile creare la cartella '%s' - controlla i tuoi permessi.");\r
+ define("TB_MSGCREATE", "%s cartelle create con successo."); \r
+ define("TB_MSGDELETE", "%s files cancellati con successo.");\r
+ define("TB_MSGRENAME", "%s files rinominati con successo.");\r
+ define("TB_MSGMOVE", "%s files spostati con successo."); \r
+ define("TB_MSGRESIZE", "%s immagini ridimensionate con successo.");\r
+ define("TB_MSGROTATE", "%s immagini ruotate con successo.");\r
+ define("TB_MSGEDITERR", "%s files sono andati incontro ad un errore durante la operazione richiesta.");\r
+ define("TB_MSGUPGOOD", "%s files inviati con successo.");\r
+ define("TB_MSGUPBAD", "%s files non sono stati inviati a causa di restrizioni di sicurezza.");\r
+ define("TB_MSGUPDUP", "%s files non sono stati inviati, perche' gia' esistenti - cancella o rinomina i files originali.");\r
+ define("TB_MSGUPFAIL", "Errore nell'invio files - controlla i tuoi permessi per '%s'.");\r
+ define("TB_MSGMAXSIZE", "Non e possibile mettere in coda per l invio, in quanto le dimensioni del file superano il limite di");\r
+ define("TB_TTLMAXSIZE", "Errore dimensioni files");\r
+ define("TB_DENIED", "Devi avere i permessi per vedere questa pagina.");\r
+ define("TB_UPDENIED", "Devi avere il permesso di upload per vedere questa pagina.");\r
+ define("TB_EDDENIED", "Devi avere permesso di modifica o cancellazione per vedere questa pagina.");\r
+ define("TB_FODENIED", "Devi avere i permessi di modifica delle cartelle per vedere questa pagina."); \r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'lv'\r
+Author: Raimonds Supulnieks\r
+email: raimonds6[at]gmail[dot]com\r
+*/\r
+ define("TB_BROWSE", "Caurlūkot");\r
+ define("TB_EDIT", "Labot");\r
+ define("TB_UPLOAD", "Augšupielādēt");\r
+ define("TB_VIEW", "Apskatīt kā: ");\r
+ define("TB_SHOW", "Parādīt: ");\r
+ define("TB_PAGE", "Lapa");\r
+ define("TB_FILENAME", "Faila nosaukums");\r
+ define("TB_SIZE", "Izmērs");\r
+ define("TB_DIMENSIONS", "Dimensijas");\r
+ define("TB_TYPE", "Tips");\r
+ define("TB_DATE", "Rediģēšanas datums");\r
+ define("TB_SEARCH", "Meklēt");\r
+ define("TB_FILES", "Faili");\r
+ define("TB_BROWSEFILES", "Caurlūkot failus");\r
+ define("TB_DETAILS", "Detaļas");\r
+ define("TB_THUMBS", "Mazie attēlojumi");\r
+ define("TB_EDITFILES", "Labot failus");\r
+ define("TB_ACTION", "Darbība");\r
+ define("TB_DELETE", "Dzēst");\r
+ define("TB_RENAME", "Pārsaukt");\r
+ define("TB_ROTATE", "Apgriezt");\r
+ define("TB_RESIZE", "Mainīt izmēru");\r
+ define("TB_UPLOADFILES", "Augšupielādēt failus");\r
+ define("TB_PROGRESS", "Progress");\r
+ define("TB_REMOVE", "Aizvākt");\r
+ define("TB_BYTES", "baiti");\r
+ define("TB_WIDTH", "garums");\r
+ define("TB_HEIGHT", "platums");\r
+ define("TB_NONE", "Nekas");\r
+ define("TB_TYPEIMG", "Bildes");\r
+ define("TB_TYPEMEDIA", "Media");\r
+ define("TB_TYPEFILE", "Visi faili");\r
+ define("TB_ROTATECW", "Apgriezt par 90 grādiem pa pulksteņa virzienu");\r
+ define("TB_ROTATECCW", "Apgriezt par 90 grādiem pret pulksteņa virzienu");\r
+ define("TB_MSGNEWTHUMBS", "%s jauni bilžu mazie attēlojumi tikuši izveidoti.");\r
+ define("TB_MSGMKDIR", "Mape '%s' tika veiksmīgi izveidota.");\r
+ define("TB_MSGMKDIRFAIL", "Neiespējami izveidot mapi '%s' - lūdzu pārbaudiet savas atļaujas.");\r
+ define("TB_MSGDELETE", "%s faili tika veiksmīgi izdzēsti.");\r
+ define("TB_MSGRENAME", "%s faili tika veiksmīgi pārsaukti.");\r
+ define("TB_MSGRESIZE", "%s bildām tika veiksmīgi izmainīts izmērs.");\r
+ define("TB_MSGROTATE", "%s bildes tika veiksmīgi apgrieztas.");\r
+ define("TB_MSGEDITERR", "%s failiem tika konstatēta kļūda pieprasītajā darbībā.");\r
+ define("TB_MSGUPGOOD", "%s faili tika veiksmīgi augšupielādēti.");\r
+ define("TB_MSGUPBAD", "%s faili netika augšupielādēti sakarā ar drošības ierobežojumiem.");\r
+ define("TB_MSGUPDUP", "%s faili netika augšupielādēti, jo tādi faili jau eksistē - lūdzu izdzēsiet vai pārsauciet orģinālos failus.");\r
+ define("TB_MSGUPFAIL", " Faila augšupielādē neizdevusies - lūdzu pārbaudiet atļaujas priekš '%s'.");\r
+ define("TB_MSGMAXSIZE", "nevar tikt augšupielādēts, jo ir sasniegts maksimālais izmērs");\r
+ define("TB_TTLMAXSIZE", " Faila izmēra kļūda");\r
+ define("TB_DENIED", "Jūs pieprasiet atļauju, lai apskatītu šo lapu.");\r
+ define("TB_UPDENIED", "Jūs pieprasiet augšupielādes atļauju, lai apskatītu šo lapu.");\r
+ define("TB_EDDENIED", "Jūs pieprasiet labošanas vai dzēšanas atļaujas, lai apskatītu šo lapu.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.40 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language: nl\r
+Author: Rudy Mens\r
+email: ruud[at]lazyadmin[dot]nl\r
+updated by fc.stuurman@hccnet.nl\r
+*/\r
+define("TB_BROWSE", "Bladeren");\r
+define("TB_EDIT", "Aanpassen");\r
+define("TB_UPLOAD", "Upload");\r
+define("TB_FOLDERS", "Folders");\r
+define("TB_FOLDERNAME", "Folder Naam");\r
+define("TB_FOLDERCURR", "Huidige Folder: ");\r
+define("TB_FOLDERDEST", "Doel Folder: ");\r
+define("TB_VIEW", "Beeld: ");\r
+define("TB_SHOW", "Show: ");\r
+define("TB_PAGE", "Pagina");\r
+define("TB_FILENAME", "Naam");\r
+define("TB_SIZE", "Grootte");\r
+define("TB_DIMENSIONS", "Afmeting");\r
+define("TB_TYPE", "Type");\r
+define("TB_DATE", "Gewijzigd op");\r
+define("TB_SEARCH", "Zoeken");\r
+define("TB_FILES", "bestanden");\r
+define("TB_BROWSEFILES", "Overzicht");\r
+define("TB_DETAILS", "Details");\r
+define("TB_THUMBS", "Miniatuurweergaven");\r
+define("TB_EDITFILES", "Bestanden aanpassen");\r
+define("TB_ACTION", "Actie");\r
+define("TB_CREATE", "Creer");\r
+define("TB_DELETE", "Verwijder");\r
+define("TB_RENAME", "Hernoem");\r
+define("TB_ROTATE", "Draaien");\r
+define("TB_RESIZE", "Formaat wijzigen");\r
+define("TB_MOVE", "Verplaats");\r
+define("TB_UPLOADFILES", "Upload Bestanden");\r
+define("TB_PROGRESS", "Voortgang");\r
+define("TB_REMOVE", "Verwijderen");\r
+define("TB_BYTES", "bytes");\r
+define("TB_WIDTH", "breedte");\r
+define("TB_HEIGHT", "hoogte");\r
+define("TB_NONE", "Niet");\r
+define("TB_TYPEIMG", "Afbeeldingen");\r
+define("TB_TYPEMEDIA", "Media");\r
+define("TB_TYPEFILE", "Alle bestanden");\r
+define("TB_ROTATECW", "Rechtsom draaien");\r
+define("TB_ROTATECCW", "Linksom draaien");\r
+define("TB_MSGNEWTHUMBS", "%s nieuwe miniatuurweergaven van de afbeeldingen zijn gegenareerd.");\r
+define("TB_MSGMKDIR", "De map '%s' is successvol aangemaakt.");\r
+define("TB_MSGMKDIRFAIL", "Kan de map '%s' niet aanmaken - Kijk je rechten instellingen na.");\r
+define("TB_MSGCREATE", "%s bestand(en) is/zijn succesvol gecreerd.");\r
+define("TB_MSGDELETE", "%s bestand(en) is/zijn succesvol verwijderd.");\r
+define("TB_MSGRENAME", "%s bestand(en) is/zijn succesvol hernoemd.");\r
+define("TB_MSGMOVE", "%s bestand(en) is/zijn succesvol verplaatst.");\r
+define("TB_MSGRESIZE", "%s afbeelding(en) is/zijn succesvol gewijzigd.");\r
+define("TB_MSGROTATE", "%s afbeelding(en) is/zijn succesvol hernoemd.");\r
+define("TB_MSGEDITERR", "%s bestand(en) gevonden met problemen tijdens deze handeling.");\r
+define("TB_MSGUPGOOD", "%s bestand(en) is/zijn succesvol geupload.");\r
+define("TB_MSGUPBAD", "%s bestand(en) is/zijn niet geupload door beveilings problemen.");\r
+define("TB_MSGUPDUP", "%s files have not been uploaded, as they already exist - please delete or rename original file.");\r
+define("TB_MSGUPFAIL", "Bestand upload mislukt - controleer de rechten voor '%s'.");\r
+define("TB_MSGMAXSIZE", "Kan niet worden toegevoegd aan de wachtrij om het bestand te groot is");\r
+define("TB_TTLMAXSIZE", "Bestand is te groot");\r
+define("TB_DENIED", "Je bent niet bevoegd om deze pagina te bekijken.");\r
+define("TB_UPDENIED", "Je hebt upload rechten nodig om deze pagina te bekijken.");\r
+define("TB_EDDENIED", "Je hebt verwijder of aanpas rechten nodig om deze pagina te bekijken.");\r
+define("TB_FODENIED", "Je hebt folder maintenance rechten nodig om deze pagina te bekijken.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'en'\r
+Author: Maja Bielawa\r
+email: ivoryeve[at]wp[dot]pl\r
+*/\r
+ define("TB_BROWSE", "Przeglądaj");\r
+ define("TB_EDIT", "Operacje");\r
+ define("TB_UPLOAD", "Załaduj");\r
+ define("TB_FOLDERS", "Foldery");\r
+ define("TB_FOLDERNAME", "Nazwa Folderu");\r
+ define("TB_FOLDERCURR", "Bieżący folder: ");\r
+ define("TB_FOLDERDEST", "Docelowy folder: ");\r
+ define("TB_VIEW", "Pokaż jako");\r
+ define("TB_SHOW", "Pokaż");\r
+ define("TB_PAGE", "Strona");\r
+ define("TB_FILENAME", "Nazwa Pliku");\r
+ define("TB_SIZE", "Rozmiar");\r
+ define("TB_DIMENSIONS", "Wymiary");\r
+ define("TB_TYPE", "Typ");\r
+ define("TB_DATE", "Data modyfikacji");\r
+ define("TB_SEARCH", "Szukaj");\r
+ define("TB_FILES", "Pliki");\r
+ define("TB_BROWSEFILES", "Przeglądaj pliki");\r
+ define("TB_DETAILS", "Szczegóły");\r
+ define("TB_THUMBS", "Miniatura");\r
+ define("TB_EDITFILES", "Edytuj pliki");\r
+ define("TB_ACTION", "Akcja");\r
+ define("TB_CREATE", "Stwórz");\r
+ define("TB_DELETE", "Usuń");\r
+ define("TB_RENAME", "Zmień nazwę");\r
+ define("TB_ROTATE", "Obróć");\r
+ define("TB_RESIZE", "Zmień rozmiar");\r
+ define("TB_MOVE", "Przenieś");\r
+ define("TB_UPLOADFILES", "Załaduj pliki");\r
+ define("TB_PROGRESS", "Postęp");\r
+ define("TB_REMOVE", "Usuń");\r
+ define("TB_BYTES", "bajtów");\r
+ define("TB_WIDTH", "szerokość");\r
+ define("TB_HEIGHT", "wysokość");\r
+ define("TB_NONE", "brak");\r
+ define("TB_TYPEIMG", "Obrazy");\r
+ define("TB_TYPEMEDIA", "Media");\r
+ define("TB_TYPEFILE", "Wszystkie pliki");\r
+ define("TB_ROTATECW", "Obróć o 90 stopni w prawo");\r
+ define("TB_ROTATECCW", "Obróć o 90 stopni w lewo");\r
+ define("TB_MSGNEWTHUMBS", "Stworzono %s nowych miniatur.");\r
+ define("TB_MSGMKDIR", "Katalog '%s' został utworzony.");\r
+ define("TB_MSGMKDIRFAIL", "Utworzenie katalogu '%s' jest niemożliwe.");\r
+ define("TB_MSGCREATE", "%s katalogów zostało poprawnie utworzonych.");\r
+ define("TB_MSGDELETE", "%s plików zostały skasowanych.");\r
+ define("TB_MSGRENAME", "Zmieniono nazwę %s plików.");\r
+ define("TB_MSGMOVE", "Przeniesiono poprawnie %s plików.");\r
+ define("TB_MSGRESIZE", "Zmieniono rozmiar %s obrazów.");\r
+ define("TB_MSGROTATE", "Obrócono %s obrazów.");\r
+ define("TB_MSGEDITERR", "Wystąpił problem podczas operacji na %s plikach.");\r
+ define("TB_MSGUPGOOD", "Załadowano %s plików.");\r
+ define("TB_MSGUPBAD", "Nie załadowano %s plików ze względu na ograniczenia związane z bezpieczeństwem.");\r
+ define("TB_MSGUPDUP", "%s plików nie zostało załadowanych, ponieważ pliki z takimi nazwami już istnieją. Skasuj lub zmień nazwę plikom na serwerze.");\r
+ define("TB_MSGUPFAIL", "Pliki nie mogą zostać załadowane, sprawdź katalog '%s'.");\r
+ define("TB_MSGMAXSIZE", "nie może zostac załadowany, ponieważ rozmiar przekracza ustalony limit");\r
+ define("TB_TTLMAXSIZE", "Błąd rozmaru pliku");\r
+ define("TB_DENIED", "Nie masz uprawnień, aby otworzyć tę zakładkę.");\r
+ define("TB_UPDENIED", "Dostęp zabroniony - włącz możliwość ładowania plików, aby zobaczyć tą zakładkę.");\r
+ define("TB_EDDENIED", "Dostęp zabroniony - włącz możliwość kasowania lub zmiany nazw plików, aby zobaczyć tą zakładkę.");\r
+ define("TB_FODENIED", "Dostęp zabroniony - włącz możliwość zarządzania folderami, aby zobaczyć tą zakładkę.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.40 Beta 3 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language 'pt'\r
+Author: Francis Rebouças e MEM\r
+email: francisreboucas[at]gmail[dot]com e talofo[at]gmail[dot]com\r
+*/\r
+ define("TB_BROWSE", "Procurar");\r
+ define("TB_EDIT", "Editar");\r
+ define("TB_UPLOAD", "Upload");\r
+ define("TB_FOLDERS", "Pastas");//new\r
+ define("TB_FOLDERNAME", "Nome da Pasta");//new\r
+ define("TB_FOLDERCURR", "Pasta Actual: ");//new\r
+ define("TB_FOLDERDEST", "Destino: ");//new\r
+ define("TB_VIEW", "Visualizar: ");\r
+ define("TB_SHOW", "Mostrar: ");\r
+ define("TB_PAGE", "Página");\r
+ define("TB_FILENAME", "Nome");\r
+ define("TB_SIZE", "Tam.");\r
+ define("TB_DIMENSIONS", "Dimensões");\r
+ define("TB_TYPE", "Tipo");\r
+ define("TB_DATE", "Data de Criação");\r
+ define("TB_SEARCH", "Procurar");\r
+ define("TB_FILES", "arquivos");\r
+ define("TB_BROWSEFILES", "Lista de Arquivos");\r
+ define("TB_DETAILS", "Detalhes");\r
+ define("TB_THUMBS", "Miniaturas");\r
+ define("TB_EDITFILES", "Editar Arquivos");\r
+ define("TB_ACTION", "Acção");\r
+ define("TB_CREATE", "Criar");//new\r
+ define("TB_DELETE", "Apagar");\r
+ define("TB_RENAME", "Renomear");\r
+ define("TB_ROTATE", "Rodar");\r
+ define("TB_RESIZE", "Redimencionar");\r
+ define("TB_MOVE", "Mover");//new\r
+ define("TB_UPLOADFILES", "Enviar Arquivos");\r
+ define("TB_PROGRESS", "Progresso");\r
+ define("TB_REMOVE", "Remover");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "largura");\r
+ define("TB_HEIGHT", "altura");\r
+ define("TB_NONE", "Nenhum");\r
+ define("TB_TYPEIMG", "Imagens");\r
+ define("TB_TYPEMEDIA", "Medias");\r
+ define("TB_TYPEFILE", "Todos os arquivos");\r
+ define("TB_ROTATECW", "Rodar 90 graus no sentido horário");\r
+ define("TB_ROTATECCW", "Rodar 90 graus no sentido anti-horário");\r
+ define("TB_MSGNEWTHUMBS", "%s novas miniaturas foram geradas.");\r
+ define("TB_MSGMKDIR", "O diretório %s foi criado com sucesso.");\r
+ define("TB_MSGMKDIRFAIL", "Incapaz de criar o diretório %s - verifique as suas permissões.");\r
+ define("TB_MSGCREATE", "%s pasta(s) foram criadas com sucesso.");//new\r
+ define("TB_MSGDELETE", "%s arquivos foram excluídos com sucesso.");\r
+ define("TB_MSGRENAME", "%s arquivos foram renomeados com sucesso.");\r
+ define("TB_MSGMOVE", "%s ficheiro(s) foram movidos com sucesso.");//new\r
+ define("TB_MSGRESIZE", "%s imagens foram redimensionadas com sucesso.");\r
+ define("TB_MSGROTATE", "%s imagens foram rodadas com sucesso.");\r
+ define("TB_MSGEDITERR", "%s arquivos encontraram erros durante a operação solicitada.");\r
+ define("TB_MSGUPGOOD", "%s arquivos foram enviados com sucesso.");\r
+ define("TB_MSGUPBAD", "%s arquivos não foram enviados, devido a restrições de segurança.");\r
+ define("TB_MSGUPDUP", "%s ficheiro(s) não foram enviados para o servidor. Ficheiros com o mesmo nome já existem. - apague or renomeie o ficheiro original.");\r
+ define("TB_MSGUPFAIL", "Falha no upload de arquivo - Seleccionou algum arquivo?");\r
+ define("TB_MSGMAXSIZE", "não pode ser colocado em fila para carregar quando o tamanho exceder o limite máximo de");\r
+ define("TB_TTLMAXSIZE", "Erro no tamanho do ficheiro");\r
+ define("TB_DENIED", "Você necessita de permissão para aceder a esta página.");\r
+ define("TB_UPDENIED", "Você necessita de permissão de upload para aceder a esta página.");\r
+ define("TB_EDDENIED", "Você necessita de permissão de excluir ou editar para aceder a esta página.");\r
+ define("TB_FODENIED", "Você necessita de permissão de acesso a pastas para ver esta página.");//new\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.40 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'ru'\r
+Author: Bryn Jones\r
+email: bryn[at]lunarvis[dot]com\r
+*/\r
+ define("TB_BROWSE", "Обзор");\r
+ define("TB_EDIT", "Изменить");\r
+ define("TB_UPLOAD", "Загрузить");\r
+ define("TB_FOLDERS", "Каталоги");\r
+ define("TB_FOLDERNAME", "Имя каталога");\r
+ define("TB_FOLDERCURR", "Текущий каталог: ");\r
+ define("TB_FOLDERDEST", "Каталог назначения: ");\r
+ define("TB_VIEW", "Показать как: ");\r
+ define("TB_SHOW", "Просмотр: ");\r
+ define("TB_PAGE", "Страница");\r
+ define("TB_FILENAME", "Имя файла");\r
+ define("TB_SIZE", "Объем");\r
+ define("TB_DIMENSIONS", "Размерность");\r
+ define("TB_TYPE", "Тип");\r
+ define("TB_DATE", "Дата изменения");\r
+ define("TB_SEARCH", "Поиск");\r
+ define("TB_FILES", "Файлы");\r
+ define("TB_BROWSEFILES", "Обзор файлов");\r
+ define("TB_DETAILS", "Детали");\r
+ define("TB_THUMBS", "Миниатюры");\r
+ define("TB_EDITFILES", "Изменить файлы");\r
+ define("TB_ACTION", "Действие");\r
+ define("TB_CREATE", "Создать");\r
+ define("TB_DELETE", "Удалить");\r
+ define("TB_RENAME", "Переименовать");\r
+ define("TB_ROTATE", "Повернуть");\r
+ define("TB_RESIZE", "Изменить размер");\r
+ define("TB_MOVE", "Переместить");\r
+ define("TB_UPLOADFILES", "Загрузка файлов");\r
+ define("TB_PROGRESS", "Выполнение");\r
+ define("TB_REMOVE", "Убрать");\r
+ define("TB_BYTES", "байт");\r
+ define("TB_WIDTH", "ширина");\r
+ define("TB_HEIGHT", "высота");\r
+ define("TB_NONE", "Ничего");\r
+ define("TB_TYPEIMG", "Изображения");\r
+ define("TB_TYPEMEDIA", "Медиа");\r
+ define("TB_TYPEFILE", "Все файлы");\r
+ define("TB_ROTATECW", "Повернуть на 90 градусов по часовой");\r
+ define("TB_ROTATECCW", "Повернуть на 90 градусов против часовой");\r
+ define("TB_MSGNEWTHUMBS", "Для %s новых изображений были созданы миниатюры.");\r
+ define("TB_MSGMKDIR", "'%s' каталог(ов) были успешно созданы.");\r
+ define("TB_MSGMKDIRFAIL", "Невозможно создать каталог '%s' - пожалуйста проверьте права доступа.");\r
+ define("TB_MSGCREATE", "%s каталог(ов) успешно создан(о).");\r
+ define("TB_MSGDELETE", "%s файл(ов) успешно удалены.");\r
+ define("TB_MSGRENAME", "%s файл(ов) успешно переименованы.");\r
+ define("TB_MSGMOVE", "%s файл(ов) успешно перемещены.");\r
+ define("TB_MSGRESIZE", "%s изображения были успешно изменены.");\r
+ define("TB_MSGROTATE", "%s изображения успешно повернуты.");\r
+ define("TB_MSGEDITERR", "%s файл(а) возникли ошибки во время требуемой операции.");\r
+ define("TB_MSGUPGOOD", "%s файл(а) были успешно загружены.");\r
+ define("TB_MSGUPBAD", "%s файл(а) не были загружены, не из-за ограничений безопасности.");\r
+ define("TB_MSGUPDUP", "%s файл(а) не были загружены, поскольку они уже существуют - пожалуйста удалите или переименуйте оригинальные файлы.");\r
+ define("TB_MSGUPFAIL", "Невозможно загрузить файлы - пожалуйста проверьте права доступа для '%s'.");\r
+ define("TB_MSGMAXSIZE", "не может быть поставлен в очередь для загрузки, поскольку размер превышает максимальный предел");\r
+ define("TB_TTLMAXSIZE", "Ошибка размера файла");\r
+ define("TB_DENIED", "Вам требуется разрешение для просмотра этой страницы.");\r
+ define("TB_UPDENIED", "Вам требуется разрешение на загрузку файлов.");\r
+ define("TB_EDDENIED", "Вам требуется разрешение на редактирования или удаление.");\r
+ define("TB_FODENIED", "Вам требуется разрешение на управление каталогами.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.32 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Default Language 'en'\r
+Author: Bryn Jones\r
+email: bryn[at]lunarvis[dot]com\r
+*/\r
+ define("TB_BROWSE", "Prechádzať");\r
+ define("TB_EDIT", "Upraviť");\r
+ define("TB_UPLOAD", "Nahrať");\r
+ define("TB_VIEW", "Zobraziť ako: ");\r
+ define("TB_SHOW", "Ukázať: ");\r
+ define("TB_PAGE", "Strana");\r
+ define("TB_FILENAME", "Meno súboru");\r
+ define("TB_SIZE", "Veľkosť");\r
+ define("TB_DIMENSIONS", "Rozlíšenie");\r
+ define("TB_TYPE", "Typ");\r
+ define("TB_DATE", "Zmenené");\r
+ define("TB_SEARCH", "Hľadať");\r
+ define("TB_FILES", "Súbory");\r
+ define("TB_BROWSEFILES", "Prechádzať súbory");\r
+ define("TB_DETAILS", "Detaily");\r
+ define("TB_THUMBS", "Náhľady");\r
+ define("TB_EDITFILES", "Upraviť súbory");\r
+ define("TB_ACTION", "Akcia");\r
+ define("TB_DELETE", "Zmazať");\r
+ define("TB_RENAME", "Premenovať");\r
+ define("TB_ROTATE", "Otočiť");\r
+ define("TB_RESIZE", "Zmenšiť/zväčšiť");\r
+ define("TB_UPLOADFILES", "Nahrať súbory");\r
+ define("TB_PROGRESS", "Priebeh");\r
+ define("TB_REMOVE", "Odstrániť");\r
+ define("TB_BYTES", "bytov");\r
+ define("TB_WIDTH", "širka");\r
+ define("TB_HEIGHT", "výška");\r
+ define("TB_NONE", "Žiadny");\r
+ define("TB_TYPEIMG", "Obrázky");\r
+ define("TB_TYPEMEDIA", "Médiá");\r
+ define("TB_TYPEFILE", "Všetky súbory");\r
+ define("TB_ROTATECW", "Otočiť o 90° po smere hodinových ručičiek");\r
+ define("TB_ROTATECCW", "Otočiť o 90° proti smere hodinových ručičiek");\r
+ define("TB_MSGNEWTHUMBS", "%s nové náhľady obrázkov boli generované.");\r
+ define("TB_MSGMKDIR", "Priečinok '%s' bol úspešne vytvorený.");\r
+ define("TB_MSGMKDIRFAIL", "Nemôžem vytvoriť priečinok '%s', skontrolujte práva zápisu.");\r
+ define("TB_MSGDELETE", "%s súbory boli úspešne zmazané.");\r
+ define("TB_MSGRENAME", "%s súbory boli úspešne premenované.");\r
+ define("TB_MSGRESIZE", "%s súbory boli úspešne zmenšené/zväčšené.");\r
+ define("TB_MSGROTATE", "%s súbory boli úspešne otočené.");\r
+ define("TB_MSGEDITERR", "U '%s'vznikli problémy počas požadovanej operácie.");\r
+ define("TB_MSGUPGOOD", "%s boli úspešne nahrané.");\r
+ define("TB_MSGUPBAD", "%s súbory neboli úspešne nahrané, kôli bezpečnostným obmedzeniam.");\r
+ define("TB_MSGUPDUP", "%s súbory neboli úspešne nahrané, pretože existujú - premenujte ich alebo zmažte.");\r
+ define("TB_MSGUPFAIL", "Nahrávanie súboru zlyhalo - prosím skontrolujte povolenia pre zápis u '%s'.");\r
+ define("TB_MSGMAXSIZE", "nemôže byť označený pre upload, pretože jeho veľkosť presiahla limit");\r
+ define("TB_TTLMAXSIZE", "Chyba veľkosti súboru");\r
+ define("TB_DENIED", "Potrebujete práva pre zobrazenie tejto stránky.");\r
+ define("TB_UPDENIED", "Potrebujete práva na nahrávanie pre zobrazenie tejto stránky.");\r
+ define("TB_EDDENIED", "Potrebujete práva pre úpravy alebo mazanie pre zobrazenie tejto stránky.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php \r
+/*\r
+TinyBrowser 1.41 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language 'sv' - Swedish\r
+Author: Robin Morero\r
+email: robin[at]morero[dot]se\r
+*/\r
+ define("TB_BROWSE", "Bläddra");\r
+ define("TB_EDIT", "Redigera");\r
+ define("TB_UPLOAD", "Ladda upp");\r
+ define("TB_FOLDERS", "Mappar");\r
+ define("TB_FOLDERNAME", "Mappnamn");\r
+ define("TB_FOLDERCURR", "Aktuell mapp: ");\r
+ define("TB_FOLDERDEST", "Destination: ");\r
+ define("TB_VIEW", "Visa som: ");\r
+ define("TB_SHOW", "Visa: ");\r
+ define("TB_PAGE", "Sida");\r
+ define("TB_FILENAME", "Filnamn");\r
+ define("TB_SIZE", "Storlek");\r
+ define("TB_DIMENSIONS", "Dimensioner");\r
+ define("TB_TYPE", "Typ");\r
+ define("TB_DATE", "Modifieringsdatum");\r
+ define("TB_SEARCH", "Sök");\r
+ define("TB_FILES", "Filer");\r
+ define("TB_BROWSEFILES", "Bläddra bland filer");\r
+ define("TB_DETAILS", "Detaljer");\r
+ define("TB_THUMBS", "Miniatyrer");\r
+ define("TB_EDITFILES", "Redigera filer");\r
+ define("TB_ACTION", "Val: ");\r
+ define("TB_CREATE", "Skapa");\r
+ define("TB_DELETE", "Radera");\r
+ define("TB_RENAME", "Byt namn");\r
+ define("TB_ROTATE", "Rotera");\r
+ define("TB_RESIZE", "Ändra storlek");\r
+ define("TB_MOVE", "Flytta");\r
+ define("TB_UPLOADFILES", "Ladda upp filer");\r
+ define("TB_PROGRESS", "Status");\r
+ define("TB_REMOVE", "Radera");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "bredd");\r
+ define("TB_HEIGHT", "höjd");\r
+ define("TB_NONE", "Ingen");\r
+ define("TB_TYPEIMG", "Bilder");\r
+ define("TB_TYPEMEDIA", "Media");\r
+ define("TB_TYPEFILE", "Alla Filer");\r
+ define("TB_ROTATECW", "Rotera 90 grader medurs");\r
+ define("TB_ROTATECCW", "Rotera 90 grader moturs");\r
+ define("TB_MSGNEWTHUMBS", "%s nya miniatyrer har skapats.");\r
+ define("TB_MSGMKDIR", "Mappen: '%s' har skapats.");\r
+ define("TB_MSGMKDIRFAIL", "Kunde inte skapa mappen: '%s' directory - kontrollera rättigheter.");\r
+ define("TB_MSGCREATE", "%s mappar har skapats.");\r
+ define("TB_MSGDELETE", "%s filer har tagits bort.");\r
+ define("TB_MSGRENAME", "%s filer har döpts om.");\r
+ define("TB_MSGMOVE", "%s filer har flyttats.");\r
+ define("TB_MSGRESIZE", "Dimensioner har ändrats på %s bilder.");\r
+ define("TB_MSGROTATE", "%s har roterats.");\r
+ define("TB_MSGEDITERR", "Fel uppstod vid behandling av %s filer.");\r
+ define("TB_MSGUPGOOD", "%s filer har laddats upp.");\r
+ define("TB_MSGUPBAD", "På grund av säkerhetsrestriktioner kunde inte %s filer laddas upp..");\r
+ define("TB_MSGUPDUP", "%s filer laddades inte upp, då de redan finns - radera eller döp om orginalfilerna.");\r
+ define("TB_MSGUPFAIL", "Filuppladdningen misslyckades - kontrollera rättigheter till '%s' samt inställningar i php.ini.");\r
+ define("TB_MSGMAXSIZE", "kan inte köas för uppladdning då storleken är större än maximalt tillåtet värde på");\r
+ define("TB_TTLMAXSIZE", "Ogiltig filstorlek");\r
+ define("TB_DENIED", "Rättigheter krävs för att visa sidan.");\r
+ define("TB_UPDENIED", "Rättigheter att ladda upp filer krävs för att visa sidan.");\r
+ define("TB_EDDENIED", "Rättigheter att redigera/radera filer krävs för att visa sidan.");\r
+ define("TB_FODENIED", "Rättigheter att redigera mappar krävs för att visa sidan.");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php\r
+/*\r
+TinyBrowser 1.40 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language 'zh-cn'\r
+Author: John Tam , Last update:2008/10/17\r
+email: jokytam168[at]gmail[dot]com\r
+*/\r
+ define("TB_BROWSE", "浏览");\r
+ define("TB_EDIT", "编辑");\r
+ define("TB_UPLOAD", "上传档案");\r
+ define("TB_FOLDERS", "资料夹");\r
+ define("TB_FOLDERNAME", "资料夹名称");\r
+ define("TB_FOLDERCURR", "当前资料夹: ");\r
+ define("TB_FOLDERDEST", "目的地资料夹: ");\r
+ define("TB_VIEW", "排列图示依: ");\r
+ define("TB_SHOW", "展示: ");\r
+ define("TB_PAGE", "页");\r
+ define("TB_FILENAME", "档案名称");\r
+ define("TB_SIZE", "档案大小");\r
+ define("TB_DIMENSIONS", "尺寸");\r
+ define("TB_TYPE", "种类");\r
+ define("TB_DATE", "修改日期");\r
+ define("TB_SEARCH", "搜寻");\r
+ define("TB_FILES", "档案");\r
+ define("TB_BROWSEFILES", "档案浏览");\r
+ define("TB_DETAILS", "详细资料");\r
+ define("TB_THUMBS", "缩图");\r
+ define("TB_EDITFILES", "编辑档案");\r
+ define("TB_ACTION", "动作: ");\r
+ define("TB_CREATE", "建立");\r
+ define("TB_DELETE", "删除");\r
+ define("TB_RENAME", "更名档案");\r
+ define("TB_ROTATE", "旋转图片");\r
+ define("TB_RESIZE", "调整大小");\r
+ define("TB_MOVE", "移动档案");\r
+ define("TB_UPLOADFILES", "上传档案");\r
+ define("TB_PROGRESS", "上传进度");\r
+ define("TB_REMOVE", "移除");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "宽度");\r
+ define("TB_HEIGHT", "高度");\r
+ define("TB_NONE", "保持原状");\r
+ define("TB_TYPEIMG", "图片档案");\r
+ define("TB_TYPEMEDIA", "多媒体档案");\r
+ define("TB_TYPEFILE", "其他档案");\r
+ define("TB_ROTATECW", "顺时针旋转90度");\r
+ define("TB_ROTATECCW", "逆时针旋转90度");\r
+ define("TB_MSGNEWTHUMBS", "图片 %s 的缩图成功产生!");\r
+ define("TB_MSGMKDIR", "资料夹 %s 成功建立!");\r
+ define("TB_MSGMKDIRFAIL", "无法建立资料夹 %s ,请检查资料夹写入权限");\r
+ define("TB_MSGCREATE", "建立资料夹 %s 成功!");\r
+ define("TB_MSGDELETE", "删除 %s 笔档案完成");\r
+ define("TB_MSGRENAME", "档案 %s 更名完成");\r
+ define("TB_MSGMOVE", "档案 %s 移动完成");\r
+ define("TB_MSGRESIZE", "图片 %s 调整大小完成");\r
+ define("TB_MSGROTATE", "图片 %s 旋转完成");\r
+ define("TB_MSGEDITERR", "在进行操作时,档案 %s 遭遇错误,无法进行您的要求!");\r
+ define("TB_MSGUPGOOD", "上传 %s 笔档案完成");\r
+ define("TB_MSGUPBAD", "由于写入权限及安全性问题,档案 %s 无法上传");\r
+ define("TB_MSGUPDUP", "档案 %s 无法更新,已存同样档名的档案,请先将同样档名的资料删除或更名");\r
+ define("TB_MSGUPFAIL", "档案 '%s' 上传失败,请检查档案的写入权限");\r
+ define("TB_MSGMAXSIZE", "已超过系统档案大小限制,无法再加入上传等待区,系统限制为");\r
+ define("TB_TTLMAXSIZE", "档案大小错误");\r
+ define("TB_DENIED", "您没有权限操作本项功能");\r
+ define("TB_UPDENIED", "您没有上传档案的权限");\r
+ define("TB_EDDENIED", "您没有修改及删除档案的权限");\r
+ define("TB_FODENIED", "您没有建立及修改资料夹的权限");\r
+?>
\ No newline at end of file
--- /dev/null
+<?php\r
+/*\r
+TinyBrowser 1.40 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+Language 'zh-tw'\r
+Author: John Tam , Last update:2008/10/17\r
+email: jokytam168[at]gmail[dot]com\r
+*/\r
+ define("TB_BROWSE", "瀏覽");\r
+ define("TB_EDIT", "編輯");\r
+ define("TB_UPLOAD", "上傳檔案");\r
+ define("TB_FOLDERS", "資料夾");\r
+ define("TB_FOLDERNAME", "資料夾名稱");\r
+ define("TB_FOLDERCURR", "當前資料夾: ");\r
+ define("TB_FOLDERDEST", "目的地資料夾: ");\r
+ define("TB_VIEW", "排列圖示依: ");\r
+ define("TB_SHOW", "展示: ");\r
+ define("TB_PAGE", "頁");\r
+ define("TB_FILENAME", "檔案名稱");\r
+ define("TB_SIZE", "檔案大小");\r
+ define("TB_DIMENSIONS", "尺寸");\r
+ define("TB_TYPE", "種類");\r
+ define("TB_DATE", "修改日期");\r
+ define("TB_SEARCH", "搜尋");\r
+ define("TB_FILES", "檔案");\r
+ define("TB_BROWSEFILES", "檔案瀏覽");\r
+ define("TB_DETAILS", "詳細資料");\r
+ define("TB_THUMBS", "縮圖");\r
+ define("TB_EDITFILES", "編輯檔案");\r
+ define("TB_ACTION", "動作: ");\r
+ define("TB_CREATE", "建立");\r
+ define("TB_DELETE", "刪除");\r
+ define("TB_RENAME", "更名檔案");\r
+ define("TB_ROTATE", "旋轉圖片");\r
+ define("TB_RESIZE", "調整大小");\r
+ define("TB_MOVE", "移動檔案");\r
+ define("TB_UPLOADFILES", "上傳檔案");\r
+ define("TB_PROGRESS", "上傳進度");\r
+ define("TB_REMOVE", "移除");\r
+ define("TB_BYTES", "bytes");\r
+ define("TB_WIDTH", "寬度");\r
+ define("TB_HEIGHT", "高度");\r
+ define("TB_NONE", "保持原狀");\r
+ define("TB_TYPEIMG", "圖片檔案");\r
+ define("TB_TYPEMEDIA", "多媒體檔案");\r
+ define("TB_TYPEFILE", "其他檔案");\r
+ define("TB_ROTATECW", "順時針旋轉90度");\r
+ define("TB_ROTATECCW", "逆時針旋轉90度");\r
+ define("TB_MSGNEWTHUMBS", "圖片 %s 的縮圖成功產生!");\r
+ define("TB_MSGMKDIR", "資料夾 %s 成功建立!");\r
+ define("TB_MSGMKDIRFAIL", "無法建立資料夾 %s ,請檢查資料夾寫入權限");\r
+ define("TB_MSGCREATE", "建立資料夾 %s 成功!");\r
+ define("TB_MSGDELETE", "刪除 %s 筆檔案完成");\r
+ define("TB_MSGRENAME", "檔案 %s 更名完成");\r
+ define("TB_MSGMOVE", "檔案 %s 移動完成");\r
+ define("TB_MSGRESIZE", "圖片 %s 調整大小完成");\r
+ define("TB_MSGROTATE", "圖片 %s 旋轉完成");\r
+ define("TB_MSGEDITERR", "在進行操作時,檔案 %s 遭遇錯誤,無法進行您的要求!");\r
+ define("TB_MSGUPGOOD", "上傳 %s 筆檔案完成");\r
+ define("TB_MSGUPBAD", "由於寫入權限及安全性問題,檔案 %s 無法上傳");\r
+ define("TB_MSGUPDUP", "檔案 %s 無法更新,已存同樣檔名的檔案,請先將同樣檔名的資料刪除或更名");\r
+ define("TB_MSGUPFAIL", "檔案 '%s' 上傳失敗,請檢查檔案的寫入權限");\r
+ define("TB_MSGMAXSIZE", "已超過系統檔案大小限制,無法再加入上傳等待區,系統限制為");\r
+ define("TB_TTLMAXSIZE", "檔案大小錯誤");\r
+ define("TB_DENIED", "您沒有權限操作本項功能");\r
+ define("TB_UPDENIED", "您沒有上傳檔案的權限");\r
+ define("TB_EDDENIED", "您沒有修改及刪除檔案的權限");\r
+ define("TB_FODENIED", "您沒有建立及修改資料夾的權限");\r
+?>
\ No newline at end of file
--- /dev/null
+TinyBrowser 1.41 - A TinyMCE file browser (C) 2008 Bryn Jones\r
+(author website - http://www.lunarvis.com)\r
+\r
+ This program is free software: you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation, either version 3 of the License, or\r
+ (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+\r
+\r
+TinyBrowser Features:\r
+=====================\r
+\r
+- Integrates as a custom file browser within TinyMCE for image, media and 'all'\r
+ file types, or can work in stand-alone mode\r
+\r
+- Adobe Flash based file uploader, supporting multiple file selection and upload\r
+ with file type and size filtering (permission based)\r
+\r
+- Browse files with a list view or as thumbnails (images only), with optional\r
+ pagination\r
+\r
+- List view has image thumbnail on hover\r
+\r
+- File display order customisable e.g. by name, type, size, date\r
+\r
+- Find function to filter results by search string \r
+\r
+- Display detailed file information such as type, size and dimensions (images\r
+ only)\r
+\r
+- File deletion facility (permission based)\r
+\r
+- File edit facility (permission based) - rename, resize and rotate (last two\r
+ images only)\r
+ \r
+- Folder browsing and creation\r
+\r
+- File storage location user definable for each file type\r
+\r
+- Optional session control\r
+\r
+- Multi-lingual support with language definition files\r
+\r
+- Many user definable settings, all from central configuration file\r
+\r
+\r
+TinyBrowser Background\r
+======================\r
+\r
+I created TinyBrowser as I couldn't find the right TinyMCE file browser for my\r
+needs, particularly the ability to select and upload multiple files in an easy\r
+way.\r
+\r
+\r
+Version Notes\r
+=============\r
+\r
+TinyBrowser 1.41 - released 05/05/2009\r
+--------------------------------------\r
+New Features:\r
+Added folder argument to tinyBrowserPopUp function, so that a sub-folder can be\r
+selected when using TinyBrowser in standalone mode.\r
+Added error logging - errors are output to error.log in tinybrowser directory.\r
+Added Spanish, Croatian, Slovakian, Latvian, Czech, Italian, Hungarian, Swedish\r
+and Russian language files (thanks to all who contributed).\r
+\r
+Changes:\r
+Prohibited files are no longer browseable (if the paths defined contained files\r
+of this type).\r
+Only defined file extensions of a file type are browseable and editable.\r
+Changed stripos function to strpos to ensure PHP4 compatability.\r
+Updated createfolder function to work recursively with PHP4.\r
+Remember current folder after upload.\r
+Changed filename clean regex to be less strict.\r
+\r
+Bug Fixes:\r
+Fixed transparency support for gif and png (thanks to Dirk Bohl).\r
+Added 'no-cache' meta tag to ensure latest page is served by web browser.\r
+Added another fix for no style issue with TinyMCE integration.\r
+Security fix for browse type when set to non-existant value.\r
+Security fix for malicious setting of folder get variable to relative values.\r
+\r
+TinyBrowser 1.40 - released N/A\r
+--------------------------------------\r
+New Features:\r
+Added multiple folder support with a separate Folders tab to allow folder\r
+creation, renaming and deletion.\r
+Added Move action to Edit tab, to allow moving of files between folders.\r
+Added Danish language file.\r
+Added 'delayprocess' to config file - this can be set if server response is\r
+delayed, preventing uploaded files being processed correctly.\r
+Added width and height config values for the TinyBrowser pop up window size.\r
+Added 'cleanfilename' flag to config file, to remove disallowed characters\r
+from filenames on upload (set to true by default).\r
+ \r
+Changes:\r
+Added recursive flag to createfolder function, to allow TinyBrowser to \r
+create full upload path.\r
+Changed default window size to 770px x 480px.\r
+Minor code optimisation.\r
+Prohibited files are now not browseable (if the paths defined contained files of\r
+this type).\r
+Now only defined file extensions of a file type are browseable and editable.\r
+Changed stripos function call to strpos to ensure PHP4 compatability.\r
+Updated createfolder function to work recursively with PHP4.\r
+Remember current folder after upload.\r
+\r
+Bug Fixes:\r
+Fixed minor bug causing elementid to be lost after file upload in\r
+stand-alone mode.\r
+Fixed stand-alone javascript selectURL function bug that prevented \r
+TinyBrowser window close on selection. \r
+Fixed bug in Flash upload that prevented folder permission error reporting.\r
+Fixed bug in image resize and rotate functions that converted all types\r
+to jpeg.\r
+\r
+TinyBrowser 1.33 - released 23/09/2008\r
+--------------------------------------\r
+New Features:\r
+Added German, Finnish, Traditional and Simplified Chinese language files.\r
+Added session control workaround for upload_file.php (called by Flash).\r
+\r
+Changes:\r
+Flash uploader has been modified to display the file type and also to fix\r
+strange progress bar behaviour when uploading multiple files. As the\r
+upload process is not concurrent, I have removed the individual progress\r
+bars and replaced them with one (progress is still per file however).\r
+When the Upload button is pressed all the buttons now disappear.\r
+\r
+Bug Fixes:\r
+Fixed minor bug that affected css layout after file upload.\r
+Fixed bug introduced in 1.32 that prevented automatic image resize on\r
+upload.\r
+Added 'HTTP/1.1 200' response to upload_file.php script, to address\r
+Flash bug in some Mac setups.\r
+Added check for valid images in Browse and Edit tabs - non-image files\r
+are still listed but error producing image properties code is bypassed.\r
+ \r
+\r
+TinyBrowser 1.32 - released 17/09/2008\r
+--------------------------------------\r
+New Features:\r
+None.\r
+\r
+Changes:\r
+The upload path is now passed to the Flash upload widget, for better\r
+compatibility with Firefox and Opera when you set your paths using session\r
+variables (this is due to a Flash bug that loses session data).\r
+Files are no longer uploaded to a temporary directory, so there's now no\r
+folder creation during the upload process. Instead, file name extensions\r
+are suffixed with an underscore until processed. (This renders them\r
+useless until verification).\r
+The thumbs directory has been changed to '_thumbs'.\r
+\r
+Bug Fixes:\r
+Fixed security hole - previously, it was possible to directly\r
+submit files to the upload_file.php script. Due to the Flash session bug,\r
+normal session control does not work. Instead, a hash string check has been\r
+added to the upload_file.php script and the installation instructions\r
+amended.\r
+ \r
+TinyBrowser 1.31 - released 16/09/2008\r
+--------------------------------------\r
+New Features:\r
+None.\r
+\r
+Changes:\r
+Added prohibited files logic to the file_upload.php script (previously\r
+located only in file_process.php script).\r
+Changed duplicate file handling behaviour - TinyBrowser now discards\r
+files with the same name.\r
+\r
+Bug Fixes:\r
+None.\r
+\r
+TinyBrowser 1.30 - released 12/09/2008\r
+--------------------------------------\r
+New Features:\r
+'Stand-alone' mode, for use without TinyMCE.\r
+Optional and configurable pagination, to break results down into pages.\r
+New configuration option, $tinybrowser['link'], allows the passback link to\r
+be different to the upload path.\r
+Added automatic creation of upload directories (with definable chmod for Unix\r
+servers).\r
+Added alert messages for errors and actions.\r
+Multi-lingual support - credit to Francis Rebouças \r
+(francisreboucas[at]gmail[dot]com) for idea, design, implementation and \r
+Portugese language file.\r
+Experimental support for FCKeditor.\r
+\r
+Changes:\r
+Rationalised TinyBrowser file and folder names and structure (brought in line\r
+with TinyMCE plugin specification).\r
+Revised documentation.\r
+After file upload user is now directed back to upload tab instead of the\r
+browse tab.\r
+ \r
+Bug Fixes:\r
+Fixed security hole - prohibited file extensions not obeyed due to error in\r
+inherited code. \r
+Fixed small issue with edit / delete permissions (not consistently hiding\r
+edit tab).\r
+\r
+TinyBrowser 1.20 - released 20/08/2008\r
+--------------------------------------\r
+New Features:\r
+Added thumbnail on hover for detail view (images only). Note: not working in\r
+IE6.\r
+Added Edit tab - allows file rename, resize and rotate (last two for images\r
+only). Also moved delete action to here.\r
+Added configurable automatic image resize on upload.\r
+\r
+Changes:\r
+Moved file thumbnail generation to upload process.\r
+Changed table css to match Flash upload.\r
+Improved thumbnail view layout.\r
+Removed the form select elements for sort by and type, and made the table\r
+column headers clickable.\r
+\r
+Bug Fixes:\r
+Changed default $tinymce['docroot'] value to\r
+rtrim($_SERVER['DOCUMENT_ROOT'],'/') - this fixes an issue with server setups\r
+that return a value with a '/' suffix.\r
+Removed .htaccess file after various bug reports - doesn't appear to be\r
+required for majority of server setups.\r
+Fixed silly bug with thumbnail urls that could prevent generation and viewing\r
+under some server setups.\r
+Fixed various other minor bugs and tidied code.\r
+\r
+TinyBrowser 1.10 \r
+----------------\r
+Adjusted layout of file upload.\r
+Added facility to limit permitted file upload size (separate values for each\r
+file type).\r
+Amended installation instructions for clarity.\r
+Tested as working in Opera 9.\r
+\r
+TinyBrowser 1.00\r
+----------------\r
+Tested in Firefox 2 and 3, Internet Explorer 6 and 7 and Safari 3.\r
+Requires Adobe Flash Player 9.\r
+\r
+\r
+Requirements\r
+============\r
+\r
+Adobe Flash Player 8 +\r
+PHP enabled server\r
+\r
+Supported browsers:\r
+Internet Explorer 6 +\r
+Firefox 2 +\r
+Safari 3 +\r
+Opera 9 +\r
+Google Chrome\r
+\r
+\r
+Language Definition Files\r
+=========================\r
+\r
+English (en)\r
+Chinese Simplified (zh-cn)\r
+Chinese Traditional (zh-tw)\r
+Croatian (hr)\r
+Czech (cs)\r
+Danish (da)\r
+Dutch (nl)\r
+Finnish (fi)\r
+French (fr)\r
+German (de)\r
+Hungarian (hu)\r
+Italian (it)\r
+Latvian (lv)\r
+Polish (pl)\r
+Portuguese (pt)\r
+Russian (ru)\r
+Slovak (sk)\r
+Spanish (es)\r
+Swedish (sv)\r
+\r
+\r
+\r
+Known Issues\r
+============\r
+\r
+None.\r
+\r
+\r
+Troubleshooting\r
+===============\r
+\r
+If you receive a 403, 406 or 412 status error on uploading files, please create\r
+an .htaccess file in your tinybrowser directory with the following contents:\r
+\r
+SecFilterEngine Off\r
+SecFilterScanPOST Off\r
+\r
+If you use Linux and the Squid proxy, you need to add a "ignore_expect_100 on"\r
+flag to the squid config file to avoid a 417 status error.\r
+\r
+\r
+TinyBrowser Installation Method 1\r
+=================================\r
+\r
+The standard TinyBrowser installation, this integrates TinyBrowser as a custom\r
+file browseer with TinyMCE.\r
+\r
+1) Copy the tinybrowser folder and contents to your TinyMCE plugins directory.\r
+\r
+2) Place the following javascript link after the link to TinyMCE (tiny_mce.js):\r
+\r
+ <script type="text/javascript"\r
+ src="/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php"></script>\r
+\r
+ ***NOTE:*** The above link assumes TinyMCE is installed in your website root\r
+ directory, you will need to amend the link to your specific setup!\r
+\r
+3) Add this line to your TinyMCE init:\r
+\r
+ file_browser_callback : "tinyBrowser"\r
+\r
+4) Edit the TinyBrowser configuration file (config_tinybrowser.php). The most\r
+ important settings are the file paths (these will be automatically created on\r
+ your server by TinyBrowser if they do not exist) and also the 'obfuscate'\r
+ property, which should be set to a random value.\r
+\r
+ ***NOTE:*** If your server is Unix-based. you may wish to modify the \r
+ $tinybrowser['unixpermissions'] config value, which decides permissions.\r
+\r
+5) All done! Now you will see a browse button in the TinyMCE dialog windows for\r
+ plugins like image, media and link - just click this button and TinyBrowser\r
+ will appear.\r
+\r
+\r
+TinyBrowser Installation Method 2\r
+=================================\r
+\r
+This installation allows TinyBrowser to be used in 'stand-alone' mode, for\r
+integration with any web application.\r
+\r
+1) Copy the tinybrowser folder and contents to your server.\r
+\r
+2) Place the following javascript link within the <head> tag on the page you\r
+ require TinyBrowser:\r
+\r
+ <script language="javascript" type="text/javascript"\r
+ src="/tinybrowser/tb_standalone.js.php"></script>\r
+\r
+ ***NOTE:*** The above link assumes TinyBrowser is installed in your website\r
+ root directory, you will need to amend the link to your specific setup!\r
+\r
+3) Edit the TinyBrowser configuration file (config_tinybrowser.php). The most\r
+ important settings are the file paths (these will be automatically created on\r
+ your server by TinyBrowser if they do not exist) and also the 'obfuscate'\r
+ property, which should be set to a random value.\r
+\r
+ ***NOTE:*** If your server is Unix-based. you may wish to modify the\r
+ $tinybrowser['unixpermissions'] config value, which decides permissions.\r
+\r
+4) To launch TinyBrowser use the following javascript function:\r
+\r
+ tinyBrowserPopUp('type','elementid');\r
+\r
+ 'type' can contain 'image', 'media' or 'file' - corresponding to the type of\r
+ file you want TinyBrowser to manage.\r
+\r
+ 'elementid' is the id of the page element you want populate with the file url\r
+ TinyBrowser returns - this is generally a form text input. If you want to\r
+ immediately display the image then create an <img> tag with the same element\r
+ id, only suffixed with img - e.g. elementidimg.\r
+\r
+ \r
+TinyBrowser Installation Method 3\r
+=================================\r
+\r
+This installation method integrates TinyBrowser as a custom file browser with\r
+FCKeditor.\r
+\r
+1) Copy the tinybrowser folder and contents to your server.\r
+\r
+2) Edit your fckconfig.js file as follows (replace existing lines).\r
+\r
+ To enable TinyBrowser for files:\r
+ FCKConfig.LinkBrowserURL = '/yourtinybrowserurl/tinybrowser.php?type=file';\r
+\r
+ To enable TinyBrowser for images:\r
+ FCKConfig.ImageBrowserURL = '/yourtinybrowserurl/tinybrowser.php?type=image';\r
+\r
+ To enable TinyBrowser for Flash:\r
+ FCKConfig.FlashBrowserURL = '/yourtinybrowserurl/tinybrowser.php?type=media';\r
+\r
+ If you wish to disable the default FCKeditor file uploads (recommended), set\r
+ the following:\r
+ FCKConfig.LinkUpload = false;\r
+ FCKConfig.ImageUpload = false;\r
+ FCKConfig.FlashUpload = false;\r
+\r
+3) Edit the TinyBrowser configuration file (config_tinybrowser.php).\r
+\r
+ Change the $tinybrowser['integration'] line:\r
+ $tinybrowser['integration'] = 'fckeditor';\r
+\r
+ The other most important settings are the file paths (these will be\r
+ automatically created on your server by TinyBrowser if they do not exist) and\r
+ the 'obfuscate' property, which should be set to a random value.\r
+\r
+ ***NOTE:*** If your server is Unix-based. you may wish to modify the\r
+ $tinybrowser['unixpermissions'] config value, which decides permissions.\r
+\r
+4) All done! Now when you click the Browse Server button in the FCKeditor dialog\r
+ windows for image, Flash and link, TinyBrowser will appear instead of the\r
+ standard FCKeditor file browser.\r
+\r
+\r
+Contact\r
+=======\r
+\r
+Please notify me by email bryn[at]lunarvis[dot]com if you notice any bugs or\r
+have ideas for new features.\r
+\r
+-----------------------------\r
+File Last Modified 05/05/2009
\ No newline at end of file
--- /dev/null
+<?php
+require_once("config_tinybrowser.php");
+
+$tbpath = pathinfo($_SERVER['SCRIPT_NAME']);
+$tbmain = $tbpath['dirname'].'/tinybrowser.php';
+?>
+
+function tinyBrowserPopUp(type,formelementid,folder) {
+ tburl = "<?php echo $tbmain; ?>" + "?type=" + type + "&feid=" + formelementid;
+ if (folder !== undefined) tburl += "&folder="+folder+"%2F";
+ newwindow=window.open(tburl,'tinybrowser','height=<?php echo $tinybrowser['window']['height']+15; ?>,width=<?php echo $tinybrowser['window']['width']+15; ?>,scrollbars=yes,resizable=yes');
+ if (window.focus) {newwindow.focus()}
+ return false;
+}
--- /dev/null
+<?php
+
+require_once("config_tinybrowser.php");
+
+$tbpath = pathinfo($_SERVER['SCRIPT_NAME']);
+$tbmain = $tbpath['dirname'].'/tinybrowser.php';
+?>
+
+ function tinyBrowser (field_name, url, type, win) {
+
+ /* If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
+ the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
+ These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
+
+ var cmsURL = "<?php echo $tbmain; ?>"; // script URL - use an absolute path!
+ if (cmsURL.indexOf("?") < 0) {
+ //add the type as the only query parameter
+ cmsURL = cmsURL + "?type=" + type;
+ }
+ else {
+ //add the type as an additional query parameter
+ // (PHP session ID is now included if there is one at all)
+ cmsURL = cmsURL + "&type=" + type;
+ }
+
+ tinyMCE.activeEditor.windowManager.open({
+ file : cmsURL,
+ title : 'Tiny Browser',
+ width : <?php echo $tinybrowser['window']['width']; ?>,
+ height : <?php echo $tinybrowser['window']['height']; ?>,
+ resizable : "yes",
+ scrollbars : "yes",
+ inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
+ close_previous : "no"
+ }, {
+ window : win,
+ input : field_name
+ });
+ return false;
+ }
\ No newline at end of file
--- /dev/null
+<?php\r
+require_once('config_tinybrowser.php');\r
+// Set language\r
+if(isset($tinybrowser['language']) && file_exists('langs/'.$tinybrowser['language'].'.php'))\r
+ {\r
+ require_once('langs/'.$tinybrowser['language'].'.php'); \r
+ }\r
+else\r
+ {\r
+ require_once('langs/en.php'); // Falls back to English\r
+ }\r
+require_once('fns_tinybrowser.php');\r
+\r
+// Check session, if it exists\r
+if(session_id() != '')\r
+ {\r
+ if(!isset($_SESSION[$tinybrowser['sessioncheck']]))\r
+ {\r
+ echo TB_DENIED;\r
+ exit;\r
+ }\r
+ }\r
+\r
+// Assign file operation variables\r
+$validtypes = array('image','media','file');\r
+$typenow = ((isset($_GET['type']) && in_array($_GET['type'],$validtypes)) ? $_GET['type'] : 'image');\r
+$standalone = ((isset($_GET['feid']) && $_GET['feid']!='') ? true : false);\r
+$foldernow = str_replace(array('../','..\\','./','.\\'),'',($tinybrowser['allowfolders'] && isset($_REQUEST['folder']) ? urldecode($_REQUEST['folder']) : ''));\r
+\r
+if($standalone)\r
+ {\r
+ $passfeid = '&feid='.$_GET['feid']; \r
+ $rowhlightinit = ' onload="rowHighlight();"';\r
+ }\r
+else\r
+ {\r
+ $passfeid = '';\r
+ $rowhlightinit = ''; \r
+ }\r
+\r
+// Assign browsing options\r
+$sortbynow = (isset($_REQUEST['sortby']) ? $_REQUEST['sortby'] : $tinybrowser['order']['by']);\r
+$sorttypenow = (isset($_REQUEST['sorttype']) ? $_REQUEST['sorttype'] : $tinybrowser['order']['type']);\r
+$sorttypeflip = ($sorttypenow == 'asc' ? 'desc' : 'asc'); \r
+$viewtypenow = (isset($_REQUEST['viewtype']) ? $_REQUEST['viewtype'] : $tinybrowser['view']['image']);\r
+$findnow = (isset($_POST['find']) && !empty($_POST['find']) ? $_POST['find'] : false);\r
+$showpagenow = (isset($_REQUEST['showpage']) ? $_REQUEST['showpage'] : 0);\r
+\r
+// Assign url pass variables\r
+$passfolder = '&folder='.urlencode($foldernow);\r
+$passfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? '&feid='.$_GET['feid'] : '');\r
+$passviewtype = '&viewtype='.$viewtypenow;\r
+$passsortby = '&sortby='.$sortbynow.'&sorttype='.$sorttypenow;\r
+\r
+// Assign view, thumbnail and link paths\r
+$browsepath = $tinybrowser['path'][$typenow].$foldernow;\r
+$linkpath = $tinybrowser['link'][$typenow].$foldernow;\r
+$thumbpath = $tinybrowser[$tinybrowser['thumbsrc']][$typenow].$foldernow;\r
+\r
+// Assign sort parameters for column header links\r
+$sortbyget = array();\r
+$sortbyget['name'] = '&viewtype='.$viewtypenow.'&sortby=name';\r
+$sortbyget['size'] = '&viewtype='.$viewtypenow.'&sortby=size'; \r
+$sortbyget['type'] = '&viewtype='.$viewtypenow.'&sortby=type'; \r
+$sortbyget['modified'] = '&viewtype='.$viewtypenow.'&sortby=modified';\r
+$sortbyget['dimensions'] = '&viewtype='.$viewtypenow.'&sortby=dimensions'; \r
+$sortbyget[$sortbynow] .= '&sorttype='.$sorttypeflip;\r
+\r
+// Assign css style for current sort type column\r
+$thclass = array();\r
+$thclass['name'] = '';\r
+$thclass['size'] = ''; \r
+$thclass['type'] = ''; \r
+$thclass['modified'] = '';\r
+$thclass['dimensions'] = ''; \r
+$thclass[$sortbynow] = ' class="'.$sorttypenow.'"';\r
+\r
+// Initalise alert array\r
+$notify = array(\r
+ 'type' => array(),\r
+ 'message' => array()\r
+);\r
+$newthumbqty = 0;\r
+\r
+// read folder contents if folder exists\r
+if(file_exists($tinybrowser['docroot'].$browsepath))\r
+ {\r
+ // Read directory contents and populate $file array\r
+ $dh = opendir($tinybrowser['docroot'].$browsepath);\r
+ $file = array();\r
+ while (($filename = readdir($dh)) !== false)\r
+ {\r
+ // get file extension\r
+ $nameparts = explode('.',$filename);\r
+ $ext = end($nameparts);\r
+\r
+ // filter directories and prohibited file types\r
+ if($filename != '.' && $filename != '..' && !is_dir($tinybrowser['docroot'].$browsepath.$filename) && !in_array($ext, $tinybrowser['prohibited']) && ($typenow == 'file' || strpos(strtolower($tinybrowser['filetype'][$typenow]),strtolower($ext))))\r
+ {\r
+ // search file name if search term entered\r
+ if($findnow) $exists = strpos(strtolower($filename),strtolower($findnow));\r
+ \r
+ // assign file details to array, for all files or those that match search\r
+ if(!$findnow || ($findnow && $exists !== false))\r
+ {\r
+ $file['name'][] = $filename;\r
+ $file['sortname'][] = strtolower($filename);\r
+ $file['modified'][] = filemtime($tinybrowser['docroot'].$browsepath.$filename);\r
+ $file['size'][] = filesize($tinybrowser['docroot'].$browsepath.$filename);\r
+ \r
+ // image specific info or general\r
+ if($typenow=='image' && $imginfo = getimagesize($tinybrowser['docroot'].$browsepath.$filename))\r
+ {\r
+ $file['width'][] = $imginfo[0];\r
+ $file['height'][] = $imginfo[1];\r
+ $file['dimensions'][] = $imginfo[0] + $imginfo[1];\r
+ $file['type'][] = $imginfo['mime'];\r
+ \r
+ // Check a thumbnail exists\r
+ if(!file_exists($tinybrowser['docroot'].$browsepath.'_thumbs/')) createfolder($tinybrowser['docroot'].$browsepath.'_thumbs/',$tinybrowser['unixpermissions']);\r
+ $thumbimg = $tinybrowser['docroot'].$browsepath.'_thumbs/_'.$filename;\r
+ if (!file_exists($thumbimg))\r
+ {\r
+ $nothumbimg = $tinybrowser['docroot'].$browsepath.$filename;\r
+ $mime = getimagesize($nothumbimg);\r
+ $im = convert_image($nothumbimg,$mime['mime']);\r
+ resizeimage($im,$tinybrowser['thumbsize'],$tinybrowser['thumbsize'],$thumbimg,$tinybrowser['thumbquality'],$mime['mime']);\r
+ imagedestroy($im);\r
+ $newthumbqty++;\r
+ }\r
+ }\r
+ else \r
+ {\r
+ $file['width'][] = 'N/A';\r
+ $file['height'][] = 'N/A';\r
+ $file['dimensions'][] = 'N/A';\r
+ $file['type'][] = returnMIMEType($filename);\r
+ }\r
+ } \r
+ }\r
+ }\r
+ closedir($dh);\r
+ }\r
+// create file upload folder\r
+else\r
+ {\r
+ $success = createfolder($tinybrowser['docroot'].$browsepath,$tinybrowser['unixpermissions']);\r
+ if($success)\r
+ {\r
+ if($typenow=='image') createfolder($tinybrowser['docroot'].$browsepath.'_thumbs/',$tinybrowser['unixpermissions']);\r
+ $notify['type'][]='success';\r
+ $notify['message'][]=sprintf(TB_MSGMKDIR, $browsepath);\r
+ }\r
+ else\r
+ {\r
+ $notify['type'][]='error';\r
+ $notify['message'][]=sprintf(TB_MSGMKDIRFAIL, $browsepath);\r
+ }\r
+ }\r
+ \r
+// Assign directory structure to array\r
+$browsedirs=array();\r
+dirtree($browsedirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);\r
+ \r
+// generate alert if new thumbnails created\r
+if($newthumbqty>0)\r
+ {\r
+ $notify['type'][]='info';\r
+ $notify['message'][]=sprintf(TB_MSGNEWTHUMBS, $newthumbqty);\r
+ }\r
+ \r
+\r
+// determine sort order\r
+$sortorder = ($sorttypenow == 'asc' ? SORT_ASC : SORT_DESC);\r
+$num_of_files = (isset($file['name']) ? count($file['name']) : 0);\r
+\r
+if($num_of_files>0)\r
+ {\r
+ // sort files by selected order\r
+ sortfileorder($sortbynow,$sortorder,$file);\r
+ }\r
+\r
+// determine pagination\r
+if($tinybrowser['pagination']>0)\r
+ {\r
+ $showpage_start = ($showpagenow ? ($_REQUEST['showpage']*$tinybrowser['pagination'])-$tinybrowser['pagination'] : 0);\r
+ $showpage_end = $showpage_start+$tinybrowser['pagination'];\r
+ if($showpage_end>$num_of_files) $showpage_end = $num_of_files;\r
+ }\r
+else\r
+ {\r
+ $showpage_start = 0;\r
+ $showpage_end = $num_of_files;\r
+ }\r
+?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+<title>TinyBrowser :: <?php echo TB_BROWSE; ?></title>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<meta http-equiv="Pragma" content="no-cache" />\r
+<?php\r
+if(!$standalone && $tinybrowser['integration']=='tinymce')\r
+ {\r
+ ?><script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <link rel="stylesheet" type="text/css" media="all" href="<?php echo $tinybrowser['tinymcecss']; ?>" /><?php\r
+ }\r
+else\r
+ {\r
+ ?><link rel="stylesheet" type="text/css" media="all" href="css/stylefull_tinybrowser.css" /><?php \r
+ }\r
+?>\r
+<link rel="stylesheet" type="text/css" media="all" href="css/style_tinybrowser.css.php" />\r
+<script language="javascript" type="text/javascript" src="js/tinybrowser.js.php?<?php echo substr($passfeid,1); ?>"></script>\r
+</head>\r
+<body<?php echo $rowhlightinit; ?>>\r
+<?php\r
+if(count($notify['type'])>0) alert($notify);\r
+form_open('foldertab',false,'tinybrowser.php','?type='.$typenow.$passviewtype.$passsortby.$passfeid);\r
+?>\r
+<div class="tabs">\r
+<ul>\r
+<li id="browse_tab" class="current"><span><a href="tinybrowser.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_BROWSE; ?></a></span></li><?php\r
+if($tinybrowser['allowupload']) \r
+ {\r
+ ?><li id="upload_tab"><span><a href="upload.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_UPLOAD; ?></a></span></li><?php\r
+ }\r
+if($tinybrowser['allowedit'] || $tinybrowser['allowdelete'])\r
+ {\r
+ ?><li id="edit_tab"><span><a href="edit.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_EDIT; ?></a></span></li><?php\r
+ }\r
+if($tinybrowser['allowfolders'])\r
+ {\r
+ ?><li id="folders_tab"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li><?php\r
+ }\r
+// Display folder select, if multiple exist\r
+if(count($browsedirs)>1)\r
+ {\r
+ ?><li id="folder_tab" class="right"><span><?php\r
+ form_select($browsedirs,'folder',TB_FOLDERCURR,urlencode($foldernow),true);\r
+ ?></span></li><?php\r
+ } \r
+?>\r
+</ul>\r
+</div>\r
+</form>\r
+<div class="panel_wrapper">\r
+<div id="general_panel" class="panel currentmod">\r
+<fieldset>\r
+<legend><?php echo TB_BROWSEFILES; ?></legend>\r
+<?php\r
+form_open('browse','custom','tinybrowser.php','?type='.$typenow.$passfolder.$passfeid);\r
+?>\r
+<div class="pushleft">\r
+<?php\r
+\r
+// Offer view type if file type is image\r
+if($typenow=='image')\r
+ {\r
+ $select = array(\r
+ array('thumb',TB_THUMBS),\r
+ array('detail',TB_DETAILS)\r
+ );\r
+ form_select($select,'viewtype',TB_VIEW,$viewtypenow,true);\r
+ }\r
+ \r
+// Show page select if pagination is set\r
+if($tinybrowser['pagination']>0)\r
+ {\r
+ $pagelimit = ceil($num_of_files/$tinybrowser['pagination'])+1;\r
+ $page = array();\r
+ for($i=1;$i<$pagelimit;$i++)\r
+ {\r
+ $page[] = array($i,TB_PAGE.' '.$i);\r
+ }\r
+ if($i>2) form_select($page,'showpage',TB_SHOW,$showpagenow,true);\r
+ }\r
+?></div><div class="pushright"><?php\r
+\r
+form_hidden_input('sortby',$sortbynow);\r
+form_hidden_input('sorttype',$sorttypenow);\r
+form_text_input('find',false,$findnow,25,50);\r
+form_submit_button('search',TB_SEARCH,'');\r
+\r
+?></div>\r
+<?php\r
+\r
+// if image show dimensions header\r
+if($typenow=='image')\r
+ {\r
+ $imagehead = '<th><a href="?type='.$typenow.$passfolder.$passfeid.$sortbyget['dimensions'].'"'.$thclass['dimensions'].'>'.TB_DIMENSIONS.'</a></th>';\r
+ }\r
+else $imagehead = '';\r
+\r
+echo '<div class="tabularwrapper"><table class="browse">'\r
+ .'<tr><th><a href="?type='.$typenow.$passfolder.$passfeid.$sortbyget['name'].'"'.$thclass['name'].'>'.TB_FILENAME.'</a></th>'\r
+ .'<th><a href="?type='.$typenow.$passfolder.$passfeid.$sortbyget['size'].'"'.$thclass['size'].'>'.TB_SIZE.'</a></th>'\r
+ .$imagehead\r
+ .'<th><a href="?type='.$typenow.$passfolder.$passfeid.$sortbyget['type'].'"'.$thclass['type'].'>'.TB_TYPE.'</th>'\r
+ .'<th><a href="?type='.$typenow.$passfolder.$passfeid.$sortbyget['modified'].'"'.$thclass['modified'].'>'.TB_DATE.'</th></tr>';\r
+\r
+// show image thumbnails, unless detail view is selected\r
+if($typenow=='image' && $viewtypenow != 'detail')\r
+ {\r
+ echo '</table></div>';\r
+\r
+ for($i=$showpage_start;$i<$showpage_end;$i++)\r
+ {\r
+ echo '<div class="img-browser"><a href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.TB_FILENAME.': '.$file['name'][$i]\r
+ .' '.TB_DIMENSIONS.': '.$file['width'][$i].' x '.$file['height'][$i]\r
+ .' '.TB_DATE.': '.date($tinybrowser['dateformat'],$file['modified'][$i])\r
+ .' '.TB_TYPE.': '.$file['type'][$i]\r
+ .' '.TB_SIZE.': '.bytestostring($file['size'][$i],1)\r
+ .'"><img src="'.$thumbpath.'_thumbs/_'.$file['name'][$i]\r
+ .'" /><div class="filename">'.$file['name'][$i].'</div></a></div>';\r
+ }\r
+ }\r
+else\r
+ {\r
+ for($i=$showpage_start;$i<$showpage_end;$i++)\r
+ {\r
+ $alt = (IsOdd($i) ? 'r1' : 'r0');\r
+ echo '<tr class="'.$alt.'">';\r
+ if($typenow=='image') echo '<td><a class="imghover" href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.$file['name'][$i].'"><img src="'.$thumbpath.'_thumbs/_'.$file['name'][$i].'" alt="" />'.truncate_text($file['name'][$i],30).'</a></td>';\r
+ else echo '<td><a href="#" onclick="selectURL(\''.$linkpath.$file['name'][$i].'\');" title="'.$file['name'][$i].'">'.truncate_text($file['name'][$i],30).'</a></td>';\r
+ echo '<td>'.bytestostring($file['size'][$i],1).'</td>';\r
+ if($typenow=='image') echo '<td>'.$file['width'][$i].' x '.$file['height'][$i].'</td>'; \r
+ echo '<td>'.$file['type'][$i].'</td>'\r
+ .'<td>'.date($tinybrowser['dateformat'],$file['modified'][$i]).'</td></tr>'."\n";\r
+ }\r
+ echo '</table></div>';\r
+ }\r
+?>\r
+</fieldset></div></div>\r
+<form name="passform"><input name = "fileurl" type="hidden" value= "" /></form>\r
+</body>\r
+</html>\r
--- /dev/null
+<?php
+require_once('config_tinybrowser.php');
+// Set language
+if(isset($tinybrowser['language']) && file_exists('langs/'.$tinybrowser['language'].'.php'))
+ {
+ require_once('langs/'.$tinybrowser['language'].'.php');
+ }
+else
+ {
+ require_once('langs/en.php'); // Falls back to English
+ }
+require_once('fns_tinybrowser.php');
+
+// Check session, if it exists
+if(session_id() != '')
+ {
+ if(!isset($_SESSION[$tinybrowser['sessioncheck']]))
+ {
+ echo TB_DENIED;
+ exit;
+ }
+ }
+
+if(!$tinybrowser['allowupload'])
+ {
+ echo TB_UPDENIED;
+ exit;
+ }
+
+// Assign get variables
+$validtypes = array('image','media','file');
+$typenow = ((isset($_GET['type']) && in_array($_GET['type'],$validtypes)) ? $_GET['type'] : 'image');
+$foldernow = str_replace(array('../','..\\','./','.\\'),'',($tinybrowser['allowfolders'] && isset($_REQUEST['folder']) ? urldecode($_REQUEST['folder']) : ''));
+$passfolder = '&folder='.urlencode($foldernow);
+$passfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? '&feid='.$_GET['feid'] : '');
+$passupfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? $_GET['feid'] : '');
+
+// Assign upload path
+$uploadpath = urlencode($tinybrowser['path'][$typenow].$foldernow);
+
+// Assign directory structure to array
+$uploaddirs=array();
+dirtree($uploaddirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);
+
+// determine file dialog file types
+switch ($_GET['type'])
+ {
+ case 'image':
+ $filestr = TB_TYPEIMG;
+ break;
+ case 'media':
+ $filestr = TB_TYPEMEDIA;
+ break;
+ case 'file':
+ $filestr = TB_TYPEFILE;
+ break;
+ }
+$fileexts = str_replace(",",";",$tinybrowser['filetype'][$_GET['type']]);
+$filelist = $filestr.' ('.$tinybrowser['filetype'][$_GET['type']].')';
+
+// Initalise alert array
+$notify = array(
+ 'type' => array(),
+ 'message' => array()
+);
+$goodqty = (isset($_GET['goodfiles']) ? $_GET['goodfiles'] : 0);
+$badqty = (isset($_GET['badfiles']) ? $_GET['badfiles'] : 0);
+$dupqty = (isset($_GET['dupfiles']) ? $_GET['dupfiles'] : 0);
+
+if($goodqty>0)
+ {
+ $notify['type'][]='success';
+ $notify['message'][]=sprintf(TB_MSGUPGOOD, $goodqty);
+ }
+if($badqty>0)
+ {
+ $notify['type'][]='failure';
+ $notify['message'][]=sprintf(TB_MSGUPBAD, $badqty);
+ }
+if($dupqty>0)
+ {
+ $notify['type'][]='failure';
+ $notify['message'][]=sprintf(TB_MSGUPDUP, $dupqty);
+ }
+if(isset($_GET['permerror']))
+ {
+ $notify['type'][]='failure';
+ $notify['message'][]=sprintf(TB_MSGUPFAIL, $tinybrowser['docroot'].$tinybrowser['path'][$typenow]);
+ }
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>TinyBrowser :: <?php echo TB_UPLOAD; ?></title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<meta http-equiv="Pragma" content="no-cache" />
+<?php
+if($passfeid == '' && $tinybrowser['integration']=='tinymce')
+ {
+ ?><link rel="stylesheet" type="text/css" media="all" href="<?php echo $tinybrowser['tinymcecss']; ?>" /><?php
+ }
+else
+ {
+ ?><link rel="stylesheet" type="text/css" media="all" href="css/stylefull_tinybrowser.css" /><?php
+ }
+?>
+<link rel="stylesheet" type="text/css" media="all" href="css/style_tinybrowser.css.php" />
+<script type="text/javascript" src="js/swfobject.js"></script>
+<script type="text/javascript">
+function uploadComplete(url) {
+document.location = url;
+}
+</script>
+</head>
+<body onload='
+ var so = new SWFObject("flexupload.swf", "mymovie", "100%", "340", "9", "#ffffff");
+ so.addVariable("folder", "<?php echo $uploadpath; ?>");
+ so.addVariable("uptype", "<?php echo $typenow; ?>");
+ so.addVariable("destid", "<?php echo $passupfeid; ?>");
+ so.addVariable("maxsize", "<?php echo $tinybrowser['maxsize'][$_GET['type']]; ?>");
+ so.addVariable("sessid", "<?php echo session_id(); ?>");
+ so.addVariable("obfus", "<?php echo md5($_SERVER['DOCUMENT_ROOT'].$tinybrowser['obfuscate']); ?>");
+ so.addVariable("filenames", "<?php echo $filelist; ?>");
+ so.addVariable("extensions", "<?php echo $fileexts; ?>");
+ so.addVariable("filenamelbl", "<?php echo TB_FILENAME; ?>");
+ so.addVariable("sizelbl", "<?php echo TB_SIZE; ?>");
+ so.addVariable("typelbl", "<?php echo TB_TYPE; ?>");
+ so.addVariable("progresslbl", "<?php echo TB_PROGRESS; ?>");
+ so.addVariable("browselbl", "<?php echo TB_BROWSE; ?>");
+ so.addVariable("removelbl", "<?php echo TB_REMOVE; ?>");
+ so.addVariable("uploadlbl", "<?php echo TB_UPLOAD; ?>");
+ so.addVariable("uplimitmsg", "<?php echo TB_MSGMAXSIZE; ?>");
+ so.addVariable("uplimitlbl", "<?php echo TB_TTLMAXSIZE; ?>");
+ so.addVariable("uplimitbyte", "<?php echo TB_BYTES; ?>");
+ so.addParam("allowScriptAccess", "always");
+ so.addParam("type", "application/x-shockwave-flash");
+ so.write("flashcontent");'>
+<?php
+if(count($notify['type'])>0) alert($notify);
+form_open('foldertab',false,'upload.php','?type='.$typenow.$passfeid);
+?>
+<div class="tabs">
+<ul>
+<li id="browse_tab"><span><a href="tinybrowser.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_BROWSE; ?></a></span></li>
+<li id="upload_tab" class="current"><span><a href="upload.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_UPLOAD; ?></a></span></li>
+<?php
+if($tinybrowser['allowedit'] || $tinybrowser['allowdelete'])
+ {
+ ?><li id="edit_tab"><span><a href="edit.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_EDIT; ?></a></span></li>
+ <?php
+ }
+if($tinybrowser['allowfolders'])
+ {
+ ?><li id="folders_tab"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li><?php
+ }
+// Display folder select, if multiple exist
+if(count($uploaddirs)>1)
+ {
+ ?><li id="folder_tab" class="right"><span><?php
+ form_select($uploaddirs,'folder',TB_FOLDERCURR,urlencode($foldernow),true);
+ ?></span></li><?php
+ }
+?>
+</ul>
+</div>
+</form>
+<div class="panel_wrapper">
+<div id="general_panel" class="panel currentmod">
+<fieldset>
+<legend><?php echo TB_UPLOADFILES; ?></legend>
+<?php
+
+?>
+ <div id="flashcontent"></div>
+</fieldset></div></div>
+</body>
+</html>
--- /dev/null
+<?php\r
+require_once('config_tinybrowser.php');\r
+require_once('fns_tinybrowser.php');\r
+\r
+// Check session, if it exists\r
+if(session_id() != '')\r
+ {\r
+ if(!isset($_SESSION[$tinybrowser['sessioncheck']])) { echo 'Error!'; exit; }\r
+ }\r
+ \r
+// Check hash is correct (workaround for Flash session bug, to stop external form posting)\r
+if($_GET['obfuscate'] != md5($_SERVER['DOCUMENT_ROOT'].$tinybrowser['obfuscate'])) { echo 'Error!'; exit; } \r
+\r
+// Check and assign get variables\r
+if(isset($_GET['type'])) { $typenow = $_GET['type']; } else { echo 'Error!'; exit; } \r
+if(isset($_GET['folder'])) { $dest_folder = urldecode($_GET['folder']); } else { echo 'Error!'; exit; } \r
+\r
+// Check file extension isn't prohibited\r
+$nameparts = explode('.',$_FILES['Filedata']['name']);\r
+$ext = end($nameparts);\r
+\r
+if(!validateExtension($ext, $tinybrowser['prohibited'])) { echo 'Error!'; exit; } \r
+\r
+// Check file data\r
+if ($_FILES['Filedata']['tmp_name'] && $_FILES['Filedata']['name'])\r
+ { \r
+ $source_file = $_FILES['Filedata']['tmp_name'];\r
+ $file_name = stripslashes($_FILES['Filedata']['name']);\r
+ if($tinybrowser['cleanfilename']) $file_name = clean_filename($file_name);\r
+ if(is_dir($tinybrowser['docroot'].$dest_folder))\r
+ {\r
+ $success = copy($source_file,$tinybrowser['docroot'].$dest_folder.'/'.$file_name.'_');\r
+ }\r
+ if($success)\r
+ {\r
+ header('HTTP/1.1 200 OK'); // if this doesn't work for you, try header('HTTP/1.1 201 Created');\r
+ ?><html><head><title>File Upload Success</title></head><body>File Upload Success</body></html><?php\r
+ }\r
+ } \r
+?>\r
--- /dev/null
+<?php\r
+require_once('config_tinybrowser.php');\r
+require_once('fns_tinybrowser.php');\r
+\r
+// delay script if set\r
+if($tinybrowser['delayprocess']>0) sleep($tinybrowser['delayprocess']);\r
+\r
+// Initialise files array and error vars\r
+$files = array();\r
+$good = 0;\r
+$bad = 0;\r
+$dup = 0;\r
+$total = (isset($_GET['filetotal']) ? $_GET['filetotal'] : 0);\r
+\r
+\r
+// Assign get variables\r
+$folder = $tinybrowser['docroot'].urldecode($_GET['folder']);\r
+$foldernow = urlencode(str_replace($tinybrowser['path'][$_GET['type']],'',urldecode($_GET['folder'])));\r
+$passfeid = (isset($_GET['feid']) ? '&feid='.$_GET['feid'] : '');\r
+\r
+if ($handle = opendir($folder))\r
+ {\r
+ while (false !== ($file = readdir($handle)))\r
+ {\r
+ if ($file != "." && $file != ".." && substr($file,-1)=='_')\r
+ {\r
+ //-- File Naming\r
+ $tmp_filename = $folder.$file;\r
+ $dest_filename = $folder.rtrim($file,'_');\r
+ \r
+ //-- Duplicate Files\r
+ if(file_exists($dest_filename)) { unlink($tmp_filename); $dup++; continue; }\r
+\r
+ //-- Bad extensions\r
+ $nameparts = explode('.',$dest_filename);\r
+ $ext = end($nameparts);\r
+ \r
+ if(!validateExtension($ext, $tinybrowser['prohibited'])) { unlink($tmp_filename); continue; }\r
+ \r
+ //-- Rename temp file to dest file\r
+ rename($tmp_filename, $dest_filename);\r
+ $good++;\r
+ \r
+ //-- if image, perform additional processing\r
+ if($_GET['type']=='image')\r
+ {\r
+ //-- Good mime-types\r
+ $imginfo = getimagesize($dest_filename);\r
+ if($imginfo === false) { unlink($dest_filename); continue; }\r
+ $mime = $imginfo['mime'];\r
+\r
+ // resize image to maximum height and width, if set\r
+ if($tinybrowser['imageresize']['width'] > 0 || $tinybrowser['imageresize']['height'] > 0)\r
+ {\r
+ // assign new width and height values, only if they are less than existing image size\r
+ $widthnew = ($tinybrowser['imageresize']['width'] > 0 && $tinybrowser['imageresize']['width'] < $imginfo[0] ? $tinybrowser['imageresize']['width'] : $imginfo[0]);\r
+ $heightnew = ($tinybrowser['imageresize']['height'] > 0 && $tinybrowser['imageresize']['height'] < $imginfo[1] ? $tinybrowser['imageresize']['height'] : $imginfo[1]);\r
+\r
+ // only resize if width or height values are different\r
+ if($widthnew != $imginfo[0] || $heightnew != $imginfo[1])\r
+ {\r
+ $im = convert_image($dest_filename,$mime);\r
+ resizeimage($im,$widthnew,$heightnew,$dest_filename,$tinybrowser['imagequality'],$mime);\r
+ imagedestroy($im);\r
+ }\r
+ }\r
+\r
+ // generate thumbnail\r
+ $thumbimg = $folder.'_thumbs/_'.rtrim($file,'_');\r
+ if (!file_exists($thumbimg))\r
+ {\r
+ $im = convert_image($dest_filename,$mime);\r
+ resizeimage ($im,$tinybrowser['thumbsize'],$tinybrowser['thumbsize'],$thumbimg,$tinybrowser['thumbquality'],$mime);\r
+ imagedestroy ($im);\r
+ }\r
+ }\r
+\r
+ }\r
+ }\r
+ closedir($handle);\r
+ }\r
+$bad = $total-($good+$dup);\r
+\r
+// Check for problem during upload\r
+if($total>0 && $bad==$total) Header('Location: ./upload.php?type='.$_GET['type'].$passfeid.'&permerror=1&total='.$total);\r
+else Header('Location: ./upload.php?type='.$_GET['type'].$passfeid.'&folder='.$foldernow.'&badfiles='.$bad.'&goodfiles='.$good.'&dupfiles='.$dup);\r
+?>\r
+\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+ <head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+ <meta http-equiv="Pragma" content="no-cache" />\r
+ <title>TinyBrowser :: Process Upload</title>\r
+ </head>\r
+ <body>\r
+ <p>Sorry, there was an error processing file uploads.</p>\r
+ </body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g<a.length;g++){l=a[g].nodeValue;l=l.replace(/(\u00a0)/g,'<span _mce_bogus="1" class="mceItemHidden mceItemNbsp">$1</span>');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.VisualChars', {\r
+ init : function(ed, url) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+\r
+ // Register commands\r
+ ed.addCommand('mceVisualChars', t._toggleVisualChars, t);\r
+\r
+ // Register buttons\r
+ ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'});\r
+\r
+ ed.onBeforeGetContent.add(function(ed, o) {\r
+ if (t.state && o.format != 'raw' && !o.draft) {\r
+ t.state = true;\r
+ t._toggleVisualChars(false);\r
+ }\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Visual characters',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _toggleVisualChars : function(bookmark) {\r
+ var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm;\r
+\r
+ t.state = !t.state;\r
+ ed.controlManager.setActive('visualchars', t.state);\r
+\r
+ if (bookmark)\r
+ bm = s.getBookmark();\r
+\r
+ if (t.state) {\r
+ nl = [];\r
+ tinymce.walk(b, function(n) {\r
+ if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1)\r
+ nl.push(n);\r
+ }, 'childNodes');\r
+\r
+ for (i = 0; i < nl.length; i++) {\r
+ nv = nl[i].nodeValue;\r
+ nv = nv.replace(/(\u00a0)/g, '<span _mce_bogus="1" class="mceItemHidden mceItemNbsp">$1</span>');\r
+\r
+ div = ed.dom.create('div', null, nv);\r
+ while (node = div.lastChild)\r
+ ed.dom.insertAfter(node, nl[i]);\r
+\r
+ ed.dom.remove(nl[i]);\r
+ }\r
+ } else {\r
+ nl = ed.dom.select('span.mceItemNbsp', b);\r
+\r
+ for (i = nl.length - 1; i >= 0; i--)\r
+ ed.dom.remove(nl[i], 1);\r
+ }\r
+\r
+ s.moveToBookmark(bm);\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars);\r
+})();
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.WordCount', {\r
+ block : 0,\r
+ id : null,\r
+ countre : null,\r
+ cleanre : null,\r
+\r
+ init : function(ed, url) {\r
+ var t = this, last = 0;\r
+\r
+ t.countre = ed.getParam('wordcount_countregex', /\S\s+/g);\r
+ t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\\/-]*/g);\r
+ t.id = ed.id + '-word-count';\r
+\r
+ ed.onPostRender.add(function(ed, cm) {\r
+ var row, id;\r
+\r
+ // Add it to the specified id or the theme advanced path\r
+ id = ed.getParam('wordcount_target_id');\r
+ if (!id) {\r
+ row = tinymce.DOM.get(ed.id + '_path_row');\r
+\r
+ if (row)\r
+ tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>');\r
+ } else\r
+ tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>');\r
+ });\r
+\r
+ ed.onInit.add(function(ed) {\r
+ ed.selection.onSetContent.add(function() {\r
+ t._count(ed);\r
+ });\r
+\r
+ t._count(ed);\r
+ });\r
+\r
+ ed.onSetContent.add(function(ed) {\r
+ t._count(ed);\r
+ });\r
+\r
+ ed.onKeyUp.add(function(ed, e) {\r
+ if (e.keyCode == last)\r
+ return;\r
+\r
+ if (13 == e.keyCode || 8 == last || 46 == last)\r
+ t._count(ed);\r
+\r
+ last = e.keyCode;\r
+ });\r
+ },\r
+\r
+ _count : function(ed) {\r
+ var t = this, tc = 0;\r
+\r
+ // Keep multiple calls from happening at the same time\r
+ if (t.block)\r
+ return;\r
+\r
+ t.block = 1;\r
+\r
+ setTimeout(function() {\r
+ var tx = ed.getContent({format : 'raw'});\r
+\r
+ if (tx) {\r
+ tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars\r
+ tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation\r
+ tx.replace(t.countre, function() {tc++;}); // count the words\r
+ }\r
+\r
+ tinymce.DOM.setHTML(t.id, tc.toString());\r
+\r
+ setTimeout(function() {t.block = 0;}, 2000);\r
+ }, 1);\r
+ },\r
+\r
+ getInfo: function() {\r
+ return {\r
+ longname : 'Word Count plugin',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);\r
+})();\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#xhtmlxtras_dlg.title_abbr_element}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/element_common.js"></script>\r
+ <script type="text/javascript" src="js/abbr.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertAbbr();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+ <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+ <td>\r
+ <select id="class" name="class" class="field mceEditableSelect">\r
+ <option value="">{#not_set}</option> \r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+ <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+ <td>\r
+ <select id="dir" name="dir" class="field"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" class="field" />\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onblur">onblur</label>:</td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onclick">onclick</label>:</td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#xhtmlxtras_dlg.title_acronym_element}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/element_common.js"></script>\r
+ <script type="text/javascript" src="js/acronym.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertAcronym();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+ <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+ <td>\r
+ <select id="class" name="class" class="field mceEditableSelect">\r
+ <option value="">{#not_set}</option> \r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+ <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+ <td>\r
+ <select id="dir" name="dir" class="field"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" class="field" />\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onblur">onblur</label>:</td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onclick">onclick</label>:</td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#xhtmlxtras_dlg.attribs_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="js/attributes.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/attributes.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertAction();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li>\r
+ <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+ <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+ <td><input id="id" name="id" type="text" value="" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td><label id="classlabel" for="classlist">{#class_name}</label></td>\r
+ <td>\r
+ <select id="classlist" name="classlist" class="mceEditableSelect">\r
+ <option value="" selected="selected">{#not_set}</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+ <td><input id="style" name="style" type="text" value="" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+ <td>\r
+ <select id="dir" name="dir"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option> \r
+ <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" />\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td>\r
+ <td><input type="text" id="tabindex" name="tabindex" value="" /></td>\r
+ </tr>\r
+\r
+ <tr>\r
+ <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td>\r
+ <td><input type="text" id="accesskey" name="accesskey" value="" /></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onblur">onblur</label>:</td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onclick">onclick</label>:</td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#xhtmlxtras_dlg.title_cite_element}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/element_common.js"></script>\r
+ <script type="text/javascript" src="js/cite.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="insertCite();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+ <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+ <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+ <td>\r
+ <select id="class" name="class" class="field mceEditableSelect">\r
+ <option value="">{#not_set}</option> \r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+ <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+ <td>\r
+ <select id="dir" name="dir" class="field"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" class="field" />\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onblur">onblur</label>:</td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onclick">onclick</label>:</td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+.panel_wrapper div.current {\r
+ height: 290px;\r
+}\r
+\r
+#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {\r
+ width: 200px;\r
+}\r
+\r
+#events_panel input {\r
+ width: 200px;\r
+}\r
--- /dev/null
+input.field, select.field {width:200px;}\r
+input.picker {width:179px; margin-left: 5px;}\r
+input.disabled {border-color:#F2F2F2;}\r
+img.picker {vertical-align:text-bottom; cursor:pointer;}\r
+h1 {padding: 0 0 5px 0;}\r
+.panel_wrapper div.current {height:160px;}\r
+#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;}\r
+a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;}\r
+#datetime {width:180px;}\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#xhtmlxtras_dlg.title_del_element}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/element_common.js"></script>\r
+ <script type="text/javascript" src="js/del.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body id="xhtmlxtrasins" style="display: none">\r
+<form onsubmit="insertDel();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td>\r
+ <td>\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr> \r
+ <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> \r
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td>\r
+ <td><input id="cite" name="cite" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+ <td><input id="title" name="title" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+ <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+ <td>\r
+ <select id="class" name="class" class="field mceEditableSelect">\r
+ <option value="">{#not_set}</option> \r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+ <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+ <td>\r
+ <select id="dir" name="dir" class="field"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" class="field" />\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onblur">onblur</label>:</td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onclick">onclick</label>:</td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_plugin_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', {\r
+ init : function(ed, url) {\r
+ // Register commands\r
+ ed.addCommand('mceCite', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/cite.htm',\r
+ width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)),\r
+ height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceAcronym', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/acronym.htm',\r
+ width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),\r
+ height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceAbbr', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/abbr.htm',\r
+ width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),\r
+ height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceDel', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/del.htm',\r
+ width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),\r
+ height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceIns', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/ins.htm',\r
+ width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),\r
+ height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)),\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ ed.addCommand('mceAttributes', function() {\r
+ ed.windowManager.open({\r
+ file : url + '/attributes.htm',\r
+ width : 380,\r
+ height : 370,\r
+ inline : 1\r
+ }, {\r
+ plugin_url : url\r
+ });\r
+ });\r
+\r
+ // Register buttons\r
+ ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'});\r
+ ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'});\r
+ ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'});\r
+ ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'});\r
+ ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'});\r
+ ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'});\r
+\r
+ ed.onNodeChange.add(function(ed, cm, n, co) {\r
+ n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS');\r
+\r
+ cm.setDisabled('cite', co);\r
+ cm.setDisabled('acronym', co);\r
+ cm.setDisabled('abbr', co);\r
+ cm.setDisabled('del', co);\r
+ cm.setDisabled('ins', co);\r
+ cm.setDisabled('attribs', n && n.nodeName == 'BODY');\r
+ cm.setActive('cite', 0);\r
+ cm.setActive('acronym', 0);\r
+ cm.setActive('abbr', 0);\r
+ cm.setActive('del', 0);\r
+ cm.setActive('ins', 0);\r
+\r
+ // Activate all\r
+ if (n) {\r
+ do {\r
+ cm.setDisabled(n.nodeName.toLowerCase(), 0);\r
+ cm.setActive(n.nodeName.toLowerCase(), 1);\r
+ } while (n = n.parentNode);\r
+ }\r
+ });\r
+\r
+ ed.onPreInit.add(function() {\r
+ // Fixed IE issue where it can't handle these elements correctly\r
+ ed.dom.create('abbr');\r
+ });\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'XHTML Xtras Plugin',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ };\r
+ }\r
+ });\r
+\r
+ // Register plugin\r
+ tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin);\r
+})();
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#xhtmlxtras_dlg.title_ins_element}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/editable_selects.js"></script>\r
+ <script type="text/javascript" src="js/element_common.js"></script>\r
+ <script type="text/javascript" src="js/ins.js"></script>\r
+ <link rel="stylesheet" type="text/css" href="css/popup.css" />\r
+</head>\r
+<body id="xhtmlxtrasins" style="display: none">\r
+<form onsubmit="insertIns();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li>\r
+ <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> -->\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> \r
+ <td>\r
+ <table border="0" cellspacing="0" cellpadding="0">\r
+ <tr> \r
+ <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> \r
+ <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> \r
+ <td><input id="cite" name="cite" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend>\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> \r
+ <td><input id="title" name="title" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> \r
+ <td><input id="id" name="id" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> \r
+ <td>\r
+ <select id="class" name="class" class="field mceEditableSelect">\r
+ <option value="">{#not_set}</option> \r
+ </select>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> \r
+ <td><input id="style" name="style" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> \r
+ <td>\r
+ <select id="dir" name="dir" class="field"> \r
+ <option value="">{#not_set}</option> \r
+ <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> \r
+ <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> \r
+ </select>\r
+ </td> \r
+ </tr>\r
+ <tr>\r
+ <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> \r
+ <td>\r
+ <input id="lang" name="lang" type="text" value="" class="field" />\r
+ </td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ <div id="events_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend>\r
+\r
+ <table border="0" cellpadding="0" cellspacing="4">\r
+ <tr>\r
+ <td class="label"><label for="onfocus">onfocus</label>:</td> \r
+ <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onblur">onblur</label>:</td> \r
+ <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onclick">onclick</label>:</td> \r
+ <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="ondblclick">ondblclick</label>:</td> \r
+ <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousedown">onmousedown</label>:</td> \r
+ <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseup">onmouseup</label>:</td> \r
+ <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseover">onmouseover</label>:</td> \r
+ <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmousemove">onmousemove</label>:</td> \r
+ <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onmouseout">onmouseout</label>:</td> \r
+ <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeypress">onkeypress</label>:</td> \r
+ <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeydown">onkeydown</label>:</td> \r
+ <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> \r
+ </tr>\r
+\r
+ <tr>\r
+ <td class="label"><label for="onkeyup">onkeyup</label>:</td> \r
+ <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> \r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+/**\r
+ * abbr.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+ SXE.initElementDialog('abbr');\r
+ if (SXE.currentAction == "update") {\r
+ SXE.showRemoveButton();\r
+ }\r
+}\r
+\r
+function insertAbbr() {\r
+ SXE.insertElement('abbr');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function removeAbbr() {\r
+ SXE.removeElement('abbr');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+/**\r
+ * acronym.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+ SXE.initElementDialog('acronym');\r
+ if (SXE.currentAction == "update") {\r
+ SXE.showRemoveButton();\r
+ }\r
+}\r
+\r
+function insertAcronym() {\r
+ SXE.insertElement('acronym');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function removeAcronym() {\r
+ SXE.removeElement('acronym');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+/**\r
+ * attributes.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+ var inst = tinyMCEPopup.editor;\r
+ var dom = inst.dom;\r
+ var elm = inst.selection.getNode();\r
+ var f = document.forms[0];\r
+ var onclick = dom.getAttrib(elm, 'onclick');\r
+\r
+ setFormValue('title', dom.getAttrib(elm, 'title'));\r
+ setFormValue('id', dom.getAttrib(elm, 'id'));\r
+ setFormValue('style', dom.getAttrib(elm, "style"));\r
+ setFormValue('dir', dom.getAttrib(elm, 'dir'));\r
+ setFormValue('lang', dom.getAttrib(elm, 'lang'));\r
+ setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));\r
+ setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));\r
+ setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\r
+ setFormValue('onblur', dom.getAttrib(elm, 'onblur'));\r
+ setFormValue('onclick', onclick);\r
+ setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\r
+ setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\r
+ setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\r
+ setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\r
+ setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\r
+ setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\r
+ setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\r
+ setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\r
+ setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\r
+ className = dom.getAttrib(elm, 'class');\r
+\r
+ addClassesToList('classlist', 'advlink_styles');\r
+ selectByValue(f, 'classlist', className, true);\r
+\r
+ TinyMCE_EditableSelects.init();\r
+}\r
+\r
+function setFormValue(name, value) {\r
+ if(value && document.forms[0].elements[name]){\r
+ document.forms[0].elements[name].value = value;\r
+ }\r
+}\r
+\r
+function insertAction() {\r
+ var inst = tinyMCEPopup.editor;\r
+ var elm = inst.selection.getNode();\r
+\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel"); \r
+ setAllAttribs(elm);\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+ var formObj = document.forms[0];\r
+ var valueElm = formObj.elements[attrib.toLowerCase()];\r
+ var inst = tinyMCEPopup.editor;\r
+ var dom = inst.dom;\r
+\r
+ if (typeof(value) == "undefined" || value == null) {\r
+ value = "";\r
+\r
+ if (valueElm)\r
+ value = valueElm.value;\r
+ }\r
+\r
+ if (value != "") {\r
+ dom.setAttrib(elm, attrib.toLowerCase(), value);\r
+\r
+ if (attrib == "style")\r
+ attrib = "style.cssText";\r
+\r
+ if (attrib.substring(0, 2) == 'on')\r
+ value = 'return true;' + value;\r
+\r
+ if (attrib == "class")\r
+ attrib = "className";\r
+\r
+ elm[attrib]=value;\r
+ } else\r
+ elm.removeAttribute(attrib);\r
+}\r
+\r
+function setAllAttribs(elm) {\r
+ var f = document.forms[0];\r
+\r
+ setAttrib(elm, 'title');\r
+ setAttrib(elm, 'id');\r
+ setAttrib(elm, 'style');\r
+ setAttrib(elm, 'class', getSelectValue(f, 'classlist'));\r
+ setAttrib(elm, 'dir');\r
+ setAttrib(elm, 'lang');\r
+ setAttrib(elm, 'tabindex');\r
+ setAttrib(elm, 'accesskey');\r
+ setAttrib(elm, 'onfocus');\r
+ setAttrib(elm, 'onblur');\r
+ setAttrib(elm, 'onclick');\r
+ setAttrib(elm, 'ondblclick');\r
+ setAttrib(elm, 'onmousedown');\r
+ setAttrib(elm, 'onmouseup');\r
+ setAttrib(elm, 'onmouseover');\r
+ setAttrib(elm, 'onmousemove');\r
+ setAttrib(elm, 'onmouseout');\r
+ setAttrib(elm, 'onkeypress');\r
+ setAttrib(elm, 'onkeydown');\r
+ setAttrib(elm, 'onkeyup');\r
+\r
+ // Refresh in old MSIE\r
+// if (tinyMCE.isMSIE5)\r
+// elm.outerHTML = elm.outerHTML;\r
+}\r
+\r
+function insertAttribute() {\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
+tinyMCEPopup.requireLangPack();\r
--- /dev/null
+/**\r
+ * cite.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+ SXE.initElementDialog('cite');\r
+ if (SXE.currentAction == "update") {\r
+ SXE.showRemoveButton();\r
+ }\r
+}\r
+\r
+function insertCite() {\r
+ SXE.insertElement('cite');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function removeCite() {\r
+ SXE.removeElement('cite');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+/**\r
+ * del.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+ SXE.initElementDialog('del');\r
+ if (SXE.currentAction == "update") {\r
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\r
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\r
+ SXE.showRemoveButton();\r
+ }\r
+}\r
+\r
+function setElementAttribs(elm) {\r
+ setAllCommonAttribs(elm);\r
+ setAttrib(elm, 'datetime');\r
+ setAttrib(elm, 'cite');\r
+}\r
+\r
+function insertDel() {\r
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');\r
+\r
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+ if (elm == null) {\r
+ var s = SXE.inst.selection.getContent();\r
+ if(s.length > 0) {\r
+ insertInlineElement('del');\r
+ var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});\r
+ for (var i=0; i<elementArray.length; i++) {\r
+ var elm = elementArray[i];\r
+ setElementAttribs(elm);\r
+ }\r
+ }\r
+ } else {\r
+ setElementAttribs(elm);\r
+ }\r
+ tinyMCEPopup.editor.nodeChanged();\r
+ tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function insertInlineElement(en) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+ dom.replace(dom.create(en), n, 1);\r
+ });\r
+}\r
+\r
+function removeDel() {\r
+ SXE.removeElement('del');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+/**\r
+ * element_common.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+function initCommonAttributes(elm) {\r
+ var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;\r
+\r
+ // Setup form data for common element attributes\r
+ setFormValue('title', dom.getAttrib(elm, 'title'));\r
+ setFormValue('id', dom.getAttrib(elm, 'id'));\r
+ selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);\r
+ setFormValue('style', dom.getAttrib(elm, 'style'));\r
+ selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));\r
+ setFormValue('lang', dom.getAttrib(elm, 'lang'));\r
+ setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));\r
+ setFormValue('onblur', dom.getAttrib(elm, 'onblur'));\r
+ setFormValue('onclick', dom.getAttrib(elm, 'onclick'));\r
+ setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));\r
+ setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));\r
+ setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));\r
+ setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));\r
+ setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));\r
+ setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));\r
+ setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));\r
+ setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));\r
+ setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));\r
+}\r
+\r
+function setFormValue(name, value) {\r
+ if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;\r
+}\r
+\r
+function insertDateTime(id) {\r
+ document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");\r
+}\r
+\r
+function getDateTime(d, fmt) {\r
+ fmt = fmt.replace("%D", "%m/%d/%y");\r
+ fmt = fmt.replace("%r", "%I:%M:%S %p");\r
+ fmt = fmt.replace("%Y", "" + d.getFullYear());\r
+ fmt = fmt.replace("%y", "" + d.getYear());\r
+ fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));\r
+ fmt = fmt.replace("%d", addZeros(d.getDate(), 2));\r
+ fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));\r
+ fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));\r
+ fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));\r
+ fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));\r
+ fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));\r
+ fmt = fmt.replace("%%", "%");\r
+\r
+ return fmt;\r
+}\r
+\r
+function addZeros(value, len) {\r
+ var i;\r
+\r
+ value = "" + value;\r
+\r
+ if (value.length < len) {\r
+ for (i=0; i<(len-value.length); i++)\r
+ value = "0" + value;\r
+ }\r
+\r
+ return value;\r
+}\r
+\r
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\r
+ if (!form_obj || !form_obj.elements[field_name])\r
+ return;\r
+\r
+ var sel = form_obj.elements[field_name];\r
+\r
+ var found = false;\r
+ for (var i=0; i<sel.options.length; i++) {\r
+ var option = sel.options[i];\r
+\r
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\r
+ option.selected = true;\r
+ found = true;\r
+ } else\r
+ option.selected = false;\r
+ }\r
+\r
+ if (!found && add_custom && value != '') {\r
+ var option = new Option('Value: ' + value, value);\r
+ option.selected = true;\r
+ sel.options[sel.options.length] = option;\r
+ }\r
+\r
+ return found;\r
+}\r
+\r
+function setAttrib(elm, attrib, value) {\r
+ var formObj = document.forms[0];\r
+ var valueElm = formObj.elements[attrib.toLowerCase()];\r
+ tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);\r
+}\r
+\r
+function setAllCommonAttribs(elm) {\r
+ setAttrib(elm, 'title');\r
+ setAttrib(elm, 'id');\r
+ setAttrib(elm, 'class');\r
+ setAttrib(elm, 'style');\r
+ setAttrib(elm, 'dir');\r
+ setAttrib(elm, 'lang');\r
+ /*setAttrib(elm, 'onfocus');\r
+ setAttrib(elm, 'onblur');\r
+ setAttrib(elm, 'onclick');\r
+ setAttrib(elm, 'ondblclick');\r
+ setAttrib(elm, 'onmousedown');\r
+ setAttrib(elm, 'onmouseup');\r
+ setAttrib(elm, 'onmouseover');\r
+ setAttrib(elm, 'onmousemove');\r
+ setAttrib(elm, 'onmouseout');\r
+ setAttrib(elm, 'onkeypress');\r
+ setAttrib(elm, 'onkeydown');\r
+ setAttrib(elm, 'onkeyup');*/\r
+}\r
+\r
+SXE = {\r
+ currentAction : "insert",\r
+ inst : tinyMCEPopup.editor,\r
+ updateElement : null\r
+}\r
+\r
+SXE.focusElement = SXE.inst.selection.getNode();\r
+\r
+SXE.initElementDialog = function(element_name) {\r
+ addClassesToList('class', 'xhtmlxtras_styles');\r
+ TinyMCE_EditableSelects.init();\r
+\r
+ element_name = element_name.toLowerCase();\r
+ var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\r
+ if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {\r
+ SXE.currentAction = "update";\r
+ }\r
+\r
+ if (SXE.currentAction == "update") {\r
+ initCommonAttributes(elm);\r
+ SXE.updateElement = elm;\r
+ }\r
+\r
+ document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); \r
+}\r
+\r
+SXE.insertElement = function(element_name) {\r
+ var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;\r
+\r
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+ if (elm == null) {\r
+ var s = SXE.inst.selection.getContent();\r
+ if(s.length > 0) {\r
+ tagName = element_name;\r
+\r
+ insertInlineElement(element_name);\r
+ var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));\r
+ for (var i=0; i<elementArray.length; i++) {\r
+ var elm = elementArray[i];\r
+\r
+ if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {\r
+ elm.id = '';\r
+ elm.setAttribute('id', '');\r
+ elm.removeAttribute('id');\r
+ elm.removeAttribute('_mce_new');\r
+\r
+ setAllCommonAttribs(elm);\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ setAllCommonAttribs(elm);\r
+ }\r
+ SXE.inst.nodeChanged();\r
+ tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+}\r
+\r
+SXE.removeElement = function(element_name){\r
+ element_name = element_name.toLowerCase();\r
+ elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());\r
+ if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){\r
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+ tinyMCE.execCommand('mceRemoveNode', false, elm);\r
+ SXE.inst.nodeChanged();\r
+ tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+ }\r
+}\r
+\r
+SXE.showRemoveButton = function() {\r
+ document.getElementById("remove").style.display = '';\r
+}\r
+\r
+SXE.containsClass = function(elm,cl) {\r
+ return (elm.className.indexOf(cl) > -1) ? true : false;\r
+}\r
+\r
+SXE.removeClass = function(elm,cl) {\r
+ if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {\r
+ return true;\r
+ }\r
+ var classNames = elm.className.split(" ");\r
+ var newClassNames = "";\r
+ for (var x = 0, cnl = classNames.length; x < cnl; x++) {\r
+ if (classNames[x] != cl) {\r
+ newClassNames += (classNames[x] + " ");\r
+ }\r
+ }\r
+ elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end\r
+}\r
+\r
+SXE.addClass = function(elm,cl) {\r
+ if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;\r
+ return true;\r
+}\r
+\r
+function insertInlineElement(en) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ tinymce.each(dom.select('span,font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+ dom.replace(dom.create(en, {_mce_new : 1}), n, 1);\r
+ });\r
+}\r
--- /dev/null
+/**\r
+ * ins.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function init() {\r
+ SXE.initElementDialog('ins');\r
+ if (SXE.currentAction == "update") {\r
+ setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));\r
+ setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));\r
+ SXE.showRemoveButton();\r
+ }\r
+}\r
+\r
+function setElementAttribs(elm) {\r
+ setAllCommonAttribs(elm);\r
+ setAttrib(elm, 'datetime');\r
+ setAttrib(elm, 'cite');\r
+}\r
+\r
+function insertIns() {\r
+ var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');\r
+ tinyMCEPopup.execCommand('mceBeginUndoLevel');\r
+ if (elm == null) {\r
+ var s = SXE.inst.selection.getContent();\r
+ if(s.length > 0) {\r
+ insertInlineElement('INS');\r
+ var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});\r
+ for (var i=0; i<elementArray.length; i++) {\r
+ var elm = elementArray[i];\r
+ setElementAttribs(elm);\r
+ }\r
+ }\r
+ } else {\r
+ setElementAttribs(elm);\r
+ }\r
+ tinyMCEPopup.editor.nodeChanged();\r
+ tinyMCEPopup.execCommand('mceEndUndoLevel');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function removeIns() {\r
+ SXE.removeElement('ins');\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function insertInlineElement(en) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom;\r
+\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {\r
+ if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')\r
+ dom.replace(dom.create(en), n, 1);\r
+ });\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCE.addI18n('en.xhtmlxtras_dlg',{\r
+attribute_label_title:"Title",\r
+attribute_label_id:"ID",\r
+attribute_label_class:"Class",\r
+attribute_label_style:"Style",\r
+attribute_label_cite:"Cite",\r
+attribute_label_datetime:"Date/Time",\r
+attribute_label_langdir:"Text Direction",\r
+attribute_option_ltr:"Left to right",\r
+attribute_option_rtl:"Right to left",\r
+attribute_label_langcode:"Language",\r
+attribute_label_tabindex:"TabIndex",\r
+attribute_label_accesskey:"AccessKey",\r
+attribute_events_tab:"Events",\r
+attribute_attrib_tab:"Attributes",\r
+general_tab:"General",\r
+attrib_tab:"Attributes",\r
+events_tab:"Events",\r
+fieldset_general_tab:"General Settings",\r
+fieldset_attrib_tab:"Element Attributes",\r
+fieldset_events_tab:"Element Events",\r
+title_ins_element:"Insertion Element",\r
+title_del_element:"Deletion Element",\r
+title_acronym_element:"Acronym Element",\r
+title_abbr_element:"Abbreviation Element",\r
+title_cite_element:"Citation Element",\r
+remove:"Remove",\r
+insert_date:"Insert current date/time",\r
+option_ltr:"Left to right",\r
+option_rtl:"Right to left",\r
+attribs_title:"Insert/Edit Attributes"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.about_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="js/about.js"></script>\r
+</head>\r
+<body id="about" style="display: none">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>\r
+ <li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>\r
+ <li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <h3>{#advanced_dlg.about_title}</h3>\r
+ <p>Version: <span id="version"></span> (<span id="date"></span>)</p>\r
+ <p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>\r
+ by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>\r
+ <p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>\r
+ <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>\r
+\r
+ <div id="buttoncontainer">\r
+ <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>\r
+ <a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a>\r
+ <a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a>\r
+ </div>\r
+ </div>\r
+\r
+ <div id="plugins_panel" class="panel">\r
+ <div id="pluginscontainer">\r
+ <h3>{#advanced_dlg.about_loaded}</h3>\r
+\r
+ <div id="plugintablecontainer">\r
+ </div>\r
+\r
+ <p> </p>\r
+ </div>\r
+ </div>\r
+\r
+ <div id="help_panel" class="panel noscroll" style="overflow: visible;">\r
+ <div id="iframecontainer"></div>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.anchor_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/anchor.js"></script>\r
+</head>\r
+<body style="display: none">\r
+<form onsubmit="AnchorDialog.update();return false;" action="#">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td colspan="2" class="title">{#advanced_dlg.anchor_title}</td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap">{#advanced_dlg.anchor_name}:</td>\r
+ <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td>\r
+ </tr>\r
+ </table>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#update}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.charmap_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/charmap.js"></script>\r
+</head>\r
+<body id="charmap" style="display:none">\r
+<table align="center" border="0" cellspacing="0" cellpadding="2">\r
+ <tr>\r
+ <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td>\r
+ </tr>\r
+ <tr>\r
+ <td id="charmapView" rowspan="2" align="left" valign="top">\r
+ <!-- Chars will be rendered here -->\r
+ </td>\r
+ <td width="100" align="center" valign="top">\r
+ <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px">\r
+ <tr>\r
+ <td id="codeV"> </td>\r
+ </tr>\r
+ <tr>\r
+ <td id="codeN"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td valign="bottom" style="padding-bottom: 3px;">\r
+ <table width="100" align="center" border="0" cellpadding="2" cellspacing="0">\r
+ <tr>\r
+ <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>\r
+ </tr>\r
+ <tr>\r
+ <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center"> </td>\r
+ </tr>\r
+ <tr>\r
+ <td style="font-size: 1px;"> </td>\r
+ </tr>\r
+ <tr>\r
+ <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>\r
+ </tr>\r
+ <tr>\r
+ <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center"> </td>\r
+ </tr>\r
+ </table>\r
+ </td>\r
+ </tr>\r
+</table>\r
+\r
+</body>\r
+</html>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.colorpicker_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="js/color_picker.js"></script>\r
+</head>\r
+<body id="colorpicker" style="display: none">\r
+<form onsubmit="insertAction();return false" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>\r
+ <li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>\r
+ <li id="named_tab"><span><a href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="picker_panel" class="panel current">\r
+ <fieldset>\r
+ <legend>{#advanced_dlg.colorpicker_picker_title}</legend>\r
+ <div id="picker">\r
+ <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />\r
+\r
+ <div id="light">\r
+ <!-- Will be filled with divs -->\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+ </div>\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="rgb_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advanced_dlg.colorpicker_palette_title}</legend>\r
+ <div id="webcolors">\r
+ <!-- Gets filled with web safe colors-->\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+ </fieldset>\r
+ </div>\r
+\r
+ <div id="named_panel" class="panel">\r
+ <fieldset>\r
+ <legend>{#advanced_dlg.colorpicker_named_title}</legend>\r
+ <div id="namedcolors">\r
+ <!-- Gets filled with named colors-->\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+\r
+ <div id="colornamecontainer">\r
+ {#advanced_dlg.colorpicker_name} <span id="colorname"></span>\r
+ </div>\r
+ </fieldset>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#apply}" />\r
+\r
+ <div id="preview"></div>\r
+\r
+ <div id="previewblock">\r
+ <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" />\r
+ </div>\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){i.formatter.remove(p[0])}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=this.settings,m=d.get(j.id+"_tbl"),n=d.get(j.id+"_ifr");i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);d.setStyle(m,"height","");d.setStyle(n,"height",l);if(k.theme_advanced_resize_horizontal){d.setStyle(m,"width","");d.setStyle(n,"width",i);if(i<m.clientWidth){d.setStyle(n,"width",m.clientWidth)}}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:n,ch:E})}}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(r,z,l,x,j){var C=this,i,y=0,B,u,D=C.settings,A,k,w,m,q;e.each(C.stateControls,function(n){z.setActive(n,r.queryCommandState(C.controls[n][1]))});function o(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}z.setActive("visualaid",r.hasVisual);z.setDisabled("undo",!r.undoManager.hasUndo()&&!r.typing);z.setDisabled("redo",!r.undoManager.hasRedo());z.setDisabled("outdent",!r.queryCommandState("Outdent"));i=o("A");if(u=z.get("link")){if(!i||!i.name){u.setDisabled(!i&&x);u.setActive(!!i)}}if(u=z.get("unlink")){u.setDisabled(!i&&x);u.setActive(!!i&&!i.name)}if(u=z.get("anchor")){u.setActive(!!i&&i.name)}i=o("IMG");if(u=z.get("image")){u.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(u=z.get("styleselect")){C._importClasses();m=[];f(u.items,function(n){m.push(n.value)});q=r.formatter.matchAll(m);u.select(q[0])}if(u=z.get("formatselect")){i=o(d.isBlock);if(i){u.select(i.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!A&&p.className){A=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(u=z.get("fontselect")){u.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(u=z.get("fontsizeselect")){if(D.theme_advanced_runtime_fontsize&&!k&&!A){k=r.dom.getStyle(l,"fontSize",true)}u.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===A){return true}})}if(D.theme_advanced_path&&D.theme_advanced_statusbar_location){i=d.get(r.id+"_path")||d.add(r.id+"_path_row","span",{id:r.id+"_path"});d.setHTML(i,"");o(function(E){var p=E.nodeName.toLowerCase(),s,v,t="";if(E.nodeType!=1||E.nodeName==="BR"||(d.hasClass(E,"mceItemHidden")||d.hasClass(E,"mceItemRemoved"))){return}if(B=d.getAttrib(E,"mce_name")){p=B}if(e.isIE&&E.scopeName!=="HTML"){p=E.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(B=d.getAttrib(E,"src")){t+="src: "+B+" "}break;case"a":if(B=d.getAttrib(E,"name")){t+="name: "+B+" ";p+="#"+B}if(B=d.getAttrib(E,"href")){t+="href: "+B+" "}break;case"font":if(B=d.getAttrib(E,"face")){t+="font: "+B+" "}if(B=d.getAttrib(E,"size")){t+="size: "+B+" "}if(B=d.getAttrib(E,"color")){t+="color: "+B+" "}break;case"span":if(B=d.getAttrib(E,"style")){t+="style: "+B+" "}break}if(B=d.getAttrib(E,"id")){t+="id: "+B+" "}if(B=E.className){B=B.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(B){t+="class: "+B+" ";if(d.isBlock(E)||p=="img"||p=="span"){p+="."+B}}}p=p.replace(/(html:)/g,"");p={name:p,node:E,title:t};C.onResolveName.dispatch(C,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(y++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},r.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_template_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;\r
+\r
+ // Tell it to load theme specific language pack(s)\r
+ tinymce.ThemeManager.requireLangPack('advanced');\r
+\r
+ tinymce.create('tinymce.themes.AdvancedTheme', {\r
+ sizes : [8, 10, 12, 14, 18, 24, 36],\r
+\r
+ // Control name lookup, format: title, command\r
+ controls : {\r
+ bold : ['bold_desc', 'Bold'],\r
+ italic : ['italic_desc', 'Italic'],\r
+ underline : ['underline_desc', 'Underline'],\r
+ strikethrough : ['striketrough_desc', 'Strikethrough'],\r
+ justifyleft : ['justifyleft_desc', 'JustifyLeft'],\r
+ justifycenter : ['justifycenter_desc', 'JustifyCenter'],\r
+ justifyright : ['justifyright_desc', 'JustifyRight'],\r
+ justifyfull : ['justifyfull_desc', 'JustifyFull'],\r
+ bullist : ['bullist_desc', 'InsertUnorderedList'],\r
+ numlist : ['numlist_desc', 'InsertOrderedList'],\r
+ outdent : ['outdent_desc', 'Outdent'],\r
+ indent : ['indent_desc', 'Indent'],\r
+ cut : ['cut_desc', 'Cut'],\r
+ copy : ['copy_desc', 'Copy'],\r
+ paste : ['paste_desc', 'Paste'],\r
+ undo : ['undo_desc', 'Undo'],\r
+ redo : ['redo_desc', 'Redo'],\r
+ link : ['link_desc', 'mceLink'],\r
+ unlink : ['unlink_desc', 'unlink'],\r
+ image : ['image_desc', 'mceImage'],\r
+ cleanup : ['cleanup_desc', 'mceCleanup'],\r
+ help : ['help_desc', 'mceHelp'],\r
+ code : ['code_desc', 'mceCodeEditor'],\r
+ hr : ['hr_desc', 'InsertHorizontalRule'],\r
+ removeformat : ['removeformat_desc', 'RemoveFormat'],\r
+ sub : ['sub_desc', 'subscript'],\r
+ sup : ['sup_desc', 'superscript'],\r
+ forecolor : ['forecolor_desc', 'ForeColor'],\r
+ forecolorpicker : ['forecolor_desc', 'mceForeColor'],\r
+ backcolor : ['backcolor_desc', 'HiliteColor'],\r
+ backcolorpicker : ['backcolor_desc', 'mceBackColor'],\r
+ charmap : ['charmap_desc', 'mceCharMap'],\r
+ visualaid : ['visualaid_desc', 'mceToggleVisualAid'],\r
+ anchor : ['anchor_desc', 'mceInsertAnchor'],\r
+ newdocument : ['newdocument_desc', 'mceNewDocument'],\r
+ blockquote : ['blockquote_desc', 'mceBlockQuote']\r
+ },\r
+\r
+ stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],\r
+\r
+ init : function(ed, url) {\r
+ var t = this, s, v, o;\r
+ \r
+ t.editor = ed;\r
+ t.url = url;\r
+ t.onResolveName = new tinymce.util.Dispatcher(this);\r
+\r
+ // Default settings\r
+ t.settings = s = extend({\r
+ theme_advanced_path : true,\r
+ theme_advanced_toolbar_location : 'bottom',\r
+ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",\r
+ theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",\r
+ theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",\r
+ theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",\r
+ theme_advanced_toolbar_align : "center",\r
+ theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",\r
+ theme_advanced_more_colors : 1,\r
+ theme_advanced_row_height : 23,\r
+ theme_advanced_resize_horizontal : 1,\r
+ theme_advanced_resizing_use_cookie : 1,\r
+ theme_advanced_font_sizes : "1,2,3,4,5,6,7",\r
+ readonly : ed.settings.readonly\r
+ }, ed.settings);\r
+\r
+ // Setup default font_size_style_values\r
+ if (!s.font_size_style_values)\r
+ s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";\r
+\r
+ if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {\r
+ s.font_size_style_values = tinymce.explode(s.font_size_style_values);\r
+ s.font_size_classes = tinymce.explode(s.font_size_classes || '');\r
+\r
+ // Parse string value\r
+ o = {};\r
+ ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;\r
+ each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {\r
+ var cl;\r
+\r
+ if (k == v && v >= 1 && v <= 7) {\r
+ k = v + ' (' + t.sizes[v - 1] + 'pt)';\r
+ cl = s.font_size_classes[v - 1];\r
+ v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');\r
+ }\r
+\r
+ if (/^\s*\./.test(v))\r
+ cl = v.replace(/\./g, '');\r
+\r
+ o[k] = cl ? {'class' : cl} : {fontSize : v};\r
+ });\r
+\r
+ s.theme_advanced_font_sizes = o;\r
+ }\r
+\r
+ if ((v = s.theme_advanced_path_location) && v != 'none')\r
+ s.theme_advanced_statusbar_location = s.theme_advanced_path_location;\r
+\r
+ if (s.theme_advanced_statusbar_location == 'none')\r
+ s.theme_advanced_statusbar_location = 0;\r
+\r
+ // Init editor\r
+ ed.onInit.add(function() {\r
+ if (!ed.settings.readonly)\r
+ ed.onNodeChange.add(t._nodeChanged, t);\r
+\r
+ if (ed.settings.content_css !== false)\r
+ ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css"));\r
+ });\r
+\r
+ ed.onSetProgressState.add(function(ed, b, ti) {\r
+ var co, id = ed.id, tb;\r
+\r
+ if (b) {\r
+ t.progressTimer = setTimeout(function() {\r
+ co = ed.getContainer();\r
+ co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);\r
+ tb = DOM.get(ed.id + '_tbl');\r
+\r
+ DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});\r
+ DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});\r
+ }, ti || 0);\r
+ } else {\r
+ DOM.remove(id + '_blocker');\r
+ DOM.remove(id + '_progress');\r
+ clearTimeout(t.progressTimer);\r
+ }\r
+ });\r
+\r
+ DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");\r
+\r
+ if (s.skin_variant)\r
+ DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");\r
+ },\r
+\r
+ createControl : function(n, cf) {\r
+ var cd, c;\r
+\r
+ if (c = cf.createControl(n))\r
+ return c;\r
+\r
+ switch (n) {\r
+ case "styleselect":\r
+ return this._createStyleSelect();\r
+\r
+ case "formatselect":\r
+ return this._createBlockFormats();\r
+\r
+ case "fontselect":\r
+ return this._createFontSelect();\r
+\r
+ case "fontsizeselect":\r
+ return this._createFontSizeSelect();\r
+\r
+ case "forecolor":\r
+ return this._createForeColorMenu();\r
+\r
+ case "backcolor":\r
+ return this._createBackColorMenu();\r
+ }\r
+\r
+ if ((cd = this.controls[n]))\r
+ return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});\r
+ },\r
+\r
+ execCommand : function(cmd, ui, val) {\r
+ var f = this['_' + cmd];\r
+\r
+ if (f) {\r
+ f.call(this, ui, val);\r
+ return true;\r
+ }\r
+\r
+ return false;\r
+ },\r
+\r
+ _importClasses : function(e) {\r
+ var ed = this.editor, ctrl = ed.controlManager.get('styleselect');\r
+\r
+ if (ctrl.getLength() == 0) {\r
+ each(ed.dom.getClasses(), function(o, idx) {\r
+ var name = 'style_' + idx;\r
+\r
+ ed.formatter.register(name, {\r
+ inline : 'span',\r
+ attributes : {'class' : o['class']},\r
+ selector : '*'\r
+ });\r
+\r
+ ctrl.add(o['class'], name);\r
+ });\r
+ }\r
+ },\r
+\r
+ _createStyleSelect : function(n) {\r
+ var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;\r
+\r
+ // Setup style select box\r
+ ctrl = ctrlMan.createListBox('styleselect', {\r
+ title : 'advanced.style_select',\r
+ onselect : function(name) {\r
+ var matches, formatNames = [];\r
+\r
+ each(ctrl.items, function(item) {\r
+ formatNames.push(item.value);\r
+ });\r
+\r
+ ed.focus();\r
+ ed.undoManager.add();\r
+\r
+ // Toggle off the current format\r
+ matches = ed.formatter.matchAll(formatNames);\r
+ if (!name || matches[0] == name)\r
+ ed.formatter.remove(matches[0]);\r
+ else\r
+ ed.formatter.apply(name);\r
+\r
+ ed.undoManager.add();\r
+ ed.nodeChanged();\r
+\r
+ return false; // No auto select\r
+ }\r
+ });\r
+\r
+ // Handle specified format\r
+ ed.onInit.add(function() {\r
+ var counter = 0, formats = ed.getParam('style_formats');\r
+\r
+ if (formats) {\r
+ each(formats, function(fmt) {\r
+ var name, keys = 0;\r
+\r
+ each(fmt, function() {keys++;});\r
+\r
+ if (keys > 1) {\r
+ name = fmt.name = fmt.name || 'style_' + (counter++);\r
+ ed.formatter.register(name, fmt);\r
+ ctrl.add(fmt.title, name);\r
+ } else\r
+ ctrl.add(fmt.title);\r
+ });\r
+ } else {\r
+ each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {\r
+ var name;\r
+\r
+ if (val) {\r
+ name = 'style_' + (counter++);\r
+\r
+ ed.formatter.register(name, {\r
+ inline : 'span',\r
+ classes : val,\r
+ selector : '*'\r
+ });\r
+\r
+ ctrl.add(t.editor.translate(key), name);\r
+ }\r
+ });\r
+ }\r
+ });\r
+\r
+ // Auto import classes if the ctrl box is empty\r
+ if (ctrl.getLength() == 0) {\r
+ ctrl.onPostRender.add(function(ed, n) {\r
+ if (!ctrl.NativeListBox) {\r
+ Event.add(n.id + '_text', 'focus', t._importClasses, t);\r
+ Event.add(n.id + '_text', 'mousedown', t._importClasses, t);\r
+ Event.add(n.id + '_open', 'focus', t._importClasses, t);\r
+ Event.add(n.id + '_open', 'mousedown', t._importClasses, t);\r
+ } else\r
+ Event.add(n.id, 'focus', t._importClasses, t);\r
+ });\r
+ }\r
+\r
+ return ctrl;\r
+ },\r
+\r
+ _createFontSelect : function() {\r
+ var c, t = this, ed = t.editor;\r
+\r
+ c = ed.controlManager.createListBox('fontselect', {\r
+ title : 'advanced.fontdefault',\r
+ onselect : function(v) {\r
+ var cur = c.items[c.selectedIndex];\r
+\r
+ if (!v && cur) {\r
+ ed.execCommand('FontName', false, cur.value);\r
+ return;\r
+ }\r
+\r
+ ed.execCommand('FontName', false, v);\r
+\r
+ // Fake selection, execCommand will fire a nodeChange and update the selection\r
+ c.select(function(sv) {\r
+ return v == sv;\r
+ });\r
+\r
+ return false; // No auto select\r
+ }\r
+ });\r
+\r
+ if (c) {\r
+ each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {\r
+ c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});\r
+ });\r
+ }\r
+\r
+ return c;\r
+ },\r
+\r
+ _createFontSizeSelect : function() {\r
+ var t = this, ed = t.editor, c, i = 0, cl = [];\r
+\r
+ c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {\r
+ var cur = c.items[c.selectedIndex];\r
+\r
+ if (!v && cur) {\r
+ cur = cur.value;\r
+\r
+ if (cur['class']) {\r
+ ed.formatter.toggle('fontsize_class', {value : cur['class']});\r
+ ed.undoManager.add();\r
+ ed.nodeChanged();\r
+ } else {\r
+ ed.execCommand('FontSize', false, cur.fontSize);\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
+ if (v['class']) {\r
+ ed.focus();\r
+ ed.undoManager.add();\r
+ ed.formatter.toggle('fontsize_class', {value : v['class']});\r
+ ed.undoManager.add();\r
+ ed.nodeChanged();\r
+ } else\r
+ ed.execCommand('FontSize', false, v.fontSize);\r
+\r
+ // Fake selection, execCommand will fire a nodeChange and update the selection\r
+ c.select(function(sv) {\r
+ return v == sv;\r
+ });\r
+\r
+ return false; // No auto select\r
+ }});\r
+\r
+ if (c) {\r
+ each(t.settings.theme_advanced_font_sizes, function(v, k) {\r
+ var fz = v.fontSize;\r
+\r
+ if (fz >= 1 && fz <= 7)\r
+ fz = t.sizes[parseInt(fz) - 1] + 'pt';\r
+\r
+ c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});\r
+ });\r
+ }\r
+\r
+ return c;\r
+ },\r
+\r
+ _createBlockFormats : function() {\r
+ var c, fmts = {\r
+ p : 'advanced.paragraph',\r
+ address : 'advanced.address',\r
+ pre : 'advanced.pre',\r
+ h1 : 'advanced.h1',\r
+ h2 : 'advanced.h2',\r
+ h3 : 'advanced.h3',\r
+ h4 : 'advanced.h4',\r
+ h5 : 'advanced.h5',\r
+ h6 : 'advanced.h6',\r
+ div : 'advanced.div',\r
+ blockquote : 'advanced.blockquote',\r
+ code : 'advanced.code',\r
+ dt : 'advanced.dt',\r
+ dd : 'advanced.dd',\r
+ samp : 'advanced.samp'\r
+ }, t = this;\r
+\r
+ c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});\r
+ if (c) {\r
+ each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {\r
+ c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});\r
+ });\r
+ }\r
+\r
+ return c;\r
+ },\r
+\r
+ _createForeColorMenu : function() {\r
+ var c, t = this, s = t.settings, o = {}, v;\r
+\r
+ if (s.theme_advanced_more_colors) {\r
+ o.more_colors_func = function() {\r
+ t._mceColorPicker(0, {\r
+ color : c.value,\r
+ func : function(co) {\r
+ c.setColor(co);\r
+ }\r
+ });\r
+ };\r
+ }\r
+\r
+ if (v = s.theme_advanced_text_colors)\r
+ o.colors = v;\r
+\r
+ if (s.theme_advanced_default_foreground_color)\r
+ o.default_color = s.theme_advanced_default_foreground_color;\r
+\r
+ o.title = 'advanced.forecolor_desc';\r
+ o.cmd = 'ForeColor';\r
+ o.scope = this;\r
+\r
+ c = t.editor.controlManager.createColorSplitButton('forecolor', o);\r
+\r
+ return c;\r
+ },\r
+\r
+ _createBackColorMenu : function() {\r
+ var c, t = this, s = t.settings, o = {}, v;\r
+\r
+ if (s.theme_advanced_more_colors) {\r
+ o.more_colors_func = function() {\r
+ t._mceColorPicker(0, {\r
+ color : c.value,\r
+ func : function(co) {\r
+ c.setColor(co);\r
+ }\r
+ });\r
+ };\r
+ }\r
+\r
+ if (v = s.theme_advanced_background_colors)\r
+ o.colors = v;\r
+\r
+ if (s.theme_advanced_default_background_color)\r
+ o.default_color = s.theme_advanced_default_background_color;\r
+\r
+ o.title = 'advanced.backcolor_desc';\r
+ o.cmd = 'HiliteColor';\r
+ o.scope = this;\r
+\r
+ c = t.editor.controlManager.createColorSplitButton('backcolor', o);\r
+\r
+ return c;\r
+ },\r
+\r
+ renderUI : function(o) {\r
+ var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;\r
+\r
+ n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});\r
+\r
+ if (!DOM.boxModel)\r
+ n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});\r
+\r
+ n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});\r
+ n = tb = DOM.add(n, 'tbody');\r
+\r
+ switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {\r
+ case "rowlayout":\r
+ ic = t._rowLayout(s, tb, o);\r
+ break;\r
+\r
+ case "customlayout":\r
+ ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);\r
+ break;\r
+\r
+ default:\r
+ ic = t._simpleLayout(s, tb, o, p);\r
+ }\r
+\r
+ n = o.targetNode;\r
+\r
+ // Add classes to first and last TRs\r
+ nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8\r
+ DOM.addClass(nl[0], 'mceFirst');\r
+ DOM.addClass(nl[nl.length - 1], 'mceLast');\r
+\r
+ // Add classes to first and last TDs\r
+ each(DOM.select('tr', tb), function(n) {\r
+ DOM.addClass(n.firstChild, 'mceFirst');\r
+ DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');\r
+ });\r
+\r
+ if (DOM.get(s.theme_advanced_toolbar_container))\r
+ DOM.get(s.theme_advanced_toolbar_container).appendChild(p);\r
+ else\r
+ DOM.insertAfter(p, n);\r
+\r
+ Event.add(ed.id + '_path_row', 'click', function(e) {\r
+ e = e.target;\r
+\r
+ if (e.nodeName == 'A') {\r
+ t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));\r
+\r
+ return Event.cancel(e);\r
+ }\r
+ });\r
+/*\r
+ if (DOM.get(ed.id + '_path_row')) {\r
+ Event.add(ed.id + '_tbl', 'mouseover', function(e) {\r
+ var re;\r
+ \r
+ e = e.target;\r
+\r
+ if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {\r
+ re = DOM.get(ed.id + '_path_row');\r
+ t.lastPath = re.innerHTML;\r
+ DOM.setHTML(re, e.parentNode.title);\r
+ }\r
+ });\r
+\r
+ Event.add(ed.id + '_tbl', 'mouseout', function(e) {\r
+ if (t.lastPath) {\r
+ DOM.setHTML(ed.id + '_path_row', t.lastPath);\r
+ t.lastPath = 0;\r
+ }\r
+ });\r
+ }\r
+*/\r
+\r
+ if (!ed.getParam('accessibility_focus'))\r
+ Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});\r
+\r
+ if (s.theme_advanced_toolbar_location == 'external')\r
+ o.deltaHeight = 0;\r
+\r
+ t.deltaHeight = o.deltaHeight;\r
+ o.targetNode = null;\r
+\r
+ return {\r
+ iframeContainer : ic,\r
+ editorContainer : ed.id + '_parent',\r
+ sizeContainer : sc,\r
+ deltaHeight : o.deltaHeight\r
+ };\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Advanced theme',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ }\r
+ },\r
+\r
+ resizeBy : function(dw, dh) {\r
+ var e = DOM.get(this.editor.id + '_tbl');\r
+\r
+ this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);\r
+ },\r
+\r
+ resizeTo : function(w, h) {\r
+ var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');\r
+\r
+ // Boundery fix box\r
+ w = Math.max(s.theme_advanced_resizing_min_width || 100, w);\r
+ h = Math.max(s.theme_advanced_resizing_min_height || 100, h);\r
+ w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);\r
+ h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);\r
+\r
+ // Resize iframe and container\r
+ DOM.setStyle(e, 'height', '');\r
+ DOM.setStyle(ifr, 'height', h);\r
+\r
+ if (s.theme_advanced_resize_horizontal) {\r
+ DOM.setStyle(e, 'width', '');\r
+ DOM.setStyle(ifr, 'width', w);\r
+\r
+ // Make sure that the size is never smaller than the over all ui\r
+ if (w < e.clientWidth)\r
+ DOM.setStyle(ifr, 'width', e.clientWidth);\r
+ }\r
+ },\r
+\r
+ destroy : function() {\r
+ var id = this.editor.id;\r
+\r
+ Event.clear(id + '_resize');\r
+ Event.clear(id + '_path_row');\r
+ Event.clear(id + '_external_close');\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _simpleLayout : function(s, tb, o, p) {\r
+ var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;\r
+\r
+ if (s.readonly) {\r
+ n = DOM.add(tb, 'tr');\r
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+ return ic;\r
+ }\r
+\r
+ // Create toolbar container at top\r
+ if (lo == 'top')\r
+ t._addToolbars(tb, o);\r
+\r
+ // Create external toolbar\r
+ if (lo == 'external') {\r
+ n = c = DOM.create('div', {style : 'position:relative'});\r
+ n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});\r
+ DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});\r
+ n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});\r
+ etb = DOM.add(n, 'tbody');\r
+\r
+ if (p.firstChild.className == 'mceOldBoxModel')\r
+ p.firstChild.appendChild(c);\r
+ else\r
+ p.insertBefore(c, p.firstChild);\r
+\r
+ t._addToolbars(etb, o);\r
+\r
+ ed.onMouseUp.add(function() {\r
+ var e = DOM.get(ed.id + '_external');\r
+ DOM.show(e);\r
+\r
+ DOM.hide(lastExtID);\r
+\r
+ var f = Event.add(ed.id + '_external_close', 'click', function() {\r
+ DOM.hide(ed.id + '_external');\r
+ Event.remove(ed.id + '_external_close', 'click', f);\r
+ });\r
+\r
+ DOM.show(e);\r
+ DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);\r
+\r
+ // Fixes IE rendering bug\r
+ DOM.hide(e);\r
+ DOM.show(e);\r
+ e.style.filter = '';\r
+\r
+ lastExtID = ed.id + '_external';\r
+\r
+ e = null;\r
+ });\r
+ }\r
+\r
+ if (sl == 'top')\r
+ t._addStatusBar(tb, o);\r
+\r
+ // Create iframe container\r
+ if (!s.theme_advanced_toolbar_container) {\r
+ n = DOM.add(tb, 'tr');\r
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+ }\r
+\r
+ // Create toolbar container at bottom\r
+ if (lo == 'bottom')\r
+ t._addToolbars(tb, o);\r
+\r
+ if (sl == 'bottom')\r
+ t._addStatusBar(tb, o);\r
+\r
+ return ic;\r
+ },\r
+\r
+ _rowLayout : function(s, tb, o) {\r
+ var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;\r
+\r
+ dc = s.theme_advanced_containers_default_class || '';\r
+ da = s.theme_advanced_containers_default_align || 'center';\r
+\r
+ each(explode(s.theme_advanced_containers || ''), function(c, i) {\r
+ var v = s['theme_advanced_container_' + c] || '';\r
+\r
+ switch (v.toLowerCase()) {\r
+ case 'mceeditor':\r
+ n = DOM.add(tb, 'tr');\r
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});\r
+ break;\r
+\r
+ case 'mceelementpath':\r
+ t._addStatusBar(tb, o);\r
+ break;\r
+\r
+ default:\r
+ a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();\r
+ a = 'mce' + t._ufirst(a);\r
+\r
+ n = DOM.add(DOM.add(tb, 'tr'), 'td', {\r
+ 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da\r
+ });\r
+\r
+ to = cf.createToolbar("toolbar" + i);\r
+ t._addControls(v, to);\r
+ DOM.setHTML(n, to.renderHTML());\r
+ o.deltaHeight -= s.theme_advanced_row_height;\r
+ }\r
+ });\r
+\r
+ return ic;\r
+ },\r
+\r
+ _addControls : function(v, tb) {\r
+ var t = this, s = t.settings, di, cf = t.editor.controlManager;\r
+\r
+ if (s.theme_advanced_disable && !t._disabled) {\r
+ di = {};\r
+\r
+ each(explode(s.theme_advanced_disable), function(v) {\r
+ di[v] = 1;\r
+ });\r
+\r
+ t._disabled = di;\r
+ } else\r
+ di = t._disabled;\r
+\r
+ each(explode(v), function(n) {\r
+ var c;\r
+\r
+ if (di && di[n])\r
+ return;\r
+\r
+ // Compatiblity with 2.x\r
+ if (n == 'tablecontrols') {\r
+ each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {\r
+ n = t.createControl(n, cf);\r
+\r
+ if (n)\r
+ tb.add(n);\r
+ });\r
+\r
+ return;\r
+ }\r
+\r
+ c = t.createControl(n, cf);\r
+\r
+ if (c)\r
+ tb.add(c);\r
+ });\r
+ },\r
+\r
+ _addToolbars : function(c, o) {\r
+ var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a;\r
+\r
+ a = s.theme_advanced_toolbar_align.toLowerCase();\r
+ a = 'mce' + t._ufirst(a);\r
+\r
+ n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a});\r
+\r
+ if (!ed.getParam('accessibility_focus'))\r
+ h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));\r
+\r
+ h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->'));\r
+\r
+ // Create toolbar and add the controls\r
+ for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {\r
+ tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});\r
+\r
+ if (s['theme_advanced_buttons' + i + '_add'])\r
+ v += ',' + s['theme_advanced_buttons' + i + '_add'];\r
+\r
+ if (s['theme_advanced_buttons' + i + '_add_before'])\r
+ v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;\r
+\r
+ t._addControls(v, tb);\r
+\r
+ //n.appendChild(n = tb.render());\r
+ h.push(tb.renderHTML());\r
+\r
+ o.deltaHeight -= s.theme_advanced_row_height;\r
+ }\r
+\r
+ h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));\r
+ DOM.setHTML(n, h.join(''));\r
+ },\r
+\r
+ _addStatusBar : function(tb, o) {\r
+ var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;\r
+\r
+ n = DOM.add(tb, 'tr');\r
+ n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});\r
+ n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' ');\r
+ DOM.add(n, 'a', {href : '#', accesskey : 'x'});\r
+\r
+ if (s.theme_advanced_resizing) {\r
+ DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});\r
+\r
+ if (s.theme_advanced_resizing_use_cookie) {\r
+ ed.onPostRender.add(function() {\r
+ var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');\r
+\r
+ if (!o)\r
+ return;\r
+\r
+ t.resizeTo(o.cw, o.ch);\r
+ });\r
+ }\r
+\r
+ ed.onPostRender.add(function() {\r
+ Event.add(ed.id + '_resize', 'mousedown', function(e) {\r
+ var mouseMoveHandler1, mouseMoveHandler2,\r
+ mouseUpHandler1, mouseUpHandler2,\r
+ startX, startY, startWidth, startHeight, width, height, ifrElm;\r
+\r
+ function resizeOnMove(e) {\r
+ width = startWidth + (e.screenX - startX);\r
+ height = startHeight + (e.screenY - startY);\r
+\r
+ t.resizeTo(width, height);\r
+ };\r
+\r
+ function endResize(e) {\r
+ // Stop listening\r
+ Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);\r
+ Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);\r
+ Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);\r
+ Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);\r
+\r
+ // Store away the size\r
+ if (s.theme_advanced_resizing_use_cookie) {\r
+ Cookie.setHash("TinyMCE_" + ed.id + "_size", {\r
+ cw : width,\r
+ ch : height\r
+ });\r
+ }\r
+ };\r
+\r
+ e.preventDefault();\r
+\r
+ // Get the current rect size\r
+ startX = e.screenX;\r
+ startY = e.screenY;\r
+ ifrElm = DOM.get(t.editor.id + '_ifr');\r
+ startWidth = width = ifrElm.clientWidth;\r
+ startHeight = height = ifrElm.clientHeight;\r
+\r
+ // Register envent handlers\r
+ mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);\r
+ mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);\r
+ mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);\r
+ mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);\r
+ });\r
+ });\r
+ }\r
+\r
+ o.deltaHeight -= 21;\r
+ n = tb = null;\r
+ },\r
+\r
+ _nodeChanged : function(ed, cm, n, co, ob) {\r
+ var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches;\r
+\r
+ tinymce.each(t.stateControls, function(c) {\r
+ cm.setActive(c, ed.queryCommandState(t.controls[c][1]));\r
+ });\r
+\r
+ function getParent(name) {\r
+ var i, parents = ob.parents, func = name;\r
+\r
+ if (typeof(name) == 'string') {\r
+ func = function(node) {\r
+ return node.nodeName == name;\r
+ };\r
+ }\r
+\r
+ for (i = 0; i < parents.length; i++) {\r
+ if (func(parents[i]))\r
+ return parents[i];\r
+ }\r
+ };\r
+\r
+ cm.setActive('visualaid', ed.hasVisual);\r
+ cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);\r
+ cm.setDisabled('redo', !ed.undoManager.hasRedo());\r
+ cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));\r
+\r
+ p = getParent('A');\r
+ if (c = cm.get('link')) {\r
+ if (!p || !p.name) {\r
+ c.setDisabled(!p && co);\r
+ c.setActive(!!p);\r
+ }\r
+ }\r
+\r
+ if (c = cm.get('unlink')) {\r
+ c.setDisabled(!p && co);\r
+ c.setActive(!!p && !p.name);\r
+ }\r
+\r
+ if (c = cm.get('anchor')) {\r
+ c.setActive(!!p && p.name);\r
+ }\r
+\r
+ p = getParent('IMG');\r
+ if (c = cm.get('image'))\r
+ c.setActive(!!p && n.className.indexOf('mceItem') == -1);\r
+\r
+ if (c = cm.get('styleselect')) {\r
+ t._importClasses();\r
+\r
+ formatNames = [];\r
+ each(c.items, function(item) {\r
+ formatNames.push(item.value);\r
+ });\r
+\r
+ matches = ed.formatter.matchAll(formatNames);\r
+ c.select(matches[0]);\r
+ }\r
+\r
+ if (c = cm.get('formatselect')) {\r
+ p = getParent(DOM.isBlock);\r
+\r
+ if (p)\r
+ c.select(p.nodeName.toLowerCase());\r
+ }\r
+\r
+ // Find out current fontSize, fontFamily and fontClass\r
+ getParent(function(n) {\r
+ if (n.nodeName === 'SPAN') {\r
+ if (!cl && n.className)\r
+ cl = n.className;\r
+\r
+ if (!fz && n.style.fontSize)\r
+ fz = n.style.fontSize;\r
+\r
+ if (!fn && n.style.fontFamily)\r
+ fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();\r
+ }\r
+\r
+ return false;\r
+ });\r
+\r
+ if (c = cm.get('fontselect')) {\r
+ c.select(function(v) {\r
+ return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;\r
+ });\r
+ }\r
+\r
+ // Select font size\r
+ if (c = cm.get('fontsizeselect')) {\r
+ // Use computed style\r
+ if (s.theme_advanced_runtime_fontsize && !fz && !cl)\r
+ fz = ed.dom.getStyle(n, 'fontSize', true);\r
+\r
+ c.select(function(v) {\r
+ if (v.fontSize && v.fontSize === fz)\r
+ return true;\r
+\r
+ if (v['class'] && v['class'] === cl)\r
+ return true;\r
+ });\r
+ }\r
+\r
+ if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {\r
+ p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});\r
+ DOM.setHTML(p, '');\r
+\r
+ getParent(function(n) {\r
+ var na = n.nodeName.toLowerCase(), u, pi, ti = '';\r
+\r
+ /*if (n.getAttribute('_mce_bogus'))\r
+ return;\r
+*/\r
+ // Ignore non element and hidden elements\r
+ if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))\r
+ return;\r
+\r
+ // Fake name\r
+ if (v = DOM.getAttrib(n, 'mce_name'))\r
+ na = v;\r
+\r
+ // Handle prefix\r
+ if (tinymce.isIE && n.scopeName !== 'HTML')\r
+ na = n.scopeName + ':' + na;\r
+\r
+ // Remove internal prefix\r
+ na = na.replace(/mce\:/g, '');\r
+\r
+ // Handle node name\r
+ switch (na) {\r
+ case 'b':\r
+ na = 'strong';\r
+ break;\r
+\r
+ case 'i':\r
+ na = 'em';\r
+ break;\r
+\r
+ case 'img':\r
+ if (v = DOM.getAttrib(n, 'src'))\r
+ ti += 'src: ' + v + ' ';\r
+\r
+ break;\r
+\r
+ case 'a':\r
+ if (v = DOM.getAttrib(n, 'name')) {\r
+ ti += 'name: ' + v + ' ';\r
+ na += '#' + v;\r
+ }\r
+\r
+ if (v = DOM.getAttrib(n, 'href'))\r
+ ti += 'href: ' + v + ' ';\r
+\r
+ break;\r
+\r
+ case 'font':\r
+ if (v = DOM.getAttrib(n, 'face'))\r
+ ti += 'font: ' + v + ' ';\r
+\r
+ if (v = DOM.getAttrib(n, 'size'))\r
+ ti += 'size: ' + v + ' ';\r
+\r
+ if (v = DOM.getAttrib(n, 'color'))\r
+ ti += 'color: ' + v + ' ';\r
+\r
+ break;\r
+\r
+ case 'span':\r
+ if (v = DOM.getAttrib(n, 'style'))\r
+ ti += 'style: ' + v + ' ';\r
+\r
+ break;\r
+ }\r
+\r
+ if (v = DOM.getAttrib(n, 'id'))\r
+ ti += 'id: ' + v + ' ';\r
+\r
+ if (v = n.className) {\r
+ v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')\r
+\r
+ if (v) {\r
+ ti += 'class: ' + v + ' ';\r
+\r
+ if (DOM.isBlock(n) || na == 'img' || na == 'span')\r
+ na += '.' + v;\r
+ }\r
+ }\r
+\r
+ na = na.replace(/(html:)/g, '');\r
+ na = {name : na, node : n, title : ti};\r
+ t.onResolveName.dispatch(t, na);\r
+ ti = na.title;\r
+ na = na.name;\r
+\r
+ //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";\r
+ pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);\r
+\r
+ if (p.hasChildNodes()) {\r
+ p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild);\r
+ p.insertBefore(pi, p.firstChild);\r
+ } else\r
+ p.appendChild(pi);\r
+ }, ed.getBody());\r
+ }\r
+ },\r
+\r
+ // Commands gets called by execCommand\r
+\r
+ _sel : function(v) {\r
+ this.editor.execCommand('mceSelectNodeDepth', false, v);\r
+ },\r
+\r
+ _mceInsertAnchor : function(ui, v) {\r
+ var ed = this.editor;\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/anchor.htm',\r
+ width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),\r
+ height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),\r
+ inline : true\r
+ }, {\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceCharMap : function() {\r
+ var ed = this.editor;\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/charmap.htm',\r
+ width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),\r
+ height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),\r
+ inline : true\r
+ }, {\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceHelp : function() {\r
+ var ed = this.editor;\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/about.htm',\r
+ width : 480,\r
+ height : 380,\r
+ inline : true\r
+ }, {\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceColorPicker : function(u, v) {\r
+ var ed = this.editor;\r
+\r
+ v = v || {};\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/color_picker.htm',\r
+ width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),\r
+ height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),\r
+ close_previous : false,\r
+ inline : true\r
+ }, {\r
+ input_color : v.color,\r
+ func : v.func,\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceCodeEditor : function(ui, val) {\r
+ var ed = this.editor;\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/source_editor.htm',\r
+ width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),\r
+ height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),\r
+ inline : true,\r
+ resizable : true,\r
+ maximizable : true\r
+ }, {\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceImage : function(ui, val) {\r
+ var ed = this.editor;\r
+\r
+ // Internal image object like a flash placeholder\r
+ if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)\r
+ return;\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/image.htm',\r
+ width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),\r
+ height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),\r
+ inline : true\r
+ }, {\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceLink : function(ui, val) {\r
+ var ed = this.editor;\r
+\r
+ ed.windowManager.open({\r
+ url : tinymce.baseURL + '/themes/advanced/link.htm',\r
+ width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),\r
+ height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),\r
+ inline : true\r
+ }, {\r
+ theme_url : this.url\r
+ });\r
+ },\r
+\r
+ _mceNewDocument : function() {\r
+ var ed = this.editor;\r
+\r
+ ed.windowManager.confirm('advanced.newdocument', function(s) {\r
+ if (s)\r
+ ed.execCommand('mceSetContent', false, '');\r
+ });\r
+ },\r
+\r
+ _mceForeColor : function() {\r
+ var t = this;\r
+\r
+ this._mceColorPicker(0, {\r
+ color: t.fgColor,\r
+ func : function(co) {\r
+ t.fgColor = co;\r
+ t.editor.execCommand('ForeColor', false, co);\r
+ }\r
+ });\r
+ },\r
+\r
+ _mceBackColor : function() {\r
+ var t = this;\r
+\r
+ this._mceColorPicker(0, {\r
+ color: t.bgColor,\r
+ func : function(co) {\r
+ t.bgColor = co;\r
+ t.editor.execCommand('HiliteColor', false, co);\r
+ }\r
+ });\r
+ },\r
+\r
+ _ufirst : function(s) {\r
+ return s.substring(0, 1).toUpperCase() + s.substring(1);\r
+ }\r
+ });\r
+\r
+ tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);\r
+}(tinymce));
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.image_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="js/image.js"></script>\r
+</head>\r
+<body id="image" style="display: none">\r
+<form onsubmit="ImageDialog.update();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>\r
+ <td><table border="0" cellspacing="0" cellpadding="0">\r
+ <tr>\r
+ <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>\r
+ <td id="srcbrowsercontainer"> </td>\r
+ </tr>\r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="image_list">{#advanced_dlg.image_list}</label></td>\r
+ <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>\r
+ <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>\r
+ <td><select id="align" name="align" onchange="ImageDialog.updateStyle();">\r
+ <option value="">{#not_set}</option>\r
+ <option value="baseline">{#advanced_dlg.image_align_baseline}</option>\r
+ <option value="top">{#advanced_dlg.image_align_top}</option>\r
+ <option value="middle">{#advanced_dlg.image_align_middle}</option>\r
+ <option value="bottom">{#advanced_dlg.image_align_bottom}</option>\r
+ <option value="text-top">{#advanced_dlg.image_align_texttop}</option>\r
+ <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>\r
+ <option value="left">{#advanced_dlg.image_align_left}</option>\r
+ <option value="right">{#advanced_dlg.image_align_right}</option>\r
+ </select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>\r
+ <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />\r
+ x\r
+ <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>\r
+ <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>\r
+ <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>\r
+ <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+function init() {\r
+ var ed, tcont;\r
+\r
+ tinyMCEPopup.resizeToInnerSize();\r
+ ed = tinyMCEPopup.editor;\r
+\r
+ // Give FF some time\r
+ window.setTimeout(insertHelpIFrame, 10);\r
+\r
+ tcont = document.getElementById('plugintablecontainer');\r
+ document.getElementById('plugins_tab').style.display = 'none';\r
+\r
+ var html = "";\r
+ html += '<table id="plugintable">';\r
+ html += '<thead>';\r
+ html += '<tr>';\r
+ html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';\r
+ html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';\r
+ html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';\r
+ html += '</tr>';\r
+ html += '</thead>';\r
+ html += '<tbody>';\r
+\r
+ tinymce.each(ed.plugins, function(p, n) {\r
+ var info;\r
+\r
+ if (!p.getInfo)\r
+ return;\r
+\r
+ html += '<tr>';\r
+\r
+ info = p.getInfo();\r
+\r
+ if (info.infourl != null && info.infourl != '')\r
+ html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';\r
+ else\r
+ html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';\r
+\r
+ if (info.authorurl != null && info.authorurl != '')\r
+ html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';\r
+ else\r
+ html += '<td width="35%">' + info.author + '</td>';\r
+\r
+ html += '<td width="15%">' + info.version + '</td>';\r
+ html += '</tr>';\r
+\r
+ document.getElementById('plugins_tab').style.display = '';\r
+\r
+ });\r
+\r
+ html += '</tbody>';\r
+ html += '</table>';\r
+\r
+ tcont.innerHTML = html;\r
+\r
+ tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;\r
+ tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;\r
+}\r
+\r
+function insertHelpIFrame() {\r
+ var html;\r
+\r
+ if (tinyMCEPopup.getParam('docs_url')) {\r
+ html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';\r
+ document.getElementById('iframecontainer').innerHTML = html;\r
+ document.getElementById('help_tab').style.display = 'block';\r
+ }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var AnchorDialog = {\r
+ init : function(ed) {\r
+ var action, elm, f = document.forms[0];\r
+\r
+ this.editor = ed;\r
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A');\r
+ v = ed.dom.getAttrib(elm, 'name');\r
+\r
+ if (v) {\r
+ this.action = 'update';\r
+ f.anchorName.value = v;\r
+ }\r
+\r
+ f.insert.value = ed.getLang(elm ? 'update' : 'insert');\r
+ },\r
+\r
+ update : function() {\r
+ var ed = this.editor, elm, name = document.forms[0].anchorName.value;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ if (this.action != 'update')\r
+ ed.selection.collapse(1);\r
+\r
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A');\r
+ if (elm)\r
+ elm.name = name;\r
+ else\r
+ ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));\r
+\r
+ tinyMCEPopup.close();\r
+ }\r
+};\r
+\r
+tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);\r
--- /dev/null
+/**\r
+ * charmap.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+tinyMCEPopup.requireLangPack();\r
+\r
+var charmap = [\r
+ [' ', ' ', true, 'no-break space'],\r
+ ['&', '&', true, 'ampersand'],\r
+ ['"', '"', true, 'quotation mark'],\r
+// finance\r
+ ['¢', '¢', true, 'cent sign'],\r
+ ['€', '€', true, 'euro sign'],\r
+ ['£', '£', true, 'pound sign'],\r
+ ['¥', '¥', true, 'yen sign'],\r
+// signs\r
+ ['©', '©', true, 'copyright sign'],\r
+ ['®', '®', true, 'registered sign'],\r
+ ['™', '™', true, 'trade mark sign'],\r
+ ['‰', '‰', true, 'per mille sign'],\r
+ ['µ', 'µ', true, 'micro sign'],\r
+ ['·', '·', true, 'middle dot'],\r
+ ['•', '•', true, 'bullet'],\r
+ ['…', '…', true, 'three dot leader'],\r
+ ['′', '′', true, 'minutes / feet'],\r
+ ['″', '″', true, 'seconds / inches'],\r
+ ['§', '§', true, 'section sign'],\r
+ ['¶', '¶', true, 'paragraph sign'],\r
+ ['ß', 'ß', true, 'sharp s / ess-zed'],\r
+// quotations\r
+ ['‹', '‹', true, 'single left-pointing angle quotation mark'],\r
+ ['›', '›', true, 'single right-pointing angle quotation mark'],\r
+ ['«', '«', true, 'left pointing guillemet'],\r
+ ['»', '»', true, 'right pointing guillemet'],\r
+ ['‘', '‘', true, 'left single quotation mark'],\r
+ ['’', '’', true, 'right single quotation mark'],\r
+ ['“', '“', true, 'left double quotation mark'],\r
+ ['”', '”', true, 'right double quotation mark'],\r
+ ['‚', '‚', true, 'single low-9 quotation mark'],\r
+ ['„', '„', true, 'double low-9 quotation mark'],\r
+ ['<', '<', true, 'less-than sign'],\r
+ ['>', '>', true, 'greater-than sign'],\r
+ ['≤', '≤', true, 'less-than or equal to'],\r
+ ['≥', '≥', true, 'greater-than or equal to'],\r
+ ['–', '–', true, 'en dash'],\r
+ ['—', '—', true, 'em dash'],\r
+ ['¯', '¯', true, 'macron'],\r
+ ['‾', '‾', true, 'overline'],\r
+ ['¤', '¤', true, 'currency sign'],\r
+ ['¦', '¦', true, 'broken bar'],\r
+ ['¨', '¨', true, 'diaeresis'],\r
+ ['¡', '¡', true, 'inverted exclamation mark'],\r
+ ['¿', '¿', true, 'turned question mark'],\r
+ ['ˆ', 'ˆ', true, 'circumflex accent'],\r
+ ['˜', '˜', true, 'small tilde'],\r
+ ['°', '°', true, 'degree sign'],\r
+ ['−', '−', true, 'minus sign'],\r
+ ['±', '±', true, 'plus-minus sign'],\r
+ ['÷', '÷', true, 'division sign'],\r
+ ['⁄', '⁄', true, 'fraction slash'],\r
+ ['×', '×', true, 'multiplication sign'],\r
+ ['¹', '¹', true, 'superscript one'],\r
+ ['²', '²', true, 'superscript two'],\r
+ ['³', '³', true, 'superscript three'],\r
+ ['¼', '¼', true, 'fraction one quarter'],\r
+ ['½', '½', true, 'fraction one half'],\r
+ ['¾', '¾', true, 'fraction three quarters'],\r
+// math / logical\r
+ ['ƒ', 'ƒ', true, 'function / florin'],\r
+ ['∫', '∫', true, 'integral'],\r
+ ['∑', '∑', true, 'n-ary sumation'],\r
+ ['∞', '∞', true, 'infinity'],\r
+ ['√', '√', true, 'square root'],\r
+ ['∼', '∼', false,'similar to'],\r
+ ['≅', '≅', false,'approximately equal to'],\r
+ ['≈', '≈', true, 'almost equal to'],\r
+ ['≠', '≠', true, 'not equal to'],\r
+ ['≡', '≡', true, 'identical to'],\r
+ ['∈', '∈', false,'element of'],\r
+ ['∉', '∉', false,'not an element of'],\r
+ ['∋', '∋', false,'contains as member'],\r
+ ['∏', '∏', true, 'n-ary product'],\r
+ ['∧', '∧', false,'logical and'],\r
+ ['∨', '∨', false,'logical or'],\r
+ ['¬', '¬', true, 'not sign'],\r
+ ['∩', '∩', true, 'intersection'],\r
+ ['∪', '∪', false,'union'],\r
+ ['∂', '∂', true, 'partial differential'],\r
+ ['∀', '∀', false,'for all'],\r
+ ['∃', '∃', false,'there exists'],\r
+ ['∅', '∅', false,'diameter'],\r
+ ['∇', '∇', false,'backward difference'],\r
+ ['∗', '∗', false,'asterisk operator'],\r
+ ['∝', '∝', false,'proportional to'],\r
+ ['∠', '∠', false,'angle'],\r
+// undefined\r
+ ['´', '´', true, 'acute accent'],\r
+ ['¸', '¸', true, 'cedilla'],\r
+ ['ª', 'ª', true, 'feminine ordinal indicator'],\r
+ ['º', 'º', true, 'masculine ordinal indicator'],\r
+ ['†', '†', true, 'dagger'],\r
+ ['‡', '‡', true, 'double dagger'],\r
+// alphabetical special chars\r
+ ['À', 'À', true, 'A - grave'],\r
+ ['Á', 'Á', true, 'A - acute'],\r
+ ['Â', 'Â', true, 'A - circumflex'],\r
+ ['Ã', 'Ã', true, 'A - tilde'],\r
+ ['Ä', 'Ä', true, 'A - diaeresis'],\r
+ ['Å', 'Å', true, 'A - ring above'],\r
+ ['Æ', 'Æ', true, 'ligature AE'],\r
+ ['Ç', 'Ç', true, 'C - cedilla'],\r
+ ['È', 'È', true, 'E - grave'],\r
+ ['É', 'É', true, 'E - acute'],\r
+ ['Ê', 'Ê', true, 'E - circumflex'],\r
+ ['Ë', 'Ë', true, 'E - diaeresis'],\r
+ ['Ì', 'Ì', true, 'I - grave'],\r
+ ['Í', 'Í', true, 'I - acute'],\r
+ ['Î', 'Î', true, 'I - circumflex'],\r
+ ['Ï', 'Ï', true, 'I - diaeresis'],\r
+ ['Ð', 'Ð', true, 'ETH'],\r
+ ['Ñ', 'Ñ', true, 'N - tilde'],\r
+ ['Ò', 'Ò', true, 'O - grave'],\r
+ ['Ó', 'Ó', true, 'O - acute'],\r
+ ['Ô', 'Ô', true, 'O - circumflex'],\r
+ ['Õ', 'Õ', true, 'O - tilde'],\r
+ ['Ö', 'Ö', true, 'O - diaeresis'],\r
+ ['Ø', 'Ø', true, 'O - slash'],\r
+ ['Œ', 'Œ', true, 'ligature OE'],\r
+ ['Š', 'Š', true, 'S - caron'],\r
+ ['Ù', 'Ù', true, 'U - grave'],\r
+ ['Ú', 'Ú', true, 'U - acute'],\r
+ ['Û', 'Û', true, 'U - circumflex'],\r
+ ['Ü', 'Ü', true, 'U - diaeresis'],\r
+ ['Ý', 'Ý', true, 'Y - acute'],\r
+ ['Ÿ', 'Ÿ', true, 'Y - diaeresis'],\r
+ ['Þ', 'Þ', true, 'THORN'],\r
+ ['à', 'à', true, 'a - grave'],\r
+ ['á', 'á', true, 'a - acute'],\r
+ ['â', 'â', true, 'a - circumflex'],\r
+ ['ã', 'ã', true, 'a - tilde'],\r
+ ['ä', 'ä', true, 'a - diaeresis'],\r
+ ['å', 'å', true, 'a - ring above'],\r
+ ['æ', 'æ', true, 'ligature ae'],\r
+ ['ç', 'ç', true, 'c - cedilla'],\r
+ ['è', 'è', true, 'e - grave'],\r
+ ['é', 'é', true, 'e - acute'],\r
+ ['ê', 'ê', true, 'e - circumflex'],\r
+ ['ë', 'ë', true, 'e - diaeresis'],\r
+ ['ì', 'ì', true, 'i - grave'],\r
+ ['í', 'í', true, 'i - acute'],\r
+ ['î', 'î', true, 'i - circumflex'],\r
+ ['ï', 'ï', true, 'i - diaeresis'],\r
+ ['ð', 'ð', true, 'eth'],\r
+ ['ñ', 'ñ', true, 'n - tilde'],\r
+ ['ò', 'ò', true, 'o - grave'],\r
+ ['ó', 'ó', true, 'o - acute'],\r
+ ['ô', 'ô', true, 'o - circumflex'],\r
+ ['õ', 'õ', true, 'o - tilde'],\r
+ ['ö', 'ö', true, 'o - diaeresis'],\r
+ ['ø', 'ø', true, 'o slash'],\r
+ ['œ', 'œ', true, 'ligature oe'],\r
+ ['š', 'š', true, 's - caron'],\r
+ ['ù', 'ù', true, 'u - grave'],\r
+ ['ú', 'ú', true, 'u - acute'],\r
+ ['û', 'û', true, 'u - circumflex'],\r
+ ['ü', 'ü', true, 'u - diaeresis'],\r
+ ['ý', 'ý', true, 'y - acute'],\r
+ ['þ', 'þ', true, 'thorn'],\r
+ ['ÿ', 'ÿ', true, 'y - diaeresis'],\r
+ ['Α', 'Α', true, 'Alpha'],\r
+ ['Β', 'Β', true, 'Beta'],\r
+ ['Γ', 'Γ', true, 'Gamma'],\r
+ ['Δ', 'Δ', true, 'Delta'],\r
+ ['Ε', 'Ε', true, 'Epsilon'],\r
+ ['Ζ', 'Ζ', true, 'Zeta'],\r
+ ['Η', 'Η', true, 'Eta'],\r
+ ['Θ', 'Θ', true, 'Theta'],\r
+ ['Ι', 'Ι', true, 'Iota'],\r
+ ['Κ', 'Κ', true, 'Kappa'],\r
+ ['Λ', 'Λ', true, 'Lambda'],\r
+ ['Μ', 'Μ', true, 'Mu'],\r
+ ['Ν', 'Ν', true, 'Nu'],\r
+ ['Ξ', 'Ξ', true, 'Xi'],\r
+ ['Ο', 'Ο', true, 'Omicron'],\r
+ ['Π', 'Π', true, 'Pi'],\r
+ ['Ρ', 'Ρ', true, 'Rho'],\r
+ ['Σ', 'Σ', true, 'Sigma'],\r
+ ['Τ', 'Τ', true, 'Tau'],\r
+ ['Υ', 'Υ', true, 'Upsilon'],\r
+ ['Φ', 'Φ', true, 'Phi'],\r
+ ['Χ', 'Χ', true, 'Chi'],\r
+ ['Ψ', 'Ψ', true, 'Psi'],\r
+ ['Ω', 'Ω', true, 'Omega'],\r
+ ['α', 'α', true, 'alpha'],\r
+ ['β', 'β', true, 'beta'],\r
+ ['γ', 'γ', true, 'gamma'],\r
+ ['δ', 'δ', true, 'delta'],\r
+ ['ε', 'ε', true, 'epsilon'],\r
+ ['ζ', 'ζ', true, 'zeta'],\r
+ ['η', 'η', true, 'eta'],\r
+ ['θ', 'θ', true, 'theta'],\r
+ ['ι', 'ι', true, 'iota'],\r
+ ['κ', 'κ', true, 'kappa'],\r
+ ['λ', 'λ', true, 'lambda'],\r
+ ['μ', 'μ', true, 'mu'],\r
+ ['ν', 'ν', true, 'nu'],\r
+ ['ξ', 'ξ', true, 'xi'],\r
+ ['ο', 'ο', true, 'omicron'],\r
+ ['π', 'π', true, 'pi'],\r
+ ['ρ', 'ρ', true, 'rho'],\r
+ ['ς', 'ς', true, 'final sigma'],\r
+ ['σ', 'σ', true, 'sigma'],\r
+ ['τ', 'τ', true, 'tau'],\r
+ ['υ', 'υ', true, 'upsilon'],\r
+ ['φ', 'φ', true, 'phi'],\r
+ ['χ', 'χ', true, 'chi'],\r
+ ['ψ', 'ψ', true, 'psi'],\r
+ ['ω', 'ω', true, 'omega'],\r
+// symbols\r
+ ['ℵ', 'ℵ', false,'alef symbol'],\r
+ ['ϖ', 'ϖ', false,'pi symbol'],\r
+ ['ℜ', 'ℜ', false,'real part symbol'],\r
+ ['ϑ','ϑ', false,'theta symbol'],\r
+ ['ϒ', 'ϒ', false,'upsilon - hook symbol'],\r
+ ['℘', '℘', false,'Weierstrass p'],\r
+ ['ℑ', 'ℑ', false,'imaginary part'],\r
+// arrows\r
+ ['←', '←', true, 'leftwards arrow'],\r
+ ['↑', '↑', true, 'upwards arrow'],\r
+ ['→', '→', true, 'rightwards arrow'],\r
+ ['↓', '↓', true, 'downwards arrow'],\r
+ ['↔', '↔', true, 'left right arrow'],\r
+ ['↵', '↵', false,'carriage return'],\r
+ ['⇐', '⇐', false,'leftwards double arrow'],\r
+ ['⇑', '⇑', false,'upwards double arrow'],\r
+ ['⇒', '⇒', false,'rightwards double arrow'],\r
+ ['⇓', '⇓', false,'downwards double arrow'],\r
+ ['⇔', '⇔', false,'left right double arrow'],\r
+ ['∴', '∴', false,'therefore'],\r
+ ['⊂', '⊂', false,'subset of'],\r
+ ['⊃', '⊃', false,'superset of'],\r
+ ['⊄', '⊄', false,'not a subset of'],\r
+ ['⊆', '⊆', false,'subset of or equal to'],\r
+ ['⊇', '⊇', false,'superset of or equal to'],\r
+ ['⊕', '⊕', false,'circled plus'],\r
+ ['⊗', '⊗', false,'circled times'],\r
+ ['⊥', '⊥', false,'perpendicular'],\r
+ ['⋅', '⋅', false,'dot operator'],\r
+ ['⌈', '⌈', false,'left ceiling'],\r
+ ['⌉', '⌉', false,'right ceiling'],\r
+ ['⌊', '⌊', false,'left floor'],\r
+ ['⌋', '⌋', false,'right floor'],\r
+ ['⟨', '〈', false,'left-pointing angle bracket'],\r
+ ['⟩', '〉', false,'right-pointing angle bracket'],\r
+ ['◊', '◊', true,'lozenge'],\r
+ ['♠', '♠', false,'black spade suit'],\r
+ ['♣', '♣', true, 'black club suit'],\r
+ ['♥', '♥', true, 'black heart suit'],\r
+ ['♦', '♦', true, 'black diamond suit'],\r
+ [' ', ' ', false,'en space'],\r
+ [' ', ' ', false,'em space'],\r
+ [' ', ' ', false,'thin space'],\r
+ ['‌', '‌', false,'zero width non-joiner'],\r
+ ['‍', '‍', false,'zero width joiner'],\r
+ ['‎', '‎', false,'left-to-right mark'],\r
+ ['‏', '‏', false,'right-to-left mark'],\r
+ ['­', '­', false,'soft hyphen']\r
+];\r
+\r
+tinyMCEPopup.onInit.add(function() {\r
+ tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());\r
+});\r
+\r
+function renderCharMapHTML() {\r
+ var charsPerRow = 20, tdWidth=20, tdHeight=20, i;\r
+ var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';\r
+ var cols=-1;\r
+\r
+ for (i=0; i<charmap.length; i++) {\r
+ if (charmap[i][2]==true) {\r
+ cols++;\r
+ html += ''\r
+ + '<td class="charmap">'\r
+ + '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'\r
+ + charmap[i][1]\r
+ + '</a></td>';\r
+ if ((cols+1) % charsPerRow == 0)\r
+ html += '</tr><tr height="' + tdHeight + '">';\r
+ }\r
+ }\r
+\r
+ if (cols % charsPerRow > 0) {\r
+ var padd = charsPerRow - (cols % charsPerRow);\r
+ for (var i=0; i<padd-1; i++)\r
+ html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>';\r
+ }\r
+\r
+ html += '</tr></table>';\r
+\r
+ return html;\r
+}\r
+\r
+function insertChar(chr) {\r
+ tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');\r
+\r
+ // Refocus in window\r
+ if (tinyMCEPopup.isWindow)\r
+ window.focus();\r
+\r
+ tinyMCEPopup.editor.focus();\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function previewChar(codeA, codeB, codeN) {\r
+ var elmA = document.getElementById('codeA');\r
+ var elmB = document.getElementById('codeB');\r
+ var elmV = document.getElementById('codeV');\r
+ var elmN = document.getElementById('codeN');\r
+\r
+ if (codeA=='#160;') {\r
+ elmV.innerHTML = '__';\r
+ } else {\r
+ elmV.innerHTML = '&' + codeA;\r
+ }\r
+\r
+ elmB.innerHTML = '&' + codeA;\r
+ elmA.innerHTML = '&' + codeB;\r
+ elmN.innerHTML = codeN;\r
+}\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;\r
+\r
+var colors = [\r
+ "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",\r
+ "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",\r
+ "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",\r
+ "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",\r
+ "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",\r
+ "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",\r
+ "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",\r
+ "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",\r
+ "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",\r
+ "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",\r
+ "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",\r
+ "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",\r
+ "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",\r
+ "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",\r
+ "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",\r
+ "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",\r
+ "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",\r
+ "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",\r
+ "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",\r
+ "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",\r
+ "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",\r
+ "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",\r
+ "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",\r
+ "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",\r
+ "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",\r
+ "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",\r
+ "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"\r
+];\r
+\r
+var named = {\r
+ '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',\r
+ '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown',\r
+ '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue',\r
+ '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod',\r
+ '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen',\r
+ '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue',\r
+ '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue',\r
+ '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen',\r
+ '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey',\r
+ '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory',\r
+ '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue',\r
+ '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen',\r
+ '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey',\r
+ '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',\r
+ '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue',\r
+ '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin',\r
+ '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid',\r
+ '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff',\r
+ '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue',\r
+ '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver',\r
+ '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen',\r
+ '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',\r
+ '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen'\r
+};\r
+\r
+function init() {\r
+ var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color'));\r
+\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ generatePicker();\r
+\r
+ if (inputColor) {\r
+ changeFinalColor(inputColor);\r
+\r
+ col = convertHexToRGB(inputColor);\r
+\r
+ if (col)\r
+ updateLight(col.r, col.g, col.b);\r
+ }\r
+}\r
+\r
+function insertAction() {\r
+ var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ if (f)\r
+ f(color);\r
+\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function showColor(color, name) {\r
+ if (name)\r
+ document.getElementById("colorname").innerHTML = name;\r
+\r
+ document.getElementById("preview").style.backgroundColor = color;\r
+ document.getElementById("color").value = color.toLowerCase();\r
+}\r
+\r
+function convertRGBToHex(col) {\r
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");\r
+\r
+ if (!col)\r
+ return col;\r
+\r
+ var rgb = col.replace(re, "$1,$2,$3").split(',');\r
+ if (rgb.length == 3) {\r
+ r = parseInt(rgb[0]).toString(16);\r
+ g = parseInt(rgb[1]).toString(16);\r
+ b = parseInt(rgb[2]).toString(16);\r
+\r
+ r = r.length == 1 ? '0' + r : r;\r
+ g = g.length == 1 ? '0' + g : g;\r
+ b = b.length == 1 ? '0' + b : b;\r
+\r
+ return "#" + r + g + b;\r
+ }\r
+\r
+ return col;\r
+}\r
+\r
+function convertHexToRGB(col) {\r
+ if (col.indexOf('#') != -1) {\r
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\r
+\r
+ r = parseInt(col.substring(0, 2), 16);\r
+ g = parseInt(col.substring(2, 4), 16);\r
+ b = parseInt(col.substring(4, 6), 16);\r
+\r
+ return {r : r, g : g, b : b};\r
+ }\r
+\r
+ return null;\r
+}\r
+\r
+function generatePicker() {\r
+ var el = document.getElementById('light'), h = '', i;\r
+\r
+ for (i = 0; i < detail; i++){\r
+ h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'\r
+ + ' onclick="changeFinalColor(this.style.backgroundColor)"'\r
+ + ' onmousedown="isMouseDown = true; return false;"'\r
+ + ' onmouseup="isMouseDown = false;"'\r
+ + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'\r
+ + ' onmouseover="isMouseOver = true;"'\r
+ + ' onmouseout="isMouseOver = false;"'\r
+ + '></div>';\r
+ }\r
+\r
+ el.innerHTML = h;\r
+}\r
+\r
+function generateWebColors() {\r
+ var el = document.getElementById('webcolors'), h = '', i;\r
+\r
+ if (el.className == 'generated')\r
+ return;\r
+\r
+ h += '<table border="0" cellspacing="1" cellpadding="0">'\r
+ + '<tr>';\r
+\r
+ for (i=0; i<colors.length; i++) {\r
+ h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'\r
+ + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">'\r
+ + '</a></td>';\r
+ if ((i+1) % 18 == 0)\r
+ h += '</tr><tr>';\r
+ }\r
+\r
+ h += '</table>';\r
+\r
+ el.innerHTML = h;\r
+ el.className = 'generated';\r
+}\r
+\r
+function generateNamedColors() {\r
+ var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;\r
+\r
+ if (el.className == 'generated')\r
+ return;\r
+\r
+ for (n in named) {\r
+ v = named[n];\r
+ h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>'\r
+ }\r
+\r
+ el.innerHTML = h;\r
+ el.className = 'generated';\r
+}\r
+\r
+function dechex(n) {\r
+ return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);\r
+}\r
+\r
+function computeColor(e) {\r
+ var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;\r
+\r
+ x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);\r
+ y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);\r
+\r
+ partWidth = document.getElementById('colors').width / 6;\r
+ partDetail = detail / 2;\r
+ imHeight = document.getElementById('colors').height;\r
+\r
+ r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;\r
+ g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);\r
+ b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);\r
+\r
+ coef = (imHeight - y) / imHeight;\r
+ r = 128 + (r - 128) * coef;\r
+ g = 128 + (g - 128) * coef;\r
+ b = 128 + (b - 128) * coef;\r
+\r
+ changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));\r
+ updateLight(r, g, b);\r
+}\r
+\r
+function updateLight(r, g, b) {\r
+ var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;\r
+\r
+ for (i=0; i<detail; i++) {\r
+ if ((i>=0) && (i<partDetail)) {\r
+ finalCoef = i / partDetail;\r
+ finalR = dechex(255 - (255 - r) * finalCoef);\r
+ finalG = dechex(255 - (255 - g) * finalCoef);\r
+ finalB = dechex(255 - (255 - b) * finalCoef);\r
+ } else {\r
+ finalCoef = 2 - i / partDetail;\r
+ finalR = dechex(r * finalCoef);\r
+ finalG = dechex(g * finalCoef);\r
+ finalB = dechex(b * finalCoef);\r
+ }\r
+\r
+ color = finalR + finalG + finalB;\r
+\r
+ setCol('gs' + i, '#'+color);\r
+ }\r
+}\r
+\r
+function changeFinalColor(color) {\r
+ if (color.indexOf('#') == -1)\r
+ color = convertRGBToHex(color);\r
+\r
+ setCol('preview', color);\r
+ document.getElementById('color').value = color;\r
+}\r
+\r
+function setCol(e, c) {\r
+ try {\r
+ document.getElementById(e).style.backgroundColor = c;\r
+ } catch (ex) {\r
+ // Ignore IE warning\r
+ }\r
+}\r
+\r
+tinyMCEPopup.onInit.add(init);\r
--- /dev/null
+var ImageDialog = {\r
+ preInit : function() {\r
+ var url;\r
+\r
+ tinyMCEPopup.requireLangPack();\r
+\r
+ if (url = tinyMCEPopup.getParam("external_image_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+ },\r
+\r
+ init : function() {\r
+ var f = document.forms[0], ed = tinyMCEPopup.editor;\r
+\r
+ // Setup browse button\r
+ document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');\r
+ if (isVisible('srcbrowser'))\r
+ document.getElementById('src').style.width = '180px';\r
+\r
+ e = ed.selection.getNode();\r
+\r
+ this.fillFileList('image_list', 'tinyMCEImageList');\r
+\r
+ if (e.nodeName == 'IMG') {\r
+ f.src.value = ed.dom.getAttrib(e, 'src');\r
+ f.alt.value = ed.dom.getAttrib(e, 'alt');\r
+ f.border.value = this.getAttrib(e, 'border');\r
+ f.vspace.value = this.getAttrib(e, 'vspace');\r
+ f.hspace.value = this.getAttrib(e, 'hspace');\r
+ f.width.value = ed.dom.getAttrib(e, 'width');\r
+ f.height.value = ed.dom.getAttrib(e, 'height');\r
+ f.insert.value = ed.getLang('update');\r
+ this.styleVal = ed.dom.getAttrib(e, 'style');\r
+ selectByValue(f, 'image_list', f.src.value);\r
+ selectByValue(f, 'align', this.getAttrib(e, 'align'));\r
+ this.updateStyle();\r
+ }\r
+ },\r
+\r
+ fillFileList : function(id, l) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ l = window[l];\r
+\r
+ if (l && l.length > 0) {\r
+ lst.options[lst.options.length] = new Option('', '');\r
+\r
+ tinymce.each(l, function(o) {\r
+ lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ update : function() {\r
+ var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+\r
+ if (f.src.value === '') {\r
+ if (ed.selection.getNode().nodeName == 'IMG') {\r
+ ed.dom.remove(ed.selection.getNode());\r
+ ed.execCommand('mceRepaint');\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+\r
+ if (!ed.settings.inline_styles) {\r
+ args = tinymce.extend(args, {\r
+ vspace : nl.vspace.value,\r
+ hspace : nl.hspace.value,\r
+ border : nl.border.value,\r
+ align : getSelectValue(f, 'align')\r
+ });\r
+ } else\r
+ args.style = this.styleVal;\r
+\r
+ tinymce.extend(args, {\r
+ src : f.src.value,\r
+ alt : f.alt.value,\r
+ width : f.width.value,\r
+ height : f.height.value\r
+ });\r
+\r
+ el = ed.selection.getNode();\r
+\r
+ if (el && el.nodeName == 'IMG') {\r
+ ed.dom.setAttribs(el, args);\r
+ } else {\r
+ ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});\r
+ ed.dom.setAttribs('__mce_tmp', args);\r
+ ed.dom.setAttrib('__mce_tmp', 'id', '');\r
+ ed.undoManager.add();\r
+ }\r
+\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ updateStyle : function() {\r
+ var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];\r
+\r
+ if (tinyMCEPopup.editor.settings.inline_styles) {\r
+ st = tinyMCEPopup.dom.parseStyle(this.styleVal);\r
+\r
+ // Handle align\r
+ v = getSelectValue(f, 'align');\r
+ if (v) {\r
+ if (v == 'left' || v == 'right') {\r
+ st['float'] = v;\r
+ delete st['vertical-align'];\r
+ } else {\r
+ st['vertical-align'] = v;\r
+ delete st['float'];\r
+ }\r
+ } else {\r
+ delete st['float'];\r
+ delete st['vertical-align'];\r
+ }\r
+\r
+ // Handle border\r
+ v = f.border.value;\r
+ if (v || v == '0') {\r
+ if (v == '0')\r
+ st['border'] = '0';\r
+ else\r
+ st['border'] = v + 'px solid black';\r
+ } else\r
+ delete st['border'];\r
+\r
+ // Handle hspace\r
+ v = f.hspace.value;\r
+ if (v) {\r
+ delete st['margin'];\r
+ st['margin-left'] = v + 'px';\r
+ st['margin-right'] = v + 'px';\r
+ } else {\r
+ delete st['margin-left'];\r
+ delete st['margin-right'];\r
+ }\r
+\r
+ // Handle vspace\r
+ v = f.vspace.value;\r
+ if (v) {\r
+ delete st['margin'];\r
+ st['margin-top'] = v + 'px';\r
+ st['margin-bottom'] = v + 'px';\r
+ } else {\r
+ delete st['margin-top'];\r
+ delete st['margin-bottom'];\r
+ }\r
+\r
+ // Merge\r
+ st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');\r
+ this.styleVal = dom.serializeStyle(st, 'img');\r
+ }\r
+ },\r
+\r
+ getAttrib : function(e, at) {\r
+ var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;\r
+\r
+ if (ed.settings.inline_styles) {\r
+ switch (at) {\r
+ case 'align':\r
+ if (v = dom.getStyle(e, 'float'))\r
+ return v;\r
+\r
+ if (v = dom.getStyle(e, 'vertical-align'))\r
+ return v;\r
+\r
+ break;\r
+\r
+ case 'hspace':\r
+ v = dom.getStyle(e, 'margin-left')\r
+ v2 = dom.getStyle(e, 'margin-right');\r
+ if (v && v == v2)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+\r
+ case 'vspace':\r
+ v = dom.getStyle(e, 'margin-top')\r
+ v2 = dom.getStyle(e, 'margin-bottom');\r
+ if (v && v == v2)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+\r
+ case 'border':\r
+ v = 0;\r
+\r
+ tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {\r
+ sv = dom.getStyle(e, 'border-' + sv + '-width');\r
+\r
+ // False or not the same as prev\r
+ if (!sv || (sv != v && v !== 0)) {\r
+ v = 0;\r
+ return false;\r
+ }\r
+\r
+ if (sv)\r
+ v = sv;\r
+ });\r
+\r
+ if (v)\r
+ return parseInt(v.replace(/[^0-9]/g, ''));\r
+\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (v = dom.getAttrib(e, at))\r
+ return v;\r
+\r
+ return '';\r
+ },\r
+\r
+ resetImageData : function() {\r
+ var f = document.forms[0];\r
+\r
+ f.width.value = f.height.value = ""; \r
+ },\r
+\r
+ updateImageData : function() {\r
+ var f = document.forms[0], t = ImageDialog;\r
+\r
+ if (f.width.value == "")\r
+ f.width.value = t.preloadImg.width;\r
+\r
+ if (f.height.value == "")\r
+ f.height.value = t.preloadImg.height;\r
+ },\r
+\r
+ getImageData : function() {\r
+ var f = document.forms[0];\r
+\r
+ this.preloadImg = new Image();\r
+ this.preloadImg.onload = this.updateImageData;\r
+ this.preloadImg.onerror = this.resetImageData;\r
+ this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);\r
+ }\r
+};\r
+\r
+ImageDialog.preInit();\r
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+\r
+var LinkDialog = {\r
+ preInit : function() {\r
+ var url;\r
+\r
+ if (url = tinyMCEPopup.getParam("external_link_list_url"))\r
+ document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');\r
+ },\r
+\r
+ init : function() {\r
+ var f = document.forms[0], ed = tinyMCEPopup.editor;\r
+\r
+ // Setup browse button\r
+ document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');\r
+ if (isVisible('hrefbrowser'))\r
+ document.getElementById('href').style.width = '180px';\r
+\r
+ this.fillClassList('class_list');\r
+ this.fillFileList('link_list', 'tinyMCELinkList');\r
+ this.fillTargetList('target_list');\r
+\r
+ if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {\r
+ f.href.value = ed.dom.getAttrib(e, 'href');\r
+ f.linktitle.value = ed.dom.getAttrib(e, 'title');\r
+ f.insert.value = ed.getLang('update');\r
+ selectByValue(f, 'link_list', f.href.value);\r
+ selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));\r
+ selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));\r
+ }\r
+ },\r
+\r
+ update : function() {\r
+ var f = document.forms[0], ed = tinyMCEPopup.editor, e, b;\r
+\r
+ tinyMCEPopup.restoreSelection();\r
+ e = ed.dom.getParent(ed.selection.getNode(), 'A');\r
+\r
+ // Remove element if there is no href\r
+ if (!f.href.value) {\r
+ if (e) {\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+ b = ed.selection.getBookmark();\r
+ ed.dom.remove(e, 1);\r
+ ed.selection.moveToBookmark(b);\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+ return;\r
+ }\r
+ }\r
+\r
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");\r
+\r
+ // Create new anchor elements\r
+ if (e == null) {\r
+ ed.getDoc().execCommand("unlink", false, null);\r
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});\r
+\r
+ tinymce.each(ed.dom.select("a"), function(n) {\r
+ if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {\r
+ e = n;\r
+\r
+ ed.dom.setAttribs(e, {\r
+ href : f.href.value,\r
+ title : f.linktitle.value,\r
+ target : f.target_list ? getSelectValue(f, "target_list") : null,\r
+ 'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
+ });\r
+ }\r
+ });\r
+ } else {\r
+ ed.dom.setAttribs(e, {\r
+ href : f.href.value,\r
+ title : f.linktitle.value,\r
+ target : f.target_list ? getSelectValue(f, "target_list") : null,\r
+ 'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
+ });\r
+ }\r
+\r
+ // Don't move caret if selection was image\r
+ if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {\r
+ ed.focus();\r
+ ed.selection.select(e);\r
+ ed.selection.collapse(0);\r
+ tinyMCEPopup.storeSelection();\r
+ }\r
+\r
+ tinyMCEPopup.execCommand("mceEndUndoLevel");\r
+ tinyMCEPopup.close();\r
+ },\r
+\r
+ checkPrefix : function(n) {\r
+ if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))\r
+ n.value = 'mailto:' + n.value;\r
+\r
+ if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))\r
+ n.value = 'http://' + n.value;\r
+ },\r
+\r
+ fillFileList : function(id, l) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ l = window[l];\r
+\r
+ if (l && l.length > 0) {\r
+ lst.options[lst.options.length] = new Option('', '');\r
+\r
+ tinymce.each(l, function(o) {\r
+ lst.options[lst.options.length] = new Option(o[0], o[1]);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ fillClassList : function(id) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;\r
+\r
+ if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {\r
+ cl = [];\r
+\r
+ tinymce.each(v.split(';'), function(v) {\r
+ var p = v.split('=');\r
+\r
+ cl.push({'title' : p[0], 'class' : p[1]});\r
+ });\r
+ } else\r
+ cl = tinyMCEPopup.editor.dom.getClasses();\r
+\r
+ if (cl.length > 0) {\r
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+\r
+ tinymce.each(cl, function(o) {\r
+ lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);\r
+ });\r
+ } else\r
+ dom.remove(dom.getParent(id, 'tr'));\r
+ },\r
+\r
+ fillTargetList : function(id) {\r
+ var dom = tinyMCEPopup.dom, lst = dom.get(id), v;\r
+\r
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');\r
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');\r
+ lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');\r
+\r
+ if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {\r
+ tinymce.each(v.split(','), function(v) {\r
+ v = v.split('=');\r
+ lst.options[lst.options.length] = new Option(v[0], v[1]);\r
+ });\r
+ }\r
+ }\r
+};\r
+\r
+LinkDialog.preInit();\r
+tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);\r
--- /dev/null
+tinyMCEPopup.requireLangPack();\r
+tinyMCEPopup.onInit.add(onLoadInit);\r
+\r
+function saveContent() {\r
+ tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});\r
+ tinyMCEPopup.close();\r
+}\r
+\r
+function onLoadInit() {\r
+ tinyMCEPopup.resizeToInnerSize();\r
+\r
+ // Remove Gecko spellchecking\r
+ if (tinymce.isGecko)\r
+ document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");\r
+\r
+ document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});\r
+\r
+ if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {\r
+ setWrap('soft');\r
+ document.getElementById('wraped').checked = true;\r
+ }\r
+\r
+ resizeInputs();\r
+}\r
+\r
+function setWrap(val) {\r
+ var v, n, s = document.getElementById('htmlSource');\r
+\r
+ s.wrap = val;\r
+\r
+ if (!tinymce.isIE) {\r
+ v = s.value;\r
+ n = s.cloneNode(false);\r
+ n.setAttribute("wrap", val);\r
+ s.parentNode.replaceChild(n, s);\r
+ n.value = v;\r
+ }\r
+}\r
+\r
+function toggleWordWrap(elm) {\r
+ if (elm.checked)\r
+ setWrap('soft');\r
+ else\r
+ setWrap('off');\r
+}\r
+\r
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;\r
+\r
+function resizeInputs() {\r
+ var el = document.getElementById('htmlSource');\r
+\r
+ if (!tinymce.isIE) {\r
+ wHeight = self.innerHeight - 65;\r
+ wWidth = self.innerWidth - 16;\r
+ } else {\r
+ wHeight = document.body.clientHeight - 70;\r
+ wWidth = document.body.clientWidth - 16;\r
+ }\r
+\r
+ el.style.height = Math.abs(wHeight) + 'px';\r
+ el.style.width = Math.abs(wWidth) + 'px';\r
+}\r
--- /dev/null
+tinyMCE.addI18n('en.advanced',{\r
+style_select:"Styles",\r
+font_size:"Font size",\r
+fontdefault:"Font family",\r
+block:"Format",\r
+paragraph:"Paragraph",\r
+div:"Div",\r
+address:"Address",\r
+pre:"Preformatted",\r
+h1:"Heading 1",\r
+h2:"Heading 2",\r
+h3:"Heading 3",\r
+h4:"Heading 4",\r
+h5:"Heading 5",\r
+h6:"Heading 6",\r
+blockquote:"Blockquote",\r
+code:"Code",\r
+samp:"Code sample",\r
+dt:"Definition term ",\r
+dd:"Definition description",\r
+bold_desc:"Bold (Ctrl+B)",\r
+italic_desc:"Italic (Ctrl+I)",\r
+underline_desc:"Underline (Ctrl+U)",\r
+striketrough_desc:"Strikethrough",\r
+justifyleft_desc:"Align left",\r
+justifycenter_desc:"Align center",\r
+justifyright_desc:"Align right",\r
+justifyfull_desc:"Align full",\r
+bullist_desc:"Unordered list",\r
+numlist_desc:"Ordered list",\r
+outdent_desc:"Outdent",\r
+indent_desc:"Indent",\r
+undo_desc:"Undo (Ctrl+Z)",\r
+redo_desc:"Redo (Ctrl+Y)",\r
+link_desc:"Insert/edit link",\r
+unlink_desc:"Unlink",\r
+image_desc:"Insert/edit image",\r
+cleanup_desc:"Cleanup messy code",\r
+code_desc:"Edit HTML Source",\r
+sub_desc:"Subscript",\r
+sup_desc:"Superscript",\r
+hr_desc:"Insert horizontal ruler",\r
+removeformat_desc:"Remove formatting",\r
+custom1_desc:"Your custom description here",\r
+forecolor_desc:"Select text color",\r
+backcolor_desc:"Select background color",\r
+charmap_desc:"Insert custom character",\r
+visualaid_desc:"Toggle guidelines/invisible elements",\r
+anchor_desc:"Insert/edit anchor",\r
+cut_desc:"Cut",\r
+copy_desc:"Copy",\r
+paste_desc:"Paste",\r
+image_props_desc:"Image properties",\r
+newdocument_desc:"New document",\r
+help_desc:"Help",\r
+blockquote_desc:"Blockquote",\r
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",\r
+path:"Path",\r
+newdocument:"Are you sure you want clear all contents?",\r
+toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",\r
+more_colors:"More colors"\r
+});
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n('en.advanced_dlg',{\r
+about_title:"About TinyMCE",\r
+about_general:"About",\r
+about_help:"Help",\r
+about_license:"License",\r
+about_plugins:"Plugins",\r
+about_plugin:"Plugin",\r
+about_author:"Author",\r
+about_version:"Version",\r
+about_loaded:"Loaded plugins",\r
+anchor_title:"Insert/edit anchor",\r
+anchor_name:"Anchor name",\r
+code_title:"HTML Source Editor",\r
+code_wordwrap:"Word wrap",\r
+colorpicker_title:"Select a color",\r
+colorpicker_picker_tab:"Picker",\r
+colorpicker_picker_title:"Color picker",\r
+colorpicker_palette_tab:"Palette",\r
+colorpicker_palette_title:"Palette colors",\r
+colorpicker_named_tab:"Named",\r
+colorpicker_named_title:"Named colors",\r
+colorpicker_color:"Color:",\r
+colorpicker_name:"Name:",\r
+charmap_title:"Select custom character",\r
+image_title:"Insert/edit image",\r
+image_src:"Image URL",\r
+image_alt:"Image description",\r
+image_list:"Image list",\r
+image_border:"Border",\r
+image_dimensions:"Dimensions",\r
+image_vspace:"Vertical space",\r
+image_hspace:"Horizontal space",\r
+image_align:"Alignment",\r
+image_align_baseline:"Baseline",\r
+image_align_top:"Top",\r
+image_align_middle:"Middle",\r
+image_align_bottom:"Bottom",\r
+image_align_texttop:"Text top",\r
+image_align_textbottom:"Text bottom",\r
+image_align_left:"Left",\r
+image_align_right:"Right",\r
+link_title:"Insert/edit link",\r
+link_url:"Link URL",\r
+link_target:"Target",\r
+link_target_same:"Open link in the same window",\r
+link_target_blank:"Open link in a new window",\r
+link_titlefield:"Title",\r
+link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",\r
+link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",\r
+link_list:"Link list"\r
+});
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.link_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="../../utils/mctabs.js"></script>\r
+ <script type="text/javascript" src="../../utils/form_utils.js"></script>\r
+ <script type="text/javascript" src="../../utils/validate.js"></script>\r
+ <script type="text/javascript" src="js/link.js"></script>\r
+</head>\r
+<body id="link" style="display: none">\r
+<form onsubmit="LinkDialog.update();return false;" action="#">\r
+ <div class="tabs">\r
+ <ul>\r
+ <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>\r
+ </ul>\r
+ </div>\r
+\r
+ <div class="panel_wrapper">\r
+ <div id="general_panel" class="panel current">\r
+\r
+ <table border="0" cellpadding="4" cellspacing="0">\r
+ <tr>\r
+ <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>\r
+ <td><table border="0" cellspacing="0" cellpadding="0"> \r
+ <tr> \r
+ <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> \r
+ <td id="hrefbrowsercontainer"> </td>\r
+ </tr> \r
+ </table></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="link_list">{#advanced_dlg.link_list}</label></td>\r
+ <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>\r
+ <td><select id="target_list" name="target_list"></select></td>\r
+ </tr>\r
+ <tr>\r
+ <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>\r
+ <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><label for="class_list">{#class_name}</label></td>\r
+ <td><select id="class_list" name="class_list"></select></td>\r
+ </tr>\r
+ </table>\r
+ </div>\r
+ </div>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" id="insert" name="insert" value="{#insert}" />\r
+ <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />\r
+ </div>\r
+</form>\r
+</body>\r
+</html>\r
--- /dev/null
+body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}\r
+body {background:#FFF;}\r
+body.mceForceColors {background:#FFF; color:#000;}\r
+h1 {font-size: 2em}\r
+h2 {font-size: 1.5em}\r
+h3 {font-size: 1.17em}\r
+h4 {font-size: 1em}\r
+h5 {font-size: .83em}\r
+h6 {font-size: .75em}\r
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;}\r
+span.mceItemNbsp {background: #DDD}\r
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
+img {border:0;}\r
+table {cursor:default}\r
+table td, table th {cursor:text}\r
+ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
+del {color:red; text-decoration:line-through}\r
+cite {border-bottom:1px dashed blue}\r
+acronym {border-bottom:1px dotted #CCC; cursor:help}\r
+abbr {border-bottom:1px dashed #CCC; cursor:help}\r
+\r
+/* IE */\r
+* html body {\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+}\r
+\r
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
+font[face=mceinline] {font-family:inherit !important}\r
--- /dev/null
+/* Generic */\r
+body {\r
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDDDDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+background:#F0F0EE;\r
+padding:0;\r
+margin:8px 8px 0 8px;\r
+}\r
+\r
+html {background:#F0F0EE;}\r
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+textarea {resize:none;outline:none;}\r
+a:link, a:visited {color:black;}\r
+a:hover {color:#2B6FB6;}\r
+.nowrap {white-space: nowrap}\r
+\r
+/* Forms */\r
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
+legend {color:#2B6FB6; font-weight:bold;}\r
+label.msg {display:none;}\r
+label.invalid {color:#EE0000; display:inline;}\r
+input.invalid {border:1px solid #EE0000;}\r
+input {background:#FFF; border:1px solid #CCC;}\r
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+input, select, textarea {border:1px solid #808080;}\r
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+.input_noborder {border:0;}\r
+\r
+/* Buttons */\r
+#insert, #cancel, input.button, .updateButton {\r
+border:0; margin:0; padding:0;\r
+font-weight:bold;\r
+width:94px; height:26px;\r
+background:url(img/buttons.png) 0 -26px;\r
+cursor:pointer;\r
+padding-bottom:2px;\r
+float:left;\r
+}\r
+\r
+#insert {background:url(img/buttons.png) 0 -52px}\r
+#cancel {background:url(img/buttons.png) 0 0; float:right}\r
+\r
+/* Browse */\r
+a.pickcolor, a.browse {text-decoration:none}\r
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
+.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
+a.pickcolor:hover span {background-color:#B2BBD0;}\r
+a.pickcolor:hover span.disabled {}\r
+\r
+/* Charmap */\r
+table.charmap {border:1px solid #AAA; text-align:center}\r
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}\r
+#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
+#charmap a:hover {background:#CCC;color:#2B6FB6}\r
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
+\r
+/* Source */\r
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
+.mceActionPanel {margin-top:5px;}\r
+\r
+/* Tabs classes */\r
+.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}\r
+.tabs ul {margin:0; padding:0; list-style:none;}\r
+.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
+.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
+.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
+.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}\r
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
+\r
+/* Panels */\r
+.panel_wrapper div.panel {display:none;}\r
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
+\r
+/* Columns */\r
+.column {float:left;}\r
+.properties {width:100%;}\r
+.properties .column1 {}\r
+.properties .column2 {text-align:left;}\r
+\r
+/* Titles */\r
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
+h3 {font-size:14px;}\r
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
+\r
+/* Dialog specific */\r
+#link .panel_wrapper, #link div.current {height:125px;}\r
+#image .panel_wrapper, #image div.current {height:200px;}\r
+#plugintable thead {font-weight:bold; background:#DDD;}\r
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
+#plugintable {width:96%; margin-top:10px;}\r
+#pluginscontainer {height:290px; overflow:auto;}\r
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
+#colorpicker #light div {overflow:hidden;}\r
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
+#colorpicker .panel_wrapper div.current {height:175px;}\r
+#colorpicker #namedcolors {width:150px;}\r
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
+#colorpicker #colornamecontainer {margin-top:5px;}\r
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}\r
--- /dev/null
+/* Reset */\r
+.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}\r
+.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+.defaultSkin table td {vertical-align:middle}\r
+\r
+/* Containers */\r
+.defaultSkin table {direction:ltr; background:#F0F0EE}\r
+.defaultSkin iframe {display:block; background:#FFF}\r
+.defaultSkin .mceToolbar {height:26px}\r
+.defaultSkin .mceLeft {text-align:left}\r
+.defaultSkin .mceRight {text-align:right}\r
+\r
+/* External */\r
+.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}\r
+.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
+.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
+\r
+/* Layout */\r
+.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}\r
+.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}\r
+.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}\r
+.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}\r
+.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}\r
+.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}\r
+.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}\r
+.defaultSkin .mceStatusbar div {float:left; margin:2px}\r
+.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}\r
+.defaultSkin .mceStatusbar a:hover {text-decoration:underline}\r
+.defaultSkin table.mceToolbar {margin-left:3px}\r
+.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}\r
+.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+.defaultSkin td.mceCenter {text-align:center;}\r
+.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}\r
+.defaultSkin td.mceRight table {margin:0 0 0 auto;}\r
+\r
+/* Button */\r
+.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}\r
+.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
+.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}\r
+.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.defaultSkin .mceButtonLabeled {width:auto}\r
+.defaultSkin .mceButtonLabeled span.mceIcon {float:left}\r
+.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
+.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}\r
+\r
+/* Separator */\r
+.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}\r
+\r
+/* ListBox */\r
+.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}\r
+.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}\r
+.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}\r
+.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}\r
+.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}\r
+.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}\r
+.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}\r
+.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
+.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}\r
+.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}\r
+\r
+/* SplitButton */\r
+.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}\r
+.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}\r
+.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}\r
+.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}\r
+.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}\r
+.defaultSkin .mceSplitButton span.mceOpen {display:none}\r
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}\r
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}\r
+.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}\r
+.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}\r
+\r
+/* ColorSplitButton */\r
+.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
+.defaultSkin .mceColorSplitMenu td {padding:2px}\r
+.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
+.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
+.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}\r
+.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
+.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}\r
+.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}\r
+.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}\r
+\r
+/* Menu */\r
+.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}\r
+.defaultSkin .mceNoIcons span.mceIcon {width:0;}\r
+.defaultSkin .mceNoIcons a .mceText {padding-left:10px}\r
+.defaultSkin .mceMenu table {background:#FFF}\r
+.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}\r
+.defaultSkin .mceMenu td {height:20px}\r
+.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
+.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}\r
+.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}\r
+.defaultSkin .mceMenu pre.mceText {font-family:Monospace}\r
+.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
+.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
+.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
+.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}\r
+.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
+.defaultSkin .mceMenuItemDisabled .mceText {color:#888}\r
+.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}\r
+.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}\r
+.defaultSkin .mceMenu span.mceMenuLine {display:none}\r
+.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}\r
+\r
+/* Progress,Resize */\r
+.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}\r
+.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
+\r
+/* Formats */\r
+.defaultSkin .mce_formatPreview a {font-size:10px}\r
+.defaultSkin .mce_p span.mceText {}\r
+.defaultSkin .mce_address span.mceText {font-style:italic}\r
+.defaultSkin .mce_pre span.mceText {font-family:monospace}\r
+.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
+.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
+.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
+.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
+.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
+.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
+\r
+/* Theme */\r
+.defaultSkin span.mce_bold {background-position:0 0}\r
+.defaultSkin span.mce_italic {background-position:-60px 0}\r
+.defaultSkin span.mce_underline {background-position:-140px 0}\r
+.defaultSkin span.mce_strikethrough {background-position:-120px 0}\r
+.defaultSkin span.mce_undo {background-position:-160px 0}\r
+.defaultSkin span.mce_redo {background-position:-100px 0}\r
+.defaultSkin span.mce_cleanup {background-position:-40px 0}\r
+.defaultSkin span.mce_bullist {background-position:-20px 0}\r
+.defaultSkin span.mce_numlist {background-position:-80px 0}\r
+.defaultSkin span.mce_justifyleft {background-position:-460px 0}\r
+.defaultSkin span.mce_justifyright {background-position:-480px 0}\r
+.defaultSkin span.mce_justifycenter {background-position:-420px 0}\r
+.defaultSkin span.mce_justifyfull {background-position:-440px 0}\r
+.defaultSkin span.mce_anchor {background-position:-200px 0}\r
+.defaultSkin span.mce_indent {background-position:-400px 0}\r
+.defaultSkin span.mce_outdent {background-position:-540px 0}\r
+.defaultSkin span.mce_link {background-position:-500px 0}\r
+.defaultSkin span.mce_unlink {background-position:-640px 0}\r
+.defaultSkin span.mce_sub {background-position:-600px 0}\r
+.defaultSkin span.mce_sup {background-position:-620px 0}\r
+.defaultSkin span.mce_removeformat {background-position:-580px 0}\r
+.defaultSkin span.mce_newdocument {background-position:-520px 0}\r
+.defaultSkin span.mce_image {background-position:-380px 0}\r
+.defaultSkin span.mce_help {background-position:-340px 0}\r
+.defaultSkin span.mce_code {background-position:-260px 0}\r
+.defaultSkin span.mce_hr {background-position:-360px 0}\r
+.defaultSkin span.mce_visualaid {background-position:-660px 0}\r
+.defaultSkin span.mce_charmap {background-position:-240px 0}\r
+.defaultSkin span.mce_paste {background-position:-560px 0}\r
+.defaultSkin span.mce_copy {background-position:-700px 0}\r
+.defaultSkin span.mce_cut {background-position:-680px 0}\r
+.defaultSkin span.mce_blockquote {background-position:-220px 0}\r
+.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}\r
+.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}\r
+.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}\r
+.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}\r
+\r
+/* Plugins */\r
+.defaultSkin span.mce_advhr {background-position:-0px -20px}\r
+.defaultSkin span.mce_ltr {background-position:-20px -20px}\r
+.defaultSkin span.mce_rtl {background-position:-40px -20px}\r
+.defaultSkin span.mce_emotions {background-position:-60px -20px}\r
+.defaultSkin span.mce_fullpage {background-position:-80px -20px}\r
+.defaultSkin span.mce_fullscreen {background-position:-100px -20px}\r
+.defaultSkin span.mce_iespell {background-position:-120px -20px}\r
+.defaultSkin span.mce_insertdate {background-position:-140px -20px}\r
+.defaultSkin span.mce_inserttime {background-position:-160px -20px}\r
+.defaultSkin span.mce_absolute {background-position:-180px -20px}\r
+.defaultSkin span.mce_backward {background-position:-200px -20px}\r
+.defaultSkin span.mce_forward {background-position:-220px -20px}\r
+.defaultSkin span.mce_insert_layer {background-position:-240px -20px}\r
+.defaultSkin span.mce_insertlayer {background-position:-260px -20px}\r
+.defaultSkin span.mce_movebackward {background-position:-280px -20px}\r
+.defaultSkin span.mce_moveforward {background-position:-300px -20px}\r
+.defaultSkin span.mce_media {background-position:-320px -20px}\r
+.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}\r
+.defaultSkin span.mce_pastetext {background-position:-360px -20px}\r
+.defaultSkin span.mce_pasteword {background-position:-380px -20px}\r
+.defaultSkin span.mce_selectall {background-position:-400px -20px}\r
+.defaultSkin span.mce_preview {background-position:-420px -20px}\r
+.defaultSkin span.mce_print {background-position:-440px -20px}\r
+.defaultSkin span.mce_cancel {background-position:-460px -20px}\r
+.defaultSkin span.mce_save {background-position:-480px -20px}\r
+.defaultSkin span.mce_replace {background-position:-500px -20px}\r
+.defaultSkin span.mce_search {background-position:-520px -20px}\r
+.defaultSkin span.mce_styleprops {background-position:-560px -20px}\r
+.defaultSkin span.mce_table {background-position:-580px -20px}\r
+.defaultSkin span.mce_cell_props {background-position:-600px -20px}\r
+.defaultSkin span.mce_delete_table {background-position:-620px -20px}\r
+.defaultSkin span.mce_delete_col {background-position:-640px -20px}\r
+.defaultSkin span.mce_delete_row {background-position:-660px -20px}\r
+.defaultSkin span.mce_col_after {background-position:-680px -20px}\r
+.defaultSkin span.mce_col_before {background-position:-700px -20px}\r
+.defaultSkin span.mce_row_after {background-position:-720px -20px}\r
+.defaultSkin span.mce_row_before {background-position:-740px -20px}\r
+.defaultSkin span.mce_merge_cells {background-position:-760px -20px}\r
+.defaultSkin span.mce_table_props {background-position:-980px -20px}\r
+.defaultSkin span.mce_row_props {background-position:-780px -20px}\r
+.defaultSkin span.mce_split_cells {background-position:-800px -20px}\r
+.defaultSkin span.mce_template {background-position:-820px -20px}\r
+.defaultSkin span.mce_visualchars {background-position:-840px -20px}\r
+.defaultSkin span.mce_abbr {background-position:-860px -20px}\r
+.defaultSkin span.mce_acronym {background-position:-880px -20px}\r
+.defaultSkin span.mce_attribs {background-position:-900px -20px}\r
+.defaultSkin span.mce_cite {background-position:-920px -20px}\r
+.defaultSkin span.mce_del {background-position:-940px -20px}\r
+.defaultSkin span.mce_ins {background-position:-960px -20px}\r
+.defaultSkin span.mce_pagebreak {background-position:0 -40px}\r
+.defaultSkin span.mce_restoredraft {background-position:-20px -40px}\r
+.defaultSkin span.mce_spellchecker {background-position:-540px -20px}\r
--- /dev/null
+body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}\r
+body {background:#FFF;}\r
+body.mceForceColors {background:#FFF; color:#000;}\r
+h1 {font-size: 2em}\r
+h2 {font-size: 1.5em}\r
+h3 {font-size: 1.17em}\r
+h4 {font-size: 1em}\r
+h5 {font-size: .83em}\r
+h6 {font-size: .75em}\r
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}\r
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}\r
+span.mceItemNbsp {background: #DDD}\r
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}\r
+img {border:0;}\r
+table {cursor:default}\r
+table td, table th {cursor:text}\r
+ins {border-bottom:1px solid green; text-decoration: none; color:green}\r
+del {color:red; text-decoration:line-through}\r
+cite {border-bottom:1px dashed blue}\r
+acronym {border-bottom:1px dotted #CCC; cursor:help}\r
+abbr {border-bottom:1px dashed #CCC; cursor:help}\r
+\r
+/* IE */\r
+* html body {\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+}\r
+\r
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}\r
+font[face=mceinline] {font-family:inherit !important}\r
--- /dev/null
+/* Generic */\r
+body {\r
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;\r
+scrollbar-3dlight-color:#F0F0EE;\r
+scrollbar-arrow-color:#676662;\r
+scrollbar-base-color:#F0F0EE;\r
+scrollbar-darkshadow-color:#DDDDDD;\r
+scrollbar-face-color:#E0E0DD;\r
+scrollbar-highlight-color:#F0F0EE;\r
+scrollbar-shadow-color:#F0F0EE;\r
+scrollbar-track-color:#F5F5F5;\r
+background:#F0F0EE;\r
+padding:0;\r
+margin:8px 8px 0 8px;\r
+}\r
+\r
+html {background:#F0F0EE;}\r
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+textarea {resize:none;outline:none;}\r
+a:link, a:visited {color:black;}\r
+a:hover {color:#2B6FB6;}\r
+.nowrap {white-space: nowrap}\r
+\r
+/* Forms */\r
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}\r
+legend {color:#2B6FB6; font-weight:bold;}\r
+label.msg {display:none;}\r
+label.invalid {color:#EE0000; display:inline;}\r
+input.invalid {border:1px solid #EE0000;}\r
+input {background:#FFF; border:1px solid #CCC;}\r
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+input, select, textarea {border:1px solid #808080;}\r
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}\r
+.input_noborder {border:0;}\r
+\r
+/* Buttons */\r
+#insert, #cancel, input.button, .updateButton {\r
+border:0; margin:0; padding:0;\r
+font-weight:bold;\r
+width:94px; height:26px;\r
+background:url(../default/img/buttons.png) 0 -26px;\r
+cursor:pointer;\r
+padding-bottom:2px;\r
+float:left;\r
+}\r
+\r
+#insert {background:url(../default/img/buttons.png) 0 -52px}\r
+#cancel {background:url(../default/img/buttons.png) 0 0; float:right}\r
+\r
+/* Browse */\r
+a.pickcolor, a.browse {text-decoration:none}\r
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}\r
+.mceOldBoxModel a.browse span {width:22px; height:20px;}\r
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}\r
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}\r
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}\r
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}\r
+a.pickcolor:hover span {background-color:#B2BBD0;}\r
+a.pickcolor:hover span.disabled {}\r
+\r
+/* Charmap */\r
+table.charmap {border:1px solid #AAA; text-align:center}\r
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}\r
+#charmap a {display:block; color:#000; text-decoration:none; border:0}\r
+#charmap a:hover {background:#CCC;color:#2B6FB6}\r
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}\r
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}\r
+\r
+/* Source */\r
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}\r
+.mceActionPanel {margin-top:5px;}\r
+\r
+/* Tabs classes */\r
+.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}\r
+.tabs ul {margin:0; padding:0; list-style:none;}\r
+.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}\r
+.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}\r
+.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}\r
+.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}\r
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}\r
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}\r
+\r
+/* Panels */\r
+.panel_wrapper div.panel {display:none;}\r
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}\r
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}\r
+\r
+/* Columns */\r
+.column {float:left;}\r
+.properties {width:100%;}\r
+.properties .column1 {}\r
+.properties .column2 {text-align:left;}\r
+\r
+/* Titles */\r
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}\r
+h3 {font-size:14px;}\r
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}\r
+\r
+/* Dialog specific */\r
+#link .panel_wrapper, #link div.current {height:125px;}\r
+#image .panel_wrapper, #image div.current {height:200px;}\r
+#plugintable thead {font-weight:bold; background:#DDD;}\r
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}\r
+#plugintable {width:96%; margin-top:10px;}\r
+#pluginscontainer {height:290px; overflow:auto;}\r
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}\r
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}\r
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}\r
+#colorpicker #light div {overflow:hidden;}\r
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}\r
+#colorpicker .panel_wrapper div.current {height:175px;}\r
+#colorpicker #namedcolors {width:150px;}\r
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}\r
+#colorpicker #colornamecontainer {margin-top:5px;}\r
--- /dev/null
+/* Reset */\r
+.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}\r
+.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+.o2k7Skin table td {vertical-align:middle}\r
+\r
+/* Containers */\r
+.o2k7Skin table {background:#E5EFFD}\r
+.o2k7Skin iframe {display:block; background:#FFF}\r
+.o2k7Skin .mceToolbar {height:26px}\r
+\r
+/* External */\r
+.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}\r
+.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}\r
+.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}\r
+\r
+/* Layout */\r
+.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}\r
+.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}\r
+.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}\r
+.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}\r
+.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}\r
+.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}\r
+.o2k7Skin .mceStatusbar div {float:left; padding:2px}\r
+.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}\r
+.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}\r
+.o2k7Skin table.mceToolbar {margin-left:3px}\r
+.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}\r
+.o2k7Skin .mceToolbar td.mceFirst span {margin:0}\r
+.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}\r
+.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none}\r
+.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px}\r
+.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+.o2k7Skin td.mceCenter {text-align:center;}\r
+.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;}\r
+.o2k7Skin td.mceRight table {margin:0 0 0 auto;}\r
+\r
+/* Button */\r
+.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}\r
+.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px}\r
+.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}\r
+.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}\r
+.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px}\r
+.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.o2k7Skin .mceButtonLabeled {width:auto}\r
+.o2k7Skin .mceButtonLabeled span.mceIcon {float:left}\r
+.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}\r
+.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888}\r
+\r
+/* Separator */\r
+.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}\r
+\r
+/* ListBox */\r
+.o2k7Skin .mceListBox {margin-left:3px}\r
+.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}\r
+.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}\r
+.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}\r
+.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}\r
+.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}\r
+.o2k7Skin .mceListBoxDisabled .mceText {color:gray}\r
+.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}\r
+.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}\r
+.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}\r
+\r
+/* SplitButton */\r
+.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px}\r
+.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}\r
+.o2k7Skin .mceSplitButton a.mceAction {width:22px}\r
+.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}\r
+.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}\r
+.o2k7Skin .mceSplitButton span.mceOpen {display:none}\r
+.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}\r
+.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px}\r
+.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+.o2k7Skin .mceSplitButtonActive {background-position:0 -44px}\r
+\r
+/* ColorSplitButton */\r
+.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}\r
+.o2k7Skin .mceColorSplitMenu td {padding:2px}\r
+.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}\r
+.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}\r
+.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}\r
+.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}\r
+.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}\r
+.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden}\r
+.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}\r
+\r
+/* Menu */\r
+.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}\r
+.o2k7Skin .mceNoIcons span.mceIcon {width:0;}\r
+.o2k7Skin .mceNoIcons a .mceText {padding-left:10px}\r
+.o2k7Skin .mceMenu table {background:#FFF}\r
+.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block}\r
+.o2k7Skin .mceMenu td {height:20px}\r
+.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0}\r
+.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}\r
+.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px}\r
+.o2k7Skin .mceMenu pre.mceText {font-family:Monospace}\r
+.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}\r
+.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}\r
+.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px}\r
+.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}\r
+.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}\r
+.o2k7Skin .mceMenuItemDisabled .mceText {color:#888}\r
+.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)}\r
+.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}\r
+.o2k7Skin .mceMenu span.mceMenuLine {display:none}\r
+.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}\r
+\r
+/* Progress,Resize */\r
+.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}\r
+.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}\r
+\r
+/* Formats */\r
+.o2k7Skin .mce_formatPreview a {font-size:10px}\r
+.o2k7Skin .mce_p span.mceText {}\r
+.o2k7Skin .mce_address span.mceText {font-style:italic}\r
+.o2k7Skin .mce_pre span.mceText {font-family:monospace}\r
+.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}\r
+.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}\r
+.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}\r
+.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}\r
+.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}\r
+.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}\r
+\r
+/* Theme */\r
+.o2k7Skin span.mce_bold {background-position:0 0}\r
+.o2k7Skin span.mce_italic {background-position:-60px 0}\r
+.o2k7Skin span.mce_underline {background-position:-140px 0}\r
+.o2k7Skin span.mce_strikethrough {background-position:-120px 0}\r
+.o2k7Skin span.mce_undo {background-position:-160px 0}\r
+.o2k7Skin span.mce_redo {background-position:-100px 0}\r
+.o2k7Skin span.mce_cleanup {background-position:-40px 0}\r
+.o2k7Skin span.mce_bullist {background-position:-20px 0}\r
+.o2k7Skin span.mce_numlist {background-position:-80px 0}\r
+.o2k7Skin span.mce_justifyleft {background-position:-460px 0}\r
+.o2k7Skin span.mce_justifyright {background-position:-480px 0}\r
+.o2k7Skin span.mce_justifycenter {background-position:-420px 0}\r
+.o2k7Skin span.mce_justifyfull {background-position:-440px 0}\r
+.o2k7Skin span.mce_anchor {background-position:-200px 0}\r
+.o2k7Skin span.mce_indent {background-position:-400px 0}\r
+.o2k7Skin span.mce_outdent {background-position:-540px 0}\r
+.o2k7Skin span.mce_link {background-position:-500px 0}\r
+.o2k7Skin span.mce_unlink {background-position:-640px 0}\r
+.o2k7Skin span.mce_sub {background-position:-600px 0}\r
+.o2k7Skin span.mce_sup {background-position:-620px 0}\r
+.o2k7Skin span.mce_removeformat {background-position:-580px 0}\r
+.o2k7Skin span.mce_newdocument {background-position:-520px 0}\r
+.o2k7Skin span.mce_image {background-position:-380px 0}\r
+.o2k7Skin span.mce_help {background-position:-340px 0}\r
+.o2k7Skin span.mce_code {background-position:-260px 0}\r
+.o2k7Skin span.mce_hr {background-position:-360px 0}\r
+.o2k7Skin span.mce_visualaid {background-position:-660px 0}\r
+.o2k7Skin span.mce_charmap {background-position:-240px 0}\r
+.o2k7Skin span.mce_paste {background-position:-560px 0}\r
+.o2k7Skin span.mce_copy {background-position:-700px 0}\r
+.o2k7Skin span.mce_cut {background-position:-680px 0}\r
+.o2k7Skin span.mce_blockquote {background-position:-220px 0}\r
+.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0}\r
+.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0}\r
+.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0}\r
+.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0}\r
+\r
+/* Plugins */\r
+.o2k7Skin span.mce_advhr {background-position:-0px -20px}\r
+.o2k7Skin span.mce_ltr {background-position:-20px -20px}\r
+.o2k7Skin span.mce_rtl {background-position:-40px -20px}\r
+.o2k7Skin span.mce_emotions {background-position:-60px -20px}\r
+.o2k7Skin span.mce_fullpage {background-position:-80px -20px}\r
+.o2k7Skin span.mce_fullscreen {background-position:-100px -20px}\r
+.o2k7Skin span.mce_iespell {background-position:-120px -20px}\r
+.o2k7Skin span.mce_insertdate {background-position:-140px -20px}\r
+.o2k7Skin span.mce_inserttime {background-position:-160px -20px}\r
+.o2k7Skin span.mce_absolute {background-position:-180px -20px}\r
+.o2k7Skin span.mce_backward {background-position:-200px -20px}\r
+.o2k7Skin span.mce_forward {background-position:-220px -20px}\r
+.o2k7Skin span.mce_insert_layer {background-position:-240px -20px}\r
+.o2k7Skin span.mce_insertlayer {background-position:-260px -20px}\r
+.o2k7Skin span.mce_movebackward {background-position:-280px -20px}\r
+.o2k7Skin span.mce_moveforward {background-position:-300px -20px}\r
+.o2k7Skin span.mce_media {background-position:-320px -20px}\r
+.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px}\r
+.o2k7Skin span.mce_pastetext {background-position:-360px -20px}\r
+.o2k7Skin span.mce_pasteword {background-position:-380px -20px}\r
+.o2k7Skin span.mce_selectall {background-position:-400px -20px}\r
+.o2k7Skin span.mce_preview {background-position:-420px -20px}\r
+.o2k7Skin span.mce_print {background-position:-440px -20px}\r
+.o2k7Skin span.mce_cancel {background-position:-460px -20px}\r
+.o2k7Skin span.mce_save {background-position:-480px -20px}\r
+.o2k7Skin span.mce_replace {background-position:-500px -20px}\r
+.o2k7Skin span.mce_search {background-position:-520px -20px}\r
+.o2k7Skin span.mce_styleprops {background-position:-560px -20px}\r
+.o2k7Skin span.mce_table {background-position:-580px -20px}\r
+.o2k7Skin span.mce_cell_props {background-position:-600px -20px}\r
+.o2k7Skin span.mce_delete_table {background-position:-620px -20px}\r
+.o2k7Skin span.mce_delete_col {background-position:-640px -20px}\r
+.o2k7Skin span.mce_delete_row {background-position:-660px -20px}\r
+.o2k7Skin span.mce_col_after {background-position:-680px -20px}\r
+.o2k7Skin span.mce_col_before {background-position:-700px -20px}\r
+.o2k7Skin span.mce_row_after {background-position:-720px -20px}\r
+.o2k7Skin span.mce_row_before {background-position:-740px -20px}\r
+.o2k7Skin span.mce_merge_cells {background-position:-760px -20px}\r
+.o2k7Skin span.mce_table_props {background-position:-980px -20px}\r
+.o2k7Skin span.mce_row_props {background-position:-780px -20px}\r
+.o2k7Skin span.mce_split_cells {background-position:-800px -20px}\r
+.o2k7Skin span.mce_template {background-position:-820px -20px}\r
+.o2k7Skin span.mce_visualchars {background-position:-840px -20px}\r
+.o2k7Skin span.mce_abbr {background-position:-860px -20px}\r
+.o2k7Skin span.mce_acronym {background-position:-880px -20px}\r
+.o2k7Skin span.mce_attribs {background-position:-900px -20px}\r
+.o2k7Skin span.mce_cite {background-position:-920px -20px}\r
+.o2k7Skin span.mce_del {background-position:-940px -20px}\r
+.o2k7Skin span.mce_ins {background-position:-960px -20px}\r
+.o2k7Skin span.mce_pagebreak {background-position:0 -40px}\r
+.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}\r
+.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}\r
--- /dev/null
+/* Black */\r
+.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)}\r
+.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}\r
+.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}\r
+.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}\r
+.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;}\r
+.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)}\r
+.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1}
\ No newline at end of file
--- /dev/null
+/* Silver */\r
+.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)}\r
+.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}\r
+.o2k7SkinSilver .mceListBox .mceText {background:#FFF}\r
+.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}\r
--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+ <title>{#advanced_dlg.code_title}</title>\r
+ <script type="text/javascript" src="../../tiny_mce_popup.js"></script>\r
+ <script type="text/javascript" src="js/source_editor.js"></script>\r
+</head>\r
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">\r
+ <form name="source" onsubmit="saveContent();return false;" action="#">\r
+ <div style="float: left" class="title">{#advanced_dlg.code_title}</div>\r
+\r
+ <div id="wrapline" style="float: right">\r
+ <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>\r
+ </div>\r
+\r
+ <br style="clear: both" />\r
+\r
+ <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>\r
+\r
+ <div class="mceActionPanel">\r
+ <input type="submit" name="insert" value="{#update}" id="insert" />\r
+ <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />\r
+ </div>\r
+ </form>\r
+</body>\r
+</html>\r
--- /dev/null
+(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})});c.dom.loadCSS(d+"/skins/"+f.skin+"/content.css")});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
\ No newline at end of file
--- /dev/null
+/**\r
+ * editor_template_src.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+(function() {\r
+ var DOM = tinymce.DOM;\r
+\r
+ // Tell it to load theme specific language pack(s)\r
+ tinymce.ThemeManager.requireLangPack('simple');\r
+\r
+ tinymce.create('tinymce.themes.SimpleTheme', {\r
+ init : function(ed, url) {\r
+ var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;\r
+\r
+ t.editor = ed;\r
+\r
+ ed.onInit.add(function() {\r
+ ed.onNodeChange.add(function(ed, cm) {\r
+ tinymce.each(states, function(c) {\r
+ cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));\r
+ });\r
+ });\r
+\r
+ ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css");\r
+ });\r
+\r
+ DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");\r
+ },\r
+\r
+ renderUI : function(o) {\r
+ var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;\r
+\r
+ n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);\r
+ n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});\r
+ n = tb = DOM.add(n, 'tbody');\r
+\r
+ // Create iframe container\r
+ n = DOM.add(tb, 'tr');\r
+ n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});\r
+\r
+ // Create toolbar container\r
+ n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});\r
+\r
+ // Create toolbar\r
+ tb = t.toolbar = cf.createToolbar("tools1");\r
+ tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));\r
+ tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));\r
+ tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));\r
+ tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));\r
+ tb.add(cf.createSeparator());\r
+ tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));\r
+ tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));\r
+ tb.add(cf.createSeparator());\r
+ tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));\r
+ tb.add(cf.createSeparator());\r
+ tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));\r
+ tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));\r
+ tb.renderTo(n);\r
+\r
+ return {\r
+ iframeContainer : ic,\r
+ editorContainer : ed.id + '_container',\r
+ sizeContainer : sc,\r
+ deltaHeight : -20\r
+ };\r
+ },\r
+\r
+ getInfo : function() {\r
+ return {\r
+ longname : 'Simple theme',\r
+ author : 'Moxiecode Systems AB',\r
+ authorurl : 'http://tinymce.moxiecode.com',\r
+ version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+ }\r
+ }\r
+ });\r
+\r
+ tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);\r
+})();
\ No newline at end of file
--- /dev/null
+tinyMCE.addI18n('en.simple',{\r
+bold_desc:"Bold (Ctrl+B)",\r
+italic_desc:"Italic (Ctrl+I)",\r
+underline_desc:"Underline (Ctrl+U)",\r
+striketrough_desc:"Strikethrough",\r
+bullist_desc:"Unordered list",\r
+numlist_desc:"Ordered list",\r
+undo_desc:"Undo (Ctrl+Z)",\r
+redo_desc:"Redo (Ctrl+Y)",\r
+cleanup_desc:"Cleanup messy code"\r
+});
\ No newline at end of file
--- /dev/null
+body, td, pre {\r
+ font-family: Verdana, Arial, Helvetica, sans-serif;\r
+ font-size: 10px;\r
+}\r
+\r
+body {\r
+ background-color: #FFFFFF;\r
+}\r
+\r
+.mceVisualAid {\r
+ border: 1px dashed #BBBBBB;\r
+}\r
+\r
+/* MSIE specific */\r
+\r
+* html body {\r
+ scrollbar-3dlight-color: #F0F0EE;\r
+ scrollbar-arrow-color: #676662;\r
+ scrollbar-base-color: #F0F0EE;\r
+ scrollbar-darkshadow-color: #DDDDDD;\r
+ scrollbar-face-color: #E0E0DD;\r
+ scrollbar-highlight-color: #F0F0EE;\r
+ scrollbar-shadow-color: #F0F0EE;\r
+ scrollbar-track-color: #F5F5F5; \r
+}\r
--- /dev/null
+/* Reset */\r
+.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+\r
+/* Containers */\r
+.defaultSimpleSkin {position:relative}\r
+.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}\r
+.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}\r
+.defaultSimpleSkin .mceToolbar {height:24px;}\r
+\r
+/* Layout */\r
+.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}\r
+.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+\r
+/* Button */\r
+.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}\r
+.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}\r
+.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}\r
+.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+\r
+/* Separator */\r
+.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}\r
+\r
+/* Theme */\r
+.defaultSimpleSkin span.mce_bold {background-position:0 0}\r
+.defaultSimpleSkin span.mce_italic {background-position:-60px 0}\r
+.defaultSimpleSkin span.mce_underline {background-position:-140px 0}\r
+.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}\r
+.defaultSimpleSkin span.mce_undo {background-position:-160px 0}\r
+.defaultSimpleSkin span.mce_redo {background-position:-100px 0}\r
+.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}\r
+.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}\r
+.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}\r
--- /dev/null
+body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}\r
+\r
+body {background: #FFF;}\r
+.mceVisualAid {border: 1px dashed #BBB;}\r
+\r
+/* IE */\r
+\r
+* html body {\r
+scrollbar-3dlight-color: #F0F0EE;\r
+scrollbar-arrow-color: #676662;\r
+scrollbar-base-color: #F0F0EE;\r
+scrollbar-darkshadow-color: #DDDDDD;\r
+scrollbar-face-color: #E0E0DD;\r
+scrollbar-highlight-color: #F0F0EE;\r
+scrollbar-shadow-color: #F0F0EE;\r
+scrollbar-track-color: #F5F5F5; \r
+}\r
--- /dev/null
+/* Reset */\r
+.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}\r
+\r
+/* Containers */\r
+.o2k7SimpleSkin {position:relative}\r
+.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}\r
+.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}\r
+.o2k7SimpleSkin .mceToolbar {height:26px;}\r
+\r
+/* Layout */\r
+.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }\r
+.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}\r
+.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px}\r
+.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}\r
+\r
+/* Button */\r
+.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}\r
+.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}\r
+.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}\r
+.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}\r
+.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}\r
+\r
+/* Separator */\r
+.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}\r
+\r
+/* Theme */\r
+.o2k7SimpleSkin span.mce_bold {background-position:0 0}\r
+.o2k7SimpleSkin span.mce_italic {background-position:-60px 0}\r
+.o2k7SimpleSkin span.mce_underline {background-position:-140px 0}\r
+.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0}\r
+.o2k7SimpleSkin span.mce_undo {background-position:-160px 0}\r
+.o2k7SimpleSkin span.mce_redo {background-position:-100px 0}\r
+.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0}\r
+.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}\r
+.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0}\r
--- /dev/null
+(function(c){var a=/^\s*|\s*$/g,d;var b={majorVersion:"3",minorVersion:"3.8",releaseDate:"2010-06-30",_init:function(){var r=this,o=document,m=navigator,f=m.userAgent,l,e,k,j,h,q;r.isOpera=c.opera&&opera.buildNumber;r.isWebKit=/WebKit/.test(f);r.isIE=!r.isWebKit&&!r.isOpera&&(/MSIE/gi).test(f)&&(/Explorer/gi).test(m.appName);r.isIE6=r.isIE&&/MSIE [56]/.test(f);r.isGecko=!r.isWebKit&&/Gecko/.test(f);r.isMac=f.indexOf("Mac")!=-1;r.isAir=/adobeair/i.test(f);r.isIDevice=/(iPad|iPhone)/.test(f);if(c.tinyMCEPreInit){r.suffix=tinyMCEPreInit.suffix;r.baseURL=tinyMCEPreInit.base;r.query=tinyMCEPreInit.query;return}r.suffix="";e=o.getElementsByTagName("base");for(l=0;l<e.length;l++){if(q=e[l].href){if(/^https?:\/\/[^\/]+$/.test(q)){q+="/"}j=q?q.match(/.*\//)[0]:""}}function g(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){r.suffix="_src"}if((h=i.src.indexOf("?"))!=-1){r.query=i.src.substring(h+1)}r.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(j&&r.baseURL.indexOf("://")==-1&&r.baseURL.indexOf("/")!==0){r.baseURL=j+r.baseURL}return r.baseURL}return null}e=o.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}k=o.getElementsByTagName("head")[0];if(k){e=k.getElementsByTagName("script");for(l=0;l<e.length;l++){if(g(e[l])){return}}}return},is:function(f,e){if(!e){return f!==d}if(e=="array"&&(f.hasOwnProperty&&f instanceof Array)){return true}return typeof(f)==e},each:function(h,e,g){var i,f;if(!h){return 0}g=g||h;if(h.length!==d){for(i=0,f=h.length;i<f;i++){if(e.call(g,h[i],i,h)===false){return 0}}}else{for(i in h){if(h.hasOwnProperty(i)){if(e.call(g,h[i],i,h)===false){return 0}}}}return 1},map:function(e,g){var h=[];b.each(e,function(f){h.push(g(f))});return h},grep:function(e,g){var h=[];b.each(e,function(f){if(!g||g(f)){h.push(f)}});return h},inArray:function(f,g){var h,e;if(f){for(h=0,e=f.length;h<e;h++){if(f[h]===g){return h}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(e,i){if(e!==d){k[i]=e}})}return k},trim:function(e){return(e?""+e:"").replace(a,"")},create:function(m,e){var l=this,f,h,i,j,g,k=0;m=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(m);i=m[3].match(/(^|\.)(\w+)$/i)[2];h=l.createNS(m[3].replace(/\.\w+$/,""));if(h[i]){return}if(m[2]=="static"){h[i]=e;if(this.onCreate){this.onCreate(m[2],m[3],h[i])}return}if(!e[i]){e[i]=function(){};k=1}h[i]=e[i];l.extend(h[i].prototype,e);if(m[5]){f=l.resolve(m[5]).prototype;j=m[5].match(/\.(\w+)$/i)[1];g=h[i];if(k){h[i]=function(){return f[j].apply(this,arguments)}}else{h[i]=function(){this.parent=f[j];return g.apply(this,arguments)}}h[i].prototype[i]=h[i];l.each(f,function(o,p){h[i].prototype[p]=f[p]});l.each(e,function(o,p){if(f[p]){h[i].prototype[p]=function(){this.parent=f[p];return o.apply(this,arguments)}}else{if(p!=i){h[i].prototype[p]=o}}})}l.each(e["static"],function(o,p){h[i][p]=o});if(this.onCreate){this.onCreate(m[2],m[3],h[i].prototype)}},walk:function(h,g,i,e){e=e||this;if(h){if(i){h=h[i]}b.each(h,function(j,f){if(g.call(e,j,f,i)===false){return false}b.walk(j,g,i,e)})}},createNS:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0;f<h.length;f++){e=h[f];if(!g[e]){g[e]={}}g=g[e]}return g},resolve:function(h,g){var f,e;g=g||c;h=h.split(".");for(f=0,e=h.length;f<e;f++){g=g[h[f]];if(!g){break}}return g},addUnload:function(i,h){var g=this;i={func:i,scope:h||this};if(!g.unloads){function e(){var f=g.unloads,k,l;if(f){for(l in f){k=f[l];if(k&&k.func){k.func.call(k.scope,1)}}if(c.detachEvent){c.detachEvent("onbeforeunload",j);c.detachEvent("onunload",e)}else{if(c.removeEventListener){c.removeEventListener("unload",e,false)}}g.unloads=k=f=w=e=0;if(c.CollectGarbage){CollectGarbage()}}}function j(){var k=document;if(k.readyState=="interactive"){function f(){k.detachEvent("onstop",f);if(e){e()}k=0}if(k){k.attachEvent("onstop",f)}c.setTimeout(function(){if(k){k.detachEvent("onstop",f)}},0)}}if(c.attachEvent){c.attachEvent("onunload",e);c.attachEvent("onbeforeunload",j)}else{if(c.addEventListener){c.addEventListener("unload",e,false)}}g.unloads=[i]}else{g.unloads.push(i)}return i},removeUnload:function(h){var e=this.unloads,g=null;b.each(e,function(j,f){if(j&&j.func==h){e.splice(f,1);g=h;return false}});return g},explode:function(e,f){return e?b.map(e.split(f||","),b.trim):e},_addVer:function(f){var e;if(!this.query){return f}e=(f.indexOf("?")==-1?"?":"&")+this.query;if(f.indexOf("#")==-1){return f+e}return f.replace("#",e+"#")}};b._init();c.tinymce=c.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat";p.stdMode=u.documentMode===8;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(m.is(s)){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=(""+o).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true"> </p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/gi,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/'/g,"'");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=r.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"--")+"--></mce:noscript>"})}r=r.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=z.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){return}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(k){var p,n,m,r,u,s,t=g.dom.doc,o=t.body;function l(B){var x,A,v,z,y;v=d.create("a");x=B?m:u;A=B?r:s;z=p.duplicate();if(x==t){x=o;A=0}if(x.nodeType==3){x.parentNode.insertBefore(v,x);z.moveToElementText(v);z.moveStart("character",A);d.remove(v);p.setEndPoint(B?"StartToStart":"EndToEnd",z)}else{y=x.childNodes;if(y.length){if(A>=y.length){d.insertAfter(v,y[y.length-1])}else{x.insertBefore(v,y[A])}z.moveToElementText(v)}else{v=t.createTextNode(j);x.appendChild(v);z.moveToElementText(v.parentNode);z.collapse(c)}p.setEndPoint(B?"StartToStart":"EndToEnd",z);d.remove(v)}}this.destroy();m=k.startContainer;r=k.startOffset;u=k.endContainer;s=k.endOffset;p=o.createTextRange();if(m==u&&m.nodeType==1&&r==s-1){if(r==s-1){try{n=o.createControlRange();n.addElement(m.childNodes[r]);n.select();n.scrollIntoView();return}catch(q){}}}l(true);l();p.select();p.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null};if(g.dom.boxModel){(function(){var q=d.doc,l=q.body,n,o;q.documentElement.unselectable=c;function p(r,u){var s=l.createTextRange();try{s.moveToPoint(r,u)}catch(t){s=null}return s}function m(s){var r;if(s.button){r=p(s.x,s.y);if(r){if(r.compareEndPoints("StartToStart",o)>0){r.setEndPoint("StartToStart",o)}else{r.setEndPoint("EndToEnd",o)}r.select()}}else{k()}}function k(){d.unbind(q,"mouseup",k);d.unbind(q,"mousemove",m);n=0}d.bind(q,"mousedown",function(r){if(r.target.nodeName==="HTML"){if(n){k()}n=1;o=p(r.x,r.y);if(o){d.bind(q,"mouseup",k);d.bind(q,"mousemove",m);o.select()}}})})()}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}return r};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.leftMatch[v].exec(y))){var r=u[1];u.splice(1,1);if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(C,B,F,u){var s=C,H=[],z=B,x,e,y=B&&B[0]&&b.isXML(B[0]);while(C&&B.length){for(var A in f.filter){if((x=f.leftMatch[A].exec(C))!=null&&x[2]){var r=f.filter[A],G,E,t=x[1];e=false;x.splice(1,1);if(t.substr(t.length-1)==="\\"){continue}if(z===H){H=[]}if(f.preFilter[A]){x=f.preFilter[A](x,z,F,H,u,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var v=0;(E=z[v])!=null;v++){if(E){G=r(E,x,v,z);var D=u^!!G;if(F&&G!=null){if(D){e=true}else{z[v]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(f.match[A],"");if(!e){return[]}break}}}if(C===s){if(e==null){b.error(C)}else{break}}s=C}return z};b.error=function(e){throw"Syntax error, unrecognized expression: "+e};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,r){var t=typeof r==="string",v=t&&!/\W/.test(r),y=t&&!v;if(v){r=r.toLowerCase()}for(var s=0,e=x.length,u;s<e;s++){if((u=x[s])){while((u=u.previousSibling)&&u.nodeType!==1){}x[s]=y||u&&u.nodeName.toLowerCase()===r?u||false:u===r}}if(y){b.filter(r,x,true)}},">":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s<e;s++){v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName.toLowerCase()===r?t:false}}}else{for(;s<e;s++){v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v<u;v++){if(t[v]===s){return false}}return true}else{b.error("Syntax error, unrecognized expression: "+e)}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while((r=r.previousSibling)){if(r.nodeType===1){return false}}if(x==="first"){return true}r=e;case"last":while((r=r.nextSibling)){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s===1&&A===0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s===0){return y===0}else{return(y%s===0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s<e;s++){r.push(u[s])}}else{for(;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){if(!r.compareDocumentPosition||!e.compareDocumentPosition){if(r==e){o=true}return r.compareDocumentPosition?-1:1}var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){o=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){if(!r.sourceIndex||!e.sourceIndex){if(r==e){o=true}return r.sourceIndex?-1:1}var s=r.sourceIndex-e.sourceIndex;if(s===0){o=true}return s}}else{if(document.createRange){c=function(t,r){if(!t.ownerDocument||!r.ownerDocument){if(t==r){o=true}return t.ownerDocument?-1:1}var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){o=true}return u}}}}b.getText=function(e){var r="",t;for(var s=0;e[s];s++){t=e[s];if(t.nodeType===3||t.nodeType===4){r+=t.nodeValue}else{if(t.nodeType!==8){r+=b.getText(t.childNodes)}}}return r};(function(){var r=document.createElement("div"),s="script"+(new Date()).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName.toLowerCase()===x){u=e;break}e=e[r]}A[t]=u}}}function q(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';if(j.startContainer==k&&j.endContainer==k){k.body.innerHTML=i}else{j.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=i}else{j.insertNode(j.createContextualFragment(i))}}l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndBefore(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='<br _mce_bogus="1" />'}return t}k("start");k("end");f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=g.win.document.createRange?g.win.document.createRange():g.win.document.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(_mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML=" ";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._info=q;k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(E,J){var A=this,B=A.settings,y=A.writer,q,j,u,G,F,I,C,h,z,k,r,D,p,m,H,o,x;if(!B.node_filter||B.node_filter(E)){switch(E.nodeType){case 1:if(E.hasAttribute?E.hasAttribute("_mce_bogus"):E.getAttribute("_mce_bogus")){return}p=H=false;q=E.hasChildNodes();k=E.getAttribute("_mce_name")||E.nodeName.toLowerCase();o=E.getAttribute("_mce_type");if(o){if(!A._info.cleanup){p=true;return}else{H=1}}if(d){x=E.scopeName;if(x&&x!=="HTML"&&x!=="html"){k=x+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!H){if(!A.validElementsRE||!A.validElementsRE.test(k)||(A.invalidElementsRE&&A.invalidElementsRE.test(k))||J){p=true;break}}if(d){if(B.fix_content_duplication){if(E._mce_serialized==A.key){return}E._mce_serialized=A.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(E.nodeName==="BR"&&E.getAttribute("type")=="_moz"){return}}}if(B.validate_children){if(A.elementName&&!A.schema.isValid(A.elementName,k)){p=true;break}A.elementName=k}r=A.findRule(k);if(!r){p=true;break}k=r.name||k;m=B.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){I=r.requiredAttribs;for(G=I.length-1;G>=0;G--){if(this.dom.getAttrib(E,I[G])!==""){break}}if(G==-1){p=true;break}}y.writeStartElement(k);if(r.attribs){for(G=0,C=r.attribs,F=C.length;G<F;G++){I=C[G];z=A._getAttrib(E,I);if(z!==null){y.writeAttribute(I.name,z)}}}if(r.validAttribsRE){C=A.dom.getAttribs(E);for(G=C.length-1;G>-1;G--){h=C[G];if(h.specified){I=h.nodeName.toLowerCase();if(B.invalid_attrs.test(I)||!r.validAttribsRE.test(I)){continue}D=A.findAttribRule(r,I);z=A._getAttrib(E,D,I);if(z!==null){y.writeAttribute(I,z)}}}}if(o&&H){y.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(E.innerHTML)){y.writeText("// ");y.writeCDATA(E.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=E.firstChild)&&u.nodeType===1&&E.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){y.writeText("\u00a0")}}else{if(!q){y.writeText("\u00a0")}}}break;case 3:if(B.validate_children&&A.elementName&&!A.schema.isValid(A.elementName,"#text")){return}return y.writeText(E.nodeValue);case 4:return y.writeCDATA(E.nodeValue);case 8:return y.writeComment(E.nodeValue)}}else{if(E.nodeType==1){q=E.hasChildNodes()}}if(q&&!m){u=E.firstChild;while(u){A._serializeNode(u);A.elementName=k;u=u.nextSibling}}if(!p){if(!m){y.writeFullEndElement()}else{y.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});s.onload=p;s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(k){var h=-1,i,j=k.keyCode;e(f.items,function(l,m){if(f.selectedValue==l.value){h=m}});if(j==38){i=f.items[h-1]}else{if(j==40){i=f.items[h+1]}else{if(j==13){i=f.selectedValue;f.selectedValue=null;f.settings.onselect(i);return b.cancel(k)}}}if(i){f.hideMenu();f.select(i.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"}},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"}},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s,remove:"all"})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(s){var x,q=this,v=q.settings.content_editable,r,p,u=q.getDoc();if(!s){r=q.selection.getRng();if(r.item){p=r.item(0)}if(!v){q.getWin().focus()}if(p&&p.ownerDocument==u){r=u.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((x=m.activeEditor)!=null){x.onDeactivate.dispatch(x,q)}q.onActivate.dispatch(q,x)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=(b?q.getNode():q.getStart())||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var v=this,u,y=v.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function r(t,A){var s=t.type;if(v.removed){return}if(v.onEvent.dispatch(v,t,A)!==false){v[x[t.fakeType||t.type]].dispatch(v,t,A)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){v.dom.bind(v.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";r(A)}})}else{v.dom.bind(v.getBody(),s,r)}break;case"paste":v.dom.bind(v.getBody(),s,function(A){r(A)});break;case"submit":case"reset":v.dom.bind(v.getElement().form||n.getParent(v.id,"form"),s,r);break;default:v.dom.bind(y.content_editable?v.getBody():v.getDoc(),s,r)}});v.dom.bind(y.content_editable?v.getBody():(a?v.getDoc():v.getWin()),"focus",function(s){v.focus(true)});if(m.isGecko){v.dom.bind(v.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=v.documentBaseURI.toAbsolute(s)}})}if(a){function p(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}v.onBeforeExecCommand.add(p);v.onMouseDown.add(p)}if(m.isWebKit){v.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&v.dom.hasClass(t,"mceItemAnchor"))){v.selection.getSel().setBaseAndExtent(t,0,t,1)}})}v.onMouseUp.add(v.nodeChanged);v.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(m.isMac&&(A==91||A==93))||t.ctrlKey){v.nodeChanged()}});v.onReset.add(function(){v.setContent(v.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){v.addShortcut("ctrl+z",v.getLang("undo_desc"),"Undo");v.addShortcut("ctrl+y",v.getLang("redo_desc"),"Redo")}v.addShortcut("ctrl+b",v.getLang("bold_desc"),"Bold");v.addShortcut("ctrl+i",v.getLang("italic_desc"),"Italic");v.addShortcut("ctrl+u",v.getLang("underline_desc"),"Underline");for(u=1;u<=6;u++){v.addShortcut("ctrl+"+u,"",["FormatBlock",false,"h"+u])}v.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);v.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);v.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(v.shortcuts,function(A){if(m.isMac&&A.ctrl!=t.metaKey){return}else{if(!m.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}v.onKeyUp.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyPress.add(function(s,t){var A=z(t);if(A){return j.cancel(t)}});v.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return j.cancel(t)}})}if(m.isIE){v.dom.bind(v.getDoc(),"controlselect",function(A){var t=v.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){v.dom.unbind(t.node,t.ev,t.cb)}if(!v.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=v.dom.bind(A,ev,function(C){var B;C=C.target;if(B=v.dom.getStyle(C,"width")){v.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"width","")}if(B=v.dom.getStyle(C,"height")){v.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));v.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=v.dom.bind(A,"resizestart",j.cancel,j)}t=v.resizeInfo={node:A,ev:ev,cb:s}});v.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(v.selection.getRng().item){s.dom.remove(v.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){v.onClick.add(function(s,t){j.prevent(t)})}if(y.custom_undo_redo){function q(){v.undoManager.typing=0;v.undoManager.add()}v.dom.bind(v.getDoc(),"focusout",function(s){if(!v.removed&&v.undoManager.typing){q()}});v.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){q()}});v.onKeyDown.add(function(t,D){var s,C,B;if(b&&D.keyCode==46){s=v.selection.getRng();if(s.parentElement){C=s.parentElement();if(D.ctrlKey){s.moveEnd("word",1);s.select()}v.selection.getSel().clear();if(s.parentElement()==C){B=v.selection.getBookmark();try{C.innerHTML=C.innerHTML}catch(A){}v.selection.moveToBookmark(B)}D.preventDefault();return}}if((D.keyCode>=33&&D.keyCode<=36)||(D.keyCode>=37&&D.keyCode<=40)||D.keyCode==13||D.keyCode==45){if(v.undoManager.typing){q()}return}if(!v.undoManager.typing){v.undoManager.add();v.undoManager.typing=1}});v.onMouseDown.add(function(){if(v.undoManager.typing){q()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandSupported(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u||"p")},mceCleanup:function(){var u=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(u)},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=n.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,u))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},mceToggleFormat:function(x,v,u){n.formatter.toggle(u)},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{n.dom.remove(u,a)}}},selectAll:function(){var v=l.getRoot(),u=l.createRng();u.setStart(v,0);u.setEnd(v,v.childNodes.length);n.selection.setRng(u)}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(e){var c,d=0,g=[];function f(){return b.trim(e.getContent({format:"raw",no_events:1}))}return c={typing:0,onAdd:new a(c),onUndo:new a(c),onRedo:new a(c),add:function(l){var h,j=e.settings,k;l=l||{};l.content=f();k=g[d];if(k&&k.content==l.content){if(d>0||g.length==1){return null}}if(j.custom_undo_redo_levels){if(g.length>j.custom_undo_redo_levels){for(h=0;h<g.length-1;h++){g[h]=g[h+1]}g.length--;d=g.length}}l.bookmark=e.selection.getBookmark(2,true);if(d<g.length-1){if(d==0){g=[]}else{g.length=d+1}}g.push(l);d=g.length-1;c.onAdd.dispatch(c,l);e.isNotDirty=0;return l},undo:function(){var j,h;if(c.typing){c.add();c.typing=0}if(d>0){j=g[--d];e.setContent(j.content,{format:"raw"});e.selection.moveToBookmark(j.bookmark);c.onUndo.dispatch(c,j)}return j},redo:function(){var h;if(d<g.length-1){h=g[++d];e.setContent(h.content,{format:"raw"});e.selection.moveToBookmark(h.bookmark);c.onRedo.dispatch(c,h)}return h},clear:function(){g=[];d=c.typing=0},hasUndo:function(){return d>0||c.typing},hasRedo:function(){return d<g.length-1}}}})(tinymce);(function(m){var k=m.dom.Event,c=m.isIE,a=m.isGecko,b=m.isOpera,j=m.each,i=m.extend,d=true,h=false;function l(p){var q,o,n;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(p.nodeName)){if(q){o=p.cloneNode(false);o.appendChild(q);q=o}else{q=n=p.cloneNode(false)}q.removeAttribute("id")}}while(p=p.parentNode);if(q){return{wrapper:q,inner:n}}}function g(o,p){var n=p.ownerDocument.createRange();n.setStart(o.endContainer,o.endOffset);n.setEndAfter(p);return n.cloneContents().textContent.length==0}function f(o){o=o.innerHTML;o=o.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");o=o.replace(/<[^>]+>/g,"");return o.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(p,r,n){var o,q;if(f(n)){o=r.getParent(n,"ul,ol");if(!r.getParent(o.parentNode,"ul,ol")){r.split(o,n);q=r.create("p",0,'<br _mce_bogus="1" />');r.replace(q,n);p.select(q,1)}return h}return d}m.create("tinymce.ForceBlocks",{ForceBlocks:function(o){var p=this,q=o.settings,r;p.editor=o;p.dom=o.dom;r=(q.forced_root_block||"p").toLowerCase();q.element=r.toUpperCase();o.onPreInit.add(p.setup,p);p.reOpera=new RegExp("(\\u00a0| | )</"+r+">","gi");p.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,r),"gi");p.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,r),"gi");function n(s,t){if(b){t.content=t.content.replace(p.reOpera,"</"+r+">")}t.content=t.content.replace(p.rePadd,"<"+r+"$1$2$3$4$5$6>\u00a0</"+r+">");if(!c&&!b&&t.set){t.content=t.content.replace(p.reNbsp2BR1,"<"+r+"$1$2><br /></"+r+">");t.content=t.content.replace(p.reNbsp2BR2,"<"+r+"$1$2><br /></"+r+">")}else{t.content=t.content.replace(p.reBR2Nbsp,"<"+r+"$1$2>\u00a0</"+r+">")}}o.onBeforeSetContent.add(n);o.onPostProcess.add(n);if(q.forced_root_block){o.onInit.add(p.forceRoots,p);o.onSetContent.add(p.forceRoots,p);o.onBeforeGetContent.add(p.forceRoots,p)}},setup:function(){var o=this,n=o.editor,q=n.settings,u=n.dom,p=n.selection;if(q.forced_root_block){n.onBeforeExecCommand.add(o.forceRoots,o);n.onKeyUp.add(o.forceRoots,o);n.onPreProcess.add(o.forceRoots,o)}if(q.force_br_newlines){if(c){n.onKeyPress.add(function(s,t){var v;if(t.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});v=u.get("__");v.removeAttribute("id");p.select(v);p.collapse();return k.cancel(t)}})}}if(q.force_p_newlines){if(!c){n.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!o.insertPara(t)){k.cancel(t)}})}else{m.addUnload(function(){o._previousFormats=0});n.onKeyPress.add(function(s,t){o._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&q.keep_styles){o._previousFormats=l(s.selection.getStart())}});n.onKeyUp.add(function(t,x){if(x.keyCode==13&&!x.shiftKey){var v=t.selection.getStart(),s=o._previousFormats;if(!v.hasChildNodes()){v=u.getParent(v,u.isBlock);if(v){v.innerHTML="";if(o._previousFormats){v.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{v.innerHTML="\uFEFF"}p.select(v,1);t.getDoc().execCommand("Delete",false,null)}}}})}if(a){n.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){o.backspaceDelete(t,t.keyCode==8)}})}}if(m.isWebKit){function r(t){var s=p.getRng(),v,z=u.create("div",null," "),y,x=u.getViewPort(t.getWin()).h;s.insertNode(v=u.create("br"));s.setStartAfter(v);s.setEndAfter(v);p.setRng(s);if(p.getSel().focusNode==v.previousSibling){p.select(u.insertAfter(u.doc.createTextNode("\u00a0"),v));p.collapse(d)}u.insertAfter(z,v);y=u.getPos(z).y;u.remove(z);if(y>x){t.getWin().scrollTo(0,y)}}n.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(q.force_br_newlines&&!u.getParent(p.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);k.cancel(t)}})}n.onPreProcess.add(function(s,t){j(u.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(v){if(f(v)){j(u.select("span,em,strong,b,i",t.node),function(x){if(!x.hasChildNodes()){x.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(q.element!="P"){n.onKeyPress.add(function(s,t){o.lastElm=p.getNode().nodeName});n.onKeyUp.add(function(t,v){var y,x=p.getNode(),s=t.getBody();if(s.childNodes.length===1&&x.nodeName=="P"){x=u.rename(x,q.element);p.select(x);p.collapse();t.nodeChanged()}else{if(v.keyCode==13&&!v.shiftKey&&o.lastElm!="P"){y=u.getParent(x,"p");if(y){u.rename(y,q.element);t.nodeChanged()}}}})}}},find:function(v,q,r){var p=this.editor,o=p.getDoc().createTreeWalker(v,4,null,h),u=-1;while(v=o.nextNode()){u++;if(q==0&&v==r){return u}if(q==1&&u==r){return v}}return -1},forceRoots:function(x,I){var z=this,x=z.editor,M=x.getBody(),J=x.getDoc(),P=x.selection,A=P.getSel(),B=P.getRng(),N=-2,v,G,o,p,K=-16777215;var L,q,O,F,C,u=M.childNodes,E,D,y;for(E=u.length-1;E>=0;E--){L=u[E];if(L.nodeType===1&&L.getAttribute("_mce_type")){q=null;continue}if(L.nodeType===3||(!z.dom.isBlock(L)&&L.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(L.nodeName))){if(!q){if(L.nodeType!=3||/[^\s]/g.test(L.nodeValue)){if(N==-2&&B){if(!c){if(B.startContainer.nodeType==1&&(D=B.startContainer.childNodes[B.startOffset])&&D.nodeType==1){y=D.getAttribute("id");D.setAttribute("id","__mce")}else{if(x.dom.getParent(B.startContainer,function(n){return n===M})){G=B.startOffset;o=B.endOffset;N=z.find(M,0,B.startContainer);v=z.find(M,0,B.endContainer)}}}else{if(B.item){p=J.body.createTextRange();p.moveToElementText(B.item(0));B=p}p=J.body.createTextRange();p.moveToElementText(M);p.collapse(1);O=p.move("character",K)*-1;p=B.duplicate();p.collapse(1);F=p.move("character",K)*-1;p=B.duplicate();p.collapse(0);C=(p.move("character",K)*-1)-F;N=F-O;v=C}}q=x.dom.create(x.settings.forced_root_block);L.parentNode.replaceChild(q,L);q.appendChild(L)}}else{if(q.hasChildNodes()){q.insertBefore(L,q.firstChild)}else{q.appendChild(L)}}}else{q=null}}if(N!=-2){if(!c){q=M.getElementsByTagName(x.settings.element)[0];B=J.createRange();if(N!=-1){B.setStart(z.find(M,1,N),G)}else{B.setStart(q,0)}if(v!=-1){B.setEnd(z.find(M,1,v),o)}else{B.setEnd(q,0)}if(A){A.removeAllRanges();A.addRange(B)}}else{try{B=A.createRange();B.moveToElementText(M);B.collapse(1);B.moveStart("character",N);B.moveEnd("character",v);B.select()}catch(H){}}}else{if(!c&&(D=x.dom.get("__mce"))){if(y){D.setAttribute("id",y)}else{D.removeAttribute("id")}B=J.createRange();B.setStartBefore(D);B.setEndBefore(D);P.setRng(B)}}},getParentBlock:function(p){var o=this.dom;return o.getParent(p,o.isBlock)},insertPara:function(S){var G=this,x=G.editor,O=x.dom,T=x.getDoc(),X=x.settings,H=x.selection.getSel(),I=H.getRangeAt(0),W=T.body;var L,M,J,Q,P,u,p,v,A,o,E,V,q,z,K,N=O.getViewPort(x.getWin()),D,F,C;L=T.createRange();L.setStart(H.anchorNode,H.anchorOffset);L.collapse(d);M=T.createRange();M.setStart(H.focusNode,H.focusOffset);M.collapse(d);J=L.compareBoundaryPoints(L.START_TO_END,M)<0;Q=J?H.anchorNode:H.focusNode;P=J?H.anchorOffset:H.focusOffset;u=J?H.focusNode:H.anchorNode;p=J?H.focusOffset:H.anchorOffset;if(Q===u&&/^(TD|TH)$/.test(Q.nodeName)){if(Q.firstChild.nodeName=="BR"){O.remove(Q.firstChild)}if(Q.childNodes.length==0){x.dom.add(Q,X.element,null,"<br />");V=x.dom.add(Q,X.element,null,"<br />")}else{K=Q.innerHTML;Q.innerHTML="";x.dom.add(Q,X.element,null,K);V=x.dom.add(Q,X.element,null,"<br />")}I=T.createRange();I.selectNodeContents(V);I.collapse(1);x.selection.setRng(I);return h}if(Q==W&&u==W&&W.firstChild&&x.dom.isBlock(W.firstChild)){Q=u=Q.firstChild;P=p=0;L=T.createRange();L.setStart(Q,0);M=T.createRange();M.setStart(u,0)}Q=Q.nodeName=="HTML"?T.body:Q;Q=Q.nodeName=="BODY"?Q.firstChild:Q;u=u.nodeName=="HTML"?T.body:u;u=u.nodeName=="BODY"?u.firstChild:u;v=G.getParentBlock(Q);A=G.getParentBlock(u);o=v?v.nodeName:X.element;if(K=G.dom.getParent(v,"li,pre")){if(K.nodeName=="LI"){return e(x.selection,G.dom,K)}return d}if(v&&(v.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;v=null}if(A&&(A.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;A=null}if(/(TD|TABLE|TH|CAPTION)/.test(o)||(v&&o=="DIV"&&/left|right/gi.test(O.getStyle(v,"float",1)))){o=X.element;v=A=null}E=(v&&v.nodeName==o)?v.cloneNode(0):x.dom.create(o);V=(A&&A.nodeName==o)?A.cloneNode(0):x.dom.create(o);V.removeAttribute("id");if(/^(H[1-6])$/.test(o)&&g(I,v)){V=x.dom.create(X.element)}K=q=Q;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}q=K}while((K=K.previousSibling?K.previousSibling:K.parentNode));K=z=u;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}z=K}while((K=K.nextSibling?K.nextSibling:K.parentNode));if(q.nodeName==o){L.setStart(q,0)}else{L.setStartBefore(q)}L.setEnd(Q,P);E.appendChild(L.cloneContents()||T.createTextNode(""));try{M.setEndAfter(z)}catch(R){}M.setStart(u,p);V.appendChild(M.cloneContents()||T.createTextNode(""));I=T.createRange();if(!q.previousSibling&&q.parentNode.nodeName==o){I.setStartBefore(q.parentNode)}else{if(L.startContainer.nodeName==o&&L.startOffset==0){I.setStartBefore(L.startContainer)}else{I.setStart(L.startContainer,L.startOffset)}}if(!z.nextSibling&&z.parentNode.nodeName==o){I.setEndAfter(z.parentNode)}else{I.setEnd(M.endContainer,M.endOffset)}I.deleteContents();if(b){x.getWin().scrollTo(0,N.y)}if(E.firstChild&&E.firstChild.nodeName==o){E.innerHTML=E.firstChild.innerHTML}if(V.firstChild&&V.firstChild.nodeName==o){V.innerHTML=V.firstChild.innerHTML}if(f(E)){E.innerHTML="<br />"}function U(y,s){var r=[],Z,Y,t;y.innerHTML="";if(X.keep_styles){Y=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(Y.nodeName)){Z=Y.cloneNode(h);O.setAttrib(Z,"id","");r.push(Z)}}while(Y=Y.parentNode)}if(r.length>0){for(t=r.length-1,Z=y;t>=0;t--){Z=Z.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(f(V)){C=U(V,u)}if(b&&parseFloat(opera.version())<9.5){I.insertNode(E);I.insertNode(V)}else{I.insertNode(V);I.insertNode(E)}V.normalize();E.normalize();function B(r){return T.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}I=T.createRange();I.selectNodeContents(a?B(C||V):C||V);I.collapse(1);H.removeAllRanges();H.addRange(I);D=x.dom.getPos(V).y;F=V.clientHeight;if(D<N.y||D+F>N.y+N.h){x.getWin().scrollTo(0,D<N.y?D:D-N.h+25)}return h},backspaceDelete:function(v,C){var D=this,u=D.editor,z=u.getBody(),s=u.dom,q,x=u.selection,p=x.getRng(),y=p.startContainer,q,A,B,o;if(!C&&p.collapsed&&y.nodeType==1&&p.startOffset==y.childNodes.length){o=new m.dom.TreeWalker(y.lastChild,y);for(q=y.lastChild;q;q=o.prev()){if(q.nodeType==3){p.setStart(q,q.nodeValue.length);p.collapse(true);x.setRng(p);return}}}if(y&&u.dom.isBlock(y)&&!/^(TD|TH)$/.test(y.nodeName)&&C){if(y.childNodes.length==0||(y.childNodes.length==1&&y.firstChild.nodeName=="BR")){q=y;while((q=q.previousSibling)&&!u.dom.isBlock(q)){}if(q){if(y!=z.firstChild){A=u.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,h);while(B=A.nextNode()){q=B}p=u.getDoc().createRange();p.setStart(q,q.nodeValue?q.nodeValue.length:0);p.setEnd(q,q.nodeValue?q.nodeValue.length:0);x.setRng(p);u.dom.remove(y)}return k.cancel(v)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(T){var K={},M=a.each,c=T.dom,p=T.selection,s=a.dom.TreeWalker,I=new a.dom.RangeUtils(c),d=T.schema.isValid,E=c.isBlock,k=T.settings.forced_root_block,r=c.nodeIndex,D="\uFEFF",e=/^(src|href|style)$/,Q=false,A=true,o,N={apply:[],remove:[]};function y(U){return U instanceof Array}function l(V,U){return c.getParents(V,U,c.getRoot())}function b(U){return U.nodeType===1&&(U.face==="mceinline"||U.style.fontFamily==="mceinline")}function P(U){return U?K[U]:K}function j(U,V){if(U){if(typeof(U)!=="string"){M(U,function(X,W){j(W,X)})}else{V=V.length?V:[V];M(V,function(W){if(W.deep===o){W.deep=!W.selector}if(W.split===o){W.split=!W.selector||W.inline}if(W.remove===o&&W.selector&&!W.inline){W.remove="none"}if(W.selector&&W.inline){W.mixed=true;W.block_expand=true}if(typeof(W.classes)==="string"){W.classes=W.classes.split(/\s+/)}});K[U]=V}}}function R(W,ac,Y){var Z=P(W),ad=Z[0],ab,V,aa;function X(ag){var af=ag.startContainer,aj=ag.startOffset,ai,ah;if(af.nodeType==1||af.nodeValue===""){af=af.nodeType==1?af.childNodes[aj]:af;if(af){ai=new s(af,af.parentNode);for(ah=ai.current();ah;ah=ai.next()){if(ah.nodeType==3&&!f(ah)){ag.setStart(ah,0);break}}}}return ag}function U(ag,af){af=af||ad;if(ag){M(af.styles,function(ai,ah){c.setStyle(ag,ah,q(ai,ac))});M(af.attributes,function(ai,ah){c.setAttrib(ag,ah,q(ai,ac))});M(af.classes,function(ah){ah=q(ah,ac);if(!c.hasClass(ag,ah)){c.addClass(ag,ah)}})}}function ae(ag){var af=[],ai,ah;ai=ad.inline||ad.block;ah=c.create(ai);U(ah);I.walk(ag,function(aj){var ak;function al(am){var ap=am.nodeName.toLowerCase(),ao=am.parentNode.nodeName.toLowerCase(),an;if(g(ap,"br")){ak=0;if(ad.block){c.remove(am)}return}if(ad.wrapper&&v(am,W,ac)){ak=0;return}if(ad.block&&!ad.wrapper&&F(ap)){am=c.rename(am,ai);U(am);af.push(am);ak=0;return}if(ad.selector){M(Z,function(aq){if(c.is(am,aq.selector)&&!b(am)){U(am,aq);an=true}});if(!ad.inline||an){ak=0;return}}if(d(ai,ap)&&d(ao,ai)){if(!ak){ak=ah.cloneNode(Q);am.parentNode.insertBefore(ak,am);af.push(ak)}ak.appendChild(am)}else{ak=0;M(a.grep(am.childNodes),al);ak=0}}M(aj,al)});M(af,function(al){var aj;function am(ao){var an=0;M(ao.childNodes,function(ap){if(!f(ap)&&!G(ap)){an++}});return an}function ak(an){var ap,ao;M(an.childNodes,function(aq){if(aq.nodeType==1&&!G(aq)&&!b(aq)){ap=aq;return Q}});if(ap&&h(ap,ad)){ao=ap.cloneNode(Q);U(ao);c.replace(ao,an,A);c.remove(ap,1)}return ao||an}aj=am(al);if(aj===0){c.remove(al,1);return}if(ad.inline||ad.wrapper){if(!ad.exact&&aj===1){al=ak(al)}M(Z,function(an){M(c.select(an.inline,al),function(ao){S(an,ac,ao,an.exact?ao:null)})});if(v(al.parentNode,W,ac)){c.remove(al,1);al=0;return A}if(ad.merge_with_parents){c.getParent(al.parentNode,function(an){if(v(an,W,ac)){c.remove(al,1);al=0;return A}})}if(al){al=t(B(al),al);al=t(al,B(al,A))}}})}if(ad){if(Y){V=c.createRng();V.setStartBefore(Y);V.setEndAfter(Y);ae(n(V,Z))}else{if(!p.isCollapsed()||!ad.inline){ab=p.getBookmark();ae(n(p.getRng(A),Z));p.moveToBookmark(ab);p.setRng(X(p.getRng(A)));T.nodeChanged()}else{O("apply",W,ac)}}}}function z(W,af,Z){var aa=P(W),ah=aa[0],ae,ad,V;function Y(ak){var aj=ak.startContainer,ap=ak.startOffset,ao,an,al,am;if(aj.nodeType==3&&ap>=aj.nodeValue.length-1){aj=aj.parentNode;ap=r(aj)+1}if(aj.nodeType==1){al=aj.childNodes;aj=al[Math.min(ap,al.length-1)];ao=new s(aj);if(ap>al.length-1){ao.next()}for(an=ao.current();an;an=ao.next()){if(an.nodeType==3&&!f(an)){am=c.create("a",null,D);an.parentNode.insertBefore(am,an);ak.setStart(an,0);p.setRng(ak);c.remove(am);return}}}}function X(am){var al,ak,aj;al=a.grep(am.childNodes);for(ak=0,aj=aa.length;ak<aj;ak++){if(S(aa[ak],af,am,am)){break}}if(ah.deep){for(ak=0,aj=al.length;ak<aj;ak++){X(al[ak])}}}function ab(aj){var ak;M(l(aj.parentNode).reverse(),function(al){var am;if(!ak&&al.id!="_start"&&al.id!="_end"){am=v(al,W,af);if(am&&am.split!==false){ak=al}}});return ak}function U(am,aj,ao,ar){var at,aq,ap,al,an,ak;if(am){ak=am.parentNode;for(at=aj.parentNode;at&&at!=ak;at=at.parentNode){aq=at.cloneNode(Q);for(an=0;an<aa.length;an++){if(S(aa[an],af,aq,aq)){aq=0;break}}if(aq){if(ap){aq.appendChild(ap)}if(!al){al=aq}ap=aq}}if(ar&&(!ah.mixed||!E(am))){aj=c.split(am,aj)}if(ap){ao.parentNode.insertBefore(ap,ao);al.appendChild(ao)}}return aj}function ag(aj){return U(ab(aj),aj,aj,true)}function ac(al){var ak=c.get(al?"_start":"_end"),aj=ak[al?"firstChild":"lastChild"];if(G(aj)){aj=aj[al?"firstChild":"lastChild"]}c.remove(ak,true);return aj}function ai(aj){var ak,al;aj=n(aj,aa,A);if(ah.split){ak=H(aj,A);al=H(aj);if(ak!=al){ak=L(ak,"span",{id:"_start",_mce_type:"bookmark"});al=L(al,"span",{id:"_end",_mce_type:"bookmark"});ag(ak);ag(al);ak=ac(A);al=ac()}else{ak=al=ag(ak)}aj.startContainer=ak.parentNode;aj.startOffset=r(ak);aj.endContainer=al.parentNode;aj.endOffset=r(al)+1}I.walk(aj,function(am){M(am,function(an){X(an)})})}if(Z){V=c.createRng();V.setStartBefore(Z);V.setEndAfter(Z);ai(V);return}if(!p.isCollapsed()||!ah.inline){ae=p.getBookmark();ai(p.getRng(A));p.moveToBookmark(ae);if(i(W,af,p.getStart())){Y(p.getRng(true))}T.nodeChanged()}else{O("remove",W,af)}}function C(U,W,V){if(i(U,W,V)){z(U,W,V)}else{R(U,W,V)}}function v(V,U,aa,Y){var W=P(U),ab,Z,X;function ac(ag,ai,aj){var af,ah,ad=ai[aj],ae;if(ad){if(ad.length===o){for(af in ad){if(ad.hasOwnProperty(af)){if(aj==="attributes"){ah=c.getAttrib(ag,af)}else{ah=J(ag,af)}if(Y&&!ah&&!ai.exact){return}if((!Y||ai.exact)&&!g(ah,q(ad[af],aa))){return}}}}else{for(ae=0;ae<ad.length;ae++){if(aj==="attributes"?c.getAttrib(ag,ad[ae]):J(ag,ad[ae])){return ai}}}}return ai}if(W&&V){for(Z=0;Z<W.length;Z++){ab=W[Z];if(h(V,ab)&&ac(V,ab,"attributes")&&ac(V,ab,"styles")){if(X=ab.classes){for(Z=0;Z<X.length;Z++){if(!c.hasClass(V,X[Z])){return}}}return ab}}}}function i(W,Z,Y){var V,X;function U(aa){aa=c.getParent(aa,function(ab){return !!v(ab,W,Z,true)});return v(aa,W,Z)}if(Y){return U(Y)}if(p.isCollapsed()){for(X=N.apply.length-1;X>=0;X--){if(N.apply[X].name==W){return true}}for(X=N.remove.length-1;X>=0;X--){if(N.remove[X].name==W){return false}}return U(p.getNode())}Y=p.getNode();if(U(Y)){return A}V=p.getStart();if(V!=Y){if(U(V)){return A}}return Q}function u(ab,aa){var Y,Z=[],X={},W,V,U;if(p.isCollapsed()){for(V=0;V<ab.length;V++){for(W=N.remove.length-1;W>=0;W--){U=ab[V];if(N.remove[W].name==U){X[U]=true;break}}}for(W=N.apply.length-1;W>=0;W--){for(V=0;V<ab.length;V++){U=ab[V];if(!X[U]&&N.apply[W].name==U){X[U]=true;Z.push(U)}}}}Y=p.getStart();c.getParent(Y,function(ae){var ad,ac;for(ad=0;ad<ab.length;ad++){ac=ab[ad];if(!X[ac]&&v(ae,ac,aa)){X[ac]=true;Z.push(ac)}}});return Z}function x(Y){var aa=P(Y),X,W,Z,V,U;if(aa){X=p.getStart();W=l(X);for(V=aa.length-1;V>=0;V--){U=aa[V].selector;if(!U){return A}for(Z=W.length-1;Z>=0;Z--){if(c.is(W[Z],U)){return A}}}}return Q}a.extend(this,{get:P,register:j,apply:R,remove:z,toggle:C,match:i,matchAll:u,matchNode:v,canApply:x});function h(U,V){if(g(U,V.inline)){return A}if(g(U,V.block)){return A}if(V.selector){return c.is(U,V.selector)}}function g(V,U){V=V||"";U=U||"";V=""+(V.nodeName||V);U=""+(U.nodeName||U);return V.toLowerCase()==U.toLowerCase()}function J(V,U){var W=c.getStyle(V,U);if(U=="color"||U=="backgroundColor"){W=c.toHex(W)}if(U=="fontWeight"&&W==700){W="bold"}return""+W}function q(U,V){if(typeof(U)!="string"){U=U(V)}else{if(V){U=U.replace(/%(\w+)/g,function(X,W){return V[W]||X})}}return U}function f(U){return U&&U.nodeType===3&&/^([\s\r\n]+|)$/.test(U.nodeValue)}function L(W,V,U){var X=c.create(V,U);W.parentNode.insertBefore(X,W);X.appendChild(W);return X}function n(U,ac,X){var W=U.startContainer,Z=U.startOffset,af=U.endContainer,aa=U.endOffset,ae,ab;function ad(ai,aj,ag,ah){var ak,al;ah=ah||c.getRoot();for(;;){ak=ai.parentNode;if(ak==ah||(!ac[0].block_expand&&E(ak))){return ai}for(ae=ak[aj];ae&&ae!=ai;ae=ae[ag]){if(ae.nodeType==1&&!G(ae)){return ai}if(ae.nodeType==3&&!f(ae)){return ai}}ai=ai.parentNode}return ai}if(W.nodeType==1&&W.hasChildNodes()){ab=W.childNodes.length-1;W=W.childNodes[Z>ab?ab:Z];if(W.nodeType==3){Z=0}}if(af.nodeType==1&&af.hasChildNodes()){ab=af.childNodes.length-1;af=af.childNodes[aa>ab?ab:aa-1];if(af.nodeType==3){aa=af.nodeValue.length}}if(G(W.parentNode)){W=W.parentNode}if(G(W)){W=W.nextSibling||W}if(G(af.parentNode)){af=af.parentNode}if(G(af)){af=af.previousSibling||af}if(ac[0].inline||ac[0].block_expand){W=ad(W,"firstChild","nextSibling");af=ad(af,"lastChild","previousSibling")}if(ac[0].selector&&ac[0].expand!==Q&&!ac[0].inline){function Y(ah,ag){var ai,aj,ak;if(ah.nodeType==3&&ah.nodeValue.length==0&&ah[ag]){ah=ah[ag]}ai=l(ah);for(aj=0;aj<ai.length;aj++){for(ak=0;ak<ac.length;ak++){if(c.is(ai[aj],ac[ak].selector)){return ai[aj]}}}return ah}W=Y(W,"previousSibling");af=Y(af,"nextSibling")}if(ac[0].block||ac[0].selector){function V(ah,ag,aj){var ai;if(!ac[0].wrapper){ai=c.getParent(ah,ac[0].block)}if(!ai){ai=c.getParent(ah.nodeType==3?ah.parentNode:ah,E)}if(ai&&ac[0].wrapper){ai=l(ai,"ul,ol").reverse()[0]||ai}if(!ai){ai=ah;while(ai[ag]&&!E(ai[ag])){ai=ai[ag];if(g(ai,"br")){break}}}return ai||ah}W=V(W,"previousSibling");af=V(af,"nextSibling");if(ac[0].block){if(!E(W)){W=ad(W,"firstChild","nextSibling")}if(!E(af)){af=ad(af,"lastChild","previousSibling")}}}if(W.nodeType==1){Z=r(W);W=W.parentNode}if(af.nodeType==1){aa=r(af)+1;af=af.parentNode}return{startContainer:W,startOffset:Z,endContainer:af,endOffset:aa}}function S(aa,Z,X,U){var W,V,Y;if(!h(X,aa)){return Q}if(aa.remove!="all"){M(aa.styles,function(ac,ab){ac=q(ac,Z);if(typeof(ab)==="number"){ab=ac;U=0}if(!U||g(J(U,ab),ac)){c.setStyle(X,ab,"")}Y=1});if(Y&&c.getAttrib(X,"style")==""){X.removeAttribute("style");X.removeAttribute("_mce_style")}M(aa.attributes,function(ad,ab){var ac;ad=q(ad,Z);if(typeof(ab)==="number"){ab=ad;U=0}if(!U||g(c.getAttrib(U,ab),ad)){if(ab=="class"){ad=c.getAttrib(X,ab);if(ad){ac="";M(ad.split(/\s+/),function(ae){if(/mce\w+/.test(ae)){ac+=(ac?" ":"")+ae}});if(ac){c.setAttrib(X,ab,ac);return}}}if(ab=="class"){X.removeAttribute("className")}if(e.test(ab)){X.removeAttribute("_mce_"+ab)}X.removeAttribute(ab)}});M(aa.classes,function(ab){ab=q(ab,Z);if(!U||c.hasClass(U,ab)){c.removeClass(X,ab)}});V=c.getAttribs(X);for(W=0;W<V.length;W++){if(V[W].nodeName.indexOf("_")!==0){return Q}}}if(aa.remove!="none"){m(X,aa);return A}}function m(W,X){var U=W.parentNode,V;if(X.block){if(!k){function Y(aa,Z,ab){aa=B(aa,Z,ab);return !aa||(aa.nodeName=="BR"||E(aa))}if(E(W)&&!E(U)){if(!Y(W,Q)&&!Y(W.firstChild,A,1)){W.insertBefore(c.create("br"),W.firstChild)}if(!Y(W,A)&&!Y(W.lastChild,Q,1)){W.appendChild(c.create("br"))}}}else{if(U==c.getRoot()){if(!X.list_block||!g(W,X.list_block)){M(a.grep(W.childNodes),function(Z){if(d(k,Z.nodeName.toLowerCase())){if(!V){V=L(Z,k)}else{V.appendChild(Z)}}else{V=0}})}}}}if(X.selector&&X.inline&&!g(X.inline,W)){return}c.remove(W,1)}function B(V,U,W){if(V){U=U?"nextSibling":"previousSibling";for(V=W?V:V[U];V;V=V[U]){if(V.nodeType==1||!f(V)){return V}}}}function G(U){return U&&U.nodeType==1&&U.getAttribute("_mce_type")=="bookmark"}function t(Y,X){var U,W,V;function aa(ad,ac){if(ad.nodeName!=ac.nodeName){return Q}function ab(af){var ag={};M(c.getAttribs(af),function(ah){var ai=ah.nodeName.toLowerCase();if(ai.indexOf("_")!==0&&ai!=="style"){ag[ai]=c.getAttrib(af,ai)}});return ag}function ae(ai,ah){var ag,af;for(af in ai){if(ai.hasOwnProperty(af)){ag=ah[af];if(ag===o){return Q}if(ai[af]!=ag){return Q}delete ah[af]}}for(af in ah){if(ah.hasOwnProperty(af)){return Q}}return A}if(!ae(ab(ad),ab(ac))){return Q}if(!ae(c.parseStyle(c.getAttrib(ad,"style")),c.parseStyle(c.getAttrib(ac,"style")))){return Q}return A}if(Y&&X){function Z(ac,ab){for(W=ac;W;W=W[ab]){if(W.nodeType==3&&!f(W)){return ac}if(W.nodeType==1&&!G(W)){return W}}return ac}Y=Z(Y,"previousSibling");X=Z(X,"nextSibling");if(aa(Y,X)){for(W=Y.nextSibling;W&&W!=X;){V=W;W=W.nextSibling;Y.appendChild(V)}c.remove(X);M(a.grep(X.childNodes),function(ab){Y.appendChild(ab)});return Y}}return X}function F(U){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(U)}function H(V,Y){var U,X,W;U=V[Y?"startContainer":"endContainer"];X=V[Y?"startOffset":"endOffset"];if(U.nodeType==1){W=U.childNodes.length-1;if(!Y&&X){X--}U=U.childNodes[X>W?W:X]}return U}function O(Z,V,Y){var W,U=N[Z],aa=N[Z=="apply"?"remove":"apply"];function ab(){return N.apply.length||N.remove.length}function X(){N.apply=[];N.remove=[]}function ac(ad){M(N.apply.reverse(),function(ae){R(ae.name,ae.vars,ad)});M(N.remove.reverse(),function(ae){z(ae.name,ae.vars,ad)});c.remove(ad,1);X()}for(W=U.length-1;W>=0;W--){if(U[W].name==V){return}}U.push({name:V,vars:Y});for(W=aa.length-1;W>=0;W--){if(aa[W].name==V){aa.splice(W,1)}}if(ab()){T.getDoc().execCommand("FontName",false,"mceinline");N.lastRng=p.getRng();M(c.select("font,span"),function(ae){var ad;if(b(ae)){ad=p.getBookmark();ac(ae);p.moveToBookmark(ad);T.nodeChanged()}});if(!N.isListening&&ab()){N.isListening=true;M("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(ad){T[ad].addToTop(function(ae,af){if(ab()&&!a.dom.RangeUtils.compareRanges(N.lastRng,p.getRng())){M(c.select("font,span"),function(ah){var ai,ag;if(b(ah)){ai=ah.firstChild;if(ai){ac(ah);ag=c.createRng();ag.setStart(ai,ai.nodeValue.length);ag.setEnd(ai,ai.nodeValue.length);p.setRng(ag);ae.nodeChanged()}else{c.remove(ah)}}});if(af.type=="keyup"||af.type=="mouseup"){X()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){g.replace(g.create("span",{style:i}),j,1)}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
\ No newline at end of file
--- /dev/null
+
+// Uncomment and change this document.domain value if you are loading the script cross subdomains
+// document.domain = 'moxiecode.com';
+
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
--- /dev/null
+(function(win) {\r
+ var whiteSpaceRe = /^\s*|\s*$/g,\r
+ undefined;\r
+\r
+ var tinymce = {\r
+ majorVersion : '3',\r
+\r
+ minorVersion : '3.8',\r
+\r
+ releaseDate : '2010-06-30',\r
+\r
+ _init : function() {\r
+ var t = this, d = document, na = navigator, ua = na.userAgent, i, nl, n, base, p, v;\r
+\r
+ t.isOpera = win.opera && opera.buildNumber;\r
+\r
+ t.isWebKit = /WebKit/.test(ua);\r
+\r
+ t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName);\r
+\r
+ t.isIE6 = t.isIE && /MSIE [56]/.test(ua);\r
+\r
+ t.isGecko = !t.isWebKit && /Gecko/.test(ua);\r
+\r
+ t.isMac = ua.indexOf('Mac') != -1;\r
+\r
+ t.isAir = /adobeair/i.test(ua);\r
+\r
+ t.isIDevice = /(iPad|iPhone)/.test(ua);\r
+\r
+ // TinyMCE .NET webcontrol might be setting the values for TinyMCE\r
+ if (win.tinyMCEPreInit) {\r
+ t.suffix = tinyMCEPreInit.suffix;\r
+ t.baseURL = tinyMCEPreInit.base;\r
+ t.query = tinyMCEPreInit.query;\r
+ return;\r
+ }\r
+\r
+ // Get suffix and base\r
+ t.suffix = '';\r
+\r
+ // If base element found, add that infront of baseURL\r
+ nl = d.getElementsByTagName('base');\r
+ for (i=0; i<nl.length; i++) {\r
+ if (v = nl[i].href) {\r
+ // Host only value like http://site.com or http://site.com:8008\r
+ if (/^https?:\/\/[^\/]+$/.test(v))\r
+ v += '/';\r
+\r
+ base = v ? v.match(/.*\//)[0] : ''; // Get only directory\r
+ }\r
+ }\r
+\r
+ function getBase(n) {\r
+ if (n.src && /tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(n.src)) {\r
+ if (/_(src|dev)\.js/g.test(n.src))\r
+ t.suffix = '_src';\r
+\r
+ if ((p = n.src.indexOf('?')) != -1)\r
+ t.query = n.src.substring(p + 1);\r
+\r
+ t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));\r
+\r
+ // If path to script is relative and a base href was found add that one infront\r
+ // the src property will always be an absolute one on non IE browsers and IE 8\r
+ // so this logic will basically only be executed on older IE versions\r
+ if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)\r
+ t.baseURL = base + t.baseURL;\r
+\r
+ return t.baseURL;\r
+ }\r
+\r
+ return null;\r
+ };\r
+\r
+ // Check document\r
+ nl = d.getElementsByTagName('script');\r
+ for (i=0; i<nl.length; i++) {\r
+ if (getBase(nl[i]))\r
+ return;\r
+ }\r
+\r
+ // Check head\r
+ n = d.getElementsByTagName('head')[0];\r
+ if (n) {\r
+ nl = n.getElementsByTagName('script');\r
+ for (i=0; i<nl.length; i++) {\r
+ if (getBase(nl[i]))\r
+ return;\r
+ }\r
+ }\r
+\r
+ return;\r
+ },\r
+\r
+ is : function(o, t) {\r
+ if (!t)\r
+ return o !== undefined;\r
+\r
+ if (t == 'array' && (o.hasOwnProperty && o instanceof Array))\r
+ return true;\r
+\r
+ return typeof(o) == t;\r
+ },\r
+\r
+ each : function(o, cb, s) {\r
+ var n, l;\r
+\r
+ if (!o)\r
+ return 0;\r
+\r
+ s = s || o;\r
+\r
+ if (o.length !== undefined) {\r
+ // Indexed arrays, needed for Safari\r
+ for (n=0, l = o.length; n < l; n++) {\r
+ if (cb.call(s, o[n], n, o) === false)\r
+ return 0;\r
+ }\r
+ } else {\r
+ // Hashtables\r
+ for (n in o) {\r
+ if (o.hasOwnProperty(n)) {\r
+ if (cb.call(s, o[n], n, o) === false)\r
+ return 0;\r
+ }\r
+ }\r
+ }\r
+\r
+ return 1;\r
+ },\r
+\r
+\r
+ map : function(a, f) {\r
+ var o = [];\r
+\r
+ tinymce.each(a, function(v) {\r
+ o.push(f(v));\r
+ });\r
+\r
+ return o;\r
+ },\r
+\r
+ grep : function(a, f) {\r
+ var o = [];\r
+\r
+ tinymce.each(a, function(v) {\r
+ if (!f || f(v))\r
+ o.push(v);\r
+ });\r
+\r
+ return o;\r
+ },\r
+\r
+ inArray : function(a, v) {\r
+ var i, l;\r
+\r
+ if (a) {\r
+ for (i = 0, l = a.length; i < l; i++) {\r
+ if (a[i] === v)\r
+ return i;\r
+ }\r
+ }\r
+\r
+ return -1;\r
+ },\r
+\r
+ extend : function(o, e) {\r
+ var i, l, a = arguments;\r
+\r
+ for (i = 1, l = a.length; i < l; i++) {\r
+ e = a[i];\r
+\r
+ tinymce.each(e, function(v, n) {\r
+ if (v !== undefined)\r
+ o[n] = v;\r
+ });\r
+ }\r
+\r
+ return o;\r
+ },\r
+\r
+\r
+ trim : function(s) {\r
+ return (s ? '' + s : '').replace(whiteSpaceRe, '');\r
+ },\r
+\r
+ create : function(s, p) {\r
+ var t = this, sp, ns, cn, scn, c, de = 0;\r
+\r
+ // Parse : <prefix> <class>:<super class>\r
+ s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);\r
+ cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name\r
+\r
+ // Create namespace for new class\r
+ ns = t.createNS(s[3].replace(/\.\w+$/, ''));\r
+\r
+ // Class already exists\r
+ if (ns[cn])\r
+ return;\r
+\r
+ // Make pure static class\r
+ if (s[2] == 'static') {\r
+ ns[cn] = p;\r
+\r
+ if (this.onCreate)\r
+ this.onCreate(s[2], s[3], ns[cn]);\r
+\r
+ return;\r
+ }\r
+\r
+ // Create default constructor\r
+ if (!p[cn]) {\r
+ p[cn] = function() {};\r
+ de = 1;\r
+ }\r
+\r
+ // Add constructor and methods\r
+ ns[cn] = p[cn];\r
+ t.extend(ns[cn].prototype, p);\r
+\r
+ // Extend\r
+ if (s[5]) {\r
+ sp = t.resolve(s[5]).prototype;\r
+ scn = s[5].match(/\.(\w+)$/i)[1]; // Class name\r
+\r
+ // Extend constructor\r
+ c = ns[cn];\r
+ if (de) {\r
+ // Add passthrough constructor\r
+ ns[cn] = function() {\r
+ return sp[scn].apply(this, arguments);\r
+ };\r
+ } else {\r
+ // Add inherit constructor\r
+ ns[cn] = function() {\r
+ this.parent = sp[scn];\r
+ return c.apply(this, arguments);\r
+ };\r
+ }\r
+ ns[cn].prototype[cn] = ns[cn];\r
+\r
+ // Add super methods\r
+ t.each(sp, function(f, n) {\r
+ ns[cn].prototype[n] = sp[n];\r
+ });\r
+\r
+ // Add overridden methods\r
+ t.each(p, function(f, n) {\r
+ // Extend methods if needed\r
+ if (sp[n]) {\r
+ ns[cn].prototype[n] = function() {\r
+ this.parent = sp[n];\r
+ return f.apply(this, arguments);\r
+ };\r
+ } else {\r
+ if (n != cn)\r
+ ns[cn].prototype[n] = f;\r
+ }\r
+ });\r
+ }\r
+\r
+ // Add static methods\r
+ t.each(p['static'], function(f, n) {\r
+ ns[cn][n] = f;\r
+ });\r
+\r
+ if (this.onCreate)\r
+ this.onCreate(s[2], s[3], ns[cn].prototype);\r
+ },\r
+\r
+ walk : function(o, f, n, s) {\r
+ s = s || this;\r
+\r
+ if (o) {\r
+ if (n)\r
+ o = o[n];\r
+\r
+ tinymce.each(o, function(o, i) {\r
+ if (f.call(s, o, i, n) === false)\r
+ return false;\r
+\r
+ tinymce.walk(o, f, n, s);\r
+ });\r
+ }\r
+ },\r
+\r
+ createNS : function(n, o) {\r
+ var i, v;\r
+\r
+ o = o || win;\r
+\r
+ n = n.split('.');\r
+ for (i=0; i<n.length; i++) {\r
+ v = n[i];\r
+\r
+ if (!o[v])\r
+ o[v] = {};\r
+\r
+ o = o[v];\r
+ }\r
+\r
+ return o;\r
+ },\r
+\r
+ resolve : function(n, o) {\r
+ var i, l;\r
+\r
+ o = o || win;\r
+\r
+ n = n.split('.');\r
+ for (i = 0, l = n.length; i < l; i++) {\r
+ o = o[n[i]];\r
+\r
+ if (!o)\r
+ break;\r
+ }\r
+\r
+ return o;\r
+ },\r
+\r
+ addUnload : function(f, s) {\r
+ var t = this;\r
+\r
+ f = {func : f, scope : s || this};\r
+\r
+ if (!t.unloads) {\r
+ function unload() {\r
+ var li = t.unloads, o, n;\r
+\r
+ if (li) {\r
+ // Call unload handlers\r
+ for (n in li) {\r
+ o = li[n];\r
+\r
+ if (o && o.func)\r
+ o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy\r
+ }\r
+\r
+ // Detach unload function\r
+ if (win.detachEvent) {\r
+ win.detachEvent('onbeforeunload', fakeUnload);\r
+ win.detachEvent('onunload', unload);\r
+ } else if (win.removeEventListener)\r
+ win.removeEventListener('unload', unload, false);\r
+\r
+ // Destroy references\r
+ t.unloads = o = li = w = unload = 0;\r
+\r
+ // Run garbarge collector on IE\r
+ if (win.CollectGarbage)\r
+ CollectGarbage();\r
+ }\r
+ };\r
+\r
+ function fakeUnload() {\r
+ var d = document;\r
+\r
+ // Is there things still loading, then do some magic\r
+ if (d.readyState == 'interactive') {\r
+ function stop() {\r
+ // Prevent memory leak\r
+ d.detachEvent('onstop', stop);\r
+\r
+ // Call unload handler\r
+ if (unload)\r
+ unload();\r
+\r
+ d = 0;\r
+ };\r
+\r
+ // Fire unload when the currently loading page is stopped\r
+ if (d)\r
+ d.attachEvent('onstop', stop);\r
+\r
+ // Remove onstop listener after a while to prevent the unload function\r
+ // to execute if the user presses cancel in an onbeforeunload\r
+ // confirm dialog and then presses the browser stop button\r
+ win.setTimeout(function() {\r
+ if (d)\r
+ d.detachEvent('onstop', stop);\r
+ }, 0);\r
+ }\r
+ };\r
+\r
+ // Attach unload handler\r
+ if (win.attachEvent) {\r
+ win.attachEvent('onunload', unload);\r
+ win.attachEvent('onbeforeunload', fakeUnload);\r
+ } else if (win.addEventListener)\r
+ win.addEventListener('unload', unload, false);\r
+\r
+ // Setup initial unload handler array\r
+ t.unloads = [f];\r
+ } else\r
+ t.unloads.push(f);\r
+\r
+ return f;\r
+ },\r
+\r
+ removeUnload : function(f) {\r
+ var u = this.unloads, r = null;\r
+\r
+ tinymce.each(u, function(o, i) {\r
+ if (o && o.func == f) {\r
+ u.splice(i, 1);\r
+ r = f;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return r;\r
+ },\r
+\r
+ explode : function(s, d) {\r
+ return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s;\r
+ },\r
+\r
+ _addVer : function(u) {\r
+ var v;\r
+\r
+ if (!this.query)\r
+ return u;\r
+\r
+ v = (u.indexOf('?') == -1 ? '?' : '&') + this.query;\r
+\r
+ if (u.indexOf('#') == -1)\r
+ return u + v;\r
+\r
+ return u.replace('#', v + '#');\r
+ }\r
+\r
+ };\r
+\r
+ // Initialize the API\r
+ tinymce._init();\r
+\r
+ // Expose tinymce namespace to the global namespace (window)\r
+ win.tinymce = win.tinyMCE = tinymce;\r
+})(window);\r
+\r
+\r
+tinymce.create('tinymce.util.Dispatcher', {\r
+ scope : null,\r
+ listeners : null,\r
+\r
+ Dispatcher : function(s) {\r
+ this.scope = s || this;\r
+ this.listeners = [];\r
+ },\r
+\r
+ add : function(cb, s) {\r
+ this.listeners.push({cb : cb, scope : s || this.scope});\r
+\r
+ return cb;\r
+ },\r
+\r
+ addToTop : function(cb, s) {\r
+ this.listeners.unshift({cb : cb, scope : s || this.scope});\r
+\r
+ return cb;\r
+ },\r
+\r
+ remove : function(cb) {\r
+ var l = this.listeners, o = null;\r
+\r
+ tinymce.each(l, function(c, i) {\r
+ if (cb == c.cb) {\r
+ o = cb;\r
+ l.splice(i, 1);\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return o;\r
+ },\r
+\r
+ dispatch : function() {\r
+ var s, a = arguments, i, li = this.listeners, c;\r
+\r
+ // Needs to be a real loop since the listener count might change while looping\r
+ // And this is also more efficient\r
+ for (i = 0; i<li.length; i++) {\r
+ c = li[i];\r
+ s = c.cb.apply(c.scope, a);\r
+\r
+ if (s === false)\r
+ break;\r
+ }\r
+\r
+ return s;\r
+ }\r
+\r
+ });\r
+\r
+(function() {\r
+ var each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.util.URI', {\r
+ URI : function(u, s) {\r
+ var t = this, o, a, b;\r
+\r
+ // Trim whitespace\r
+ u = tinymce.trim(u);\r
+\r
+ // Default settings\r
+ s = t.settings = s || {};\r
+\r
+ // Strange app protocol or local anchor\r
+ if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) {\r
+ t.source = u;\r
+ return;\r
+ }\r
+\r
+ // Absolute path with no host, fake host and protocol\r
+ if (u.indexOf('/') === 0 && u.indexOf('//') !== 0)\r
+ u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u;\r
+\r
+ // Relative path http:// or protocol relative //path\r
+ if (!/^\w*:?\/\//.test(u))\r
+ u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u);\r
+\r
+ // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)\r
+ u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something\r
+ u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u);\r
+ each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) {\r
+ var s = u[i];\r
+\r
+ // Zope 3 workaround, they use @@something\r
+ if (s)\r
+ s = s.replace(/\(mce_at\)/g, '@@');\r
+\r
+ t[v] = s;\r
+ });\r
+\r
+ if (b = s.base_uri) {\r
+ if (!t.protocol)\r
+ t.protocol = b.protocol;\r
+\r
+ if (!t.userInfo)\r
+ t.userInfo = b.userInfo;\r
+\r
+ if (!t.port && t.host == 'mce_host')\r
+ t.port = b.port;\r
+\r
+ if (!t.host || t.host == 'mce_host')\r
+ t.host = b.host;\r
+\r
+ t.source = '';\r
+ }\r
+\r
+ //t.path = t.path || '/';\r
+ },\r
+\r
+ setPath : function(p) {\r
+ var t = this;\r
+\r
+ p = /^(.*?)\/?(\w+)?$/.exec(p);\r
+\r
+ // Update path parts\r
+ t.path = p[0];\r
+ t.directory = p[1];\r
+ t.file = p[2];\r
+\r
+ // Rebuild source\r
+ t.source = '';\r
+ t.getURI();\r
+ },\r
+\r
+ toRelative : function(u) {\r
+ var t = this, o;\r
+\r
+ if (u === "./")\r
+ return u;\r
+\r
+ u = new tinymce.util.URI(u, {base_uri : t});\r
+\r
+ // Not on same domain/port or protocol\r
+ if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol)\r
+ return u.getURI();\r
+\r
+ o = t.toRelPath(t.path, u.path);\r
+\r
+ // Add query\r
+ if (u.query)\r
+ o += '?' + u.query;\r
+\r
+ // Add anchor\r
+ if (u.anchor)\r
+ o += '#' + u.anchor;\r
+\r
+ return o;\r
+ },\r
+ \r
+ toAbsolute : function(u, nh) {\r
+ var u = new tinymce.util.URI(u, {base_uri : this});\r
+\r
+ return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0);\r
+ },\r
+\r
+ toRelPath : function(base, path) {\r
+ var items, bp = 0, out = '', i, l;\r
+\r
+ // Split the paths\r
+ base = base.substring(0, base.lastIndexOf('/'));\r
+ base = base.split('/');\r
+ items = path.split('/');\r
+\r
+ if (base.length >= items.length) {\r
+ for (i = 0, l = base.length; i < l; i++) {\r
+ if (i >= items.length || base[i] != items[i]) {\r
+ bp = i + 1;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (base.length < items.length) {\r
+ for (i = 0, l = items.length; i < l; i++) {\r
+ if (i >= base.length || base[i] != items[i]) {\r
+ bp = i + 1;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ if (bp == 1)\r
+ return path;\r
+\r
+ for (i = 0, l = base.length - (bp - 1); i < l; i++)\r
+ out += "../";\r
+\r
+ for (i = bp - 1, l = items.length; i < l; i++) {\r
+ if (i != bp - 1)\r
+ out += "/" + items[i];\r
+ else\r
+ out += items[i];\r
+ }\r
+\r
+ return out;\r
+ },\r
+\r
+ toAbsPath : function(base, path) {\r
+ var i, nb = 0, o = [], tr, outPath;\r
+\r
+ // Split paths\r
+ tr = /\/$/.test(path) ? '/' : '';\r
+ base = base.split('/');\r
+ path = path.split('/');\r
+\r
+ // Remove empty chunks\r
+ each(base, function(k) {\r
+ if (k)\r
+ o.push(k);\r
+ });\r
+\r
+ base = o;\r
+\r
+ // Merge relURLParts chunks\r
+ for (i = path.length - 1, o = []; i >= 0; i--) {\r
+ // Ignore empty or .\r
+ if (path[i].length == 0 || path[i] == ".")\r
+ continue;\r
+\r
+ // Is parent\r
+ if (path[i] == '..') {\r
+ nb++;\r
+ continue;\r
+ }\r
+\r
+ // Move up\r
+ if (nb > 0) {\r
+ nb--;\r
+ continue;\r
+ }\r
+\r
+ o.push(path[i]);\r
+ }\r
+\r
+ i = base.length - nb;\r
+\r
+ // If /a/b/c or /\r
+ if (i <= 0)\r
+ outPath = o.reverse().join('/');\r
+ else\r
+ outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');\r
+\r
+ // Add front / if it's needed\r
+ if (outPath.indexOf('/') !== 0)\r
+ outPath = '/' + outPath;\r
+\r
+ // Add traling / if it's needed\r
+ if (tr && outPath.lastIndexOf('/') !== outPath.length - 1)\r
+ outPath += tr;\r
+\r
+ return outPath;\r
+ },\r
+\r
+ getURI : function(nh) {\r
+ var s, t = this;\r
+\r
+ // Rebuild source\r
+ if (!t.source || nh) {\r
+ s = '';\r
+\r
+ if (!nh) {\r
+ if (t.protocol)\r
+ s += t.protocol + '://';\r
+\r
+ if (t.userInfo)\r
+ s += t.userInfo + '@';\r
+\r
+ if (t.host)\r
+ s += t.host;\r
+\r
+ if (t.port)\r
+ s += ':' + t.port;\r
+ }\r
+\r
+ if (t.path)\r
+ s += t.path;\r
+\r
+ if (t.query)\r
+ s += '?' + t.query;\r
+\r
+ if (t.anchor)\r
+ s += '#' + t.anchor;\r
+\r
+ t.source = s;\r
+ }\r
+\r
+ return t.source;\r
+ }\r
+ });\r
+})();\r
+\r
+(function() {\r
+ var each = tinymce.each;\r
+\r
+ tinymce.create('static tinymce.util.Cookie', {\r
+ getHash : function(n) {\r
+ var v = this.get(n), h;\r
+\r
+ if (v) {\r
+ each(v.split('&'), function(v) {\r
+ v = v.split('=');\r
+ h = h || {};\r
+ h[unescape(v[0])] = unescape(v[1]);\r
+ });\r
+ }\r
+\r
+ return h;\r
+ },\r
+\r
+ setHash : function(n, v, e, p, d, s) {\r
+ var o = '';\r
+\r
+ each(v, function(v, k) {\r
+ o += (!o ? '' : '&') + escape(k) + '=' + escape(v);\r
+ });\r
+\r
+ this.set(n, o, e, p, d, s);\r
+ },\r
+\r
+ get : function(n) {\r
+ var c = document.cookie, e, p = n + "=", b;\r
+\r
+ // Strict mode\r
+ if (!c)\r
+ return;\r
+\r
+ b = c.indexOf("; " + p);\r
+\r
+ if (b == -1) {\r
+ b = c.indexOf(p);\r
+\r
+ if (b != 0)\r
+ return null;\r
+ } else\r
+ b += 2;\r
+\r
+ e = c.indexOf(";", b);\r
+\r
+ if (e == -1)\r
+ e = c.length;\r
+\r
+ return unescape(c.substring(b + p.length, e));\r
+ },\r
+\r
+ set : function(n, v, e, p, d, s) {\r
+ document.cookie = n + "=" + escape(v) +\r
+ ((e) ? "; expires=" + e.toGMTString() : "") +\r
+ ((p) ? "; path=" + escape(p) : "") +\r
+ ((d) ? "; domain=" + d : "") +\r
+ ((s) ? "; secure" : "");\r
+ },\r
+\r
+ remove : function(n, p) {\r
+ var d = new Date();\r
+\r
+ d.setTime(d.getTime() - 1000);\r
+\r
+ this.set(n, '', d, p, d);\r
+ }\r
+ });\r
+})();\r
+\r
+tinymce.create('static tinymce.util.JSON', {\r
+ serialize : function(o) {\r
+ var i, v, s = tinymce.util.JSON.serialize, t;\r
+\r
+ if (o == null)\r
+ return 'null';\r
+\r
+ t = typeof o;\r
+\r
+ if (t == 'string') {\r
+ v = '\bb\tt\nn\ff\rr\""\'\'\\\\';\r
+\r
+ return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) {\r
+ i = v.indexOf(b);\r
+\r
+ if (i + 1)\r
+ return '\\' + v.charAt(i + 1);\r
+\r
+ a = b.charCodeAt().toString(16);\r
+\r
+ return '\\u' + '0000'.substring(a.length) + a;\r
+ }) + '"';\r
+ }\r
+\r
+ if (t == 'object') {\r
+ if (o.hasOwnProperty && o instanceof Array) {\r
+ for (i=0, v = '['; i<o.length; i++)\r
+ v += (i > 0 ? ',' : '') + s(o[i]);\r
+\r
+ return v + ']';\r
+ }\r
+\r
+ v = '{';\r
+\r
+ for (i in o)\r
+ v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';\r
+\r
+ return v + '}';\r
+ }\r
+\r
+ return '' + o;\r
+ },\r
+\r
+ parse : function(s) {\r
+ try {\r
+ return eval('(' + s + ')');\r
+ } catch (ex) {\r
+ // Ignore\r
+ }\r
+ }\r
+\r
+ });\r
+\r
+tinymce.create('static tinymce.util.XHR', {\r
+ send : function(o) {\r
+ var x, t, w = window, c = 0;\r
+\r
+ // Default settings\r
+ o.scope = o.scope || this;\r
+ o.success_scope = o.success_scope || o.scope;\r
+ o.error_scope = o.error_scope || o.scope;\r
+ o.async = o.async === false ? false : true;\r
+ o.data = o.data || '';\r
+\r
+ function get(s) {\r
+ x = 0;\r
+\r
+ try {\r
+ x = new ActiveXObject(s);\r
+ } catch (ex) {\r
+ }\r
+\r
+ return x;\r
+ };\r
+\r
+ x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP');\r
+\r
+ if (x) {\r
+ if (x.overrideMimeType)\r
+ x.overrideMimeType(o.content_type);\r
+\r
+ x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async);\r
+\r
+ if (o.content_type)\r
+ x.setRequestHeader('Content-Type', o.content_type);\r
+\r
+ x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\r
+\r
+ x.send(o.data);\r
+\r
+ function ready() {\r
+ if (!o.async || x.readyState == 4 || c++ > 10000) {\r
+ if (o.success && c < 10000 && x.status == 200)\r
+ o.success.call(o.success_scope, '' + x.responseText, x, o);\r
+ else if (o.error)\r
+ o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o);\r
+\r
+ x = null;\r
+ } else\r
+ w.setTimeout(ready, 10);\r
+ };\r
+\r
+ // Syncronous request\r
+ if (!o.async)\r
+ return ready();\r
+\r
+ // Wait for response, onReadyStateChange can not be used since it leaks memory in IE\r
+ t = w.setTimeout(ready, 10);\r
+ }\r
+ }\r
+});\r
+\r
+(function() {\r
+ var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR;\r
+\r
+ tinymce.create('tinymce.util.JSONRequest', {\r
+ JSONRequest : function(s) {\r
+ this.settings = extend({\r
+ }, s);\r
+ this.count = 0;\r
+ },\r
+\r
+ send : function(o) {\r
+ var ecb = o.error, scb = o.success;\r
+\r
+ o = extend(this.settings, o);\r
+\r
+ o.success = function(c, x) {\r
+ c = JSON.parse(c);\r
+\r
+ if (typeof(c) == 'undefined') {\r
+ c = {\r
+ error : 'JSON Parse error.'\r
+ };\r
+ }\r
+\r
+ if (c.error)\r
+ ecb.call(o.error_scope || o.scope, c.error, x);\r
+ else\r
+ scb.call(o.success_scope || o.scope, c.result);\r
+ };\r
+\r
+ o.error = function(ty, x) {\r
+ ecb.call(o.error_scope || o.scope, ty, x);\r
+ };\r
+\r
+ o.data = JSON.serialize({\r
+ id : o.id || 'c' + (this.count++),\r
+ method : o.method,\r
+ params : o.params\r
+ });\r
+\r
+ // JSON content type for Ruby on rails. Bug: #1883287\r
+ o.content_type = 'application/json';\r
+\r
+ XHR.send(o);\r
+ },\r
+\r
+ 'static' : {\r
+ sendRPC : function(o) {\r
+ return new tinymce.util.JSONRequest().send(o);\r
+ }\r
+ }\r
+ });\r
+}());\r
+(function(tinymce) {\r
+ // Shorten names\r
+ var each = tinymce.each,\r
+ is = tinymce.is,\r
+ isWebKit = tinymce.isWebKit,\r
+ isIE = tinymce.isIE,\r
+ blockRe = /^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,\r
+ boolAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'),\r
+ mceAttribs = makeMap('src,href,style,coords,shape'),\r
+ encodedChars = {'&' : '&', '"' : '"', '<' : '<', '>' : '>'},\r
+ encodeCharsRe = /[<>&\"]/g,\r
+ simpleSelectorRe = /^([a-z0-9],?)+$/i,\r
+ tagRegExp = /<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,\r
+ attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;\r
+\r
+ function makeMap(str) {\r
+ var map = {}, i;\r
+\r
+ str = str.split(',');\r
+ for (i = str.length; i >= 0; i--)\r
+ map[str[i]] = 1;\r
+\r
+ return map;\r
+ };\r
+\r
+ tinymce.create('tinymce.dom.DOMUtils', {\r
+ doc : null,\r
+ root : null,\r
+ files : null,\r
+ pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/,\r
+ props : {\r
+ "for" : "htmlFor",\r
+ "class" : "className",\r
+ className : "className",\r
+ checked : "checked",\r
+ disabled : "disabled",\r
+ maxlength : "maxLength",\r
+ readonly : "readOnly",\r
+ selected : "selected",\r
+ value : "value",\r
+ id : "id",\r
+ name : "name",\r
+ type : "type"\r
+ },\r
+\r
+ DOMUtils : function(d, s) {\r
+ var t = this, globalStyle;\r
+\r
+ t.doc = d;\r
+ t.win = window;\r
+ t.files = {};\r
+ t.cssFlicker = false;\r
+ t.counter = 0;\r
+ t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; \r
+ t.stdMode = d.documentMode === 8;\r
+\r
+ t.settings = s = tinymce.extend({\r
+ keep_values : false,\r
+ hex_colors : 1,\r
+ process_html : 1\r
+ }, s);\r
+\r
+ // Fix IE6SP2 flicker and check it failed for pre SP2\r
+ if (tinymce.isIE6) {\r
+ try {\r
+ d.execCommand('BackgroundImageCache', false, true);\r
+ } catch (e) {\r
+ t.cssFlicker = true;\r
+ }\r
+ }\r
+\r
+ // Build styles list\r
+ if (s.valid_styles) {\r
+ t._styles = {};\r
+\r
+ // Convert styles into a rule list\r
+ each(s.valid_styles, function(value, key) {\r
+ t._styles[key] = tinymce.explode(value);\r
+ });\r
+ }\r
+\r
+ tinymce.addUnload(t.destroy, t);\r
+ },\r
+\r
+ getRoot : function() {\r
+ var t = this, s = t.settings;\r
+\r
+ return (s && t.get(s.root_element)) || t.doc.body;\r
+ },\r
+\r
+ getViewPort : function(w) {\r
+ var d, b;\r
+\r
+ w = !w ? this.win : w;\r
+ d = w.document;\r
+ b = this.boxModel ? d.documentElement : d.body;\r
+\r
+ // Returns viewport size excluding scrollbars\r
+ return {\r
+ x : w.pageXOffset || b.scrollLeft,\r
+ y : w.pageYOffset || b.scrollTop,\r
+ w : w.innerWidth || b.clientWidth,\r
+ h : w.innerHeight || b.clientHeight\r
+ };\r
+ },\r
+\r
+ getRect : function(e) {\r
+ var p, t = this, sr;\r
+\r
+ e = t.get(e);\r
+ p = t.getPos(e);\r
+ sr = t.getSize(e);\r
+\r
+ return {\r
+ x : p.x,\r
+ y : p.y,\r
+ w : sr.w,\r
+ h : sr.h\r
+ };\r
+ },\r
+\r
+ getSize : function(e) {\r
+ var t = this, w, h;\r
+\r
+ e = t.get(e);\r
+ w = t.getStyle(e, 'width');\r
+ h = t.getStyle(e, 'height');\r
+\r
+ // Non pixel value, then force offset/clientWidth\r
+ if (w.indexOf('px') === -1)\r
+ w = 0;\r
+\r
+ // Non pixel value, then force offset/clientWidth\r
+ if (h.indexOf('px') === -1)\r
+ h = 0;\r
+\r
+ return {\r
+ w : parseInt(w) || e.offsetWidth || e.clientWidth,\r
+ h : parseInt(h) || e.offsetHeight || e.clientHeight\r
+ };\r
+ },\r
+\r
+ getParent : function(n, f, r) {\r
+ return this.getParents(n, f, r, false);\r
+ },\r
+\r
+ getParents : function(n, f, r, c) {\r
+ var t = this, na, se = t.settings, o = [];\r
+\r
+ n = t.get(n);\r
+ c = c === undefined;\r
+\r
+ if (se.strict_root)\r
+ r = r || t.getRoot();\r
+\r
+ // Wrap node name as func\r
+ if (is(f, 'string')) {\r
+ na = f;\r
+\r
+ if (f === '*') {\r
+ f = function(n) {return n.nodeType == 1;};\r
+ } else {\r
+ f = function(n) {\r
+ return t.is(n, na);\r
+ };\r
+ }\r
+ }\r
+\r
+ while (n) {\r
+ if (n == r || !n.nodeType || n.nodeType === 9)\r
+ break;\r
+\r
+ if (!f || f(n)) {\r
+ if (c)\r
+ o.push(n);\r
+ else\r
+ return n;\r
+ }\r
+\r
+ n = n.parentNode;\r
+ }\r
+\r
+ return c ? o : null;\r
+ },\r
+\r
+ get : function(e) {\r
+ var n;\r
+\r
+ if (e && this.doc && typeof(e) == 'string') {\r
+ n = e;\r
+ e = this.doc.getElementById(e);\r
+\r
+ // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick\r
+ if (e && e.id !== n)\r
+ return this.doc.getElementsByName(n)[1];\r
+ }\r
+\r
+ return e;\r
+ },\r
+\r
+ getNext : function(node, selector) {\r
+ return this._findSib(node, selector, 'nextSibling');\r
+ },\r
+\r
+ getPrev : function(node, selector) {\r
+ return this._findSib(node, selector, 'previousSibling');\r
+ },\r
+\r
+\r
+ select : function(pa, s) {\r
+ var t = this;\r
+\r
+ return tinymce.dom.Sizzle(pa, t.get(s) || t.get(t.settings.root_element) || t.doc, []);\r
+ },\r
+\r
+ is : function(n, selector) {\r
+ var i;\r
+\r
+ // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance\r
+ if (n.length === undefined) {\r
+ // Simple all selector\r
+ if (selector === '*')\r
+ return n.nodeType == 1;\r
+\r
+ // Simple selector just elements\r
+ if (simpleSelectorRe.test(selector)) {\r
+ selector = selector.toLowerCase().split(/,/);\r
+ n = n.nodeName.toLowerCase();\r
+\r
+ for (i = selector.length - 1; i >= 0; i--) {\r
+ if (selector[i] == n)\r
+ return true;\r
+ }\r
+\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return tinymce.dom.Sizzle.matches(selector, n.nodeType ? [n] : n).length > 0;\r
+ },\r
+\r
+\r
+ add : function(p, n, a, h, c) {\r
+ var t = this;\r
+\r
+ return this.run(p, function(p) {\r
+ var e, k;\r
+\r
+ e = is(n, 'string') ? t.doc.createElement(n) : n;\r
+ t.setAttribs(e, a);\r
+\r
+ if (h) {\r
+ if (h.nodeType)\r
+ e.appendChild(h);\r
+ else\r
+ t.setHTML(e, h);\r
+ }\r
+\r
+ return !c ? p.appendChild(e) : e;\r
+ });\r
+ },\r
+\r
+ create : function(n, a, h) {\r
+ return this.add(this.doc.createElement(n), n, a, h, 1);\r
+ },\r
+\r
+ createHTML : function(n, a, h) {\r
+ var o = '', t = this, k;\r
+\r
+ o += '<' + n;\r
+\r
+ for (k in a) {\r
+ if (a.hasOwnProperty(k))\r
+ o += ' ' + k + '="' + t.encode(a[k]) + '"';\r
+ }\r
+\r
+ if (tinymce.is(h))\r
+ return o + '>' + h + '</' + n + '>';\r
+\r
+ return o + ' />';\r
+ },\r
+\r
+ remove : function(node, keep_children) {\r
+ return this.run(node, function(node) {\r
+ var parent, child;\r
+\r
+ parent = node.parentNode;\r
+\r
+ if (!parent)\r
+ return null;\r
+\r
+ if (keep_children) {\r
+ while (child = node.firstChild) {\r
+ // IE 8 will crash if you don't remove completely empty text nodes\r
+ if (!tinymce.isIE || child.nodeType !== 3 || child.nodeValue)\r
+ parent.insertBefore(child, node);\r
+ else\r
+ node.removeChild(child);\r
+ }\r
+ }\r
+\r
+ return parent.removeChild(node);\r
+ });\r
+ },\r
+\r
+ setStyle : function(n, na, v) {\r
+ var t = this;\r
+\r
+ return t.run(n, function(e) {\r
+ var s, i;\r
+\r
+ s = e.style;\r
+\r
+ // Camelcase it, if needed\r
+ na = na.replace(/-(\D)/g, function(a, b){\r
+ return b.toUpperCase();\r
+ });\r
+\r
+ // Default px suffix on these\r
+ if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v)))\r
+ v += 'px';\r
+\r
+ switch (na) {\r
+ case 'opacity':\r
+ // IE specific opacity\r
+ if (isIE) {\r
+ s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")";\r
+\r
+ if (!n.currentStyle || !n.currentStyle.hasLayout)\r
+ s.display = 'inline-block';\r
+ }\r
+\r
+ // Fix for older browsers\r
+ s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || '';\r
+ break;\r
+\r
+ case 'float':\r
+ isIE ? s.styleFloat = v : s.cssFloat = v;\r
+ break;\r
+ \r
+ default:\r
+ s[na] = v || '';\r
+ }\r
+\r
+ // Force update of the style data\r
+ if (t.settings.update_styles)\r
+ t.setAttrib(e, '_mce_style');\r
+ });\r
+ },\r
+\r
+ getStyle : function(n, na, c) {\r
+ n = this.get(n);\r
+\r
+ if (!n)\r
+ return false;\r
+\r
+ // Gecko\r
+ if (this.doc.defaultView && c) {\r
+ // Remove camelcase\r
+ na = na.replace(/[A-Z]/g, function(a){\r
+ return '-' + a;\r
+ });\r
+\r
+ try {\r
+ return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na);\r
+ } catch (ex) {\r
+ // Old safari might fail\r
+ return null;\r
+ }\r
+ }\r
+\r
+ // Camelcase it, if needed\r
+ na = na.replace(/-(\D)/g, function(a, b){\r
+ return b.toUpperCase();\r
+ });\r
+\r
+ if (na == 'float')\r
+ na = isIE ? 'styleFloat' : 'cssFloat';\r
+\r
+ // IE & Opera\r
+ if (n.currentStyle && c)\r
+ return n.currentStyle[na];\r
+\r
+ return n.style[na];\r
+ },\r
+\r
+ setStyles : function(e, o) {\r
+ var t = this, s = t.settings, ol;\r
+\r
+ ol = s.update_styles;\r
+ s.update_styles = 0;\r
+\r
+ each(o, function(v, n) {\r
+ t.setStyle(e, n, v);\r
+ });\r
+\r
+ // Update style info\r
+ s.update_styles = ol;\r
+ if (s.update_styles)\r
+ t.setAttrib(e, s.cssText);\r
+ },\r
+\r
+ setAttrib : function(e, n, v) {\r
+ var t = this;\r
+\r
+ // Whats the point\r
+ if (!e || !n)\r
+ return;\r
+\r
+ // Strict XML mode\r
+ if (t.settings.strict)\r
+ n = n.toLowerCase();\r
+\r
+ return this.run(e, function(e) {\r
+ var s = t.settings;\r
+\r
+ switch (n) {\r
+ case "style":\r
+ if (!is(v, 'string')) {\r
+ each(v, function(v, n) {\r
+ t.setStyle(e, n, v);\r
+ });\r
+\r
+ return;\r
+ }\r
+\r
+ // No mce_style for elements with these since they might get resized by the user\r
+ if (s.keep_values) {\r
+ if (v && !t._isRes(v))\r
+ e.setAttribute('_mce_style', v, 2);\r
+ else\r
+ e.removeAttribute('_mce_style', 2);\r
+ }\r
+\r
+ e.style.cssText = v;\r
+ break;\r
+\r
+ case "class":\r
+ e.className = v || ''; // Fix IE null bug\r
+ break;\r
+\r
+ case "src":\r
+ case "href":\r
+ if (s.keep_values) {\r
+ if (s.url_converter)\r
+ v = s.url_converter.call(s.url_converter_scope || t, v, n, e);\r
+\r
+ t.setAttrib(e, '_mce_' + n, v, 2);\r
+ }\r
+\r
+ break;\r
+ \r
+ case "shape":\r
+ e.setAttribute('_mce_style', v);\r
+ break;\r
+ }\r
+\r
+ if (is(v) && v !== null && v.length !== 0)\r
+ e.setAttribute(n, '' + v, 2);\r
+ else\r
+ e.removeAttribute(n, 2);\r
+ });\r
+ },\r
+\r
+ setAttribs : function(e, o) {\r
+ var t = this;\r
+\r
+ return this.run(e, function(e) {\r
+ each(o, function(v, n) {\r
+ t.setAttrib(e, n, v);\r
+ });\r
+ });\r
+ },\r
+\r
+ getAttrib : function(e, n, dv) {\r
+ var v, t = this;\r
+\r
+ e = t.get(e);\r
+\r
+ if (!e || e.nodeType !== 1)\r
+ return false;\r
+\r
+ if (!is(dv))\r
+ dv = '';\r
+\r
+ // Try the mce variant for these\r
+ if (/^(src|href|style|coords|shape)$/.test(n)) {\r
+ v = e.getAttribute("_mce_" + n);\r
+\r
+ if (v)\r
+ return v;\r
+ }\r
+\r
+ if (isIE && t.props[n]) {\r
+ v = e[t.props[n]];\r
+ v = v && v.nodeValue ? v.nodeValue : v;\r
+ }\r
+\r
+ if (!v)\r
+ v = e.getAttribute(n, 2);\r
+\r
+ // Check boolean attribs\r
+ if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) {\r
+ if (e[t.props[n]] === true && v === '')\r
+ return n;\r
+\r
+ return v ? n : '';\r
+ }\r
+\r
+ // Inner input elements will override attributes on form elements\r
+ if (e.nodeName === "FORM" && e.getAttributeNode(n))\r
+ return e.getAttributeNode(n).nodeValue;\r
+\r
+ if (n === 'style') {\r
+ v = v || e.style.cssText;\r
+\r
+ if (v) {\r
+ v = t.serializeStyle(t.parseStyle(v), e.nodeName);\r
+\r
+ if (t.settings.keep_values && !t._isRes(v))\r
+ e.setAttribute('_mce_style', v);\r
+ }\r
+ }\r
+\r
+ // Remove Apple and WebKit stuff\r
+ if (isWebKit && n === "class" && v)\r
+ v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, '');\r
+\r
+ // Handle IE issues\r
+ if (isIE) {\r
+ switch (n) {\r
+ case 'rowspan':\r
+ case 'colspan':\r
+ // IE returns 1 as default value\r
+ if (v === 1)\r
+ v = '';\r
+\r
+ break;\r
+\r
+ case 'size':\r
+ // IE returns +0 as default value for size\r
+ if (v === '+0' || v === 20 || v === 0)\r
+ v = '';\r
+\r
+ break;\r
+\r
+ case 'width':\r
+ case 'height':\r
+ case 'vspace':\r
+ case 'checked':\r
+ case 'disabled':\r
+ case 'readonly':\r
+ if (v === 0)\r
+ v = '';\r
+\r
+ break;\r
+\r
+ case 'hspace':\r
+ // IE returns -1 as default value\r
+ if (v === -1)\r
+ v = '';\r
+\r
+ break;\r
+\r
+ case 'maxlength':\r
+ case 'tabindex':\r
+ // IE returns default value\r
+ if (v === 32768 || v === 2147483647 || v === '32768')\r
+ v = '';\r
+\r
+ break;\r
+\r
+ case 'multiple':\r
+ case 'compact':\r
+ case 'noshade':\r
+ case 'nowrap':\r
+ if (v === 65535)\r
+ return n;\r
+\r
+ return dv;\r
+\r
+ case 'shape':\r
+ v = v.toLowerCase();\r
+ break;\r
+\r
+ default:\r
+ // IE has odd anonymous function for event attributes\r
+ if (n.indexOf('on') === 0 && v)\r
+ v = ('' + v).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1');\r
+ }\r
+ }\r
+\r
+ return (v !== undefined && v !== null && v !== '') ? '' + v : dv;\r
+ },\r
+\r
+ getPos : function(n, ro) {\r
+ var t = this, x = 0, y = 0, e, d = t.doc, r;\r
+\r
+ n = t.get(n);\r
+ ro = ro || d.body;\r
+\r
+ if (n) {\r
+ // Use getBoundingClientRect on IE, Opera has it but it's not perfect\r
+ if (isIE && !t.stdMode) {\r
+ n = n.getBoundingClientRect();\r
+ e = t.boxModel ? d.documentElement : d.body;\r
+ x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border\r
+ x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x;\r
+\r
+ return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x};\r
+ }\r
+\r
+ r = n;\r
+ while (r && r != ro && r.nodeType) {\r
+ x += r.offsetLeft || 0;\r
+ y += r.offsetTop || 0;\r
+ r = r.offsetParent;\r
+ }\r
+\r
+ r = n.parentNode;\r
+ while (r && r != ro && r.nodeType) {\r
+ x -= r.scrollLeft || 0;\r
+ y -= r.scrollTop || 0;\r
+ r = r.parentNode;\r
+ }\r
+ }\r
+\r
+ return {x : x, y : y};\r
+ },\r
+\r
+ parseStyle : function(st) {\r
+ var t = this, s = t.settings, o = {};\r
+\r
+ if (!st)\r
+ return o;\r
+\r
+ function compress(p, s, ot) {\r
+ var t, r, b, l;\r
+\r
+ // Get values and check it it needs compressing\r
+ t = o[p + '-top' + s];\r
+ if (!t)\r
+ return;\r
+\r
+ r = o[p + '-right' + s];\r
+ if (t != r)\r
+ return;\r
+\r
+ b = o[p + '-bottom' + s];\r
+ if (r != b)\r
+ return;\r
+\r
+ l = o[p + '-left' + s];\r
+ if (b != l)\r
+ return;\r
+\r
+ // Compress\r
+ o[ot] = l;\r
+ delete o[p + '-top' + s];\r
+ delete o[p + '-right' + s];\r
+ delete o[p + '-bottom' + s];\r
+ delete o[p + '-left' + s];\r
+ };\r
+\r
+ function compress2(ta, a, b, c) {\r
+ var t;\r
+\r
+ t = o[a];\r
+ if (!t)\r
+ return;\r
+\r
+ t = o[b];\r
+ if (!t)\r
+ return;\r
+\r
+ t = o[c];\r
+ if (!t)\r
+ return;\r
+\r
+ // Compress\r
+ o[ta] = o[a] + ' ' + o[b] + ' ' + o[c];\r
+ delete o[a];\r
+ delete o[b];\r
+ delete o[c];\r
+ };\r
+\r
+ st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities\r
+\r
+ each(st.split(';'), function(v) {\r
+ var sv, ur = [];\r
+\r
+ if (v) {\r
+ v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities\r
+ v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';});\r
+ v = v.split(':');\r
+ sv = tinymce.trim(v[1]);\r
+ sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];});\r
+\r
+ sv = sv.replace(/rgb\([^\)]+\)/g, function(v) {\r
+ return t.toHex(v);\r
+ });\r
+\r
+ if (s.url_converter) {\r
+ sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) {\r
+ return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')';\r
+ });\r
+ }\r
+\r
+ o[tinymce.trim(v[0]).toLowerCase()] = sv;\r
+ }\r
+ });\r
+\r
+ compress("border", "", "border");\r
+ compress("border", "-width", "border-width");\r
+ compress("border", "-color", "border-color");\r
+ compress("border", "-style", "border-style");\r
+ compress("padding", "", "padding");\r
+ compress("margin", "", "margin");\r
+ compress2('border', 'border-width', 'border-style', 'border-color');\r
+\r
+ if (isIE) {\r
+ // Remove pointless border\r
+ if (o.border == 'medium none')\r
+ o.border = '';\r
+ }\r
+\r
+ return o;\r
+ },\r
+\r
+ serializeStyle : function(o, name) {\r
+ var t = this, s = '';\r
+\r
+ function add(v, k) {\r
+ if (k && v) {\r
+ // Remove browser specific styles like -moz- or -webkit-\r
+ if (k.indexOf('-') === 0)\r
+ return;\r
+\r
+ switch (k) {\r
+ case 'font-weight':\r
+ // Opera will output bold as 700\r
+ if (v == 700)\r
+ v = 'bold';\r
+\r
+ break;\r
+\r
+ case 'color':\r
+ case 'background-color':\r
+ v = v.toLowerCase();\r
+ break;\r
+ }\r
+\r
+ s += (s ? ' ' : '') + k + ': ' + v + ';';\r
+ }\r
+ };\r
+\r
+ // Validate style output\r
+ if (name && t._styles) {\r
+ each(t._styles['*'], function(name) {\r
+ add(o[name], name);\r
+ });\r
+\r
+ each(t._styles[name.toLowerCase()], function(name) {\r
+ add(o[name], name);\r
+ });\r
+ } else\r
+ each(o, add);\r
+\r
+ return s;\r
+ },\r
+\r
+ loadCSS : function(u) {\r
+ var t = this, d = t.doc, head;\r
+\r
+ if (!u)\r
+ u = '';\r
+\r
+ head = t.select('head')[0];\r
+\r
+ each(u.split(','), function(u) {\r
+ var link;\r
+\r
+ if (t.files[u])\r
+ return;\r
+\r
+ t.files[u] = true;\r
+ link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)});\r
+\r
+ // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug\r
+ // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading\r
+ // It's ugly but it seems to work fine.\r
+ if (isIE && d.documentMode) {\r
+ link.onload = function() {\r
+ d.recalc();\r
+ link.onload = null;\r
+ };\r
+ }\r
+\r
+ head.appendChild(link);\r
+ });\r
+ },\r
+\r
+ addClass : function(e, c) {\r
+ return this.run(e, function(e) {\r
+ var o;\r
+\r
+ if (!c)\r
+ return 0;\r
+\r
+ if (this.hasClass(e, c))\r
+ return e.className;\r
+\r
+ o = this.removeClass(e, c);\r
+\r
+ return e.className = (o != '' ? (o + ' ') : '') + c;\r
+ });\r
+ },\r
+\r
+ removeClass : function(e, c) {\r
+ var t = this, re;\r
+\r
+ return t.run(e, function(e) {\r
+ var v;\r
+\r
+ if (t.hasClass(e, c)) {\r
+ if (!re)\r
+ re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g");\r
+\r
+ v = e.className.replace(re, ' ');\r
+ v = tinymce.trim(v != ' ' ? v : '');\r
+\r
+ e.className = v;\r
+\r
+ // Empty class attr\r
+ if (!v) {\r
+ e.removeAttribute('class');\r
+ e.removeAttribute('className');\r
+ }\r
+\r
+ return v;\r
+ }\r
+\r
+ return e.className;\r
+ });\r
+ },\r
+\r
+ hasClass : function(n, c) {\r
+ n = this.get(n);\r
+\r
+ if (!n || !c)\r
+ return false;\r
+\r
+ return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1;\r
+ },\r
+\r
+ show : function(e) {\r
+ return this.setStyle(e, 'display', 'block');\r
+ },\r
+\r
+ hide : function(e) {\r
+ return this.setStyle(e, 'display', 'none');\r
+ },\r
+\r
+ isHidden : function(e) {\r
+ e = this.get(e);\r
+\r
+ return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none';\r
+ },\r
+\r
+ uniqueId : function(p) {\r
+ return (!p ? 'mce_' : p) + (this.counter++);\r
+ },\r
+\r
+ setHTML : function(e, h) {\r
+ var t = this;\r
+\r
+ return this.run(e, function(e) {\r
+ var x, i, nl, n, p, x;\r
+\r
+ h = t.processHTML(h);\r
+\r
+ if (isIE) {\r
+ function set() {\r
+ // Remove all child nodes\r
+ while (e.firstChild)\r
+ e.firstChild.removeNode();\r
+\r
+ try {\r
+ // IE will remove comments from the beginning\r
+ // unless you padd the contents with something\r
+ e.innerHTML = '<br />' + h;\r
+ e.removeChild(e.firstChild);\r
+ } catch (ex) {\r
+ // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p\r
+ // This seems to fix this problem\r
+\r
+ // Create new div with HTML contents and a BR infront to keep comments\r
+ x = t.create('div');\r
+ x.innerHTML = '<br />' + h;\r
+\r
+ // Add all children from div to target\r
+ each (x.childNodes, function(n, i) {\r
+ // Skip br element\r
+ if (i)\r
+ e.appendChild(n);\r
+ });\r
+ }\r
+ };\r
+\r
+ // IE has a serious bug when it comes to paragraphs it can produce an invalid\r
+ // DOM tree if contents like this <p><ul><li>Item 1</li></ul></p> is inserted\r
+ // It seems to be that IE doesn't like a root block element placed inside another root block element\r
+ if (t.settings.fix_ie_paragraphs)\r
+ h = h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi, '<p$1 _mce_keep="true"> </p>');\r
+\r
+ set();\r
+\r
+ if (t.settings.fix_ie_paragraphs) {\r
+ // Check for odd paragraphs this is a sign of a broken DOM\r
+ nl = e.getElementsByTagName("p");\r
+ for (i = nl.length - 1, x = 0; i >= 0; i--) {\r
+ n = nl[i];\r
+\r
+ if (!n.hasChildNodes()) {\r
+ if (!n._mce_keep) {\r
+ x = 1; // Is broken\r
+ break;\r
+ }\r
+\r
+ n.removeAttribute('_mce_keep');\r
+ }\r
+ }\r
+ }\r
+\r
+ // Time to fix the madness IE left us\r
+ if (x) {\r
+ // So if we replace the p elements with divs and mark them and then replace them back to paragraphs\r
+ // after we use innerHTML we can fix the DOM tree\r
+ h = h.replace(/<p ([^>]+)>|<p>/ig, '<div $1 _mce_tmp="1">');\r
+ h = h.replace(/<\/p>/gi, '</div>');\r
+\r
+ // Set the new HTML with DIVs\r
+ set();\r
+\r
+ // Replace all DIV elements with the _mce_tmp attibute back to paragraphs\r
+ // This is needed since IE has a annoying bug see above for details\r
+ // This is a slow process but it has to be done. :(\r
+ if (t.settings.fix_ie_paragraphs) {\r
+ nl = e.getElementsByTagName("DIV");\r
+ for (i = nl.length - 1; i >= 0; i--) {\r
+ n = nl[i];\r
+\r
+ // Is it a temp div\r
+ if (n._mce_tmp) {\r
+ // Create new paragraph\r
+ p = t.doc.createElement('p');\r
+\r
+ // Copy all attributes\r
+ n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) {\r
+ var v;\r
+\r
+ if (b !== '_mce_tmp') {\r
+ v = n.getAttribute(b);\r
+\r
+ if (!v && b === 'class')\r
+ v = n.className;\r
+\r
+ p.setAttribute(b, v);\r
+ }\r
+ });\r
+\r
+ // Append all children to new paragraph\r
+ for (x = 0; x<n.childNodes.length; x++)\r
+ p.appendChild(n.childNodes[x].cloneNode(true));\r
+\r
+ // Replace div with new paragraph\r
+ n.swapNode(p);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ } else\r
+ e.innerHTML = h;\r
+\r
+ return h;\r
+ });\r
+ },\r
+\r
+ processHTML : function(h) {\r
+ var t = this, s = t.settings, codeBlocks = [];\r
+\r
+ if (!s.process_html)\r
+ return h;\r
+\r
+ if (isIE) {\r
+ h = h.replace(/'/g, '''); // IE can't handle apos\r
+ h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct\r
+ }\r
+\r
+ // Fix some issues\r
+ h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open\r
+\r
+ // Store away src and href in _mce_src and mce_href since browsers mess them up\r
+ if (s.keep_values) {\r
+ // Wrap scripts and styles in comments for serialization purposes\r
+ if (/<script|noscript|style/i.test(h)) {\r
+ function trim(s) {\r
+ // Remove prefix and suffix code for element\r
+ s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n');\r
+ s = s.replace(/^[\r\n]*|[\r\n]*$/g, '');\r
+ s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, '');\r
+ s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, '');\r
+\r
+ return s;\r
+ };\r
+\r
+ // Wrap the script contents in CDATA and keep them from executing\r
+ h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) {\r
+ // Force type attribute\r
+ if (!attribs)\r
+ attribs = ' type="text/javascript"';\r
+\r
+ // Convert the src attribute of the scripts\r
+ attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) {\r
+ if (s.url_converter)\r
+ url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script'));\r
+\r
+ return '_mce_src="' + url + '"';\r
+ });\r
+\r
+ // Wrap text contents\r
+ if (tinymce.trim(text)) {\r
+ codeBlocks.push(trim(text));\r
+ text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n// -->';\r
+ }\r
+\r
+ return '<mce:script' + attribs + '>' + text + '</mce:script>';\r
+ });\r
+\r
+ // Wrap style elements\r
+ h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) {\r
+ // Wrap text contents\r
+ if (text) {\r
+ codeBlocks.push(trim(text));\r
+ text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n-->';\r
+ }\r
+\r
+ return '<mce:style' + attribs + '>' + text + '</mce:style><style ' + attribs + ' _mce_bogus="1">' + text + '</style>';\r
+ });\r
+\r
+ // Wrap noscript elements\r
+ h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {\r
+ return '<mce:noscript' + attribs + '><!--' + t.encode(text).replace(/--/g, '--') + '--></mce:noscript>';\r
+ });\r
+ }\r
+\r
+ h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->');\r
+\r
+ // This function processes the attributes in the HTML string to force boolean\r
+ // attributes to the attr="attr" format and convert style, src and href to _mce_ versions\r
+ function processTags(html) {\r
+ return html.replace(tagRegExp, function(match, elm_name, attrs, end) {\r
+ return '<' + elm_name + attrs.replace(attrRegExp, function(match, name, value, val2, val3) {\r
+ var mceValue;\r
+\r
+ name = name.toLowerCase();\r
+ value = value || val2 || val3 || "";\r
+\r
+ // Treat boolean attributes\r
+ if (boolAttrs[name]) {\r
+ // false or 0 is treated as a missing attribute\r
+ if (value === 'false' || value === '0')\r
+ return;\r
+\r
+ return name + '="' + name + '"';\r
+ }\r
+\r
+ // Is attribute one that needs special treatment\r
+ if (mceAttribs[name] && attrs.indexOf('_mce_' + name) == -1) {\r
+ mceValue = t.decode(value);\r
+\r
+ // Convert URLs to relative/absolute ones\r
+ if (s.url_converter && (name == "src" || name == "href"))\r
+ mceValue = s.url_converter.call(s.url_converter_scope || t, mceValue, name, elm_name);\r
+\r
+ // Process styles lowercases them and compresses them\r
+ if (name == 'style')\r
+ mceValue = t.serializeStyle(t.parseStyle(mceValue), name);\r
+\r
+ return name + '="' + value + '"' + ' _mce_' + name + '="' + t.encode(mceValue) + '"';\r
+ }\r
+\r
+ return match;\r
+ }) + end + '>';\r
+ });\r
+ };\r
+\r
+ h = processTags(h);\r
+\r
+ // Restore script blocks\r
+ h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) {\r
+ return codeBlocks[idx];\r
+ });\r
+ }\r
+\r
+ return h;\r
+ },\r
+\r
+ getOuterHTML : function(e) {\r
+ var d;\r
+\r
+ e = this.get(e);\r
+\r
+ if (!e)\r
+ return null;\r
+\r
+ if (e.outerHTML !== undefined)\r
+ return e.outerHTML;\r
+\r
+ d = (e.ownerDocument || this.doc).createElement("body");\r
+ d.appendChild(e.cloneNode(true));\r
+\r
+ return d.innerHTML;\r
+ },\r
+\r
+ setOuterHTML : function(e, h, d) {\r
+ var t = this;\r
+\r
+ function setHTML(e, h, d) {\r
+ var n, tp;\r
+\r
+ tp = d.createElement("body");\r
+ tp.innerHTML = h;\r
+\r
+ n = tp.lastChild;\r
+ while (n) {\r
+ t.insertAfter(n.cloneNode(true), e);\r
+ n = n.previousSibling;\r
+ }\r
+\r
+ t.remove(e);\r
+ };\r
+\r
+ return this.run(e, function(e) {\r
+ e = t.get(e);\r
+\r
+ // Only set HTML on elements\r
+ if (e.nodeType == 1) {\r
+ d = d || e.ownerDocument || t.doc;\r
+\r
+ if (isIE) {\r
+ try {\r
+ // Try outerHTML for IE it sometimes produces an unknown runtime error\r
+ if (isIE && e.nodeType == 1)\r
+ e.outerHTML = h;\r
+ else\r
+ setHTML(e, h, d);\r
+ } catch (ex) {\r
+ // Fix for unknown runtime error\r
+ setHTML(e, h, d);\r
+ }\r
+ } else\r
+ setHTML(e, h, d);\r
+ }\r
+ });\r
+ },\r
+\r
+ decode : function(s) {\r
+ var e, n, v;\r
+\r
+ // Look for entities to decode\r
+ if (/&[\w#]+;/.test(s)) {\r
+ // Decode the entities using a div element not super efficient but less code\r
+ e = this.doc.createElement("div");\r
+ e.innerHTML = s;\r
+ n = e.firstChild;\r
+ v = '';\r
+\r
+ if (n) {\r
+ do {\r
+ v += n.nodeValue;\r
+ } while (n = n.nextSibling);\r
+ }\r
+\r
+ return v || s;\r
+ }\r
+\r
+ return s;\r
+ },\r
+\r
+ encode : function(str) {\r
+ return ('' + str).replace(encodeCharsRe, function(chr) {\r
+ return encodedChars[chr];\r
+ });\r
+ },\r
+\r
+ insertAfter : function(node, reference_node) {\r
+ reference_node = this.get(reference_node);\r
+\r
+ return this.run(node, function(node) {\r
+ var parent, nextSibling;\r
+\r
+ parent = reference_node.parentNode;\r
+ nextSibling = reference_node.nextSibling;\r
+\r
+ if (nextSibling)\r
+ parent.insertBefore(node, nextSibling);\r
+ else\r
+ parent.appendChild(node);\r
+\r
+ return node;\r
+ });\r
+ },\r
+\r
+ isBlock : function(n) {\r
+ if (n.nodeType && n.nodeType !== 1)\r
+ return false;\r
+\r
+ n = n.nodeName || n;\r
+\r
+ return blockRe.test(n);\r
+ },\r
+\r
+ replace : function(n, o, k) {\r
+ var t = this;\r
+\r
+ if (is(o, 'array'))\r
+ n = n.cloneNode(true);\r
+\r
+ return t.run(o, function(o) {\r
+ if (k) {\r
+ each(tinymce.grep(o.childNodes), function(c) {\r
+ n.appendChild(c);\r
+ });\r
+ }\r
+\r
+ return o.parentNode.replaceChild(n, o);\r
+ });\r
+ },\r
+\r
+ rename : function(elm, name) {\r
+ var t = this, newElm;\r
+\r
+ if (elm.nodeName != name.toUpperCase()) {\r
+ // Rename block element\r
+ newElm = t.create(name);\r
+\r
+ // Copy attribs to new block\r
+ each(t.getAttribs(elm), function(attr_node) {\r
+ t.setAttrib(newElm, attr_node.nodeName, t.getAttrib(elm, attr_node.nodeName));\r
+ });\r
+\r
+ // Replace block\r
+ t.replace(newElm, elm, 1);\r
+ }\r
+\r
+ return newElm || elm;\r
+ },\r
+\r
+ findCommonAncestor : function(a, b) {\r
+ var ps = a, pe;\r
+\r
+ while (ps) {\r
+ pe = b;\r
+\r
+ while (pe && ps != pe)\r
+ pe = pe.parentNode;\r
+\r
+ if (ps == pe)\r
+ break;\r
+\r
+ ps = ps.parentNode;\r
+ }\r
+\r
+ if (!ps && a.ownerDocument)\r
+ return a.ownerDocument.documentElement;\r
+\r
+ return ps;\r
+ },\r
+\r
+ toHex : function(s) {\r
+ var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);\r
+\r
+ function hex(s) {\r
+ s = parseInt(s).toString(16);\r
+\r
+ return s.length > 1 ? s : '0' + s; // 0 -> 00\r
+ };\r
+\r
+ if (c) {\r
+ s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]);\r
+\r
+ return s;\r
+ }\r
+\r
+ return s;\r
+ },\r
+\r
+ getClasses : function() {\r
+ var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov;\r
+\r
+ if (t.classes)\r
+ return t.classes;\r
+\r
+ function addClasses(s) {\r
+ // IE style imports\r
+ each(s.imports, function(r) {\r
+ addClasses(r);\r
+ });\r
+\r
+ each(s.cssRules || s.rules, function(r) {\r
+ // Real type or fake it on IE\r
+ switch (r.type || 1) {\r
+ // Rule\r
+ case 1:\r
+ if (r.selectorText) {\r
+ each(r.selectorText.split(','), function(v) {\r
+ v = v.replace(/^\s*|\s*$|^\s\./g, "");\r
+\r
+ // Is internal or it doesn't contain a class\r
+ if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v))\r
+ return;\r
+\r
+ // Remove everything but class name\r
+ ov = v;\r
+ v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1');\r
+\r
+ // Filter classes\r
+ if (f && !(v = f(v, ov)))\r
+ return;\r
+\r
+ if (!lo[v]) {\r
+ cl.push({'class' : v});\r
+ lo[v] = 1;\r
+ }\r
+ });\r
+ }\r
+ break;\r
+\r
+ // Import\r
+ case 3:\r
+ addClasses(r.styleSheet);\r
+ break;\r
+ }\r
+ });\r
+ };\r
+\r
+ try {\r
+ each(t.doc.styleSheets, addClasses);\r
+ } catch (ex) {\r
+ // Ignore\r
+ }\r
+\r
+ if (cl.length > 0)\r
+ t.classes = cl;\r
+\r
+ return cl;\r
+ },\r
+\r
+ run : function(e, f, s) {\r
+ var t = this, o;\r
+\r
+ if (t.doc && typeof(e) === 'string')\r
+ e = t.get(e);\r
+\r
+ if (!e)\r
+ return false;\r
+\r
+ s = s || this;\r
+ if (!e.nodeType && (e.length || e.length === 0)) {\r
+ o = [];\r
+\r
+ each(e, function(e, i) {\r
+ if (e) {\r
+ if (typeof(e) == 'string')\r
+ e = t.doc.getElementById(e);\r
+\r
+ o.push(f.call(s, e, i));\r
+ }\r
+ });\r
+\r
+ return o;\r
+ }\r
+\r
+ return f.call(s, e);\r
+ },\r
+\r
+ getAttribs : function(n) {\r
+ var o;\r
+\r
+ n = this.get(n);\r
+\r
+ if (!n)\r
+ return [];\r
+\r
+ if (isIE) {\r
+ o = [];\r
+\r
+ // Object will throw exception in IE\r
+ if (n.nodeName == 'OBJECT')\r
+ return n.attributes;\r
+\r
+ // IE doesn't keep the selected attribute if you clone option elements\r
+ if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected'))\r
+ o.push({specified : 1, nodeName : 'selected'});\r
+\r
+ // It's crazy that this is faster in IE but it's because it returns all attributes all the time\r
+ n.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi, '').replace(/[\w:\-]+/gi, function(a) {\r
+ o.push({specified : 1, nodeName : a});\r
+ });\r
+\r
+ return o;\r
+ }\r
+\r
+ return n.attributes;\r
+ },\r
+\r
+ destroy : function(s) {\r
+ var t = this;\r
+\r
+ if (t.events)\r
+ t.events.destroy();\r
+\r
+ t.win = t.doc = t.root = t.events = null;\r
+\r
+ // Manual destroy then remove unload handler\r
+ if (!s)\r
+ tinymce.removeUnload(t.destroy);\r
+ },\r
+\r
+ createRng : function() {\r
+ var d = this.doc;\r
+\r
+ return d.createRange ? d.createRange() : new tinymce.dom.Range(this);\r
+ },\r
+\r
+ nodeIndex : function(node, normalized) {\r
+ var idx = 0, lastNodeType, lastNode, nodeType;\r
+\r
+ if (node) {\r
+ for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; node; node = node.previousSibling) {\r
+ nodeType = node.nodeType;\r
+\r
+ // Normalize text nodes\r
+ if (normalized && nodeType == 3) {\r
+ if (nodeType == lastNodeType || !node.nodeValue.length)\r
+ continue;\r
+ }\r
+\r
+ idx++;\r
+ lastNodeType = nodeType;\r
+ }\r
+ }\r
+\r
+ return idx;\r
+ },\r
+\r
+ split : function(pe, e, re) {\r
+ var t = this, r = t.createRng(), bef, aft, pa;\r
+\r
+ // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sense\r
+ // but we don't want that in our code since it serves no purpose for the end user\r
+ // For example if this is chopped:\r
+ // <p>text 1<span><b>CHOP</b></span>text 2</p>\r
+ // would produce:\r
+ // <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p>\r
+ // this function will then trim of empty edges and produce:\r
+ // <p>text 1</p><b>CHOP</b><p>text 2</p>\r
+ function trim(node) {\r
+ var i, children = node.childNodes;\r
+\r
+ if (node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark')\r
+ return;\r
+\r
+ for (i = children.length - 1; i >= 0; i--)\r
+ trim(children[i]);\r
+\r
+ if (node.nodeType != 9) {\r
+ // Keep non whitespace text nodes\r
+ if (node.nodeType == 3 && node.nodeValue.length > 0)\r
+ return;\r
+\r
+ if (node.nodeType == 1) {\r
+ // If the only child is a bookmark then move it up\r
+ children = node.childNodes;\r
+ if (children.length == 1 && children[0] && children[0].nodeType == 1 && children[0].getAttribute('_mce_type') == 'bookmark')\r
+ node.parentNode.insertBefore(children[0], node);\r
+\r
+ // Keep non empty elements or img, hr etc\r
+ if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName))\r
+ return;\r
+ }\r
+\r
+ t.remove(node);\r
+ }\r
+\r
+ return node;\r
+ };\r
+\r
+ if (pe && e) {\r
+ // Get before chunk\r
+ r.setStart(pe.parentNode, t.nodeIndex(pe));\r
+ r.setEnd(e.parentNode, t.nodeIndex(e));\r
+ bef = r.extractContents();\r
+\r
+ // Get after chunk\r
+ r = t.createRng();\r
+ r.setStart(e.parentNode, t.nodeIndex(e) + 1);\r
+ r.setEnd(pe.parentNode, t.nodeIndex(pe) + 1);\r
+ aft = r.extractContents();\r
+\r
+ // Insert before chunk\r
+ pa = pe.parentNode;\r
+ pa.insertBefore(trim(bef), pe);\r
+\r
+ // Insert middle chunk\r
+ if (re)\r
+ pa.replaceChild(re, e);\r
+ else\r
+ pa.insertBefore(e, pe);\r
+\r
+ // Insert after chunk\r
+ pa.insertBefore(trim(aft), pe);\r
+ t.remove(pe);\r
+\r
+ return re || e;\r
+ }\r
+ },\r
+\r
+ bind : function(target, name, func, scope) {\r
+ var t = this;\r
+\r
+ if (!t.events)\r
+ t.events = new tinymce.dom.EventUtils();\r
+\r
+ return t.events.add(target, name, func, scope || this);\r
+ },\r
+\r
+ unbind : function(target, name, func) {\r
+ var t = this;\r
+\r
+ if (!t.events)\r
+ t.events = new tinymce.dom.EventUtils();\r
+\r
+ return t.events.remove(target, name, func);\r
+ },\r
+\r
+\r
+ _findSib : function(node, selector, name) {\r
+ var t = this, f = selector;\r
+\r
+ if (node) {\r
+ // If expression make a function of it using is\r
+ if (is(f, 'string')) {\r
+ f = function(node) {\r
+ return t.is(node, selector);\r
+ };\r
+ }\r
+\r
+ // Loop all siblings\r
+ for (node = node[name]; node; node = node[name]) {\r
+ if (f(node))\r
+ return node;\r
+ }\r
+ }\r
+\r
+ return null;\r
+ },\r
+\r
+ _isRes : function(c) {\r
+ // Is live resizble element\r
+ return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c);\r
+ }\r
+\r
+ /*\r
+ walk : function(n, f, s) {\r
+ var d = this.doc, w;\r
+\r
+ if (d.createTreeWalker) {\r
+ w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);\r
+\r
+ while ((n = w.nextNode()) != null)\r
+ f.call(s || this, n);\r
+ } else\r
+ tinymce.walk(n, f, 'childNodes', s);\r
+ }\r
+ */\r
+\r
+ /*\r
+ toRGB : function(s) {\r
+ var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s);\r
+\r
+ if (c) {\r
+ // #FFF -> #FFFFFF\r
+ if (!is(c[3]))\r
+ c[3] = c[2] = c[1];\r
+\r
+ return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")";\r
+ }\r
+\r
+ return s;\r
+ }\r
+ */\r
+ });\r
+\r
+ tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0});\r
+})(tinymce);\r
+\r
+(function(ns) {\r
+ // Range constructor\r
+ function Range(dom) {\r
+ var t = this,\r
+ doc = dom.doc,\r
+ EXTRACT = 0,\r
+ CLONE = 1,\r
+ DELETE = 2,\r
+ TRUE = true,\r
+ FALSE = false,\r
+ START_OFFSET = 'startOffset',\r
+ START_CONTAINER = 'startContainer',\r
+ END_CONTAINER = 'endContainer',\r
+ END_OFFSET = 'endOffset',\r
+ extend = tinymce.extend,\r
+ nodeIndex = dom.nodeIndex;\r
+\r
+ extend(t, {\r
+ // Inital states\r
+ startContainer : doc,\r
+ startOffset : 0,\r
+ endContainer : doc,\r
+ endOffset : 0,\r
+ collapsed : TRUE,\r
+ commonAncestorContainer : doc,\r
+\r
+ // Range constants\r
+ START_TO_START : 0,\r
+ START_TO_END : 1,\r
+ END_TO_END : 2,\r
+ END_TO_START : 3,\r
+\r
+ // Public methods\r
+ setStart : setStart,\r
+ setEnd : setEnd,\r
+ setStartBefore : setStartBefore,\r
+ setStartAfter : setStartAfter,\r
+ setEndBefore : setEndBefore,\r
+ setEndAfter : setEndAfter,\r
+ collapse : collapse,\r
+ selectNode : selectNode,\r
+ selectNodeContents : selectNodeContents,\r
+ compareBoundaryPoints : compareBoundaryPoints,\r
+ deleteContents : deleteContents,\r
+ extractContents : extractContents,\r
+ cloneContents : cloneContents,\r
+ insertNode : insertNode,\r
+ surroundContents : surroundContents,\r
+ cloneRange : cloneRange\r
+ });\r
+\r
+ function setStart(n, o) {\r
+ _setEndPoint(TRUE, n, o);\r
+ };\r
+\r
+ function setEnd(n, o) {\r
+ _setEndPoint(FALSE, n, o);\r
+ };\r
+\r
+ function setStartBefore(n) {\r
+ setStart(n.parentNode, nodeIndex(n));\r
+ };\r
+\r
+ function setStartAfter(n) {\r
+ setStart(n.parentNode, nodeIndex(n) + 1);\r
+ };\r
+\r
+ function setEndBefore(n) {\r
+ setEnd(n.parentNode, nodeIndex(n));\r
+ };\r
+\r
+ function setEndAfter(n) {\r
+ setEnd(n.parentNode, nodeIndex(n) + 1);\r
+ };\r
+\r
+ function collapse(ts) {\r
+ if (ts) {\r
+ t[END_CONTAINER] = t[START_CONTAINER];\r
+ t[END_OFFSET] = t[START_OFFSET];\r
+ } else {\r
+ t[START_CONTAINER] = t[END_CONTAINER];\r
+ t[START_OFFSET] = t[END_OFFSET];\r
+ }\r
+\r
+ t.collapsed = TRUE;\r
+ };\r
+\r
+ function selectNode(n) {\r
+ setStartBefore(n);\r
+ setEndAfter(n);\r
+ };\r
+\r
+ function selectNodeContents(n) {\r
+ setStart(n, 0);\r
+ setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);\r
+ };\r
+\r
+ function compareBoundaryPoints(h, r) {\r
+ var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET];\r
+\r
+ // Check START_TO_START\r
+ if (h === 0)\r
+ return _compareBoundaryPoints(sc, so, sc, so);\r
+\r
+ // Check START_TO_END\r
+ if (h === 1)\r
+ return _compareBoundaryPoints(sc, so, ec, eo);\r
+\r
+ // Check END_TO_END\r
+ if (h === 2)\r
+ return _compareBoundaryPoints(ec, eo, ec, eo);\r
+\r
+ // Check END_TO_START\r
+ if (h === 3)\r
+ return _compareBoundaryPoints(ec, eo, sc, so);\r
+ };\r
+\r
+ function deleteContents() {\r
+ _traverse(DELETE);\r
+ };\r
+\r
+ function extractContents() {\r
+ return _traverse(EXTRACT);\r
+ };\r
+\r
+ function cloneContents() {\r
+ return _traverse(CLONE);\r
+ };\r
+\r
+ function insertNode(n) {\r
+ var startContainer = this[START_CONTAINER],\r
+ startOffset = this[START_OFFSET], nn, o;\r
+\r
+ // Node is TEXT_NODE or CDATA\r
+ if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {\r
+ if (!startOffset) {\r
+ // At the start of text\r
+ startContainer.parentNode.insertBefore(n, startContainer);\r
+ } else if (startOffset >= startContainer.nodeValue.length) {\r
+ // At the end of text\r
+ dom.insertAfter(n, startContainer);\r
+ } else {\r
+ // Middle, need to split\r
+ nn = startContainer.splitText(startOffset);\r
+ startContainer.parentNode.insertBefore(n, nn);\r
+ }\r
+ } else {\r
+ // Insert element node\r
+ if (startContainer.childNodes.length > 0)\r
+ o = startContainer.childNodes[startOffset];\r
+\r
+ if (o)\r
+ startContainer.insertBefore(n, o);\r
+ else\r
+ startContainer.appendChild(n);\r
+ }\r
+ };\r
+\r
+ function surroundContents(n) {\r
+ var f = t.extractContents();\r
+\r
+ t.insertNode(n);\r
+ n.appendChild(f);\r
+ t.selectNode(n);\r
+ };\r
+\r
+ function cloneRange() {\r
+ return extend(new Range(dom), {\r
+ startContainer : t[START_CONTAINER],\r
+ startOffset : t[START_OFFSET],\r
+ endContainer : t[END_CONTAINER],\r
+ endOffset : t[END_OFFSET],\r
+ collapsed : t.collapsed,\r
+ commonAncestorContainer : t.commonAncestorContainer\r
+ });\r
+ };\r
+\r
+ // Private methods\r
+\r
+ function _getSelectedNode(container, offset) {\r
+ var child;\r
+\r
+ if (container.nodeType == 3 /* TEXT_NODE */)\r
+ return container;\r
+\r
+ if (offset < 0)\r
+ return container;\r
+\r
+ child = container.firstChild;\r
+ while (child && offset > 0) {\r
+ --offset;\r
+ child = child.nextSibling;\r
+ }\r
+\r
+ if (child)\r
+ return child;\r
+\r
+ return container;\r
+ };\r
+\r
+ function _isCollapsed() {\r
+ return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);\r
+ };\r
+\r
+ function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {\r
+ var c, offsetC, n, cmnRoot, childA, childB;\r
+\r
+ // In the first case the boundary-points have the same container. A is before B\r
+ // if its offset is less than the offset of B, A is equal to B if its offset is\r
+ // equal to the offset of B, and A is after B if its offset is greater than the\r
+ // offset of B.\r
+ if (containerA == containerB) {\r
+ if (offsetA == offsetB)\r
+ return 0; // equal\r
+\r
+ if (offsetA < offsetB)\r
+ return -1; // before\r
+\r
+ return 1; // after\r
+ }\r
+\r
+ // In the second case a child node C of the container of A is an ancestor\r
+ // container of B. In this case, A is before B if the offset of A is less than or\r
+ // equal to the index of the child node C and A is after B otherwise.\r
+ c = containerB;\r
+ while (c && c.parentNode != containerA)\r
+ c = c.parentNode;\r
+\r
+ if (c) {\r
+ offsetC = 0;\r
+ n = containerA.firstChild;\r
+\r
+ while (n != c && offsetC < offsetA) {\r
+ offsetC++;\r
+ n = n.nextSibling;\r
+ }\r
+\r
+ if (offsetA <= offsetC)\r
+ return -1; // before\r
+\r
+ return 1; // after\r
+ }\r
+\r
+ // In the third case a child node C of the container of B is an ancestor container\r
+ // of A. In this case, A is before B if the index of the child node C is less than\r
+ // the offset of B and A is after B otherwise.\r
+ c = containerA;\r
+ while (c && c.parentNode != containerB) {\r
+ c = c.parentNode;\r
+ }\r
+\r
+ if (c) {\r
+ offsetC = 0;\r
+ n = containerB.firstChild;\r
+\r
+ while (n != c && offsetC < offsetB) {\r
+ offsetC++;\r
+ n = n.nextSibling;\r
+ }\r
+\r
+ if (offsetC < offsetB)\r
+ return -1; // before\r
+\r
+ return 1; // after\r
+ }\r
+\r
+ // In the fourth case, none of three other cases hold: the containers of A and B\r
+ // are siblings or descendants of sibling nodes. In this case, A is before B if\r
+ // the container of A is before the container of B in a pre-order traversal of the\r
+ // Ranges' context tree and A is after B otherwise.\r
+ cmnRoot = dom.findCommonAncestor(containerA, containerB);\r
+ childA = containerA;\r
+\r
+ while (childA && childA.parentNode != cmnRoot)\r
+ childA = childA.parentNode;\r
+\r
+ if (!childA)\r
+ childA = cmnRoot;\r
+\r
+ childB = containerB;\r
+ while (childB && childB.parentNode != cmnRoot)\r
+ childB = childB.parentNode;\r
+\r
+ if (!childB)\r
+ childB = cmnRoot;\r
+\r
+ if (childA == childB)\r
+ return 0; // equal\r
+\r
+ n = cmnRoot.firstChild;\r
+ while (n) {\r
+ if (n == childA)\r
+ return -1; // before\r
+\r
+ if (n == childB)\r
+ return 1; // after\r
+\r
+ n = n.nextSibling;\r
+ }\r
+ };\r
+\r
+ function _setEndPoint(st, n, o) {\r
+ var ec, sc;\r
+\r
+ if (st) {\r
+ t[START_CONTAINER] = n;\r
+ t[START_OFFSET] = o;\r
+ } else {\r
+ t[END_CONTAINER] = n;\r
+ t[END_OFFSET] = o;\r
+ }\r
+\r
+ // If one boundary-point of a Range is set to have a root container\r
+ // other than the current one for the Range, the Range is collapsed to\r
+ // the new position. This enforces the restriction that both boundary-\r
+ // points of a Range must have the same root container.\r
+ ec = t[END_CONTAINER];\r
+ while (ec.parentNode)\r
+ ec = ec.parentNode;\r
+\r
+ sc = t[START_CONTAINER];\r
+ while (sc.parentNode)\r
+ sc = sc.parentNode;\r
+\r
+ if (sc == ec) {\r
+ // The start position of a Range is guaranteed to never be after the\r
+ // end position. To enforce this restriction, if the start is set to\r
+ // be at a position after the end, the Range is collapsed to that\r
+ // position.\r
+ if (_compareBoundaryPoints(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0)\r
+ t.collapse(st);\r
+ } else\r
+ t.collapse(st);\r
+\r
+ t.collapsed = _isCollapsed();\r
+ t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]);\r
+ };\r
+\r
+ function _traverse(how) {\r
+ var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;\r
+\r
+ if (t[START_CONTAINER] == t[END_CONTAINER])\r
+ return _traverseSameContainer(how);\r
+\r
+ for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {\r
+ if (p == t[START_CONTAINER])\r
+ return _traverseCommonStartContainer(c, how);\r
+\r
+ ++endContainerDepth;\r
+ }\r
+\r
+ for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {\r
+ if (p == t[END_CONTAINER])\r
+ return _traverseCommonEndContainer(c, how);\r
+\r
+ ++startContainerDepth;\r
+ }\r
+\r
+ depthDiff = startContainerDepth - endContainerDepth;\r
+\r
+ startNode = t[START_CONTAINER];\r
+ while (depthDiff > 0) {\r
+ startNode = startNode.parentNode;\r
+ depthDiff--;\r
+ }\r
+\r
+ endNode = t[END_CONTAINER];\r
+ while (depthDiff < 0) {\r
+ endNode = endNode.parentNode;\r
+ depthDiff++;\r
+ }\r
+\r
+ // ascend the ancestor hierarchy until we have a common parent.\r
+ for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {\r
+ startNode = sp;\r
+ endNode = ep;\r
+ }\r
+\r
+ return _traverseCommonAncestors(startNode, endNode, how);\r
+ };\r
+\r
+ function _traverseSameContainer(how) {\r
+ var frag, s, sub, n, cnt, sibling, xferNode;\r
+\r
+ if (how != DELETE)\r
+ frag = doc.createDocumentFragment();\r
+\r
+ // If selection is empty, just return the fragment\r
+ if (t[START_OFFSET] == t[END_OFFSET])\r
+ return frag;\r
+\r
+ // Text node needs special case handling\r
+ if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) {\r
+ // get the substring\r
+ s = t[START_CONTAINER].nodeValue;\r
+ sub = s.substring(t[START_OFFSET], t[END_OFFSET]);\r
+\r
+ // set the original text node to its new value\r
+ if (how != CLONE) {\r
+ t[START_CONTAINER].deleteData(t[START_OFFSET], t[END_OFFSET] - t[START_OFFSET]);\r
+\r
+ // Nothing is partially selected, so collapse to start point\r
+ t.collapse(TRUE);\r
+ }\r
+\r
+ if (how == DELETE)\r
+ return;\r
+\r
+ frag.appendChild(doc.createTextNode(sub));\r
+ return frag;\r
+ }\r
+\r
+ // Copy nodes between the start/end offsets.\r
+ n = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]);\r
+ cnt = t[END_OFFSET] - t[START_OFFSET];\r
+\r
+ while (cnt > 0) {\r
+ sibling = n.nextSibling;\r
+ xferNode = _traverseFullySelected(n, how);\r
+\r
+ if (frag)\r
+ frag.appendChild( xferNode );\r
+\r
+ --cnt;\r
+ n = sibling;\r
+ }\r
+\r
+ // Nothing is partially selected, so collapse to start point\r
+ if (how != CLONE)\r
+ t.collapse(TRUE);\r
+\r
+ return frag;\r
+ };\r
+\r
+ function _traverseCommonStartContainer(endAncestor, how) {\r
+ var frag, n, endIdx, cnt, sibling, xferNode;\r
+\r
+ if (how != DELETE)\r
+ frag = doc.createDocumentFragment();\r
+\r
+ n = _traverseRightBoundary(endAncestor, how);\r
+\r
+ if (frag)\r
+ frag.appendChild(n);\r
+\r
+ endIdx = nodeIndex(endAncestor);\r
+ cnt = endIdx - t[START_OFFSET];\r
+\r
+ if (cnt <= 0) {\r
+ // Collapse to just before the endAncestor, which\r
+ // is partially selected.\r
+ if (how != CLONE) {\r
+ t.setEndBefore(endAncestor);\r
+ t.collapse(FALSE);\r
+ }\r
+\r
+ return frag;\r
+ }\r
+\r
+ n = endAncestor.previousSibling;\r
+ while (cnt > 0) {\r
+ sibling = n.previousSibling;\r
+ xferNode = _traverseFullySelected(n, how);\r
+\r
+ if (frag)\r
+ frag.insertBefore(xferNode, frag.firstChild);\r
+\r
+ --cnt;\r
+ n = sibling;\r
+ }\r
+\r
+ // Collapse to just before the endAncestor, which\r
+ // is partially selected.\r
+ if (how != CLONE) {\r
+ t.setEndBefore(endAncestor);\r
+ t.collapse(FALSE);\r
+ }\r
+\r
+ return frag;\r
+ };\r
+\r
+ function _traverseCommonEndContainer(startAncestor, how) {\r
+ var frag, startIdx, n, cnt, sibling, xferNode;\r
+\r
+ if (how != DELETE)\r
+ frag = doc.createDocumentFragment();\r
+\r
+ n = _traverseLeftBoundary(startAncestor, how);\r
+ if (frag)\r
+ frag.appendChild(n);\r
+\r
+ startIdx = nodeIndex(startAncestor);\r
+ ++startIdx; // Because we already traversed it....\r
+\r
+ cnt = t[END_OFFSET] - startIdx;\r
+ n = startAncestor.nextSibling;\r
+ while (cnt > 0) {\r
+ sibling = n.nextSibling;\r
+ xferNode = _traverseFullySelected(n, how);\r
+\r
+ if (frag)\r
+ frag.appendChild(xferNode);\r
+\r
+ --cnt;\r
+ n = sibling;\r
+ }\r
+\r
+ if (how != CLONE) {\r
+ t.setStartAfter(startAncestor);\r
+ t.collapse(TRUE);\r
+ }\r
+\r
+ return frag;\r
+ };\r
+\r
+ function _traverseCommonAncestors(startAncestor, endAncestor, how) {\r
+ var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling;\r
+\r
+ if (how != DELETE)\r
+ frag = doc.createDocumentFragment();\r
+\r
+ n = _traverseLeftBoundary(startAncestor, how);\r
+ if (frag)\r
+ frag.appendChild(n);\r
+\r
+ commonParent = startAncestor.parentNode;\r
+ startOffset = nodeIndex(startAncestor);\r
+ endOffset = nodeIndex(endAncestor);\r
+ ++startOffset;\r
+\r
+ cnt = endOffset - startOffset;\r
+ sibling = startAncestor.nextSibling;\r
+\r
+ while (cnt > 0) {\r
+ nextSibling = sibling.nextSibling;\r
+ n = _traverseFullySelected(sibling, how);\r
+\r
+ if (frag)\r
+ frag.appendChild(n);\r
+\r
+ sibling = nextSibling;\r
+ --cnt;\r
+ }\r
+\r
+ n = _traverseRightBoundary(endAncestor, how);\r
+\r
+ if (frag)\r
+ frag.appendChild(n);\r
+\r
+ if (how != CLONE) {\r
+ t.setStartAfter(startAncestor);\r
+ t.collapse(TRUE);\r
+ }\r
+\r
+ return frag;\r
+ };\r
+\r
+ function _traverseRightBoundary(root, how) {\r
+ var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[END_CONTAINER];\r
+\r
+ if (next == root)\r
+ return _traverseNode(next, isFullySelected, FALSE, how);\r
+\r
+ parent = next.parentNode;\r
+ clonedParent = _traverseNode(parent, FALSE, FALSE, how);\r
+\r
+ while (parent) {\r
+ while (next) {\r
+ prevSibling = next.previousSibling;\r
+ clonedChild = _traverseNode(next, isFullySelected, FALSE, how);\r
+\r
+ if (how != DELETE)\r
+ clonedParent.insertBefore(clonedChild, clonedParent.firstChild);\r
+\r
+ isFullySelected = TRUE;\r
+ next = prevSibling;\r
+ }\r
+\r
+ if (parent == root)\r
+ return clonedParent;\r
+\r
+ next = parent.previousSibling;\r
+ parent = parent.parentNode;\r
+\r
+ clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);\r
+\r
+ if (how != DELETE)\r
+ clonedGrandParent.appendChild(clonedParent);\r
+\r
+ clonedParent = clonedGrandParent;\r
+ }\r
+ };\r
+\r
+ function _traverseLeftBoundary(root, how) {\r
+ var next = _getSelectedNode(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[START_CONTAINER], parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;\r
+\r
+ if (next == root)\r
+ return _traverseNode(next, isFullySelected, TRUE, how);\r
+\r
+ parent = next.parentNode;\r
+ clonedParent = _traverseNode(parent, FALSE, TRUE, how);\r
+\r
+ while (parent) {\r
+ while (next) {\r
+ nextSibling = next.nextSibling;\r
+ clonedChild = _traverseNode(next, isFullySelected, TRUE, how);\r
+\r
+ if (how != DELETE)\r
+ clonedParent.appendChild(clonedChild);\r
+\r
+ isFullySelected = TRUE;\r
+ next = nextSibling;\r
+ }\r
+\r
+ if (parent == root)\r
+ return clonedParent;\r
+\r
+ next = parent.nextSibling;\r
+ parent = parent.parentNode;\r
+\r
+ clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);\r
+\r
+ if (how != DELETE)\r
+ clonedGrandParent.appendChild(clonedParent);\r
+\r
+ clonedParent = clonedGrandParent;\r
+ }\r
+ };\r
+\r
+ function _traverseNode(n, isFullySelected, isLeft, how) {\r
+ var txtValue, newNodeValue, oldNodeValue, offset, newNode;\r
+\r
+ if (isFullySelected)\r
+ return _traverseFullySelected(n, how);\r
+\r
+ if (n.nodeType == 3 /* TEXT_NODE */) {\r
+ txtValue = n.nodeValue;\r
+\r
+ if (isLeft) {\r
+ offset = t[START_OFFSET];\r
+ newNodeValue = txtValue.substring(offset);\r
+ oldNodeValue = txtValue.substring(0, offset);\r
+ } else {\r
+ offset = t[END_OFFSET];\r
+ newNodeValue = txtValue.substring(0, offset);\r
+ oldNodeValue = txtValue.substring(offset);\r
+ }\r
+\r
+ if (how != CLONE)\r
+ n.nodeValue = oldNodeValue;\r
+\r
+ if (how == DELETE)\r
+ return;\r
+\r
+ newNode = n.cloneNode(FALSE);\r
+ newNode.nodeValue = newNodeValue;\r
+\r
+ return newNode;\r
+ }\r
+\r
+ if (how == DELETE)\r
+ return;\r
+\r
+ return n.cloneNode(FALSE);\r
+ };\r
+\r
+ function _traverseFullySelected(n, how) {\r
+ if (how != DELETE)\r
+ return how == CLONE ? n.cloneNode(TRUE) : n;\r
+\r
+ n.parentNode.removeChild(n);\r
+ };\r
+ };\r
+\r
+ ns.Range = Range;\r
+})(tinymce.dom);\r
+\r
+(function() {\r
+ function Selection(selection) {\r
+ var t = this, invisibleChar = '\uFEFF', range, lastIERng, dom = selection.dom, TRUE = true, FALSE = false;\r
+\r
+ // Returns a W3C DOM compatible range object by using the IE Range API\r
+ function getRange() {\r
+ var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed;\r
+\r
+ // If selection is outside the current document just return an empty range\r
+ element = ieRange.item ? ieRange.item(0) : ieRange.parentElement();\r
+ if (element.ownerDocument != dom.doc)\r
+ return domRange;\r
+\r
+ // Handle control selection or text selection of a image\r
+ if (ieRange.item || !element.hasChildNodes()) {\r
+ domRange.setStart(element.parentNode, dom.nodeIndex(element));\r
+ domRange.setEnd(domRange.startContainer, domRange.startOffset + 1);\r
+\r
+ return domRange;\r
+ }\r
+\r
+ collapsed = selection.isCollapsed();\r
+\r
+ function findEndPoint(start) {\r
+ var marker, container, offset, nodes, startIndex = 0, endIndex, index, parent, checkRng, position;\r
+\r
+ // Setup temp range and collapse it\r
+ checkRng = ieRange.duplicate();\r
+ checkRng.collapse(start);\r
+\r
+ // Create marker and insert it at the end of the endpoints parent\r
+ marker = dom.create('a');\r
+ parent = checkRng.parentElement();\r
+\r
+ // If parent doesn't have any children then set the container to that parent and the index to 0\r
+ if (!parent.hasChildNodes()) {\r
+ domRange[start ? 'setStart' : 'setEnd'](parent, 0);\r
+ return;\r
+ }\r
+\r
+ parent.appendChild(marker);\r
+ checkRng.moveToElementText(marker);\r
+ position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng);\r
+ if (position > 0) {\r
+ // The position is after the end of the parent element.\r
+ // This is the case where IE puts the caret to the left edge of a table.\r
+ domRange[start ? 'setStartAfter' : 'setEndAfter'](parent);\r
+ dom.remove(marker);\r
+ return;\r
+ }\r
+\r
+ // Setup node list and endIndex\r
+ nodes = tinymce.grep(parent.childNodes);\r
+ endIndex = nodes.length - 1;\r
+ // Perform a binary search for the position\r
+ while (startIndex <= endIndex) {\r
+ index = Math.floor((startIndex + endIndex) / 2);\r
+\r
+ // Insert marker and check it's position relative to the selection\r
+ parent.insertBefore(marker, nodes[index]);\r
+ checkRng.moveToElementText(marker);\r
+ position = ieRange.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', checkRng);\r
+ if (position > 0) {\r
+ // Marker is to the right\r
+ startIndex = index + 1;\r
+ } else if (position < 0) {\r
+ // Marker is to the left\r
+ endIndex = index - 1;\r
+ } else {\r
+ // Maker is where we are\r
+ found = true;\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Setup container\r
+ container = position > 0 || index == 0 ? marker.nextSibling : marker.previousSibling;\r
+\r
+ // Handle element selection\r
+ if (container.nodeType == 1) {\r
+ dom.remove(marker);\r
+\r
+ // Find offset and container\r
+ offset = dom.nodeIndex(container);\r
+ container = container.parentNode;\r
+\r
+ // Move the offset if we are setting the end or the position is after an element\r
+ if (!start || index > 0)\r
+ offset++;\r
+ } else {\r
+ // Calculate offset within text node\r
+ if (position > 0 || index == 0) {\r
+ checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange);\r
+ offset = checkRng.text.length;\r
+ } else {\r
+ checkRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', ieRange);\r
+ offset = container.nodeValue.length - checkRng.text.length;\r
+ }\r
+\r
+ dom.remove(marker);\r
+ }\r
+\r
+ domRange[start ? 'setStart' : 'setEnd'](container, offset);\r
+ };\r
+\r
+ // Find start point\r
+ findEndPoint(true);\r
+\r
+ // Find end point if needed\r
+ if (!collapsed)\r
+ findEndPoint();\r
+\r
+ return domRange;\r
+ };\r
+\r
+ this.addRange = function(rng) {\r
+ var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body;\r
+\r
+ function setEndPoint(start) {\r
+ var container, offset, marker, tmpRng, nodes;\r
+\r
+ marker = dom.create('a');\r
+ container = start ? startContainer : endContainer;\r
+ offset = start ? startOffset : endOffset;\r
+ tmpRng = ieRng.duplicate();\r
+\r
+ if (container == doc) {\r
+ container = body;\r
+ offset = 0;\r
+ }\r
+\r
+ if (container.nodeType == 3) {\r
+ container.parentNode.insertBefore(marker, container);\r
+ tmpRng.moveToElementText(marker);\r
+ tmpRng.moveStart('character', offset);\r
+ dom.remove(marker);\r
+ ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);\r
+ } else {\r
+ nodes = container.childNodes;\r
+\r
+ if (nodes.length) {\r
+ if (offset >= nodes.length) {\r
+ dom.insertAfter(marker, nodes[nodes.length - 1]);\r
+ } else {\r
+ container.insertBefore(marker, nodes[offset]);\r
+ }\r
+\r
+ tmpRng.moveToElementText(marker);\r
+ } else {\r
+ // Empty node selection for example <div>|</div>\r
+ marker = doc.createTextNode(invisibleChar);\r
+ container.appendChild(marker);\r
+ tmpRng.moveToElementText(marker.parentNode);\r
+ tmpRng.collapse(TRUE);\r
+ }\r
+\r
+ ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng);\r
+ dom.remove(marker);\r
+ }\r
+ }\r
+\r
+ // Destroy cached range\r
+ this.destroy();\r
+\r
+ // Setup some shorter versions\r
+ startContainer = rng.startContainer;\r
+ startOffset = rng.startOffset;\r
+ endContainer = rng.endContainer;\r
+ endOffset = rng.endOffset;\r
+ ieRng = body.createTextRange();\r
+\r
+ // If single element selection then try making a control selection out of it\r
+ if (startContainer == endContainer && startContainer.nodeType == 1 && startOffset == endOffset - 1) {\r
+ if (startOffset == endOffset - 1) {\r
+ try {\r
+ ctrlRng = body.createControlRange();\r
+ ctrlRng.addElement(startContainer.childNodes[startOffset]);\r
+ ctrlRng.select();\r
+ ctrlRng.scrollIntoView();\r
+ return;\r
+ } catch (ex) {\r
+ // Ignore\r
+ }\r
+ }\r
+ }\r
+\r
+ // Set start/end point of selection\r
+ setEndPoint(true);\r
+ setEndPoint();\r
+\r
+ // Select the new range and scroll it into view\r
+ ieRng.select();\r
+ ieRng.scrollIntoView();\r
+ };\r
+\r
+ this.getRangeAt = function() {\r
+ // Setup new range if the cache is empty\r
+ if (!range || !tinymce.dom.RangeUtils.compareRanges(lastIERng, selection.getRng())) {\r
+ range = getRange();\r
+\r
+ // Store away text range for next call\r
+ lastIERng = selection.getRng();\r
+ }\r
+\r
+ // IE will say that the range is equal then produce an invalid argument exception\r
+ // if you perform specific operations in a keyup event. For example Ctrl+Del.\r
+ // This hack will invalidate the range cache if the exception occurs\r
+ try {\r
+ range.startContainer.nextSibling;\r
+ } catch (ex) {\r
+ range = getRange();\r
+ lastIERng = null;\r
+ }\r
+\r
+ // Return cached range\r
+ return range;\r
+ };\r
+\r
+ this.destroy = function() {\r
+ // Destroy cached range and last IE range to avoid memory leaks\r
+ lastIERng = range = null;\r
+ };\r
+\r
+ // IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode\r
+ if (selection.dom.boxModel) {\r
+ (function() {\r
+ var doc = dom.doc, body = doc.body, started, startRng;\r
+\r
+ // Make HTML element unselectable since we are going to handle selection by hand\r
+ doc.documentElement.unselectable = TRUE;\r
+\r
+ // Return range from point or null if it failed\r
+ function rngFromPoint(x, y) {\r
+ var rng = body.createTextRange();\r
+\r
+ try {\r
+ rng.moveToPoint(x, y);\r
+ } catch (ex) {\r
+ // IE sometimes throws and exception, so lets just ignore it\r
+ rng = null;\r
+ }\r
+\r
+ return rng;\r
+ };\r
+\r
+ // Fires while the selection is changing\r
+ function selectionChange(e) {\r
+ var pointRng;\r
+\r
+ // Check if the button is down or not\r
+ if (e.button) {\r
+ // Create range from mouse position\r
+ pointRng = rngFromPoint(e.x, e.y);\r
+\r
+ if (pointRng) {\r
+ // Check if pointRange is before/after selection then change the endPoint\r
+ if (pointRng.compareEndPoints('StartToStart', startRng) > 0)\r
+ pointRng.setEndPoint('StartToStart', startRng);\r
+ else\r
+ pointRng.setEndPoint('EndToEnd', startRng);\r
+\r
+ pointRng.select();\r
+ }\r
+ } else\r
+ endSelection();\r
+ }\r
+\r
+ // Removes listeners\r
+ function endSelection() {\r
+ dom.unbind(doc, 'mouseup', endSelection);\r
+ dom.unbind(doc, 'mousemove', selectionChange);\r
+ started = 0;\r
+ };\r
+\r
+ // Detect when user selects outside BODY\r
+ dom.bind(doc, 'mousedown', function(e) {\r
+ if (e.target.nodeName === 'HTML') {\r
+ if (started)\r
+ endSelection();\r
+\r
+ started = 1;\r
+\r
+ // Setup start position\r
+ startRng = rngFromPoint(e.x, e.y);\r
+ if (startRng) {\r
+ // Listen for selection change events\r
+ dom.bind(doc, 'mouseup', endSelection);\r
+ dom.bind(doc, 'mousemove', selectionChange);\r
+\r
+ startRng.select();\r
+ }\r
+ }\r
+ });\r
+ })();\r
+ }\r
+ };\r
+\r
+ // Expose the selection object\r
+ tinymce.dom.TridentSelection = Selection;\r
+})();\r
+\r
+\r
+/*\r
+ * Sizzle CSS Selector Engine - v1.0\r
+ * Copyright 2009, The Dojo Foundation\r
+ * Released under the MIT, BSD, and GPL Licenses.\r
+ * More information: http://sizzlejs.com/\r
+ */\r
+(function(){\r
+\r
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,\r
+ done = 0,\r
+ toString = Object.prototype.toString,\r
+ hasDuplicate = false,\r
+ baseHasDuplicate = true;\r
+\r
+// Here we check if the JavaScript engine is using some sort of\r
+// optimization where it does not always call our comparision\r
+// function. If that is the case, discard the hasDuplicate value.\r
+// Thus far that includes Google Chrome.\r
+[0, 0].sort(function(){\r
+ baseHasDuplicate = false;\r
+ return 0;\r
+});\r
+\r
+var Sizzle = function(selector, context, results, seed) {\r
+ results = results || [];\r
+ context = context || document;\r
+\r
+ var origContext = context;\r
+\r
+ if ( context.nodeType !== 1 && context.nodeType !== 9 ) {\r
+ return [];\r
+ }\r
+ \r
+ if ( !selector || typeof selector !== "string" ) {\r
+ return results;\r
+ }\r
+\r
+ var parts = [], m, set, checkSet, extra, prune = true, contextXML = Sizzle.isXML(context),\r
+ soFar = selector, ret, cur, pop, i;\r
+ \r
+ // Reset the position of the chunker regexp (start from head)\r
+ do {\r
+ chunker.exec("");\r
+ m = chunker.exec(soFar);\r
+\r
+ if ( m ) {\r
+ soFar = m[3];\r
+ \r
+ parts.push( m[1] );\r
+ \r
+ if ( m[2] ) {\r
+ extra = m[3];\r
+ break;\r
+ }\r
+ }\r
+ } while ( m );\r
+\r
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {\r
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {\r
+ set = posProcess( parts[0] + parts[1], context );\r
+ } else {\r
+ set = Expr.relative[ parts[0] ] ?\r
+ [ context ] :\r
+ Sizzle( parts.shift(), context );\r
+\r
+ while ( parts.length ) {\r
+ selector = parts.shift();\r
+\r
+ if ( Expr.relative[ selector ] ) {\r
+ selector += parts.shift();\r
+ }\r
+ \r
+ set = posProcess( selector, set );\r
+ }\r
+ }\r
+ } else {\r
+ // Take a shortcut and set the context if the root selector is an ID\r
+ // (but not if it'll be faster if the inner selector is an ID)\r
+ if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&\r
+ Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {\r
+ ret = Sizzle.find( parts.shift(), context, contextXML );\r
+ context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];\r
+ }\r
+\r
+ if ( context ) {\r
+ ret = seed ?\r
+ { expr: parts.pop(), set: makeArray(seed) } :\r
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );\r
+ set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;\r
+\r
+ if ( parts.length > 0 ) {\r
+ checkSet = makeArray(set);\r
+ } else {\r
+ prune = false;\r
+ }\r
+\r
+ while ( parts.length ) {\r
+ cur = parts.pop();\r
+ pop = cur;\r
+\r
+ if ( !Expr.relative[ cur ] ) {\r
+ cur = "";\r
+ } else {\r
+ pop = parts.pop();\r
+ }\r
+\r
+ if ( pop == null ) {\r
+ pop = context;\r
+ }\r
+\r
+ Expr.relative[ cur ]( checkSet, pop, contextXML );\r
+ }\r
+ } else {\r
+ checkSet = parts = [];\r
+ }\r
+ }\r
+\r
+ if ( !checkSet ) {\r
+ checkSet = set;\r
+ }\r
+\r
+ if ( !checkSet ) {\r
+ Sizzle.error( cur || selector );\r
+ }\r
+\r
+ if ( toString.call(checkSet) === "[object Array]" ) {\r
+ if ( !prune ) {\r
+ results.push.apply( results, checkSet );\r
+ } else if ( context && context.nodeType === 1 ) {\r
+ for ( i = 0; checkSet[i] != null; i++ ) {\r
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {\r
+ results.push( set[i] );\r
+ }\r
+ }\r
+ } else {\r
+ for ( i = 0; checkSet[i] != null; i++ ) {\r
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {\r
+ results.push( set[i] );\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ makeArray( checkSet, results );\r
+ }\r
+\r
+ if ( extra ) {\r
+ Sizzle( extra, origContext, results, seed );\r
+ Sizzle.uniqueSort( results );\r
+ }\r
+\r
+ return results;\r
+};\r
+\r
+Sizzle.uniqueSort = function(results){\r
+ if ( sortOrder ) {\r
+ hasDuplicate = baseHasDuplicate;\r
+ results.sort(sortOrder);\r
+\r
+ if ( hasDuplicate ) {\r
+ for ( var i = 1; i < results.length; i++ ) {\r
+ if ( results[i] === results[i-1] ) {\r
+ results.splice(i--, 1);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return results;\r
+};\r
+\r
+Sizzle.matches = function(expr, set){\r
+ return Sizzle(expr, null, null, set);\r
+};\r
+\r
+Sizzle.find = function(expr, context, isXML){\r
+ var set;\r
+\r
+ if ( !expr ) {\r
+ return [];\r
+ }\r
+\r
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {\r
+ var type = Expr.order[i], match;\r
+ \r
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {\r
+ var left = match[1];\r
+ match.splice(1,1);\r
+\r
+ if ( left.substr( left.length - 1 ) !== "\\" ) {\r
+ match[1] = (match[1] || "").replace(/\\/g, "");\r
+ set = Expr.find[ type ]( match, context, isXML );\r
+ if ( set != null ) {\r
+ expr = expr.replace( Expr.match[ type ], "" );\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( !set ) {\r
+ set = context.getElementsByTagName("*");\r
+ }\r
+\r
+ return {set: set, expr: expr};\r
+};\r
+\r
+Sizzle.filter = function(expr, set, inplace, not){\r
+ var old = expr, result = [], curLoop = set, match, anyFound,\r
+ isXMLFilter = set && set[0] && Sizzle.isXML(set[0]);\r
+\r
+ while ( expr && set.length ) {\r
+ for ( var type in Expr.filter ) {\r
+ if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {\r
+ var filter = Expr.filter[ type ], found, item, left = match[1];\r
+ anyFound = false;\r
+\r
+ match.splice(1,1);\r
+\r
+ if ( left.substr( left.length - 1 ) === "\\" ) {\r
+ continue;\r
+ }\r
+\r
+ if ( curLoop === result ) {\r
+ result = [];\r
+ }\r
+\r
+ if ( Expr.preFilter[ type ] ) {\r
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );\r
+\r
+ if ( !match ) {\r
+ anyFound = found = true;\r
+ } else if ( match === true ) {\r
+ continue;\r
+ }\r
+ }\r
+\r
+ if ( match ) {\r
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {\r
+ if ( item ) {\r
+ found = filter( item, match, i, curLoop );\r
+ var pass = not ^ !!found;\r
+\r
+ if ( inplace && found != null ) {\r
+ if ( pass ) {\r
+ anyFound = true;\r
+ } else {\r
+ curLoop[i] = false;\r
+ }\r
+ } else if ( pass ) {\r
+ result.push( item );\r
+ anyFound = true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( found !== undefined ) {\r
+ if ( !inplace ) {\r
+ curLoop = result;\r
+ }\r
+\r
+ expr = expr.replace( Expr.match[ type ], "" );\r
+\r
+ if ( !anyFound ) {\r
+ return [];\r
+ }\r
+\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Improper expression\r
+ if ( expr === old ) {\r
+ if ( anyFound == null ) {\r
+ Sizzle.error( expr );\r
+ } else {\r
+ break;\r
+ }\r
+ }\r
+\r
+ old = expr;\r
+ }\r
+\r
+ return curLoop;\r
+};\r
+\r
+Sizzle.error = function( msg ) {\r
+ throw "Syntax error, unrecognized expression: " + msg;\r
+};\r
+\r
+var Expr = Sizzle.selectors = {\r
+ order: [ "ID", "NAME", "TAG" ],\r
+ match: {\r
+ ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,\r
+ CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,\r
+ NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,\r
+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,\r
+ TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,\r
+ CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,\r
+ POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,\r
+ PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/\r
+ },\r
+ leftMatch: {},\r
+ attrMap: {\r
+ "class": "className",\r
+ "for": "htmlFor"\r
+ },\r
+ attrHandle: {\r
+ href: function(elem){\r
+ return elem.getAttribute("href");\r
+ }\r
+ },\r
+ relative: {\r
+ "+": function(checkSet, part){\r
+ var isPartStr = typeof part === "string",\r
+ isTag = isPartStr && !/\W/.test(part),\r
+ isPartStrNotTag = isPartStr && !isTag;\r
+\r
+ if ( isTag ) {\r
+ part = part.toLowerCase();\r
+ }\r
+\r
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {\r
+ if ( (elem = checkSet[i]) ) {\r
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}\r
+\r
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?\r
+ elem || false :\r
+ elem === part;\r
+ }\r
+ }\r
+\r
+ if ( isPartStrNotTag ) {\r
+ Sizzle.filter( part, checkSet, true );\r
+ }\r
+ },\r
+ ">": function(checkSet, part){\r
+ var isPartStr = typeof part === "string",\r
+ elem, i = 0, l = checkSet.length;\r
+\r
+ if ( isPartStr && !/\W/.test(part) ) {\r
+ part = part.toLowerCase();\r
+\r
+ for ( ; i < l; i++ ) {\r
+ elem = checkSet[i];\r
+ if ( elem ) {\r
+ var parent = elem.parentNode;\r
+ checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;\r
+ }\r
+ }\r
+ } else {\r
+ for ( ; i < l; i++ ) {\r
+ elem = checkSet[i];\r
+ if ( elem ) {\r
+ checkSet[i] = isPartStr ?\r
+ elem.parentNode :\r
+ elem.parentNode === part;\r
+ }\r
+ }\r
+\r
+ if ( isPartStr ) {\r
+ Sizzle.filter( part, checkSet, true );\r
+ }\r
+ }\r
+ },\r
+ "": function(checkSet, part, isXML){\r
+ var doneName = done++, checkFn = dirCheck, nodeCheck;\r
+\r
+ if ( typeof part === "string" && !/\W/.test(part) ) {\r
+ part = part.toLowerCase();\r
+ nodeCheck = part;\r
+ checkFn = dirNodeCheck;\r
+ }\r
+\r
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);\r
+ },\r
+ "~": function(checkSet, part, isXML){\r
+ var doneName = done++, checkFn = dirCheck, nodeCheck;\r
+\r
+ if ( typeof part === "string" && !/\W/.test(part) ) {\r
+ part = part.toLowerCase();\r
+ nodeCheck = part;\r
+ checkFn = dirNodeCheck;\r
+ }\r
+\r
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);\r
+ }\r
+ },\r
+ find: {\r
+ ID: function(match, context, isXML){\r
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
+ var m = context.getElementById(match[1]);\r
+ return m ? [m] : [];\r
+ }\r
+ },\r
+ NAME: function(match, context){\r
+ if ( typeof context.getElementsByName !== "undefined" ) {\r
+ var ret = [], results = context.getElementsByName(match[1]);\r
+\r
+ for ( var i = 0, l = results.length; i < l; i++ ) {\r
+ if ( results[i].getAttribute("name") === match[1] ) {\r
+ ret.push( results[i] );\r
+ }\r
+ }\r
+\r
+ return ret.length === 0 ? null : ret;\r
+ }\r
+ },\r
+ TAG: function(match, context){\r
+ return context.getElementsByTagName(match[1]);\r
+ }\r
+ },\r
+ preFilter: {\r
+ CLASS: function(match, curLoop, inplace, result, not, isXML){\r
+ match = " " + match[1].replace(/\\/g, "") + " ";\r
+\r
+ if ( isXML ) {\r
+ return match;\r
+ }\r
+\r
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {\r
+ if ( elem ) {\r
+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {\r
+ if ( !inplace ) {\r
+ result.push( elem );\r
+ }\r
+ } else if ( inplace ) {\r
+ curLoop[i] = false;\r
+ }\r
+ }\r
+ }\r
+\r
+ return false;\r
+ },\r
+ ID: function(match){\r
+ return match[1].replace(/\\/g, "");\r
+ },\r
+ TAG: function(match, curLoop){\r
+ return match[1].toLowerCase();\r
+ },\r
+ CHILD: function(match){\r
+ if ( match[1] === "nth" ) {\r
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'\r
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(\r
+ match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||\r
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);\r
+\r
+ // calculate the numbers (first)n+(last) including if they are negative\r
+ match[2] = (test[1] + (test[2] || 1)) - 0;\r
+ match[3] = test[3] - 0;\r
+ }\r
+\r
+ // TODO: Move to normal caching system\r
+ match[0] = done++;\r
+\r
+ return match;\r
+ },\r
+ ATTR: function(match, curLoop, inplace, result, not, isXML){\r
+ var name = match[1].replace(/\\/g, "");\r
+ \r
+ if ( !isXML && Expr.attrMap[name] ) {\r
+ match[1] = Expr.attrMap[name];\r
+ }\r
+\r
+ if ( match[2] === "~=" ) {\r
+ match[4] = " " + match[4] + " ";\r
+ }\r
+\r
+ return match;\r
+ },\r
+ PSEUDO: function(match, curLoop, inplace, result, not){\r
+ if ( match[1] === "not" ) {\r
+ // If we're dealing with a complex expression, or a simple one\r
+ if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {\r
+ match[3] = Sizzle(match[3], null, null, curLoop);\r
+ } else {\r
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);\r
+ if ( !inplace ) {\r
+ result.push.apply( result, ret );\r
+ }\r
+ return false;\r
+ }\r
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {\r
+ return true;\r
+ }\r
+ \r
+ return match;\r
+ },\r
+ POS: function(match){\r
+ match.unshift( true );\r
+ return match;\r
+ }\r
+ },\r
+ filters: {\r
+ enabled: function(elem){\r
+ return elem.disabled === false && elem.type !== "hidden";\r
+ },\r
+ disabled: function(elem){\r
+ return elem.disabled === true;\r
+ },\r
+ checked: function(elem){\r
+ return elem.checked === true;\r
+ },\r
+ selected: function(elem){\r
+ // Accessing this property makes selected-by-default\r
+ // options in Safari work properly\r
+ elem.parentNode.selectedIndex;\r
+ return elem.selected === true;\r
+ },\r
+ parent: function(elem){\r
+ return !!elem.firstChild;\r
+ },\r
+ empty: function(elem){\r
+ return !elem.firstChild;\r
+ },\r
+ has: function(elem, i, match){\r
+ return !!Sizzle( match[3], elem ).length;\r
+ },\r
+ header: function(elem){\r
+ return (/h\d/i).test( elem.nodeName );\r
+ },\r
+ text: function(elem){\r
+ return "text" === elem.type;\r
+ },\r
+ radio: function(elem){\r
+ return "radio" === elem.type;\r
+ },\r
+ checkbox: function(elem){\r
+ return "checkbox" === elem.type;\r
+ },\r
+ file: function(elem){\r
+ return "file" === elem.type;\r
+ },\r
+ password: function(elem){\r
+ return "password" === elem.type;\r
+ },\r
+ submit: function(elem){\r
+ return "submit" === elem.type;\r
+ },\r
+ image: function(elem){\r
+ return "image" === elem.type;\r
+ },\r
+ reset: function(elem){\r
+ return "reset" === elem.type;\r
+ },\r
+ button: function(elem){\r
+ return "button" === elem.type || elem.nodeName.toLowerCase() === "button";\r
+ },\r
+ input: function(elem){\r
+ return (/input|select|textarea|button/i).test(elem.nodeName);\r
+ }\r
+ },\r
+ setFilters: {\r
+ first: function(elem, i){\r
+ return i === 0;\r
+ },\r
+ last: function(elem, i, match, array){\r
+ return i === array.length - 1;\r
+ },\r
+ even: function(elem, i){\r
+ return i % 2 === 0;\r
+ },\r
+ odd: function(elem, i){\r
+ return i % 2 === 1;\r
+ },\r
+ lt: function(elem, i, match){\r
+ return i < match[3] - 0;\r
+ },\r
+ gt: function(elem, i, match){\r
+ return i > match[3] - 0;\r
+ },\r
+ nth: function(elem, i, match){\r
+ return match[3] - 0 === i;\r
+ },\r
+ eq: function(elem, i, match){\r
+ return match[3] - 0 === i;\r
+ }\r
+ },\r
+ filter: {\r
+ PSEUDO: function(elem, match, i, array){\r
+ var name = match[1], filter = Expr.filters[ name ];\r
+\r
+ if ( filter ) {\r
+ return filter( elem, i, match, array );\r
+ } else if ( name === "contains" ) {\r
+ return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;\r
+ } else if ( name === "not" ) {\r
+ var not = match[3];\r
+\r
+ for ( var j = 0, l = not.length; j < l; j++ ) {\r
+ if ( not[j] === elem ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+ } else {\r
+ Sizzle.error( "Syntax error, unrecognized expression: " + name );\r
+ }\r
+ },\r
+ CHILD: function(elem, match){\r
+ var type = match[1], node = elem;\r
+ switch (type) {\r
+ case 'only':\r
+ case 'first':\r
+ while ( (node = node.previousSibling) ) {\r
+ if ( node.nodeType === 1 ) { \r
+ return false; \r
+ }\r
+ }\r
+ if ( type === "first" ) { \r
+ return true; \r
+ }\r
+ node = elem;\r
+ case 'last':\r
+ while ( (node = node.nextSibling) ) {\r
+ if ( node.nodeType === 1 ) { \r
+ return false; \r
+ }\r
+ }\r
+ return true;\r
+ case 'nth':\r
+ var first = match[2], last = match[3];\r
+\r
+ if ( first === 1 && last === 0 ) {\r
+ return true;\r
+ }\r
+ \r
+ var doneName = match[0],\r
+ parent = elem.parentNode;\r
+ \r
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {\r
+ var count = 0;\r
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
+ if ( node.nodeType === 1 ) {\r
+ node.nodeIndex = ++count;\r
+ }\r
+ } \r
+ parent.sizcache = doneName;\r
+ }\r
+ \r
+ var diff = elem.nodeIndex - last;\r
+ if ( first === 0 ) {\r
+ return diff === 0;\r
+ } else {\r
+ return ( diff % first === 0 && diff / first >= 0 );\r
+ }\r
+ }\r
+ },\r
+ ID: function(elem, match){\r
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;\r
+ },\r
+ TAG: function(elem, match){\r
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;\r
+ },\r
+ CLASS: function(elem, match){\r
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")\r
+ .indexOf( match ) > -1;\r
+ },\r
+ ATTR: function(elem, match){\r
+ var name = match[1],\r
+ result = Expr.attrHandle[ name ] ?\r
+ Expr.attrHandle[ name ]( elem ) :\r
+ elem[ name ] != null ?\r
+ elem[ name ] :\r
+ elem.getAttribute( name ),\r
+ value = result + "",\r
+ type = match[2],\r
+ check = match[4];\r
+\r
+ return result == null ?\r
+ type === "!=" :\r
+ type === "=" ?\r
+ value === check :\r
+ type === "*=" ?\r
+ value.indexOf(check) >= 0 :\r
+ type === "~=" ?\r
+ (" " + value + " ").indexOf(check) >= 0 :\r
+ !check ?\r
+ value && result !== false :\r
+ type === "!=" ?\r
+ value !== check :\r
+ type === "^=" ?\r
+ value.indexOf(check) === 0 :\r
+ type === "$=" ?\r
+ value.substr(value.length - check.length) === check :\r
+ type === "|=" ?\r
+ value === check || value.substr(0, check.length + 1) === check + "-" :\r
+ false;\r
+ },\r
+ POS: function(elem, match, i, array){\r
+ var name = match[2], filter = Expr.setFilters[ name ];\r
+\r
+ if ( filter ) {\r
+ return filter( elem, i, match, array );\r
+ }\r
+ }\r
+ }\r
+};\r
+\r
+var origPOS = Expr.match.POS,\r
+ fescape = function(all, num){\r
+ return "\\" + (num - 0 + 1);\r
+ };\r
+\r
+for ( var type in Expr.match ) {\r
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );\r
+ Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );\r
+}\r
+\r
+var makeArray = function(array, results) {\r
+ array = Array.prototype.slice.call( array, 0 );\r
+\r
+ if ( results ) {\r
+ results.push.apply( results, array );\r
+ return results;\r
+ }\r
+ \r
+ return array;\r
+};\r
+\r
+// Perform a simple check to determine if the browser is capable of\r
+// converting a NodeList to an array using builtin methods.\r
+// Also verifies that the returned array holds DOM nodes\r
+// (which is not the case in the Blackberry browser)\r
+try {\r
+ Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;\r
+\r
+// Provide a fallback method if it does not work\r
+} catch(e){\r
+ makeArray = function(array, results) {\r
+ var ret = results || [], i = 0;\r
+\r
+ if ( toString.call(array) === "[object Array]" ) {\r
+ Array.prototype.push.apply( ret, array );\r
+ } else {\r
+ if ( typeof array.length === "number" ) {\r
+ for ( var l = array.length; i < l; i++ ) {\r
+ ret.push( array[i] );\r
+ }\r
+ } else {\r
+ for ( ; array[i]; i++ ) {\r
+ ret.push( array[i] );\r
+ }\r
+ }\r
+ }\r
+\r
+ return ret;\r
+ };\r
+}\r
+\r
+var sortOrder;\r
+\r
+if ( document.documentElement.compareDocumentPosition ) {\r
+ sortOrder = function( a, b ) {\r
+ if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {\r
+ if ( a == b ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return a.compareDocumentPosition ? -1 : 1;\r
+ }\r
+\r
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;\r
+ if ( ret === 0 ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return ret;\r
+ };\r
+} else if ( "sourceIndex" in document.documentElement ) {\r
+ sortOrder = function( a, b ) {\r
+ if ( !a.sourceIndex || !b.sourceIndex ) {\r
+ if ( a == b ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return a.sourceIndex ? -1 : 1;\r
+ }\r
+\r
+ var ret = a.sourceIndex - b.sourceIndex;\r
+ if ( ret === 0 ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return ret;\r
+ };\r
+} else if ( document.createRange ) {\r
+ sortOrder = function( a, b ) {\r
+ if ( !a.ownerDocument || !b.ownerDocument ) {\r
+ if ( a == b ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return a.ownerDocument ? -1 : 1;\r
+ }\r
+\r
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();\r
+ aRange.setStart(a, 0);\r
+ aRange.setEnd(a, 0);\r
+ bRange.setStart(b, 0);\r
+ bRange.setEnd(b, 0);\r
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);\r
+ if ( ret === 0 ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return ret;\r
+ };\r
+}\r
+\r
+// Utility function for retreiving the text value of an array of DOM nodes\r
+Sizzle.getText = function( elems ) {\r
+ var ret = "", elem;\r
+\r
+ for ( var i = 0; elems[i]; i++ ) {\r
+ elem = elems[i];\r
+\r
+ // Get the text from text nodes and CDATA nodes\r
+ if ( elem.nodeType === 3 || elem.nodeType === 4 ) {\r
+ ret += elem.nodeValue;\r
+\r
+ // Traverse everything else, except comment nodes\r
+ } else if ( elem.nodeType !== 8 ) {\r
+ ret += Sizzle.getText( elem.childNodes );\r
+ }\r
+ }\r
+\r
+ return ret;\r
+};\r
+\r
+// Check to see if the browser returns elements by name when\r
+// querying by getElementById (and provide a workaround)\r
+(function(){\r
+ // We're going to inject a fake input element with a specified name\r
+ var form = document.createElement("div"),\r
+ id = "script" + (new Date()).getTime();\r
+ form.innerHTML = "<a name='" + id + "'/>";\r
+\r
+ // Inject it into the root element, check its status, and remove it quickly\r
+ var root = document.documentElement;\r
+ root.insertBefore( form, root.firstChild );\r
+\r
+ // The workaround has to do additional checks after a getElementById\r
+ // Which slows things down for other browsers (hence the branching)\r
+ if ( document.getElementById( id ) ) {\r
+ Expr.find.ID = function(match, context, isXML){\r
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {\r
+ var m = context.getElementById(match[1]);\r
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];\r
+ }\r
+ };\r
+\r
+ Expr.filter.ID = function(elem, match){\r
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");\r
+ return elem.nodeType === 1 && node && node.nodeValue === match;\r
+ };\r
+ }\r
+\r
+ root.removeChild( form );\r
+ root = form = null; // release memory in IE\r
+})();\r
+\r
+(function(){\r
+ // Check to see if the browser returns only elements\r
+ // when doing getElementsByTagName("*")\r
+\r
+ // Create a fake element\r
+ var div = document.createElement("div");\r
+ div.appendChild( document.createComment("") );\r
+\r
+ // Make sure no comments are found\r
+ if ( div.getElementsByTagName("*").length > 0 ) {\r
+ Expr.find.TAG = function(match, context){\r
+ var results = context.getElementsByTagName(match[1]);\r
+\r
+ // Filter out possible comments\r
+ if ( match[1] === "*" ) {\r
+ var tmp = [];\r
+\r
+ for ( var i = 0; results[i]; i++ ) {\r
+ if ( results[i].nodeType === 1 ) {\r
+ tmp.push( results[i] );\r
+ }\r
+ }\r
+\r
+ results = tmp;\r
+ }\r
+\r
+ return results;\r
+ };\r
+ }\r
+\r
+ // Check to see if an attribute returns normalized href attributes\r
+ div.innerHTML = "<a href='#'></a>";\r
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&\r
+ div.firstChild.getAttribute("href") !== "#" ) {\r
+ Expr.attrHandle.href = function(elem){\r
+ return elem.getAttribute("href", 2);\r
+ };\r
+ }\r
+\r
+ div = null; // release memory in IE\r
+})();\r
+\r
+if ( document.querySelectorAll ) {\r
+ (function(){\r
+ var oldSizzle = Sizzle, div = document.createElement("div");\r
+ div.innerHTML = "<p class='TEST'></p>";\r
+\r
+ // Safari can't handle uppercase or unicode characters when\r
+ // in quirks mode.\r
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {\r
+ return;\r
+ }\r
+ \r
+ Sizzle = function(query, context, extra, seed){\r
+ context = context || document;\r
+\r
+ // Only use querySelectorAll on non-XML documents\r
+ // (ID selectors don't work in non-HTML documents)\r
+ if ( !seed && context.nodeType === 9 && !Sizzle.isXML(context) ) {\r
+ try {\r
+ return makeArray( context.querySelectorAll(query), extra );\r
+ } catch(e){}\r
+ }\r
+ \r
+ return oldSizzle(query, context, extra, seed);\r
+ };\r
+\r
+ for ( var prop in oldSizzle ) {\r
+ Sizzle[ prop ] = oldSizzle[ prop ];\r
+ }\r
+\r
+ div = null; // release memory in IE\r
+ })();\r
+}\r
+\r
+(function(){\r
+ var div = document.createElement("div");\r
+\r
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";\r
+\r
+ // Opera can't find a second classname (in 9.6)\r
+ // Also, make sure that getElementsByClassName actually exists\r
+ if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {\r
+ return;\r
+ }\r
+\r
+ // Safari caches class attributes, doesn't catch changes (in 3.2)\r
+ div.lastChild.className = "e";\r
+\r
+ if ( div.getElementsByClassName("e").length === 1 ) {\r
+ return;\r
+ }\r
+ \r
+ Expr.order.splice(1, 0, "CLASS");\r
+ Expr.find.CLASS = function(match, context, isXML) {\r
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {\r
+ return context.getElementsByClassName(match[1]);\r
+ }\r
+ };\r
+\r
+ div = null; // release memory in IE\r
+})();\r
+\r
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
+ var elem = checkSet[i];\r
+ if ( elem ) {\r
+ elem = elem[dir];\r
+ var match = false;\r
+\r
+ while ( elem ) {\r
+ if ( elem.sizcache === doneName ) {\r
+ match = checkSet[elem.sizset];\r
+ break;\r
+ }\r
+\r
+ if ( elem.nodeType === 1 && !isXML ){\r
+ elem.sizcache = doneName;\r
+ elem.sizset = i;\r
+ }\r
+\r
+ if ( elem.nodeName.toLowerCase() === cur ) {\r
+ match = elem;\r
+ break;\r
+ }\r
+\r
+ elem = elem[dir];\r
+ }\r
+\r
+ checkSet[i] = match;\r
+ }\r
+ }\r
+}\r
+\r
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {\r
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {\r
+ var elem = checkSet[i];\r
+ if ( elem ) {\r
+ elem = elem[dir];\r
+ var match = false;\r
+\r
+ while ( elem ) {\r
+ if ( elem.sizcache === doneName ) {\r
+ match = checkSet[elem.sizset];\r
+ break;\r
+ }\r
+\r
+ if ( elem.nodeType === 1 ) {\r
+ if ( !isXML ) {\r
+ elem.sizcache = doneName;\r
+ elem.sizset = i;\r
+ }\r
+ if ( typeof cur !== "string" ) {\r
+ if ( elem === cur ) {\r
+ match = true;\r
+ break;\r
+ }\r
+\r
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {\r
+ match = elem;\r
+ break;\r
+ }\r
+ }\r
+\r
+ elem = elem[dir];\r
+ }\r
+\r
+ checkSet[i] = match;\r
+ }\r
+ }\r
+}\r
+\r
+Sizzle.contains = document.compareDocumentPosition ? function(a, b){\r
+ return !!(a.compareDocumentPosition(b) & 16);\r
+} : function(a, b){\r
+ return a !== b && (a.contains ? a.contains(b) : true);\r
+};\r
+\r
+Sizzle.isXML = function(elem){\r
+ // documentElement is verified for cases where it doesn't yet exist\r
+ // (such as loading iframes in IE - #4833) \r
+ var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;\r
+ return documentElement ? documentElement.nodeName !== "HTML" : false;\r
+};\r
+\r
+var posProcess = function(selector, context){\r
+ var tmpSet = [], later = "", match,\r
+ root = context.nodeType ? [context] : context;\r
+\r
+ // Position selectors must be done after the filter\r
+ // And so must :not(positional) so we move all PSEUDOs to the end\r
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {\r
+ later += match[0];\r
+ selector = selector.replace( Expr.match.PSEUDO, "" );\r
+ }\r
+\r
+ selector = Expr.relative[selector] ? selector + "*" : selector;\r
+\r
+ for ( var i = 0, l = root.length; i < l; i++ ) {\r
+ Sizzle( selector, root[i], tmpSet );\r
+ }\r
+\r
+ return Sizzle.filter( later, tmpSet );\r
+};\r
+\r
+// EXPOSE\r
+\r
+window.tinymce.dom.Sizzle = Sizzle;\r
+\r
+})();\r
+\r
+\r
+(function(tinymce) {\r
+ // Shorten names\r
+ var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event;\r
+\r
+ tinymce.create('tinymce.dom.EventUtils', {\r
+ EventUtils : function() {\r
+ this.inits = [];\r
+ this.events = [];\r
+ },\r
+\r
+ add : function(o, n, f, s) {\r
+ var cb, t = this, el = t.events, r;\r
+\r
+ if (n instanceof Array) {\r
+ r = [];\r
+\r
+ each(n, function(n) {\r
+ r.push(t.add(o, n, f, s));\r
+ });\r
+\r
+ return r;\r
+ }\r
+\r
+ // Handle array\r
+ if (o && o.hasOwnProperty && o instanceof Array) {\r
+ r = [];\r
+\r
+ each(o, function(o) {\r
+ o = DOM.get(o);\r
+ r.push(t.add(o, n, f, s));\r
+ });\r
+\r
+ return r;\r
+ }\r
+\r
+ o = DOM.get(o);\r
+\r
+ if (!o)\r
+ return;\r
+\r
+ // Setup event callback\r
+ cb = function(e) {\r
+ // Is all events disabled\r
+ if (t.disabled)\r
+ return;\r
+\r
+ e = e || window.event;\r
+\r
+ // Patch in target, preventDefault and stopPropagation in IE it's W3C valid\r
+ if (e && isIE) {\r
+ if (!e.target)\r
+ e.target = e.srcElement;\r
+\r
+ // Patch in preventDefault, stopPropagation methods for W3C compatibility\r
+ tinymce.extend(e, t._stoppers);\r
+ }\r
+\r
+ if (!s)\r
+ return f(e);\r
+\r
+ return f.call(s, e);\r
+ };\r
+\r
+ if (n == 'unload') {\r
+ tinymce.unloads.unshift({func : cb});\r
+ return cb;\r
+ }\r
+\r
+ if (n == 'init') {\r
+ if (t.domLoaded)\r
+ cb();\r
+ else\r
+ t.inits.push(cb);\r
+\r
+ return cb;\r
+ }\r
+\r
+ // Store away listener reference\r
+ el.push({\r
+ obj : o,\r
+ name : n,\r
+ func : f,\r
+ cfunc : cb,\r
+ scope : s\r
+ });\r
+\r
+ t._add(o, n, cb);\r
+\r
+ return f;\r
+ },\r
+\r
+ remove : function(o, n, f) {\r
+ var t = this, a = t.events, s = false, r;\r
+\r
+ // Handle array\r
+ if (o && o.hasOwnProperty && o instanceof Array) {\r
+ r = [];\r
+\r
+ each(o, function(o) {\r
+ o = DOM.get(o);\r
+ r.push(t.remove(o, n, f));\r
+ });\r
+\r
+ return r;\r
+ }\r
+\r
+ o = DOM.get(o);\r
+\r
+ each(a, function(e, i) {\r
+ if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) {\r
+ a.splice(i, 1);\r
+ t._remove(o, n, e.cfunc);\r
+ s = true;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return s;\r
+ },\r
+\r
+ clear : function(o) {\r
+ var t = this, a = t.events, i, e;\r
+\r
+ if (o) {\r
+ o = DOM.get(o);\r
+\r
+ for (i = a.length - 1; i >= 0; i--) {\r
+ e = a[i];\r
+\r
+ if (e.obj === o) {\r
+ t._remove(e.obj, e.name, e.cfunc);\r
+ e.obj = e.cfunc = null;\r
+ a.splice(i, 1);\r
+ }\r
+ }\r
+ }\r
+ },\r
+\r
+ cancel : function(e) {\r
+ if (!e)\r
+ return false;\r
+\r
+ this.stop(e);\r
+\r
+ return this.prevent(e);\r
+ },\r
+\r
+ stop : function(e) {\r
+ if (e.stopPropagation)\r
+ e.stopPropagation();\r
+ else\r
+ e.cancelBubble = true;\r
+\r
+ return false;\r
+ },\r
+\r
+ prevent : function(e) {\r
+ if (e.preventDefault)\r
+ e.preventDefault();\r
+ else\r
+ e.returnValue = false;\r
+\r
+ return false;\r
+ },\r
+\r
+ destroy : function() {\r
+ var t = this;\r
+\r
+ each(t.events, function(e, i) {\r
+ t._remove(e.obj, e.name, e.cfunc);\r
+ e.obj = e.cfunc = null;\r
+ });\r
+\r
+ t.events = [];\r
+ t = null;\r
+ },\r
+\r
+ _add : function(o, n, f) {\r
+ if (o.attachEvent)\r
+ o.attachEvent('on' + n, f);\r
+ else if (o.addEventListener)\r
+ o.addEventListener(n, f, false);\r
+ else\r
+ o['on' + n] = f;\r
+ },\r
+\r
+ _remove : function(o, n, f) {\r
+ if (o) {\r
+ try {\r
+ if (o.detachEvent)\r
+ o.detachEvent('on' + n, f);\r
+ else if (o.removeEventListener)\r
+ o.removeEventListener(n, f, false);\r
+ else\r
+ o['on' + n] = null;\r
+ } catch (ex) {\r
+ // Might fail with permission denined on IE so we just ignore that\r
+ }\r
+ }\r
+ },\r
+\r
+ _pageInit : function(win) {\r
+ var t = this;\r
+\r
+ // Keep it from running more than once\r
+ if (t.domLoaded)\r
+ return;\r
+\r
+ t.domLoaded = true;\r
+\r
+ each(t.inits, function(c) {\r
+ c();\r
+ });\r
+\r
+ t.inits = [];\r
+ },\r
+\r
+ _wait : function(win) {\r
+ var t = this, doc = win.document;\r
+\r
+ // No need since the document is already loaded\r
+ if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) {\r
+ t.domLoaded = 1;\r
+ return;\r
+ }\r
+\r
+ // Use IE method\r
+ if (doc.attachEvent) {\r
+ doc.attachEvent("onreadystatechange", function() {\r
+ if (doc.readyState === "complete") {\r
+ doc.detachEvent("onreadystatechange", arguments.callee);\r
+ t._pageInit(win);\r
+ }\r
+ });\r
+\r
+ if (doc.documentElement.doScroll && win == win.top) {\r
+ (function() {\r
+ if (t.domLoaded)\r
+ return;\r
+\r
+ try {\r
+ // If IE is used, use the trick by Diego Perini\r
+ // http://javascript.nwbox.com/IEContentLoaded/\r
+ doc.documentElement.doScroll("left");\r
+ } catch (ex) {\r
+ setTimeout(arguments.callee, 0);\r
+ return;\r
+ }\r
+\r
+ t._pageInit(win);\r
+ })();\r
+ }\r
+ } else if (doc.addEventListener) {\r
+ t._add(win, 'DOMContentLoaded', function() {\r
+ t._pageInit(win);\r
+ });\r
+ }\r
+\r
+ t._add(win, 'load', function() {\r
+ t._pageInit(win);\r
+ });\r
+ },\r
+\r
+ _stoppers : {\r
+ preventDefault : function() {\r
+ this.returnValue = false;\r
+ },\r
+\r
+ stopPropagation : function() {\r
+ this.cancelBubble = true;\r
+ }\r
+ }\r
+ });\r
+\r
+ Event = tinymce.dom.Event = new tinymce.dom.EventUtils();\r
+\r
+ // Dispatch DOM content loaded event for IE and Safari\r
+ Event._wait(window);\r
+\r
+ tinymce.addUnload(function() {\r
+ Event.destroy();\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ tinymce.dom.Element = function(id, settings) {\r
+ var t = this, dom, el;\r
+\r
+ t.settings = settings = settings || {};\r
+ t.id = id;\r
+ t.dom = dom = settings.dom || tinymce.DOM;\r
+\r
+ // Only IE leaks DOM references, this is a lot faster\r
+ if (!tinymce.isIE)\r
+ el = dom.get(t.id);\r
+\r
+ tinymce.each(\r
+ ('getPos,getRect,getParent,add,setStyle,getStyle,setStyles,' + \r
+ 'setAttrib,setAttribs,getAttrib,addClass,removeClass,' + \r
+ 'hasClass,getOuterHTML,setOuterHTML,remove,show,hide,' + \r
+ 'isHidden,setHTML,get').split(/,/)\r
+ , function(k) {\r
+ t[k] = function() {\r
+ var a = [id], i;\r
+\r
+ for (i = 0; i < arguments.length; i++)\r
+ a.push(arguments[i]);\r
+\r
+ a = dom[k].apply(dom, a);\r
+ t.update(k);\r
+\r
+ return a;\r
+ };\r
+ });\r
+\r
+ tinymce.extend(t, {\r
+ on : function(n, f, s) {\r
+ return tinymce.dom.Event.add(t.id, n, f, s);\r
+ },\r
+\r
+ getXY : function() {\r
+ return {\r
+ x : parseInt(t.getStyle('left')),\r
+ y : parseInt(t.getStyle('top'))\r
+ };\r
+ },\r
+\r
+ getSize : function() {\r
+ var n = dom.get(t.id);\r
+\r
+ return {\r
+ w : parseInt(t.getStyle('width') || n.clientWidth),\r
+ h : parseInt(t.getStyle('height') || n.clientHeight)\r
+ };\r
+ },\r
+\r
+ moveTo : function(x, y) {\r
+ t.setStyles({left : x, top : y});\r
+ },\r
+\r
+ moveBy : function(x, y) {\r
+ var p = t.getXY();\r
+\r
+ t.moveTo(p.x + x, p.y + y);\r
+ },\r
+\r
+ resizeTo : function(w, h) {\r
+ t.setStyles({width : w, height : h});\r
+ },\r
+\r
+ resizeBy : function(w, h) {\r
+ var s = t.getSize();\r
+\r
+ t.resizeTo(s.w + w, s.h + h);\r
+ },\r
+\r
+ update : function(k) {\r
+ var b;\r
+\r
+ if (tinymce.isIE6 && settings.blocker) {\r
+ k = k || '';\r
+\r
+ // Ignore getters\r
+ if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0)\r
+ return;\r
+\r
+ // Remove blocker on remove\r
+ if (k == 'remove') {\r
+ dom.remove(t.blocker);\r
+ return;\r
+ }\r
+\r
+ if (!t.blocker) {\r
+ t.blocker = dom.uniqueId();\r
+ b = dom.add(settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'});\r
+ dom.setStyle(b, 'opacity', 0);\r
+ } else\r
+ b = dom.get(t.blocker);\r
+\r
+ dom.setStyles(b, {\r
+ left : t.getStyle('left', 1),\r
+ top : t.getStyle('top', 1),\r
+ width : t.getStyle('width', 1),\r
+ height : t.getStyle('height', 1),\r
+ display : t.getStyle('display', 1),\r
+ zIndex : parseInt(t.getStyle('zIndex', 1) || 0) - 1\r
+ });\r
+ }\r
+ }\r
+ });\r
+ };\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ function trimNl(s) {\r
+ return s.replace(/[\n\r]+/g, '');\r
+ };\r
+\r
+ // Shorten names\r
+ var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.dom.Selection', {\r
+ Selection : function(dom, win, serializer) {\r
+ var t = this;\r
+\r
+ t.dom = dom;\r
+ t.win = win;\r
+ t.serializer = serializer;\r
+\r
+ // Add events\r
+ each([\r
+ 'onBeforeSetContent',\r
+ 'onBeforeGetContent',\r
+ 'onSetContent',\r
+ 'onGetContent'\r
+ ], function(e) {\r
+ t[e] = new tinymce.util.Dispatcher(t);\r
+ });\r
+\r
+ // No W3C Range support\r
+ if (!t.win.getSelection)\r
+ t.tridentSel = new tinymce.dom.TridentSelection(t);\r
+\r
+ // Prevent leaks\r
+ tinymce.addUnload(t.destroy, t);\r
+ },\r
+\r
+ getContent : function(s) {\r
+ var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n;\r
+\r
+ s = s || {};\r
+ wb = wa = '';\r
+ s.get = true;\r
+ s.format = s.format || 'html';\r
+ t.onBeforeGetContent.dispatch(t, s);\r
+\r
+ if (s.format == 'text')\r
+ return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : ''));\r
+\r
+ if (r.cloneContents) {\r
+ n = r.cloneContents();\r
+\r
+ if (n)\r
+ e.appendChild(n);\r
+ } else if (is(r.item) || is(r.htmlText))\r
+ e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;\r
+ else\r
+ e.innerHTML = r.toString();\r
+\r
+ // Keep whitespace before and after\r
+ if (/^\s/.test(e.innerHTML))\r
+ wb = ' ';\r
+\r
+ if (/\s+$/.test(e.innerHTML))\r
+ wa = ' ';\r
+\r
+ s.getInner = true;\r
+\r
+ s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa;\r
+ t.onGetContent.dispatch(t, s);\r
+\r
+ return s.content;\r
+ },\r
+\r
+ setContent : function(h, s) {\r
+ var t = this, r = t.getRng(), c, d = t.win.document;\r
+\r
+ s = s || {format : 'html'};\r
+ s.set = true;\r
+ h = s.content = t.dom.processHTML(h);\r
+\r
+ // Dispatch before set content event\r
+ t.onBeforeSetContent.dispatch(t, s);\r
+ h = s.content;\r
+\r
+ if (r.insertNode) {\r
+ // Make caret marker since insertNode places the caret in the beginning of text after insert\r
+ h += '<span id="__caret">_</span>';\r
+\r
+ // Delete and insert new node\r
+ \r
+ if (r.startContainer == d && r.endContainer == d) {\r
+ // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents\r
+ d.body.innerHTML = h;\r
+ } else {\r
+ r.deleteContents();\r
+ if (d.body.childNodes.length == 0) {\r
+ d.body.innerHTML = h;\r
+ } else {\r
+ r.insertNode(r.createContextualFragment(h));\r
+ }\r
+ }\r
+\r
+ // Move to caret marker\r
+ c = t.dom.get('__caret');\r
+ // Make sure we wrap it compleatly, Opera fails with a simple select call\r
+ r = d.createRange();\r
+ r.setStartBefore(c);\r
+ r.setEndBefore(c);\r
+ t.setRng(r);\r
+\r
+ // Remove the caret position\r
+ t.dom.remove('__caret');\r
+ } else {\r
+ if (r.item) {\r
+ // Delete content and get caret text selection\r
+ d.execCommand('Delete', false, null);\r
+ r = t.getRng();\r
+ }\r
+\r
+ r.pasteHTML(h);\r
+ }\r
+\r
+ // Dispatch set content event\r
+ t.onSetContent.dispatch(t, s);\r
+ },\r
+\r
+ getStart : function() {\r
+ var rng = this.getRng(), startElement, parentElement, checkRng, node;\r
+\r
+ if (rng.duplicate || rng.item) {\r
+ // Control selection, return first item\r
+ if (rng.item)\r
+ return rng.item(0);\r
+\r
+ // Get start element\r
+ checkRng = rng.duplicate();\r
+ checkRng.collapse(1);\r
+ startElement = checkRng.parentElement();\r
+\r
+ // Check if range parent is inside the start element, then return the inner parent element\r
+ // This will fix issues when a single element is selected, IE would otherwise return the wrong start element\r
+ parentElement = node = rng.parentElement();\r
+ while (node = node.parentNode) {\r
+ if (node == startElement) {\r
+ startElement = parentElement;\r
+ break;\r
+ }\r
+ }\r
+\r
+ // If start element is body element try to move to the first child if it exists\r
+ if (startElement && startElement.nodeName == 'BODY')\r
+ return startElement.firstChild || startElement;\r
+\r
+ return startElement;\r
+ } else {\r
+ startElement = rng.startContainer;\r
+\r
+ if (startElement.nodeType == 1 && startElement.hasChildNodes())\r
+ startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)];\r
+\r
+ if (startElement && startElement.nodeType == 3)\r
+ return startElement.parentNode;\r
+\r
+ return startElement;\r
+ }\r
+ },\r
+\r
+ getEnd : function() {\r
+ var t = this, r = t.getRng(), e, eo;\r
+\r
+ if (r.duplicate || r.item) {\r
+ if (r.item)\r
+ return r.item(0);\r
+\r
+ r = r.duplicate();\r
+ r.collapse(0);\r
+ e = r.parentElement();\r
+\r
+ if (e && e.nodeName == 'BODY')\r
+ return e.lastChild || e;\r
+\r
+ return e;\r
+ } else {\r
+ e = r.endContainer;\r
+ eo = r.endOffset;\r
+\r
+ if (e.nodeType == 1 && e.hasChildNodes())\r
+ e = e.childNodes[eo > 0 ? eo - 1 : eo];\r
+\r
+ if (e && e.nodeType == 3)\r
+ return e.parentNode;\r
+\r
+ return e;\r
+ }\r
+ },\r
+\r
+ getBookmark : function(type, normalized) {\r
+ var t = this, dom = t.dom, rng, rng2, id, collapsed, name, element, index, chr = '\uFEFF', styles;\r
+\r
+ function findIndex(name, element) {\r
+ var index = 0;\r
+\r
+ each(dom.select(name), function(node, i) {\r
+ if (node == element)\r
+ index = i;\r
+ });\r
+\r
+ return index;\r
+ };\r
+\r
+ if (type == 2) {\r
+ function getLocation() {\r
+ var rng = t.getRng(true), root = dom.getRoot(), bookmark = {};\r
+\r
+ function getPoint(rng, start) {\r
+ var container = rng[start ? 'startContainer' : 'endContainer'],\r
+ offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0;\r
+\r
+ if (container.nodeType == 3) {\r
+ if (normalized) {\r
+ for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling)\r
+ offset += node.nodeValue.length;\r
+ }\r
+\r
+ point.push(offset);\r
+ } else {\r
+ childNodes = container.childNodes;\r
+\r
+ if (offset >= childNodes.length && childNodes.length) {\r
+ after = 1;\r
+ offset = Math.max(0, childNodes.length - 1);\r
+ }\r
+\r
+ point.push(t.dom.nodeIndex(childNodes[offset], normalized) + after);\r
+ }\r
+\r
+ for (; container && container != root; container = container.parentNode)\r
+ point.push(t.dom.nodeIndex(container, normalized));\r
+\r
+ return point;\r
+ };\r
+\r
+ bookmark.start = getPoint(rng, true);\r
+\r
+ if (!t.isCollapsed())\r
+ bookmark.end = getPoint(rng);\r
+\r
+ return bookmark;\r
+ };\r
+\r
+ return getLocation();\r
+ }\r
+\r
+ // Handle simple range\r
+ if (type)\r
+ return {rng : t.getRng()};\r
+\r
+ rng = t.getRng();\r
+ id = dom.uniqueId();\r
+ collapsed = tinyMCE.activeEditor.selection.isCollapsed();\r
+ styles = 'overflow:hidden;line-height:0px';\r
+\r
+ // Explorer method\r
+ if (rng.duplicate || rng.item) {\r
+ // Text selection\r
+ if (!rng.item) {\r
+ rng2 = rng.duplicate();\r
+\r
+ // Insert start marker\r
+ rng.collapse();\r
+ rng.pasteHTML('<span _mce_type="bookmark" id="' + id + '_start" style="' + styles + '">' + chr + '</span>');\r
+\r
+ // Insert end marker\r
+ if (!collapsed) {\r
+ rng2.collapse(false);\r
+ rng2.pasteHTML('<span _mce_type="bookmark" id="' + id + '_end" style="' + styles + '">' + chr + '</span>');\r
+ }\r
+ } else {\r
+ // Control selection\r
+ element = rng.item(0);\r
+ name = element.nodeName;\r
+\r
+ return {name : name, index : findIndex(name, element)};\r
+ }\r
+ } else {\r
+ element = t.getNode();\r
+ name = element.nodeName;\r
+ if (name == 'IMG')\r
+ return {name : name, index : findIndex(name, element)};\r
+\r
+ // W3C method\r
+ rng2 = rng.cloneRange();\r
+\r
+ // Insert end marker\r
+ if (!collapsed) {\r
+ rng2.collapse(false);\r
+ rng2.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_end', style : styles}, chr));\r
+ }\r
+\r
+ rng.collapse(true);\r
+ rng.insertNode(dom.create('span', {_mce_type : "bookmark", id : id + '_start', style : styles}, chr));\r
+ }\r
+\r
+ t.moveToBookmark({id : id, keep : 1});\r
+\r
+ return {id : id};\r
+ },\r
+\r
+ moveToBookmark : function(bookmark) {\r
+ var t = this, dom = t.dom, marker1, marker2, rng, root, startContainer, endContainer, startOffset, endOffset;\r
+\r
+ // Clear selection cache\r
+ if (t.tridentSel)\r
+ t.tridentSel.destroy();\r
+\r
+ if (bookmark) {\r
+ if (bookmark.start) {\r
+ rng = dom.createRng();\r
+ root = dom.getRoot();\r
+\r
+ function setEndPoint(start) {\r
+ var point = bookmark[start ? 'start' : 'end'], i, node, offset, children;\r
+\r
+ if (point) {\r
+ // Find container node\r
+ for (node = root, i = point.length - 1; i >= 1; i--) {\r
+ children = node.childNodes;\r
+\r
+ if (children.length)\r
+ node = children[point[i]];\r
+ }\r
+\r
+ // Set offset within container node\r
+ if (start)\r
+ rng.setStart(node, point[0]);\r
+ else\r
+ rng.setEnd(node, point[0]);\r
+ }\r
+ };\r
+\r
+ setEndPoint(true);\r
+ setEndPoint();\r
+\r
+ t.setRng(rng);\r
+ } else if (bookmark.id) {\r
+ function restoreEndPoint(suffix) {\r
+ var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep;\r
+\r
+ if (marker) {\r
+ node = marker.parentNode;\r
+\r
+ if (suffix == 'start') {\r
+ if (!keep) {\r
+ idx = dom.nodeIndex(marker);\r
+ } else {\r
+ node = marker.firstChild;\r
+ idx = 1;\r
+ }\r
+\r
+ startContainer = endContainer = node;\r
+ startOffset = endOffset = idx;\r
+ } else {\r
+ if (!keep) {\r
+ idx = dom.nodeIndex(marker);\r
+ } else {\r
+ node = marker.firstChild;\r
+ idx = 1;\r
+ }\r
+\r
+ endContainer = node;\r
+ endOffset = idx;\r
+ }\r
+\r
+ if (!keep) {\r
+ prev = marker.previousSibling;\r
+ next = marker.nextSibling;\r
+\r
+ // Remove all marker text nodes\r
+ each(tinymce.grep(marker.childNodes), function(node) {\r
+ if (node.nodeType == 3)\r
+ node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');\r
+ });\r
+\r
+ // Remove marker but keep children if for example contents where inserted into the marker\r
+ // Also remove duplicated instances of the marker for example by a split operation or by WebKit auto split on paste feature\r
+ while (marker = dom.get(bookmark.id + '_' + suffix))\r
+ dom.remove(marker, 1);\r
+\r
+ // If siblings are text nodes then merge them\r
+ if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3) {\r
+ idx = prev.nodeValue.length;\r
+ prev.appendData(next.nodeValue);\r
+ dom.remove(next);\r
+\r
+ if (suffix == 'start') {\r
+ startContainer = endContainer = prev;\r
+ startOffset = endOffset = idx;\r
+ } else {\r
+ endContainer = prev;\r
+ endOffset = idx;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ };\r
+\r
+ function addBogus(node) {\r
+ // Adds a bogus BR element for empty block elements\r
+ // on non IE browsers just to have a place to put the caret\r
+ if (!isIE && dom.isBlock(node) && !node.innerHTML)\r
+ node.innerHTML = '<br _mce_bogus="1" />';\r
+\r
+ return node;\r
+ };\r
+\r
+ // Restore start/end points\r
+ restoreEndPoint('start');\r
+ restoreEndPoint('end');\r
+\r
+ rng = dom.createRng();\r
+ rng.setStart(addBogus(startContainer), startOffset);\r
+ rng.setEnd(addBogus(endContainer), endOffset);\r
+ t.setRng(rng);\r
+ } else if (bookmark.name) {\r
+ t.select(dom.select(bookmark.name)[bookmark.index]);\r
+ } else if (bookmark.rng)\r
+ t.setRng(bookmark.rng);\r
+ }\r
+ },\r
+\r
+ select : function(node, content) {\r
+ var t = this, dom = t.dom, rng = dom.createRng(), idx;\r
+\r
+ idx = dom.nodeIndex(node);\r
+ rng.setStart(node.parentNode, idx);\r
+ rng.setEnd(node.parentNode, idx + 1);\r
+\r
+ // Find first/last text node or BR element\r
+ if (content) {\r
+ function setPoint(node, start) {\r
+ var walker = new tinymce.dom.TreeWalker(node, node);\r
+\r
+ do {\r
+ // Text node\r
+ if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {\r
+ if (start)\r
+ rng.setStart(node, 0);\r
+ else\r
+ rng.setEnd(node, node.nodeValue.length);\r
+\r
+ return;\r
+ }\r
+\r
+ // BR element\r
+ if (node.nodeName == 'BR') {\r
+ if (start)\r
+ rng.setStartBefore(node);\r
+ else\r
+ rng.setEndBefore(node);\r
+\r
+ return;\r
+ }\r
+ } while (node = (start ? walker.next() : walker.prev()));\r
+ };\r
+\r
+ setPoint(node, 1);\r
+ setPoint(node);\r
+ }\r
+\r
+ t.setRng(rng);\r
+\r
+ return node;\r
+ },\r
+\r
+ isCollapsed : function() {\r
+ var t = this, r = t.getRng(), s = t.getSel();\r
+\r
+ if (!r || r.item)\r
+ return false;\r
+\r
+ if (r.compareEndPoints)\r
+ return r.compareEndPoints('StartToEnd', r) === 0;\r
+\r
+ return !s || r.collapsed;\r
+ },\r
+\r
+ collapse : function(b) {\r
+ var t = this, r = t.getRng(), n;\r
+\r
+ // Control range on IE\r
+ if (r.item) {\r
+ n = r.item(0);\r
+ r = this.win.document.body.createTextRange();\r
+ r.moveToElementText(n);\r
+ }\r
+\r
+ r.collapse(!!b);\r
+ t.setRng(r);\r
+ },\r
+\r
+ getSel : function() {\r
+ var t = this, w = this.win;\r
+\r
+ return w.getSelection ? w.getSelection() : w.document.selection;\r
+ },\r
+\r
+ getRng : function(w3c) {\r
+ var t = this, s, r;\r
+\r
+ // Found tridentSel object then we need to use that one\r
+ if (w3c && t.tridentSel)\r
+ return t.tridentSel.getRangeAt(0);\r
+\r
+ try {\r
+ if (s = t.getSel())\r
+ r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange());\r
+ } catch (ex) {\r
+ // IE throws unspecified error here if TinyMCE is placed in a frame/iframe\r
+ }\r
+\r
+ // No range found then create an empty one\r
+ // This can occur when the editor is placed in a hidden container element on Gecko\r
+ // Or on IE when there was an exception\r
+ if (!r)\r
+ r = t.win.document.createRange ? t.win.document.createRange() : t.win.document.body.createTextRange();\r
+\r
+ if (t.selectedRange && t.explicitRange) {\r
+ if (r.compareBoundaryPoints(r.START_TO_START, t.selectedRange) === 0 && r.compareBoundaryPoints(r.END_TO_END, t.selectedRange) === 0) {\r
+ // Safari, Opera and Chrome only ever select text which causes the range to change.\r
+ // This lets us use the originally set range if the selection hasn't been changed by the user.\r
+ r = t.explicitRange;\r
+ } else {\r
+ t.selectedRange = null;\r
+ t.explicitRange = null;\r
+ }\r
+ }\r
+ return r;\r
+ },\r
+\r
+ setRng : function(r) {\r
+ var s, t = this;\r
+ \r
+ if (!t.tridentSel) {\r
+ s = t.getSel();\r
+\r
+ if (s) {\r
+ t.explicitRange = r;\r
+ s.removeAllRanges();\r
+ s.addRange(r);\r
+ t.selectedRange = s.getRangeAt(0);\r
+ }\r
+ } else {\r
+ // Is W3C Range\r
+ if (r.cloneRange) {\r
+ t.tridentSel.addRange(r);\r
+ return;\r
+ }\r
+\r
+ // Is IE specific range\r
+ try {\r
+ r.select();\r
+ } catch (ex) {\r
+ // Needed for some odd IE bug #1843306\r
+ }\r
+ }\r
+ },\r
+\r
+ setNode : function(n) {\r
+ var t = this;\r
+\r
+ t.setContent(t.dom.getOuterHTML(n));\r
+\r
+ return n;\r
+ },\r
+\r
+ getNode : function() {\r
+ var t = this, rng = t.getRng(), sel = t.getSel(), elm;\r
+\r
+ if (rng.setStart) {\r
+ // Range maybe lost after the editor is made visible again\r
+ if (!rng)\r
+ return t.dom.getRoot();\r
+\r
+ elm = rng.commonAncestorContainer;\r
+\r
+ // Handle selection a image or other control like element such as anchors\r
+ if (!rng.collapsed) {\r
+ if (rng.startContainer == rng.endContainer) {\r
+ if (rng.startOffset - rng.endOffset < 2) {\r
+ if (rng.startContainer.hasChildNodes())\r
+ elm = rng.startContainer.childNodes[rng.startOffset];\r
+ }\r
+ }\r
+\r
+ // If the anchor node is a element instead of a text node then return this element\r
+ if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) \r
+ return sel.anchorNode.childNodes[sel.anchorOffset]; \r
+ }\r
+\r
+ if (elm && elm.nodeType == 3)\r
+ return elm.parentNode;\r
+\r
+ return elm;\r
+ }\r
+\r
+ return rng.item ? rng.item(0) : rng.parentElement();\r
+ },\r
+\r
+ getSelectedBlocks : function(st, en) {\r
+ var t = this, dom = t.dom, sb, eb, n, bl = [];\r
+\r
+ sb = dom.getParent(st || t.getStart(), dom.isBlock);\r
+ eb = dom.getParent(en || t.getEnd(), dom.isBlock);\r
+\r
+ if (sb)\r
+ bl.push(sb);\r
+\r
+ if (sb && eb && sb != eb) {\r
+ n = sb;\r
+\r
+ while ((n = n.nextSibling) && n != eb) {\r
+ if (dom.isBlock(n))\r
+ bl.push(n);\r
+ }\r
+ }\r
+\r
+ if (eb && sb != eb)\r
+ bl.push(eb);\r
+\r
+ return bl;\r
+ },\r
+\r
+ destroy : function(s) {\r
+ var t = this;\r
+\r
+ t.win = null;\r
+\r
+ if (t.tridentSel)\r
+ t.tridentSel.destroy();\r
+\r
+ // Manual destroy then remove unload handler\r
+ if (!s)\r
+ tinymce.removeUnload(t.destroy);\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ tinymce.create('tinymce.dom.XMLWriter', {\r
+ node : null,\r
+\r
+ XMLWriter : function(s) {\r
+ // Get XML document\r
+ function getXML() {\r
+ var i = document.implementation;\r
+\r
+ if (!i || !i.createDocument) {\r
+ // Try IE objects\r
+ try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {}\r
+ try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {}\r
+ } else\r
+ return i.createDocument('', '', null);\r
+ };\r
+\r
+ this.doc = getXML();\r
+ \r
+ // Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers\r
+ this.valid = tinymce.isOpera || tinymce.isWebKit;\r
+\r
+ this.reset();\r
+ },\r
+\r
+ reset : function() {\r
+ var t = this, d = t.doc;\r
+\r
+ if (d.firstChild)\r
+ d.removeChild(d.firstChild);\r
+\r
+ t.node = d.appendChild(d.createElement("html"));\r
+ },\r
+\r
+ writeStartElement : function(n) {\r
+ var t = this;\r
+\r
+ t.node = t.node.appendChild(t.doc.createElement(n));\r
+ },\r
+\r
+ writeAttribute : function(n, v) {\r
+ if (this.valid)\r
+ v = v.replace(/>/g, '%MCGT%');\r
+\r
+ this.node.setAttribute(n, v);\r
+ },\r
+\r
+ writeEndElement : function() {\r
+ this.node = this.node.parentNode;\r
+ },\r
+\r
+ writeFullEndElement : function() {\r
+ var t = this, n = t.node;\r
+\r
+ n.appendChild(t.doc.createTextNode(""));\r
+ t.node = n.parentNode;\r
+ },\r
+\r
+ writeText : function(v) {\r
+ if (this.valid)\r
+ v = v.replace(/>/g, '%MCGT%');\r
+\r
+ this.node.appendChild(this.doc.createTextNode(v));\r
+ },\r
+\r
+ writeCDATA : function(v) {\r
+ this.node.appendChild(this.doc.createCDATASection(v));\r
+ },\r
+\r
+ writeComment : function(v) {\r
+ // Fix for bug #2035694\r
+ if (tinymce.isIE)\r
+ v = v.replace(/^\-|\-$/g, ' ');\r
+\r
+ this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' ')));\r
+ },\r
+\r
+ getContent : function() {\r
+ var h;\r
+\r
+ h = this.doc.xml || new XMLSerializer().serializeToString(this.doc);\r
+ h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, '');\r
+ h = h.replace(/ ?\/>/g, ' />');\r
+\r
+ if (this.valid)\r
+ h = h.replace(/\%MCGT%/g, '>');\r
+\r
+ return h;\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ tinymce.create('tinymce.dom.StringWriter', {\r
+ str : null,\r
+ tags : null,\r
+ count : 0,\r
+ settings : null,\r
+ indent : null,\r
+\r
+ StringWriter : function(s) {\r
+ this.settings = tinymce.extend({\r
+ indent_char : ' ',\r
+ indentation : 0\r
+ }, s);\r
+\r
+ this.reset();\r
+ },\r
+\r
+ reset : function() {\r
+ this.indent = '';\r
+ this.str = "";\r
+ this.tags = [];\r
+ this.count = 0;\r
+ },\r
+\r
+ writeStartElement : function(n) {\r
+ this._writeAttributesEnd();\r
+ this.writeRaw('<' + n);\r
+ this.tags.push(n);\r
+ this.inAttr = true;\r
+ this.count++;\r
+ this.elementCount = this.count;\r
+ },\r
+\r
+ writeAttribute : function(n, v) {\r
+ var t = this;\r
+\r
+ t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"');\r
+ },\r
+\r
+ writeEndElement : function() {\r
+ var n;\r
+\r
+ if (this.tags.length > 0) {\r
+ n = this.tags.pop();\r
+\r
+ if (this._writeAttributesEnd(1))\r
+ this.writeRaw('</' + n + '>');\r
+\r
+ if (this.settings.indentation > 0)\r
+ this.writeRaw('\n');\r
+ }\r
+ },\r
+\r
+ writeFullEndElement : function() {\r
+ if (this.tags.length > 0) {\r
+ this._writeAttributesEnd();\r
+ this.writeRaw('</' + this.tags.pop() + '>');\r
+\r
+ if (this.settings.indentation > 0)\r
+ this.writeRaw('\n');\r
+ }\r
+ },\r
+\r
+ writeText : function(v) {\r
+ this._writeAttributesEnd();\r
+ this.writeRaw(this.encode(v));\r
+ this.count++;\r
+ },\r
+\r
+ writeCDATA : function(v) {\r
+ this._writeAttributesEnd();\r
+ this.writeRaw('<![CDATA[' + v + ']]>');\r
+ this.count++;\r
+ },\r
+\r
+ writeComment : function(v) {\r
+ this._writeAttributesEnd();\r
+ this.writeRaw('<!-- ' + v + '-->');\r
+ this.count++;\r
+ },\r
+\r
+ writeRaw : function(v) {\r
+ this.str += v;\r
+ },\r
+\r
+ encode : function(s) {\r
+ return s.replace(/[<>&"]/g, function(v) {\r
+ switch (v) {\r
+ case '<':\r
+ return '<';\r
+\r
+ case '>':\r
+ return '>';\r
+\r
+ case '&':\r
+ return '&';\r
+\r
+ case '"':\r
+ return '"';\r
+ }\r
+\r
+ return v;\r
+ });\r
+ },\r
+\r
+ getContent : function() {\r
+ return this.str;\r
+ },\r
+\r
+ _writeAttributesEnd : function(s) {\r
+ if (!this.inAttr)\r
+ return;\r
+\r
+ this.inAttr = false;\r
+\r
+ if (s && this.elementCount == this.count) {\r
+ this.writeRaw(' />');\r
+ return false;\r
+ }\r
+\r
+ this.writeRaw('>');\r
+\r
+ return true;\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ // Shorten names\r
+ var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko;\r
+\r
+ function wildcardToRE(s) {\r
+ return s.replace(/([?+*])/g, '.$1');\r
+ };\r
+\r
+ tinymce.create('tinymce.dom.Serializer', {\r
+ Serializer : function(s) {\r
+ var t = this;\r
+\r
+ t.key = 0;\r
+ t.onPreProcess = new Dispatcher(t);\r
+ t.onPostProcess = new Dispatcher(t);\r
+\r
+ try {\r
+ t.writer = new tinymce.dom.XMLWriter();\r
+ } catch (ex) {\r
+ // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter\r
+ t.writer = new tinymce.dom.StringWriter();\r
+ }\r
+\r
+ // Default settings\r
+ t.settings = s = extend({\r
+ dom : tinymce.DOM,\r
+ valid_nodes : 0,\r
+ node_filter : 0,\r
+ attr_filter : 0,\r
+ invalid_attrs : /^(_mce_|_moz_|sizset|sizcache)/,\r
+ closed : /^(br|hr|input|meta|img|link|param|area)$/,\r
+ entity_encoding : 'named',\r
+ entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro',\r
+ valid_elements : '*[*]',\r
+ extended_valid_elements : 0,\r
+ invalid_elements : 0,\r
+ fix_table_elements : 1,\r
+ fix_list_elements : true,\r
+ fix_content_duplication : true,\r
+ convert_fonts_to_spans : false,\r
+ font_size_classes : 0,\r
+ apply_source_formatting : 0,\r
+ indent_mode : 'simple',\r
+ indent_char : '\t',\r
+ indent_levels : 1,\r
+ remove_linebreaks : 1,\r
+ remove_redundant_brs : 1,\r
+ element_format : 'xhtml'\r
+ }, s);\r
+\r
+ t.dom = s.dom;\r
+ t.schema = s.schema;\r
+\r
+ // Use raw entities if no entities are defined\r
+ if (s.entity_encoding == 'named' && !s.entities)\r
+ s.entity_encoding = 'raw';\r
+\r
+ if (s.remove_redundant_brs) {\r
+ t.onPostProcess.add(function(se, o) {\r
+ // Remove single BR at end of block elements since they get rendered\r
+ o.content = o.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) {\r
+ // Check if it's a single element\r
+ if (/^<br \/>\s*<\//.test(a))\r
+ return '</' + c + '>';\r
+\r
+ return a;\r
+ });\r
+ });\r
+ }\r
+\r
+ // Remove XHTML element endings i.e. produce crap :) XHTML is better\r
+ if (s.element_format == 'html') {\r
+ t.onPostProcess.add(function(se, o) {\r
+ o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>');\r
+ });\r
+ }\r
+\r
+ if (s.fix_list_elements) {\r
+ t.onPreProcess.add(function(se, o) {\r
+ var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np;\r
+\r
+ function prevNode(e, n) {\r
+ var a = n.split(','), i;\r
+\r
+ while ((e = e.previousSibling) != null) {\r
+ for (i=0; i<a.length; i++) {\r
+ if (e.nodeName == a[i])\r
+ return e;\r
+ }\r
+ }\r
+\r
+ return null;\r
+ };\r
+\r
+ for (x=0; x<a.length; x++) {\r
+ nl = t.dom.select(a[x], o.node);\r
+\r
+ for (i=0; i<nl.length; i++) {\r
+ n = nl[i];\r
+ p = n.parentNode;\r
+\r
+ if (r.test(p.nodeName)) {\r
+ np = prevNode(n, 'LI');\r
+\r
+ if (!np) {\r
+ np = t.dom.create('li');\r
+ np.innerHTML = ' ';\r
+ np.appendChild(n);\r
+ p.insertBefore(np, p.firstChild);\r
+ } else\r
+ np.appendChild(n);\r
+ }\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ if (s.fix_table_elements) {\r
+ t.onPreProcess.add(function(se, o) {\r
+ // Since Opera will crash if you attach the node to a dynamic document we need to brrowser sniff a specific build\r
+ // so Opera users with an older version will have to live with less compaible output not much we can do here\r
+ if (!tinymce.isOpera || opera.buildNumber() >= 1767) {\r
+ each(t.dom.select('p table', o.node).reverse(), function(n) {\r
+ var parent = t.dom.getParent(n.parentNode, 'table,p');\r
+\r
+ if (parent.nodeName != 'TABLE') {\r
+ try {\r
+ t.dom.split(parent, n);\r
+ } catch (ex) {\r
+ // IE can sometimes fire an unknown runtime error so we just ignore it\r
+ }\r
+ }\r
+ });\r
+ }\r
+ });\r
+ }\r
+ },\r
+\r
+ setEntities : function(s) {\r
+ var t = this, a, i, l = {}, v;\r
+\r
+ // No need to setup more than once\r
+ if (t.entityLookup)\r
+ return;\r
+\r
+ // Build regex and lookup array\r
+ a = s.split(',');\r
+ for (i = 0; i < a.length; i += 2) {\r
+ v = a[i];\r
+\r
+ // Don't add default & " etc.\r
+ if (v == 34 || v == 38 || v == 60 || v == 62)\r
+ continue;\r
+\r
+ l[String.fromCharCode(a[i])] = a[i + 1];\r
+\r
+ v = parseInt(a[i]).toString(16);\r
+ }\r
+\r
+ t.entityLookup = l;\r
+ },\r
+\r
+ setRules : function(s) {\r
+ var t = this;\r
+\r
+ t._setup();\r
+ t.rules = {};\r
+ t.wildRules = [];\r
+ t.validElements = {};\r
+\r
+ return t.addRules(s);\r
+ },\r
+\r
+ addRules : function(s) {\r
+ var t = this, dr;\r
+\r
+ if (!s)\r
+ return;\r
+\r
+ t._setup();\r
+\r
+ each(s.split(','), function(s) {\r
+ var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = [];\r
+\r
+ // Extend with default rules\r
+ if (dr)\r
+ at = tinymce.extend([], dr.attribs);\r
+\r
+ // Parse attributes\r
+ if (p.length > 1) {\r
+ each(p[1].split('|'), function(s) {\r
+ var ar = {}, i;\r
+\r
+ at = at || [];\r
+\r
+ // Parse attribute rule\r
+ s = s.replace(/::/g, '~');\r
+ s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s);\r
+ s[2] = s[2].replace(/~/g, ':');\r
+\r
+ // Add required attributes\r
+ if (s[1] == '!') {\r
+ ra = ra || [];\r
+ ra.push(s[2]);\r
+ }\r
+\r
+ // Remove inherited attributes\r
+ if (s[1] == '-') {\r
+ for (i = 0; i <at.length; i++) {\r
+ if (at[i].name == s[2]) {\r
+ at.splice(i, 1);\r
+ return;\r
+ }\r
+ }\r
+ }\r
+\r
+ switch (s[3]) {\r
+ // Add default attrib values\r
+ case '=':\r
+ ar.defaultVal = s[4] || '';\r
+ break;\r
+\r
+ // Add forced attrib values\r
+ case ':':\r
+ ar.forcedVal = s[4];\r
+ break;\r
+\r
+ // Add validation values\r
+ case '<':\r
+ ar.validVals = s[4].split('?');\r
+ break;\r
+ }\r
+\r
+ if (/[*.?]/.test(s[2])) {\r
+ wat = wat || [];\r
+ ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$');\r
+ wat.push(ar);\r
+ } else {\r
+ ar.name = s[2];\r
+ at.push(ar);\r
+ }\r
+\r
+ va.push(s[2]);\r
+ });\r
+ }\r
+\r
+ // Handle element names\r
+ each(tn, function(s, i) {\r
+ var pr = s.charAt(0), x = 1, ru = {};\r
+\r
+ // Extend with default rule data\r
+ if (dr) {\r
+ if (dr.noEmpty)\r
+ ru.noEmpty = dr.noEmpty;\r
+\r
+ if (dr.fullEnd)\r
+ ru.fullEnd = dr.fullEnd;\r
+\r
+ if (dr.padd)\r
+ ru.padd = dr.padd;\r
+ }\r
+\r
+ // Handle prefixes\r
+ switch (pr) {\r
+ case '-':\r
+ ru.noEmpty = true;\r
+ break;\r
+\r
+ case '+':\r
+ ru.fullEnd = true;\r
+ break;\r
+\r
+ case '#':\r
+ ru.padd = true;\r
+ break;\r
+\r
+ default:\r
+ x = 0;\r
+ }\r
+\r
+ tn[i] = s = s.substring(x);\r
+ t.validElements[s] = 1;\r
+\r
+ // Add element name or element regex\r
+ if (/[*.?]/.test(tn[0])) {\r
+ ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$');\r
+ t.wildRules = t.wildRules || {};\r
+ t.wildRules.push(ru);\r
+ } else {\r
+ ru.name = tn[0];\r
+\r
+ // Store away default rule\r
+ if (tn[0] == '@')\r
+ dr = ru;\r
+\r
+ t.rules[s] = ru;\r
+ }\r
+\r
+ ru.attribs = at;\r
+\r
+ if (ra)\r
+ ru.requiredAttribs = ra;\r
+\r
+ if (wat) {\r
+ // Build valid attributes regexp\r
+ s = '';\r
+ each(va, function(v) {\r
+ if (s)\r
+ s += '|';\r
+\r
+ s += '(' + wildcardToRE(v) + ')';\r
+ });\r
+ ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$');\r
+ ru.wildAttribs = wat;\r
+ }\r
+ });\r
+ });\r
+\r
+ // Build valid elements regexp\r
+ s = '';\r
+ each(t.validElements, function(v, k) {\r
+ if (s)\r
+ s += '|';\r
+\r
+ if (k != '@')\r
+ s += k;\r
+ });\r
+ t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$');\r
+\r
+ //console.debug(t.validElementsRE.toString());\r
+ //console.dir(t.rules);\r
+ //console.dir(t.wildRules);\r
+ },\r
+\r
+ findRule : function(n) {\r
+ var t = this, rl = t.rules, i, r;\r
+\r
+ t._setup();\r
+\r
+ // Exact match\r
+ r = rl[n];\r
+ if (r)\r
+ return r;\r
+\r
+ // Try wildcards\r
+ rl = t.wildRules;\r
+ for (i = 0; i < rl.length; i++) {\r
+ if (rl[i].nameRE.test(n))\r
+ return rl[i];\r
+ }\r
+\r
+ return null;\r
+ },\r
+\r
+ findAttribRule : function(ru, n) {\r
+ var i, wa = ru.wildAttribs;\r
+\r
+ for (i = 0; i < wa.length; i++) {\r
+ if (wa[i].nameRE.test(n))\r
+ return wa[i];\r
+ }\r
+\r
+ return null;\r
+ },\r
+\r
+ serialize : function(n, o) {\r
+ var h, t = this, doc, oldDoc, impl, selected;\r
+\r
+ t._setup();\r
+ o = o || {};\r
+ o.format = o.format || 'html';\r
+ t.processObj = o;\r
+\r
+ // IE looses the selected attribute on option elements so we need to store it\r
+ // See: http://support.microsoft.com/kb/829907\r
+ if (isIE) {\r
+ selected = [];\r
+ each(n.getElementsByTagName('option'), function(n) {\r
+ var v = t.dom.getAttrib(n, 'selected');\r
+\r
+ selected.push(v ? v : null);\r
+ });\r
+ }\r
+\r
+ n = n.cloneNode(true);\r
+\r
+ // IE looses the selected attribute on option elements so we need to restore it\r
+ if (isIE) {\r
+ each(n.getElementsByTagName('option'), function(n, i) {\r
+ t.dom.setAttrib(n, 'selected', selected[i]);\r
+ });\r
+ }\r
+\r
+ // Nodes needs to be attached to something in WebKit/Opera\r
+ // Older builds of Opera crashes if you attach the node to an document created dynamically\r
+ // and since we can't feature detect a crash we need to sniff the acutal build number\r
+ // This fix will make DOM ranges and make Sizzle happy!\r
+ impl = n.ownerDocument.implementation;\r
+ if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) {\r
+ // Create an empty HTML document\r
+ doc = impl.createHTMLDocument("");\r
+\r
+ // Add the element or it's children if it's a body element to the new document\r
+ each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) {\r
+ doc.body.appendChild(doc.importNode(node, true));\r
+ });\r
+\r
+ // Grab first child or body element for serialization\r
+ if (n.nodeName != 'BODY')\r
+ n = doc.body.firstChild;\r
+ else\r
+ n = doc.body;\r
+\r
+ // set the new document in DOMUtils so createElement etc works\r
+ oldDoc = t.dom.doc;\r
+ t.dom.doc = doc;\r
+ }\r
+\r
+ t.key = '' + (parseInt(t.key) + 1);\r
+\r
+ // Pre process\r
+ if (!o.no_events) {\r
+ o.node = n;\r
+ t.onPreProcess.dispatch(t, o);\r
+ }\r
+\r
+ // Serialize HTML DOM into a string\r
+ t.writer.reset();\r
+ t._info = o;\r
+ t._serializeNode(n, o.getInner);\r
+\r
+ // Post process\r
+ o.content = t.writer.getContent();\r
+\r
+ // Restore the old document if it was changed\r
+ if (oldDoc)\r
+ t.dom.doc = oldDoc;\r
+\r
+ if (!o.no_events)\r
+ t.onPostProcess.dispatch(t, o);\r
+\r
+ t._postProcess(o);\r
+ o.node = null;\r
+\r
+ return tinymce.trim(o.content);\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _postProcess : function(o) {\r
+ var t = this, s = t.settings, h = o.content, sc = [], p;\r
+\r
+ if (o.format == 'html') {\r
+ // Protect some elements\r
+ p = t._protect({\r
+ content : h,\r
+ patterns : [\r
+ {pattern : /(<script[^>]*>)(.*?)(<\/script>)/g},\r
+ {pattern : /(<noscript[^>]*>)(.*?)(<\/noscript>)/g},\r
+ {pattern : /(<style[^>]*>)(.*?)(<\/style>)/g},\r
+ {pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1},\r
+ {pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g}\r
+ ]\r
+ });\r
+\r
+ h = p.content;\r
+\r
+ // Entity encode\r
+ if (s.entity_encoding !== 'raw')\r
+ h = t._encode(h);\r
+\r
+ // Use BR instead of padded P elements inside editor and use <p> </p> outside editor\r
+/* if (o.set)\r
+ h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>');\r
+ else\r
+ h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');*/\r
+\r
+ // Since Gecko and Safari keeps whitespace in the DOM we need to\r
+ // remove it inorder to match other browsers. But I think Gecko and Safari is right.\r
+ // This process is only done when getting contents out from the editor.\r
+ if (!o.set) {\r
+ // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char\r
+ h = h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? '<p$1> </p>' : '<p$1> </p>');\r
+\r
+ if (s.remove_linebreaks) {\r
+ h = h.replace(/\r?\n|\r/g, ' ');\r
+ h = h.replace(/(<[^>]+>)\s+/g, '$1 ');\r
+ h = h.replace(/\s+(<\/[^>]+>)/g, ' $1');\r
+ h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start\r
+ h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start\r
+ h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end\r
+ }\r
+\r
+ // Simple indentation\r
+ if (s.apply_source_formatting && s.indent_mode == 'simple') {\r
+ // Add line breaks before and after block elements\r
+ h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n');\r
+ h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>');\r
+ h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n');\r
+ h = h.replace(/\n\n/g, '\n');\r
+ }\r
+ }\r
+\r
+ h = t._unprotect(h, p);\r
+\r
+ // Restore CDATA sections\r
+ h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>');\r
+\r
+ // Restore the \u00a0 character if raw mode is enabled\r
+ if (s.entity_encoding == 'raw')\r
+ h = h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g, '<p$1>\u00a0</p>');\r
+\r
+ // Restore noscript elements\r
+ h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) {\r
+ return '<noscript' + attribs + '>' + t.dom.decode(text.replace(/<!--|-->/g, '')) + '</noscript>';\r
+ });\r
+ }\r
+\r
+ o.content = h;\r
+ },\r
+\r
+ _serializeNode : function(n, inner) {\r
+ var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed, keep, type, scopeName;\r
+\r
+ if (!s.node_filter || s.node_filter(n)) {\r
+ switch (n.nodeType) {\r
+ case 1: // Element\r
+ if (n.hasAttribute ? n.hasAttribute('_mce_bogus') : n.getAttribute('_mce_bogus'))\r
+ return;\r
+\r
+ iv = keep = false;\r
+ hc = n.hasChildNodes();\r
+ nn = n.getAttribute('_mce_name') || n.nodeName.toLowerCase();\r
+\r
+ // Get internal type\r
+ type = n.getAttribute('_mce_type');\r
+ if (type) {\r
+ if (!t._info.cleanup) {\r
+ iv = true;\r
+ return;\r
+ } else\r
+ keep = 1;\r
+ }\r
+\r
+ // Add correct prefix on IE\r
+ if (isIE) {\r
+ scopeName = n.scopeName;\r
+ if (scopeName && scopeName !== 'HTML' && scopeName !== 'html')\r
+ nn = scopeName + ':' + nn;\r
+ }\r
+\r
+ // Remove mce prefix on IE needed for the abbr element\r
+ if (nn.indexOf('mce:') === 0)\r
+ nn = nn.substring(4);\r
+\r
+ // Check if valid\r
+ if (!keep) {\r
+ if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inner) {\r
+ iv = true;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if (isIE) {\r
+ // Fix IE content duplication (DOM can have multiple copies of the same node)\r
+ if (s.fix_content_duplication) {\r
+ if (n._mce_serialized == t.key)\r
+ return;\r
+\r
+ n._mce_serialized = t.key;\r
+ }\r
+\r
+ // IE sometimes adds a / infront of the node name\r
+ if (nn.charAt(0) == '/')\r
+ nn = nn.substring(1);\r
+ } else if (isGecko) {\r
+ // Ignore br elements\r
+ if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz')\r
+ return;\r
+ }\r
+\r
+ // Check if valid child\r
+ if (s.validate_children) {\r
+ if (t.elementName && !t.schema.isValid(t.elementName, nn)) {\r
+ iv = true;\r
+ break;\r
+ }\r
+\r
+ t.elementName = nn;\r
+ }\r
+\r
+ ru = t.findRule(nn);\r
+ \r
+ // No valid rule for this element could be found then skip it\r
+ if (!ru) {\r
+ iv = true;\r
+ break;\r
+ }\r
+\r
+ nn = ru.name || nn;\r
+ closed = s.closed.test(nn);\r
+\r
+ // Skip empty nodes or empty node name in IE\r
+ if ((!hc && ru.noEmpty) || (isIE && !nn)) {\r
+ iv = true;\r
+ break;\r
+ }\r
+\r
+ // Check required\r
+ if (ru.requiredAttribs) {\r
+ a = ru.requiredAttribs;\r
+\r
+ for (i = a.length - 1; i >= 0; i--) {\r
+ if (this.dom.getAttrib(n, a[i]) !== '')\r
+ break;\r
+ }\r
+\r
+ // None of the required was there\r
+ if (i == -1) {\r
+ iv = true;\r
+ break;\r
+ }\r
+ }\r
+\r
+ w.writeStartElement(nn);\r
+\r
+ // Add ordered attributes\r
+ if (ru.attribs) {\r
+ for (i=0, at = ru.attribs, l = at.length; i<l; i++) {\r
+ a = at[i];\r
+ v = t._getAttrib(n, a);\r
+\r
+ if (v !== null)\r
+ w.writeAttribute(a.name, v);\r
+ }\r
+ }\r
+\r
+ // Add wild attributes\r
+ if (ru.validAttribsRE) {\r
+ at = t.dom.getAttribs(n);\r
+ for (i=at.length-1; i>-1; i--) {\r
+ no = at[i];\r
+\r
+ if (no.specified) {\r
+ a = no.nodeName.toLowerCase();\r
+\r
+ if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a))\r
+ continue;\r
+\r
+ ar = t.findAttribRule(ru, a);\r
+ v = t._getAttrib(n, ar, a);\r
+\r
+ if (v !== null)\r
+ w.writeAttribute(a, v);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Keep type attribute\r
+ if (type && keep)\r
+ w.writeAttribute('_mce_type', type);\r
+\r
+ // Write text from script\r
+ if (nn === 'script' && tinymce.trim(n.innerHTML)) {\r
+ w.writeText('// '); // Padd it with a comment so it will parse on older browsers\r
+ w.writeCDATA(n.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures\r
+ hc = false;\r
+ break;\r
+ }\r
+\r
+ // Padd empty nodes with a \r
+ if (ru.padd) {\r
+ // If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug\r
+ if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) {\r
+ if (cn.hasAttribute ? cn.hasAttribute('_mce_bogus') : cn.getAttribute('_mce_bogus'))\r
+ w.writeText('\u00a0');\r
+ } else if (!hc)\r
+ w.writeText('\u00a0'); // No children then padd it\r
+ }\r
+\r
+ break;\r
+\r
+ case 3: // Text\r
+ // Check if valid child\r
+ if (s.validate_children && t.elementName && !t.schema.isValid(t.elementName, '#text'))\r
+ return;\r
+\r
+ return w.writeText(n.nodeValue);\r
+\r
+ case 4: // CDATA\r
+ return w.writeCDATA(n.nodeValue);\r
+\r
+ case 8: // Comment\r
+ return w.writeComment(n.nodeValue);\r
+ }\r
+ } else if (n.nodeType == 1)\r
+ hc = n.hasChildNodes();\r
+\r
+ if (hc && !closed) {\r
+ cn = n.firstChild;\r
+\r
+ while (cn) {\r
+ t._serializeNode(cn);\r
+ t.elementName = nn;\r
+ cn = cn.nextSibling;\r
+ }\r
+ }\r
+\r
+ // Write element end\r
+ if (!iv) {\r
+ if (!closed)\r
+ w.writeFullEndElement();\r
+ else\r
+ w.writeEndElement();\r
+ }\r
+ },\r
+\r
+ _protect : function(o) {\r
+ var t = this;\r
+\r
+ o.items = o.items || [];\r
+\r
+ function enc(s) {\r
+ return s.replace(/[\r\n\\]/g, function(c) {\r
+ if (c === '\n')\r
+ return '\\n';\r
+ else if (c === '\\')\r
+ return '\\\\';\r
+\r
+ return '\\r';\r
+ });\r
+ };\r
+\r
+ function dec(s) {\r
+ return s.replace(/\\[\\rn]/g, function(c) {\r
+ if (c === '\\n')\r
+ return '\n';\r
+ else if (c === '\\\\')\r
+ return '\\';\r
+\r
+ return '\r';\r
+ });\r
+ };\r
+\r
+ each(o.patterns, function(p) {\r
+ o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) {\r
+ b = dec(b);\r
+\r
+ if (p.encode)\r
+ b = t._encode(b);\r
+\r
+ o.items.push(b);\r
+ return a + '<!--mce:' + (o.items.length - 1) + '-->' + c;\r
+ }));\r
+ });\r
+\r
+ return o;\r
+ },\r
+\r
+ _unprotect : function(h, o) {\r
+ h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) {\r
+ return o.items[parseInt(b)];\r
+ });\r
+\r
+ o.items = [];\r
+\r
+ return h;\r
+ },\r
+\r
+ _encode : function(h) {\r
+ var t = this, s = t.settings, l;\r
+\r
+ // Entity encode\r
+ if (s.entity_encoding !== 'raw') {\r
+ if (s.entity_encoding.indexOf('named') != -1) {\r
+ t.setEntities(s.entities);\r
+ l = t.entityLookup;\r
+\r
+ h = h.replace(/[\u007E-\uFFFF]/g, function(a) {\r
+ var v;\r
+\r
+ if (v = l[a])\r
+ a = '&' + v + ';';\r
+\r
+ return a;\r
+ });\r
+ }\r
+\r
+ if (s.entity_encoding.indexOf('numeric') != -1) {\r
+ h = h.replace(/[\u007E-\uFFFF]/g, function(a) {\r
+ return '&#' + a.charCodeAt(0) + ';';\r
+ });\r
+ }\r
+ }\r
+\r
+ return h;\r
+ },\r
+\r
+ _setup : function() {\r
+ var t = this, s = this.settings;\r
+\r
+ if (t.done)\r
+ return;\r
+\r
+ t.done = 1;\r
+\r
+ t.setRules(s.valid_elements);\r
+ t.addRules(s.extended_valid_elements);\r
+\r
+ if (s.invalid_elements)\r
+ t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$');\r
+\r
+ if (s.attrib_value_filter)\r
+ t.attribValueFilter = s.attribValueFilter;\r
+ },\r
+\r
+ _getAttrib : function(n, a, na) {\r
+ var i, v;\r
+\r
+ na = na || a.name;\r
+\r
+ if (a.forcedVal && (v = a.forcedVal)) {\r
+ if (v === '{$uid}')\r
+ return this.dom.uniqueId();\r
+\r
+ return v;\r
+ }\r
+\r
+ v = this.dom.getAttrib(n, na);\r
+\r
+ switch (na) {\r
+ case 'rowspan':\r
+ case 'colspan':\r
+ // Whats the point? Remove usless attribute value\r
+ if (v == '1')\r
+ v = '';\r
+\r
+ break;\r
+ }\r
+\r
+ if (this.attribValueFilter)\r
+ v = this.attribValueFilter(na, v, n);\r
+\r
+ if (a.validVals) {\r
+ for (i = a.validVals.length - 1; i >= 0; i--) {\r
+ if (v == a.validVals[i])\r
+ break;\r
+ }\r
+\r
+ if (i == -1)\r
+ return null;\r
+ }\r
+\r
+ if (v === '' && typeof(a.defaultVal) != 'undefined') {\r
+ v = a.defaultVal;\r
+\r
+ if (v === '{$uid}')\r
+ return this.dom.uniqueId();\r
+\r
+ return v;\r
+ } else {\r
+ // Remove internal mceItemXX classes when content is extracted from editor\r
+ if (na == 'class' && this.processObj.get)\r
+ v = v.replace(/\s?mceItem\w+\s?/g, '');\r
+ }\r
+\r
+ if (v === '')\r
+ return null;\r
+\r
+\r
+ return v;\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ tinymce.dom.ScriptLoader = function(settings) {\r
+ var QUEUED = 0,\r
+ LOADING = 1,\r
+ LOADED = 2,\r
+ states = {},\r
+ queue = [],\r
+ scriptLoadedCallbacks = {},\r
+ queueLoadedCallbacks = [],\r
+ loading = 0,\r
+ undefined;\r
+\r
+ function loadScript(url, callback) {\r
+ var t = this, dom = tinymce.DOM, elm, uri, loc, id;\r
+\r
+ // Execute callback when script is loaded\r
+ function done() {\r
+ dom.remove(id);\r
+\r
+ if (elm)\r
+ elm.onreadystatechange = elm.onload = elm = null;\r
+\r
+ callback();\r
+ };\r
+\r
+ id = dom.uniqueId();\r
+\r
+ if (tinymce.isIE6) {\r
+ uri = new tinymce.util.URI(url);\r
+ loc = location;\r
+\r
+ // If script is from same domain and we\r
+ // use IE 6 then use XHR since it's more reliable\r
+ if (uri.host == loc.hostname && uri.port == loc.port && (uri.protocol + ':') == loc.protocol) {\r
+ tinymce.util.XHR.send({\r
+ url : tinymce._addVer(uri.getURI()),\r
+ success : function(content) {\r
+ // Create new temp script element\r
+ var script = dom.create('script', {\r
+ type : 'text/javascript'\r
+ });\r
+\r
+ // Evaluate script in global scope\r
+ script.text = content;\r
+ document.getElementsByTagName('head')[0].appendChild(script);\r
+ dom.remove(script);\r
+\r
+ done();\r
+ }\r
+ });\r
+\r
+ return;\r
+ }\r
+ }\r
+\r
+ // Create new script element\r
+ elm = dom.create('script', {\r
+ id : id,\r
+ type : 'text/javascript',\r
+ src : tinymce._addVer(url)\r
+ });\r
+\r
+ // Add onload and readystate listeners\r
+ elm.onload = done;\r
+ elm.onreadystatechange = function() {\r
+ var state = elm.readyState;\r
+\r
+ // Loaded state is passed on IE 6 however there\r
+ // are known issues with this method but we can't use\r
+ // XHR in a cross domain loading\r
+ if (state == 'complete' || state == 'loaded')\r
+ done();\r
+ };\r
+\r
+ // Most browsers support this feature so we report errors\r
+ // for those at least to help users track their missing plugins etc\r
+ // todo: Removed since it produced error if the document is unloaded by navigating away, re-add it as an option\r
+ /*elm.onerror = function() {\r
+ alert('Failed to load: ' + url);\r
+ };*/\r
+\r
+ // Add script to document\r
+ (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);\r
+ };\r
+\r
+ this.isDone = function(url) {\r
+ return states[url] == LOADED;\r
+ };\r
+\r
+ this.markDone = function(url) {\r
+ states[url] = LOADED;\r
+ };\r
+\r
+ this.add = this.load = function(url, callback, scope) {\r
+ var item, state = states[url];\r
+\r
+ // Add url to load queue\r
+ if (state == undefined) {\r
+ queue.push(url);\r
+ states[url] = QUEUED;\r
+ }\r
+\r
+ if (callback) {\r
+ // Store away callback for later execution\r
+ if (!scriptLoadedCallbacks[url])\r
+ scriptLoadedCallbacks[url] = [];\r
+\r
+ scriptLoadedCallbacks[url].push({\r
+ func : callback,\r
+ scope : scope || this\r
+ });\r
+ }\r
+ };\r
+\r
+ this.loadQueue = function(callback, scope) {\r
+ this.loadScripts(queue, callback, scope);\r
+ };\r
+\r
+ this.loadScripts = function(scripts, callback, scope) {\r
+ var loadScripts;\r
+\r
+ function execScriptLoadedCallbacks(url) {\r
+ // Execute URL callback functions\r
+ tinymce.each(scriptLoadedCallbacks[url], function(callback) {\r
+ callback.func.call(callback.scope);\r
+ });\r
+\r
+ scriptLoadedCallbacks[url] = undefined;\r
+ };\r
+\r
+ queueLoadedCallbacks.push({\r
+ func : callback,\r
+ scope : scope || this\r
+ });\r
+\r
+ loadScripts = function() {\r
+ var loadingScripts = tinymce.grep(scripts);\r
+\r
+ // Current scripts has been handled\r
+ scripts.length = 0;\r
+\r
+ // Load scripts that needs to be loaded\r
+ tinymce.each(loadingScripts, function(url) {\r
+ // Script is already loaded then execute script callbacks directly\r
+ if (states[url] == LOADED) {\r
+ execScriptLoadedCallbacks(url);\r
+ return;\r
+ }\r
+\r
+ // Is script not loading then start loading it\r
+ if (states[url] != LOADING) {\r
+ states[url] = LOADING;\r
+ loading++;\r
+\r
+ loadScript(url, function() {\r
+ states[url] = LOADED;\r
+ loading--;\r
+\r
+ execScriptLoadedCallbacks(url);\r
+\r
+ // Load more scripts if they where added by the recently loaded script\r
+ loadScripts();\r
+ });\r
+ }\r
+ });\r
+\r
+ // No scripts are currently loading then execute all pending queue loaded callbacks\r
+ if (!loading) {\r
+ tinymce.each(queueLoadedCallbacks, function(callback) {\r
+ callback.func.call(callback.scope);\r
+ });\r
+\r
+ queueLoadedCallbacks.length = 0;\r
+ }\r
+ };\r
+\r
+ loadScripts();\r
+ };\r
+ };\r
+\r
+ // Global script loader\r
+ tinymce.ScriptLoader = new tinymce.dom.ScriptLoader();\r
+})(tinymce);\r
+\r
+tinymce.dom.TreeWalker = function(start_node, root_node) {\r
+ var node = start_node;\r
+\r
+ function findSibling(node, start_name, sibling_name, shallow) {\r
+ var sibling, parent;\r
+\r
+ if (node) {\r
+ // Walk into nodes if it has a start\r
+ if (!shallow && node[start_name])\r
+ return node[start_name];\r
+\r
+ // Return the sibling if it has one\r
+ if (node != root_node) {\r
+ sibling = node[sibling_name];\r
+ if (sibling)\r
+ return sibling;\r
+\r
+ // Walk up the parents to look for siblings\r
+ for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {\r
+ sibling = parent[sibling_name];\r
+ if (sibling)\r
+ return sibling;\r
+ }\r
+ }\r
+ }\r
+ };\r
+\r
+ this.current = function() {\r
+ return node;\r
+ };\r
+\r
+ this.next = function(shallow) {\r
+ return (node = findSibling(node, 'firstChild', 'nextSibling', shallow));\r
+ };\r
+\r
+ this.prev = function(shallow) {\r
+ return (node = findSibling(node, 'lastChild', 'lastSibling', shallow));\r
+ };\r
+};\r
+\r
+(function() {\r
+ var transitional = {};\r
+\r
+ function unpack(lookup, data) {\r
+ var key;\r
+\r
+ function replace(value) {\r
+ return value.replace(/[A-Z]+/g, function(key) {\r
+ return replace(lookup[key]);\r
+ });\r
+ };\r
+\r
+ // Unpack lookup\r
+ for (key in lookup) {\r
+ if (lookup.hasOwnProperty(key))\r
+ lookup[key] = replace(lookup[key]);\r
+ }\r
+\r
+ // Unpack and parse data into object map\r
+ replace(data).replace(/#/g, '#text').replace(/(\w+)\[([^\]]+)\]/g, function(str, name, children) {\r
+ var i, map = {};\r
+\r
+ children = children.split(/\|/);\r
+\r
+ for (i = children.length - 1; i >= 0; i--)\r
+ map[children[i]] = 1;\r
+\r
+ transitional[name] = map;\r
+ });\r
+ };\r
+\r
+ // This is the XHTML 1.0 transitional elements with it's children packed to reduce it's size\r
+ // we will later include the attributes here and use it as a default for valid elements but it\r
+ // requires us to rewrite the serializer engine\r
+ unpack({\r
+ Z : '#|H|K|N|O|P',\r
+ Y : '#|X|form|R|Q',\r
+ X : 'p|T|div|U|W|isindex|fieldset|table',\r
+ W : 'pre|hr|blockquote|address|center|noframes',\r
+ U : 'ul|ol|dl|menu|dir',\r
+ ZC : '#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q',\r
+ T : 'h1|h2|h3|h4|h5|h6',\r
+ ZB : '#|X|S|Q',\r
+ S : 'R|P',\r
+ ZA : '#|a|G|J|M|O|P',\r
+ R : '#|a|H|K|N|O',\r
+ Q : 'noscript|P',\r
+ P : 'ins|del|script',\r
+ O : 'input|select|textarea|label|button',\r
+ N : 'M|L',\r
+ M : 'em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym',\r
+ L : 'sub|sup',\r
+ K : 'J|I',\r
+ J : 'tt|i|b|u|s|strike',\r
+ I : 'big|small|font|basefont',\r
+ H : 'G|F',\r
+ G : 'br|span|bdo',\r
+ F : 'object|applet|img|map|iframe'\r
+ }, 'script[]' + \r
+ 'style[]' + \r
+ 'object[#|param|X|form|a|H|K|N|O|Q]' + \r
+ 'param[]' + \r
+ 'p[S]' + \r
+ 'a[Z]' + \r
+ 'br[]' + \r
+ 'span[S]' + \r
+ 'bdo[S]' + \r
+ 'applet[#|param|X|form|a|H|K|N|O|Q]' + \r
+ 'h1[S]' + \r
+ 'img[]' + \r
+ 'map[X|form|Q|area]' + \r
+ 'h2[S]' + \r
+ 'iframe[#|X|form|a|H|K|N|O|Q]' + \r
+ 'h3[S]' + \r
+ 'tt[S]' + \r
+ 'i[S]' + \r
+ 'b[S]' + \r
+ 'u[S]' + \r
+ 's[S]' + \r
+ 'strike[S]' + \r
+ 'big[S]' + \r
+ 'small[S]' + \r
+ 'font[S]' + \r
+ 'basefont[]' + \r
+ 'em[S]' + \r
+ 'strong[S]' + \r
+ 'dfn[S]' + \r
+ 'code[S]' + \r
+ 'q[S]' + \r
+ 'samp[S]' + \r
+ 'kbd[S]' + \r
+ 'var[S]' + \r
+ 'cite[S]' + \r
+ 'abbr[S]' + \r
+ 'acronym[S]' + \r
+ 'sub[S]' + \r
+ 'sup[S]' + \r
+ 'input[]' + \r
+ 'select[optgroup|option]' + \r
+ 'optgroup[option]' + \r
+ 'option[]' + \r
+ 'textarea[]' + \r
+ 'label[S]' + \r
+ 'button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]' + \r
+ 'h4[S]' + \r
+ 'ins[#|X|form|a|H|K|N|O|Q]' + \r
+ 'h5[S]' + \r
+ 'del[#|X|form|a|H|K|N|O|Q]' + \r
+ 'h6[S]' + \r
+ 'div[#|X|form|a|H|K|N|O|Q]' + \r
+ 'ul[li]' + \r
+ 'li[#|X|form|a|H|K|N|O|Q]' + \r
+ 'ol[li]' + \r
+ 'dl[dt|dd]' + \r
+ 'dt[S]' + \r
+ 'dd[#|X|form|a|H|K|N|O|Q]' + \r
+ 'menu[li]' + \r
+ 'dir[li]' + \r
+ 'pre[ZA]' + \r
+ 'hr[]' + \r
+ 'blockquote[#|X|form|a|H|K|N|O|Q]' + \r
+ 'address[S|p]' + \r
+ 'center[#|X|form|a|H|K|N|O|Q]' + \r
+ 'noframes[#|X|form|a|H|K|N|O|Q]' + \r
+ 'isindex[]' + \r
+ 'fieldset[#|legend|X|form|a|H|K|N|O|Q]' + \r
+ 'legend[S]' + \r
+ 'table[caption|col|colgroup|thead|tfoot|tbody|tr]' + \r
+ 'caption[S]' + \r
+ 'col[]' + \r
+ 'colgroup[col]' + \r
+ 'thead[tr]' + \r
+ 'tr[th|td]' + \r
+ 'th[#|X|form|a|H|K|N|O|Q]' + \r
+ 'form[#|X|a|H|K|N|O|Q]' + \r
+ 'noscript[#|X|form|a|H|K|N|O|Q]' + \r
+ 'td[#|X|form|a|H|K|N|O|Q]' + \r
+ 'tfoot[tr]' + \r
+ 'tbody[tr]' + \r
+ 'area[]' + \r
+ 'base[]' + \r
+ 'body[#|X|form|a|H|K|N|O|Q]'\r
+ );\r
+\r
+ tinymce.dom.Schema = function() {\r
+ var t = this, elements = transitional;\r
+\r
+ t.isValid = function(name, child_name) {\r
+ var element = elements[name];\r
+\r
+ return !!(element && (!child_name || element[child_name]));\r
+ };\r
+ };\r
+})();\r
+(function(tinymce) {\r
+ tinymce.dom.RangeUtils = function(dom) {\r
+ var INVISIBLE_CHAR = '\uFEFF';\r
+\r
+ this.walk = function(rng, callback) {\r
+ var startContainer = rng.startContainer,\r
+ startOffset = rng.startOffset,\r
+ endContainer = rng.endContainer,\r
+ endOffset = rng.endOffset,\r
+ ancestor, startPoint,\r
+ endPoint, node, parent, siblings, nodes;\r
+\r
+ // Handle table cell selection the table plugin enables\r
+ // you to fake select table cells and perform formatting actions on them\r
+ nodes = dom.select('td.mceSelected,th.mceSelected');\r
+ if (nodes.length > 0) {\r
+ tinymce.each(nodes, function(node) {\r
+ callback([node]);\r
+ });\r
+\r
+ return;\r
+ }\r
+\r
+ function collectSiblings(node, name, end_node) {\r
+ var siblings = [];\r
+\r
+ for (; node && node != end_node; node = node[name])\r
+ siblings.push(node);\r
+\r
+ return siblings;\r
+ };\r
+\r
+ function findEndPoint(node, root) {\r
+ do {\r
+ if (node.parentNode == root)\r
+ return node;\r
+\r
+ node = node.parentNode;\r
+ } while(node);\r
+ };\r
+\r
+ function walkBoundary(start_node, end_node, next) {\r
+ var siblingName = next ? 'nextSibling' : 'previousSibling';\r
+\r
+ for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {\r
+ parent = node.parentNode;\r
+ siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);\r
+\r
+ if (siblings.length) {\r
+ if (!next)\r
+ siblings.reverse();\r
+\r
+ callback(siblings);\r
+ }\r
+ }\r
+ };\r
+\r
+ // If index based start position then resolve it\r
+ if (startContainer.nodeType == 1 && startContainer.hasChildNodes())\r
+ startContainer = startContainer.childNodes[startOffset];\r
+\r
+ // If index based end position then resolve it\r
+ if (endContainer.nodeType == 1 && endContainer.hasChildNodes())\r
+ endContainer = endContainer.childNodes[Math.min(startOffset == endOffset ? endOffset : endOffset - 1, endContainer.childNodes.length - 1)];\r
+\r
+ // Find common ancestor and end points\r
+ ancestor = dom.findCommonAncestor(startContainer, endContainer);\r
+\r
+ // Same container\r
+ if (startContainer == endContainer)\r
+ return callback([startContainer]);\r
+\r
+ // Process left side\r
+ for (node = startContainer; node; node = node.parentNode) {\r
+ if (node == endContainer)\r
+ return walkBoundary(startContainer, ancestor, true);\r
+\r
+ if (node == ancestor)\r
+ break;\r
+ }\r
+\r
+ // Process right side\r
+ for (node = endContainer; node; node = node.parentNode) {\r
+ if (node == startContainer)\r
+ return walkBoundary(endContainer, ancestor);\r
+\r
+ if (node == ancestor)\r
+ break;\r
+ }\r
+\r
+ // Find start/end point\r
+ startPoint = findEndPoint(startContainer, ancestor) || startContainer;\r
+ endPoint = findEndPoint(endContainer, ancestor) || endContainer;\r
+\r
+ // Walk left leaf\r
+ walkBoundary(startContainer, startPoint, true);\r
+\r
+ // Walk the middle from start to end point\r
+ siblings = collectSiblings(\r
+ startPoint == startContainer ? startPoint : startPoint.nextSibling,\r
+ 'nextSibling',\r
+ endPoint == endContainer ? endPoint.nextSibling : endPoint\r
+ );\r
+\r
+ if (siblings.length)\r
+ callback(siblings);\r
+\r
+ // Walk right leaf\r
+ walkBoundary(endContainer, endPoint);\r
+ };\r
+\r
+ /* this.split = function(rng) {\r
+ var startContainer = rng.startContainer,\r
+ startOffset = rng.startOffset,\r
+ endContainer = rng.endContainer,\r
+ endOffset = rng.endOffset;\r
+\r
+ function splitText(node, offset) {\r
+ if (offset == node.nodeValue.length)\r
+ node.appendData(INVISIBLE_CHAR);\r
+\r
+ node = node.splitText(offset);\r
+\r
+ if (node.nodeValue === INVISIBLE_CHAR)\r
+ node.nodeValue = '';\r
+\r
+ return node;\r
+ };\r
+\r
+ // Handle single text node\r
+ if (startContainer == endContainer) {\r
+ if (startContainer.nodeType == 3) {\r
+ if (startOffset != 0)\r
+ startContainer = endContainer = splitText(startContainer, startOffset);\r
+\r
+ if (endOffset - startOffset != startContainer.nodeValue.length)\r
+ splitText(startContainer, endOffset - startOffset);\r
+ }\r
+ } else {\r
+ // Split startContainer text node if needed\r
+ if (startContainer.nodeType == 3 && startOffset != 0) {\r
+ startContainer = splitText(startContainer, startOffset);\r
+ startOffset = 0;\r
+ }\r
+\r
+ // Split endContainer text node if needed\r
+ if (endContainer.nodeType == 3 && endOffset != endContainer.nodeValue.length) {\r
+ endContainer = splitText(endContainer, endOffset).previousSibling;\r
+ endOffset = endContainer.nodeValue.length;\r
+ }\r
+ }\r
+\r
+ return {\r
+ startContainer : startContainer,\r
+ startOffset : startOffset,\r
+ endContainer : endContainer,\r
+ endOffset : endOffset\r
+ };\r
+ };\r
+*/\r
+ };\r
+\r
+ tinymce.dom.RangeUtils.compareRanges = function(rng1, rng2) {\r
+ if (rng1 && rng2) {\r
+ // Compare native IE ranges\r
+ if (rng1.item || rng1.duplicate) {\r
+ // Both are control ranges and the selected element matches\r
+ if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0))\r
+ return true;\r
+\r
+ // Both are text ranges and the range matches\r
+ if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1))\r
+ return true;\r
+ } else {\r
+ // Compare w3c ranges\r
+ return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;\r
+ }\r
+ }\r
+\r
+ return false;\r
+ };\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ // Shorten class names\r
+ var DOM = tinymce.DOM, is = tinymce.is;\r
+\r
+ tinymce.create('tinymce.ui.Control', {\r
+ Control : function(id, s) {\r
+ this.id = id;\r
+ this.settings = s = s || {};\r
+ this.rendered = false;\r
+ this.onRender = new tinymce.util.Dispatcher(this);\r
+ this.classPrefix = '';\r
+ this.scope = s.scope || this;\r
+ this.disabled = 0;\r
+ this.active = 0;\r
+ },\r
+\r
+ setDisabled : function(s) {\r
+ var e;\r
+\r
+ if (s != this.disabled) {\r
+ e = DOM.get(this.id);\r
+\r
+ // Add accessibility title for unavailable actions\r
+ if (e && this.settings.unavailable_prefix) {\r
+ if (s) {\r
+ this.prevTitle = e.title;\r
+ e.title = this.settings.unavailable_prefix + ": " + e.title;\r
+ } else\r
+ e.title = this.prevTitle;\r
+ }\r
+\r
+ this.setState('Disabled', s);\r
+ this.setState('Enabled', !s);\r
+ this.disabled = s;\r
+ }\r
+ },\r
+\r
+ isDisabled : function() {\r
+ return this.disabled;\r
+ },\r
+\r
+ setActive : function(s) {\r
+ if (s != this.active) {\r
+ this.setState('Active', s);\r
+ this.active = s;\r
+ }\r
+ },\r
+\r
+ isActive : function() {\r
+ return this.active;\r
+ },\r
+\r
+ setState : function(c, s) {\r
+ var n = DOM.get(this.id);\r
+\r
+ c = this.classPrefix + c;\r
+\r
+ if (s)\r
+ DOM.addClass(n, c);\r
+ else\r
+ DOM.removeClass(n, c);\r
+ },\r
+\r
+ isRendered : function() {\r
+ return this.rendered;\r
+ },\r
+\r
+ renderHTML : function() {\r
+ },\r
+\r
+ renderTo : function(n) {\r
+ DOM.setHTML(n, this.renderHTML());\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, b;\r
+\r
+ // Set pending states\r
+ if (is(t.disabled)) {\r
+ b = t.disabled;\r
+ t.disabled = -1;\r
+ t.setDisabled(b);\r
+ }\r
+\r
+ if (is(t.active)) {\r
+ b = t.active;\r
+ t.active = -1;\r
+ t.setActive(b);\r
+ }\r
+ },\r
+\r
+ remove : function() {\r
+ DOM.remove(this.id);\r
+ this.destroy();\r
+ },\r
+\r
+ destroy : function() {\r
+ tinymce.dom.Event.clear(this.id);\r
+ }\r
+ });\r
+})(tinymce);\r
+tinymce.create('tinymce.ui.Container:tinymce.ui.Control', {\r
+ Container : function(id, s) {\r
+ this.parent(id, s);\r
+\r
+ this.controls = [];\r
+\r
+ this.lookup = {};\r
+ },\r
+\r
+ add : function(c) {\r
+ this.lookup[c.id] = c;\r
+ this.controls.push(c);\r
+\r
+ return c;\r
+ },\r
+\r
+ get : function(n) {\r
+ return this.lookup[n];\r
+ }\r
+});\r
+\r
+\r
+tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', {\r
+ Separator : function(id, s) {\r
+ this.parent(id, s);\r
+ this.classPrefix = 'mceSeparator';\r
+ },\r
+\r
+ renderHTML : function() {\r
+ return tinymce.DOM.createHTML('span', {'class' : this.classPrefix});\r
+ }\r
+});\r
+\r
+(function(tinymce) {\r
+ var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;\r
+\r
+ tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', {\r
+ MenuItem : function(id, s) {\r
+ this.parent(id, s);\r
+ this.classPrefix = 'mceMenuItem';\r
+ },\r
+\r
+ setSelected : function(s) {\r
+ this.setState('Selected', s);\r
+ this.selected = s;\r
+ },\r
+\r
+ isSelected : function() {\r
+ return this.selected;\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this;\r
+ \r
+ t.parent();\r
+\r
+ // Set pending state\r
+ if (is(t.selected))\r
+ t.setSelected(t.selected);\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk;\r
+\r
+ tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', {\r
+ Menu : function(id, s) {\r
+ var t = this;\r
+\r
+ t.parent(id, s);\r
+ t.items = {};\r
+ t.collapsed = false;\r
+ t.menuCount = 0;\r
+ t.onAddItem = new tinymce.util.Dispatcher(this);\r
+ },\r
+\r
+ expand : function(d) {\r
+ var t = this;\r
+\r
+ if (d) {\r
+ walk(t, function(o) {\r
+ if (o.expand)\r
+ o.expand();\r
+ }, 'items', t);\r
+ }\r
+\r
+ t.collapsed = false;\r
+ },\r
+\r
+ collapse : function(d) {\r
+ var t = this;\r
+\r
+ if (d) {\r
+ walk(t, function(o) {\r
+ if (o.collapse)\r
+ o.collapse();\r
+ }, 'items', t);\r
+ }\r
+\r
+ t.collapsed = true;\r
+ },\r
+\r
+ isCollapsed : function() {\r
+ return this.collapsed;\r
+ },\r
+\r
+ add : function(o) {\r
+ if (!o.settings)\r
+ o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o);\r
+\r
+ this.onAddItem.dispatch(this, o);\r
+\r
+ return this.items[o.id] = o;\r
+ },\r
+\r
+ addSeparator : function() {\r
+ return this.add({separator : true});\r
+ },\r
+\r
+ addMenu : function(o) {\r
+ if (!o.collapse)\r
+ o = this.createMenu(o);\r
+\r
+ this.menuCount++;\r
+\r
+ return this.add(o);\r
+ },\r
+\r
+ hasMenus : function() {\r
+ return this.menuCount !== 0;\r
+ },\r
+\r
+ remove : function(o) {\r
+ delete this.items[o.id];\r
+ },\r
+\r
+ removeAll : function() {\r
+ var t = this;\r
+\r
+ walk(t, function(o) {\r
+ if (o.removeAll)\r
+ o.removeAll();\r
+ else\r
+ o.remove();\r
+\r
+ o.destroy();\r
+ }, 'items', t);\r
+\r
+ t.items = {};\r
+ },\r
+\r
+ createMenu : function(o) {\r
+ var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o);\r
+\r
+ m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem);\r
+\r
+ return m;\r
+ }\r
+ });\r
+})(tinymce);\r
+(function(tinymce) {\r
+ var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element;\r
+\r
+ tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', {\r
+ DropMenu : function(id, s) {\r
+ s = s || {};\r
+ s.container = s.container || DOM.doc.body;\r
+ s.offset_x = s.offset_x || 0;\r
+ s.offset_y = s.offset_y || 0;\r
+ s.vp_offset_x = s.vp_offset_x || 0;\r
+ s.vp_offset_y = s.vp_offset_y || 0;\r
+\r
+ if (is(s.icons) && !s.icons)\r
+ s['class'] += ' mceNoIcons';\r
+\r
+ this.parent(id, s);\r
+ this.onShowMenu = new tinymce.util.Dispatcher(this);\r
+ this.onHideMenu = new tinymce.util.Dispatcher(this);\r
+ this.classPrefix = 'mceMenu';\r
+ },\r
+\r
+ createMenu : function(s) {\r
+ var t = this, cs = t.settings, m;\r
+\r
+ s.container = s.container || cs.container;\r
+ s.parent = t;\r
+ s.constrain = s.constrain || cs.constrain;\r
+ s['class'] = s['class'] || cs['class'];\r
+ s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x;\r
+ s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y;\r
+ m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s);\r
+\r
+ m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem);\r
+\r
+ return m;\r
+ },\r
+\r
+ update : function() {\r
+ var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th;\r
+\r
+ tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth;\r
+ th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight;\r
+\r
+ if (!DOM.boxModel)\r
+ t.element.setStyles({width : tw + 2, height : th + 2});\r
+ else\r
+ t.element.setStyles({width : tw, height : th});\r
+\r
+ if (s.max_width)\r
+ DOM.setStyle(co, 'width', tw);\r
+\r
+ if (s.max_height) {\r
+ DOM.setStyle(co, 'height', th);\r
+\r
+ if (tb.clientHeight < s.max_height)\r
+ DOM.setStyle(co, 'overflow', 'hidden');\r
+ }\r
+ },\r
+\r
+ showMenu : function(x, y, px) {\r
+ var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix;\r
+\r
+ t.collapse(1);\r
+\r
+ if (t.isMenuVisible)\r
+ return;\r
+\r
+ if (!t.rendered) {\r
+ co = DOM.add(t.settings.container, t.renderNode());\r
+\r
+ each(t.items, function(o) {\r
+ o.postRender();\r
+ });\r
+\r
+ t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});\r
+ } else\r
+ co = DOM.get('menu_' + t.id);\r
+\r
+ // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug\r
+ if (!tinymce.isOpera)\r
+ DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF});\r
+\r
+ DOM.show(co);\r
+ t.update();\r
+\r
+ x += s.offset_x || 0;\r
+ y += s.offset_y || 0;\r
+ vp.w -= 4;\r
+ vp.h -= 4;\r
+\r
+ // Move inside viewport if not submenu\r
+ if (s.constrain) {\r
+ w = co.clientWidth - ot;\r
+ h = co.clientHeight - ot;\r
+ mx = vp.x + vp.w;\r
+ my = vp.y + vp.h;\r
+\r
+ if ((x + s.vp_offset_x + w) > mx)\r
+ x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w);\r
+\r
+ if ((y + s.vp_offset_y + h) > my)\r
+ y = Math.max(0, (my - s.vp_offset_y) - h);\r
+ }\r
+\r
+ DOM.setStyles(co, {left : x , top : y});\r
+ t.element.update();\r
+\r
+ t.isMenuVisible = 1;\r
+ t.mouseClickFunc = Event.add(co, 'click', function(e) {\r
+ var m;\r
+\r
+ e = e.target;\r
+\r
+ if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) {\r
+ m = t.items[e.id];\r
+\r
+ if (m.isDisabled())\r
+ return;\r
+\r
+ dm = t;\r
+\r
+ while (dm) {\r
+ if (dm.hideMenu)\r
+ dm.hideMenu();\r
+\r
+ dm = dm.settings.parent;\r
+ }\r
+\r
+ if (m.settings.onclick)\r
+ m.settings.onclick(e);\r
+\r
+ return Event.cancel(e); // Cancel to fix onbeforeunload problem\r
+ }\r
+ });\r
+\r
+ if (t.hasMenus()) {\r
+ t.mouseOverFunc = Event.add(co, 'mouseover', function(e) {\r
+ var m, r, mi;\r
+\r
+ e = e.target;\r
+ if (e && (e = DOM.getParent(e, 'tr'))) {\r
+ m = t.items[e.id];\r
+\r
+ if (t.lastMenu)\r
+ t.lastMenu.collapse(1);\r
+\r
+ if (m.isDisabled())\r
+ return;\r
+\r
+ if (e && DOM.hasClass(e, cp + 'ItemSub')) {\r
+ //p = DOM.getPos(s.container);\r
+ r = DOM.getRect(e);\r
+ m.showMenu((r.x + r.w - ot), r.y - ot, r.x);\r
+ t.lastMenu = m;\r
+ DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive');\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ t.onShowMenu.dispatch(t);\r
+\r
+ if (s.keyboard_focus) {\r
+ Event.add(co, 'keydown', t._keyHandler, t);\r
+ DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link\r
+ t._focusIdx = 0;\r
+ }\r
+ },\r
+\r
+ hideMenu : function(c) {\r
+ var t = this, co = DOM.get('menu_' + t.id), e;\r
+\r
+ if (!t.isMenuVisible)\r
+ return;\r
+\r
+ Event.remove(co, 'mouseover', t.mouseOverFunc);\r
+ Event.remove(co, 'click', t.mouseClickFunc);\r
+ Event.remove(co, 'keydown', t._keyHandler);\r
+ DOM.hide(co);\r
+ t.isMenuVisible = 0;\r
+\r
+ if (!c)\r
+ t.collapse(1);\r
+\r
+ if (t.element)\r
+ t.element.hide();\r
+\r
+ if (e = DOM.get(t.id))\r
+ DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive');\r
+\r
+ t.onHideMenu.dispatch(t);\r
+ },\r
+\r
+ add : function(o) {\r
+ var t = this, co;\r
+\r
+ o = t.parent(o);\r
+\r
+ if (t.isRendered && (co = DOM.get('menu_' + t.id)))\r
+ t._add(DOM.select('tbody', co)[0], o);\r
+\r
+ return o;\r
+ },\r
+\r
+ collapse : function(d) {\r
+ this.parent(d);\r
+ this.hideMenu(1);\r
+ },\r
+\r
+ remove : function(o) {\r
+ DOM.remove(o.id);\r
+ this.destroy();\r
+\r
+ return this.parent(o);\r
+ },\r
+\r
+ destroy : function() {\r
+ var t = this, co = DOM.get('menu_' + t.id);\r
+\r
+ Event.remove(co, 'mouseover', t.mouseOverFunc);\r
+ Event.remove(co, 'click', t.mouseClickFunc);\r
+\r
+ if (t.element)\r
+ t.element.remove();\r
+\r
+ DOM.remove(co);\r
+ },\r
+\r
+ renderNode : function() {\r
+ var t = this, s = t.settings, n, tb, co, w;\r
+\r
+ w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'});\r
+ co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')});\r
+ t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container});\r
+\r
+ if (s.menu_line)\r
+ DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'});\r
+\r
+// n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'});\r
+ n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0});\r
+ tb = DOM.add(n, 'tbody');\r
+\r
+ each(t.items, function(o) {\r
+ t._add(tb, o);\r
+ });\r
+\r
+ t.rendered = true;\r
+\r
+ return w;\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _keyHandler : function(e) {\r
+ var t = this, kc = e.keyCode;\r
+\r
+ function focus(d) {\r
+ var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i];\r
+\r
+ if (e) {\r
+ t._focusIdx = i;\r
+ e.focus();\r
+ }\r
+ };\r
+\r
+ switch (kc) {\r
+ case 38:\r
+ focus(-1); // Select first link\r
+ return;\r
+\r
+ case 40:\r
+ focus(1);\r
+ return;\r
+\r
+ case 13:\r
+ return;\r
+\r
+ case 27:\r
+ return this.hideMenu();\r
+ }\r
+ },\r
+\r
+ _add : function(tb, o) {\r
+ var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic;\r
+\r
+ if (s.separator) {\r
+ ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'});\r
+ DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'});\r
+\r
+ if (n = ro.previousSibling)\r
+ DOM.addClass(n, 'mceLast');\r
+\r
+ return;\r
+ }\r
+\r
+ n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'});\r
+ n = it = DOM.add(n, 'td');\r
+ n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'});\r
+\r
+ DOM.addClass(it, s['class']);\r
+// n = DOM.add(n, 'span', {'class' : 'item'});\r
+\r
+ ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')});\r
+\r
+ if (s.icon_src)\r
+ DOM.add(ic, 'img', {src : s.icon_src});\r
+\r
+ n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title);\r
+\r
+ if (o.settings.style)\r
+ DOM.setAttrib(n, 'style', o.settings.style);\r
+\r
+ if (tb.childNodes.length == 1)\r
+ DOM.addClass(ro, 'mceFirst');\r
+\r
+ if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator'))\r
+ DOM.addClass(ro, 'mceFirst');\r
+\r
+ if (o.collapse)\r
+ DOM.addClass(ro, cp + 'ItemSub');\r
+\r
+ if (n = ro.previousSibling)\r
+ DOM.removeClass(n, 'mceLast');\r
+\r
+ DOM.addClass(ro, 'mceLast');\r
+ }\r
+ });\r
+})(tinymce);\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM;\r
+\r
+ tinymce.create('tinymce.ui.Button:tinymce.ui.Control', {\r
+ Button : function(id, s) {\r
+ this.parent(id, s);\r
+ this.classPrefix = 'mceButton';\r
+ },\r
+\r
+ renderHTML : function() {\r
+ var cp = this.classPrefix, s = this.settings, h, l;\r
+\r
+ l = DOM.encode(s.label || '');\r
+ h = '<a id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">';\r
+\r
+ if (s.image)\r
+ h += '<img class="mceIcon" src="' + s.image + '" />' + l + '</a>';\r
+ else\r
+ h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '') + '</a>';\r
+\r
+ return h;\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, s = t.settings;\r
+\r
+ tinymce.dom.Event.add(t.id, 'click', function(e) {\r
+ if (!t.isDisabled())\r
+ return s.onclick.call(s.scope, e);\r
+ });\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;\r
+\r
+ tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', {\r
+ ListBox : function(id, s) {\r
+ var t = this;\r
+\r
+ t.parent(id, s);\r
+\r
+ t.items = [];\r
+\r
+ t.onChange = new Dispatcher(t);\r
+\r
+ t.onPostRender = new Dispatcher(t);\r
+\r
+ t.onAdd = new Dispatcher(t);\r
+\r
+ t.onRenderMenu = new tinymce.util.Dispatcher(this);\r
+\r
+ t.classPrefix = 'mceListBox';\r
+ },\r
+\r
+ select : function(va) {\r
+ var t = this, fv, f;\r
+\r
+ if (va == undefined)\r
+ return t.selectByIndex(-1);\r
+\r
+ // Is string or number make function selector\r
+ if (va && va.call)\r
+ f = va;\r
+ else {\r
+ f = function(v) {\r
+ return v == va;\r
+ };\r
+ }\r
+\r
+ // Do we need to do something?\r
+ if (va != t.selectedValue) {\r
+ // Find item\r
+ each(t.items, function(o, i) {\r
+ if (f(o.value)) {\r
+ fv = 1;\r
+ t.selectByIndex(i);\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (!fv)\r
+ t.selectByIndex(-1);\r
+ }\r
+ },\r
+\r
+ selectByIndex : function(idx) {\r
+ var t = this, e, o;\r
+\r
+ if (idx != t.selectedIndex) {\r
+ e = DOM.get(t.id + '_text');\r
+ o = t.items[idx];\r
+\r
+ if (o) {\r
+ t.selectedValue = o.value;\r
+ t.selectedIndex = idx;\r
+ DOM.setHTML(e, DOM.encode(o.title));\r
+ DOM.removeClass(e, 'mceTitle');\r
+ } else {\r
+ DOM.setHTML(e, DOM.encode(t.settings.title));\r
+ DOM.addClass(e, 'mceTitle');\r
+ t.selectedValue = t.selectedIndex = null;\r
+ }\r
+\r
+ e = 0;\r
+ }\r
+ },\r
+\r
+ add : function(n, v, o) {\r
+ var t = this;\r
+\r
+ o = o || {};\r
+ o = tinymce.extend(o, {\r
+ title : n,\r
+ value : v\r
+ });\r
+\r
+ t.items.push(o);\r
+ t.onAdd.dispatch(t, o);\r
+ },\r
+\r
+ getLength : function() {\r
+ return this.items.length;\r
+ },\r
+\r
+ renderHTML : function() {\r
+ var h = '', t = this, s = t.settings, cp = t.classPrefix;\r
+\r
+ h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>';\r
+ h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>';\r
+ h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>';\r
+ h += '</tr></tbody></table>';\r
+\r
+ return h;\r
+ },\r
+\r
+ showMenu : function() {\r
+ var t = this, p1, p2, e = DOM.get(this.id), m;\r
+\r
+ if (t.isDisabled() || t.items.length == 0)\r
+ return;\r
+\r
+ if (t.menu && t.menu.isMenuVisible)\r
+ return t.hideMenu();\r
+\r
+ if (!t.isMenuRendered) {\r
+ t.renderMenu();\r
+ t.isMenuRendered = true;\r
+ }\r
+\r
+ p1 = DOM.getPos(this.settings.menu_container);\r
+ p2 = DOM.getPos(e);\r
+\r
+ m = t.menu;\r
+ m.settings.offset_x = p2.x;\r
+ m.settings.offset_y = p2.y;\r
+ m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus\r
+\r
+ // Select in menu\r
+ if (t.oldID)\r
+ m.items[t.oldID].setSelected(0);\r
+\r
+ each(t.items, function(o) {\r
+ if (o.value === t.selectedValue) {\r
+ m.items[o.id].setSelected(1);\r
+ t.oldID = o.id;\r
+ }\r
+ });\r
+\r
+ m.showMenu(0, e.clientHeight);\r
+\r
+ Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
+ DOM.addClass(t.id, t.classPrefix + 'Selected');\r
+\r
+ //DOM.get(t.id + '_text').focus();\r
+ },\r
+\r
+ hideMenu : function(e) {\r
+ var t = this;\r
+\r
+ if (t.menu && t.menu.isMenuVisible) {\r
+ // Prevent double toogles by canceling the mouse click event to the button\r
+ if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open'))\r
+ return;\r
+\r
+ if (!e || !DOM.getParent(e.target, '.mceMenu')) {\r
+ DOM.removeClass(t.id, t.classPrefix + 'Selected');\r
+ Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
+ t.menu.hideMenu();\r
+ }\r
+ }\r
+ },\r
+\r
+ renderMenu : function() {\r
+ var t = this, m;\r
+\r
+ m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
+ menu_line : 1,\r
+ 'class' : t.classPrefix + 'Menu mceNoIcons',\r
+ max_width : 150,\r
+ max_height : 150\r
+ });\r
+\r
+ m.onHideMenu.add(t.hideMenu, t);\r
+\r
+ m.add({\r
+ title : t.settings.title,\r
+ 'class' : 'mceMenuItemTitle',\r
+ onclick : function() {\r
+ if (t.settings.onselect('') !== false)\r
+ t.select(''); // Must be runned after\r
+ }\r
+ });\r
+\r
+ each(t.items, function(o) {\r
+ // No value then treat it as a title\r
+ if (o.value === undefined) {\r
+ m.add({\r
+ title : o.title,\r
+ 'class' : 'mceMenuItemTitle',\r
+ onclick : function() {\r
+ if (t.settings.onselect('') !== false)\r
+ t.select(''); // Must be runned after\r
+ }\r
+ });\r
+ } else {\r
+ o.id = DOM.uniqueId();\r
+ o.onclick = function() {\r
+ if (t.settings.onselect(o.value) !== false)\r
+ t.select(o.value); // Must be runned after\r
+ };\r
+\r
+ m.add(o);\r
+ }\r
+ });\r
+\r
+ t.onRenderMenu.dispatch(t, m);\r
+ t.menu = m;\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, cp = t.classPrefix;\r
+\r
+ Event.add(t.id, 'click', t.showMenu, t);\r
+ Event.add(t.id + '_text', 'focus', function() {\r
+ if (!t._focused) {\r
+ t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) {\r
+ var idx = -1, v, kc = e.keyCode;\r
+\r
+ // Find current index\r
+ each(t.items, function(v, i) {\r
+ if (t.selectedValue == v.value)\r
+ idx = i;\r
+ });\r
+\r
+ // Move up/down\r
+ if (kc == 38)\r
+ v = t.items[idx - 1];\r
+ else if (kc == 40)\r
+ v = t.items[idx + 1];\r
+ else if (kc == 13) {\r
+ // Fake select on enter\r
+ v = t.selectedValue;\r
+ t.selectedValue = null; // Needs to be null to fake change\r
+ t.settings.onselect(v);\r
+ return Event.cancel(e);\r
+ }\r
+\r
+ if (v) {\r
+ t.hideMenu();\r
+ t.select(v.value);\r
+ }\r
+ });\r
+ }\r
+\r
+ t._focused = 1;\r
+ });\r
+ Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;});\r
+\r
+ // Old IE doesn't have hover on all elements\r
+ if (tinymce.isIE6 || !DOM.boxModel) {\r
+ Event.add(t.id, 'mouseover', function() {\r
+ if (!DOM.hasClass(t.id, cp + 'Disabled'))\r
+ DOM.addClass(t.id, cp + 'Hover');\r
+ });\r
+\r
+ Event.add(t.id, 'mouseout', function() {\r
+ if (!DOM.hasClass(t.id, cp + 'Disabled'))\r
+ DOM.removeClass(t.id, cp + 'Hover');\r
+ });\r
+ }\r
+\r
+ t.onPostRender.dispatch(t, DOM.get(t.id));\r
+ },\r
+\r
+ destroy : function() {\r
+ this.parent();\r
+\r
+ Event.clear(this.id + '_text');\r
+ Event.clear(this.id + '_open');\r
+ }\r
+ });\r
+})(tinymce);\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher;\r
+\r
+ tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', {\r
+ NativeListBox : function(id, s) {\r
+ this.parent(id, s);\r
+ this.classPrefix = 'mceNativeListBox';\r
+ },\r
+\r
+ setDisabled : function(s) {\r
+ DOM.get(this.id).disabled = s;\r
+ },\r
+\r
+ isDisabled : function() {\r
+ return DOM.get(this.id).disabled;\r
+ },\r
+\r
+ select : function(va) {\r
+ var t = this, fv, f;\r
+\r
+ if (va == undefined)\r
+ return t.selectByIndex(-1);\r
+\r
+ // Is string or number make function selector\r
+ if (va && va.call)\r
+ f = va;\r
+ else {\r
+ f = function(v) {\r
+ return v == va;\r
+ };\r
+ }\r
+\r
+ // Do we need to do something?\r
+ if (va != t.selectedValue) {\r
+ // Find item\r
+ each(t.items, function(o, i) {\r
+ if (f(o.value)) {\r
+ fv = 1;\r
+ t.selectByIndex(i);\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (!fv)\r
+ t.selectByIndex(-1);\r
+ }\r
+ },\r
+\r
+ selectByIndex : function(idx) {\r
+ DOM.get(this.id).selectedIndex = idx + 1;\r
+ this.selectedValue = this.items[idx] ? this.items[idx].value : null;\r
+ },\r
+\r
+ add : function(n, v, a) {\r
+ var o, t = this;\r
+\r
+ a = a || {};\r
+ a.value = v;\r
+\r
+ if (t.isRendered())\r
+ DOM.add(DOM.get(this.id), 'option', a, n);\r
+\r
+ o = {\r
+ title : n,\r
+ value : v,\r
+ attribs : a\r
+ };\r
+\r
+ t.items.push(o);\r
+ t.onAdd.dispatch(t, o);\r
+ },\r
+\r
+ getLength : function() {\r
+ return this.items.length;\r
+ },\r
+\r
+ renderHTML : function() {\r
+ var h, t = this;\r
+\r
+ h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --');\r
+\r
+ each(t.items, function(it) {\r
+ h += DOM.createHTML('option', {value : it.value}, it.title);\r
+ });\r
+\r
+ h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h);\r
+\r
+ return h;\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, ch;\r
+\r
+ t.rendered = true;\r
+\r
+ function onChange(e) {\r
+ var v = t.items[e.target.selectedIndex - 1];\r
+\r
+ if (v && (v = v.value)) {\r
+ t.onChange.dispatch(t, v);\r
+\r
+ if (t.settings.onselect)\r
+ t.settings.onselect(v);\r
+ }\r
+ };\r
+\r
+ Event.add(t.id, 'change', onChange);\r
+\r
+ // Accessibility keyhandler\r
+ Event.add(t.id, 'keydown', function(e) {\r
+ var bf;\r
+\r
+ Event.remove(t.id, 'change', ch);\r
+\r
+ bf = Event.add(t.id, 'blur', function() {\r
+ Event.add(t.id, 'change', onChange);\r
+ Event.remove(t.id, 'blur', bf);\r
+ });\r
+\r
+ if (e.keyCode == 13 || e.keyCode == 32) {\r
+ onChange(e);\r
+ return Event.cancel(e);\r
+ }\r
+ });\r
+\r
+ t.onPostRender.dispatch(t, DOM.get(t.id));\r
+ }\r
+ });\r
+})(tinymce);\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', {\r
+ MenuButton : function(id, s) {\r
+ this.parent(id, s);\r
+\r
+ this.onRenderMenu = new tinymce.util.Dispatcher(this);\r
+\r
+ s.menu_container = s.menu_container || DOM.doc.body;\r
+ },\r
+\r
+ showMenu : function() {\r
+ var t = this, p1, p2, e = DOM.get(t.id), m;\r
+\r
+ if (t.isDisabled())\r
+ return;\r
+\r
+ if (!t.isMenuRendered) {\r
+ t.renderMenu();\r
+ t.isMenuRendered = true;\r
+ }\r
+\r
+ if (t.isMenuVisible)\r
+ return t.hideMenu();\r
+\r
+ p1 = DOM.getPos(t.settings.menu_container);\r
+ p2 = DOM.getPos(e);\r
+\r
+ m = t.menu;\r
+ m.settings.offset_x = p2.x;\r
+ m.settings.offset_y = p2.y;\r
+ m.settings.vp_offset_x = p2.x;\r
+ m.settings.vp_offset_y = p2.y;\r
+ m.settings.keyboard_focus = t._focused;\r
+ m.showMenu(0, e.clientHeight);\r
+\r
+ Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
+ t.setState('Selected', 1);\r
+\r
+ t.isMenuVisible = 1;\r
+ },\r
+\r
+ renderMenu : function() {\r
+ var t = this, m;\r
+\r
+ m = t.settings.control_manager.createDropMenu(t.id + '_menu', {\r
+ menu_line : 1,\r
+ 'class' : this.classPrefix + 'Menu',\r
+ icons : t.settings.icons\r
+ });\r
+\r
+ m.onHideMenu.add(t.hideMenu, t);\r
+\r
+ t.onRenderMenu.dispatch(t, m);\r
+ t.menu = m;\r
+ },\r
+\r
+ hideMenu : function(e) {\r
+ var t = this;\r
+\r
+ // Prevent double toogles by canceling the mouse click event to the button\r
+ if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';}))\r
+ return;\r
+\r
+ if (!e || !DOM.getParent(e.target, '.mceMenu')) {\r
+ t.setState('Selected', 0);\r
+ Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
+ if (t.menu)\r
+ t.menu.hideMenu();\r
+ }\r
+\r
+ t.isMenuVisible = 0;\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, s = t.settings;\r
+\r
+ Event.add(t.id, 'click', function() {\r
+ if (!t.isDisabled()) {\r
+ if (s.onclick)\r
+ s.onclick(t.value);\r
+\r
+ t.showMenu();\r
+ }\r
+ });\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', {\r
+ SplitButton : function(id, s) {\r
+ this.parent(id, s);\r
+ this.classPrefix = 'mceSplitButton';\r
+ },\r
+\r
+ renderHTML : function() {\r
+ var h, t = this, s = t.settings, h1;\r
+\r
+ h = '<tbody><tr>';\r
+\r
+ if (s.image)\r
+ h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']});\r
+ else\r
+ h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, '');\r
+\r
+ h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';\r
+ \r
+ h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']});\r
+ h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>';\r
+\r
+ h += '</tr></tbody>';\r
+\r
+ return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h);\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, s = t.settings;\r
+\r
+ if (s.onclick) {\r
+ Event.add(t.id + '_action', 'click', function() {\r
+ if (!t.isDisabled())\r
+ s.onclick(t.value);\r
+ });\r
+ }\r
+\r
+ Event.add(t.id + '_open', 'click', t.showMenu, t);\r
+ Event.add(t.id + '_open', 'focus', function() {t._focused = 1;});\r
+ Event.add(t.id + '_open', 'blur', function() {t._focused = 0;});\r
+\r
+ // Old IE doesn't have hover on all elements\r
+ if (tinymce.isIE6 || !DOM.boxModel) {\r
+ Event.add(t.id, 'mouseover', function() {\r
+ if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))\r
+ DOM.addClass(t.id, 'mceSplitButtonHover');\r
+ });\r
+\r
+ Event.add(t.id, 'mouseout', function() {\r
+ if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled'))\r
+ DOM.removeClass(t.id, 'mceSplitButtonHover');\r
+ });\r
+ }\r
+ },\r
+\r
+ destroy : function() {\r
+ this.parent();\r
+\r
+ Event.clear(this.id + '_action');\r
+ Event.clear(this.id + '_open');\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', {\r
+ ColorSplitButton : function(id, s) {\r
+ var t = this;\r
+\r
+ t.parent(id, s);\r
+\r
+ t.settings = s = tinymce.extend({\r
+ colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF',\r
+ grid_width : 8,\r
+ default_color : '#888888'\r
+ }, t.settings);\r
+\r
+ t.onShowMenu = new tinymce.util.Dispatcher(t);\r
+\r
+ t.onHideMenu = new tinymce.util.Dispatcher(t);\r
+\r
+ t.value = s.default_color;\r
+ },\r
+\r
+ showMenu : function() {\r
+ var t = this, r, p, e, p2;\r
+\r
+ if (t.isDisabled())\r
+ return;\r
+\r
+ if (!t.isMenuRendered) {\r
+ t.renderMenu();\r
+ t.isMenuRendered = true;\r
+ }\r
+\r
+ if (t.isMenuVisible)\r
+ return t.hideMenu();\r
+\r
+ e = DOM.get(t.id);\r
+ DOM.show(t.id + '_menu');\r
+ DOM.addClass(e, 'mceSplitButtonSelected');\r
+ p2 = DOM.getPos(e);\r
+ DOM.setStyles(t.id + '_menu', {\r
+ left : p2.x,\r
+ top : p2.y + e.clientHeight,\r
+ zIndex : 200000\r
+ });\r
+ e = 0;\r
+\r
+ Event.add(DOM.doc, 'mousedown', t.hideMenu, t);\r
+ t.onShowMenu.dispatch(t);\r
+\r
+ if (t._focused) {\r
+ t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) {\r
+ if (e.keyCode == 27)\r
+ t.hideMenu();\r
+ });\r
+\r
+ DOM.select('a', t.id + '_menu')[0].focus(); // Select first link\r
+ }\r
+\r
+ t.isMenuVisible = 1;\r
+ },\r
+\r
+ hideMenu : function(e) {\r
+ var t = this;\r
+\r
+ // Prevent double toogles by canceling the mouse click event to the button\r
+ if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';}))\r
+ return;\r
+\r
+ if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) {\r
+ DOM.removeClass(t.id, 'mceSplitButtonSelected');\r
+ Event.remove(DOM.doc, 'mousedown', t.hideMenu, t);\r
+ Event.remove(t.id + '_menu', 'keydown', t._keyHandler);\r
+ DOM.hide(t.id + '_menu');\r
+ }\r
+\r
+ t.onHideMenu.dispatch(t);\r
+\r
+ t.isMenuVisible = 0;\r
+ },\r
+\r
+ renderMenu : function() {\r
+ var t = this, m, i = 0, s = t.settings, n, tb, tr, w;\r
+\r
+ w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'});\r
+ m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'});\r
+ DOM.add(m, 'span', {'class' : 'mceMenuLine'});\r
+\r
+ n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'});\r
+ tb = DOM.add(n, 'tbody');\r
+\r
+ // Generate color grid\r
+ i = 0;\r
+ each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) {\r
+ c = c.replace(/^#/, '');\r
+\r
+ if (!i--) {\r
+ tr = DOM.add(tb, 'tr');\r
+ i = s.grid_width - 1;\r
+ }\r
+\r
+ n = DOM.add(tr, 'td');\r
+\r
+ n = DOM.add(n, 'a', {\r
+ href : 'javascript:;',\r
+ style : {\r
+ backgroundColor : '#' + c\r
+ },\r
+ _mce_color : '#' + c\r
+ });\r
+ });\r
+\r
+ if (s.more_colors_func) {\r
+ n = DOM.add(tb, 'tr');\r
+ n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'});\r
+ n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title);\r
+\r
+ Event.add(n, 'click', function(e) {\r
+ s.more_colors_func.call(s.more_colors_scope || this);\r
+ return Event.cancel(e); // Cancel to fix onbeforeunload problem\r
+ });\r
+ }\r
+\r
+ DOM.addClass(m, 'mceColorSplitMenu');\r
+\r
+ Event.add(t.id + '_menu', 'click', function(e) {\r
+ var c;\r
+\r
+ e = e.target;\r
+\r
+ if (e.nodeName == 'A' && (c = e.getAttribute('_mce_color')))\r
+ t.setColor(c);\r
+\r
+ return Event.cancel(e); // Prevent IE auto save warning\r
+ });\r
+\r
+ return w;\r
+ },\r
+\r
+ setColor : function(c) {\r
+ var t = this;\r
+\r
+ DOM.setStyle(t.id + '_preview', 'backgroundColor', c);\r
+\r
+ t.value = c;\r
+ t.hideMenu();\r
+ t.settings.onselect(c);\r
+ },\r
+\r
+ postRender : function() {\r
+ var t = this, id = t.id;\r
+\r
+ t.parent();\r
+ DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'});\r
+ DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value);\r
+ },\r
+\r
+ destroy : function() {\r
+ this.parent();\r
+\r
+ Event.clear(this.id + '_menu');\r
+ Event.clear(this.id + '_more');\r
+ DOM.remove(this.id + '_menu');\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {\r
+ renderHTML : function() {\r
+ var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl;\r
+\r
+ cl = t.controls;\r
+ for (i=0; i<cl.length; i++) {\r
+ // Get current control, prev control, next control and if the control is a list box or not\r
+ co = cl[i];\r
+ pr = cl[i - 1];\r
+ nx = cl[i + 1];\r
+\r
+ // Add toolbar start\r
+ if (i === 0) {\r
+ c = 'mceToolbarStart';\r
+\r
+ if (co.Button)\r
+ c += ' mceToolbarStartButton';\r
+ else if (co.SplitButton)\r
+ c += ' mceToolbarStartSplitButton';\r
+ else if (co.ListBox)\r
+ c += ' mceToolbarStartListBox';\r
+\r
+ h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));\r
+ }\r
+\r
+ // Add toolbar end before list box and after the previous button\r
+ // This is to fix the o2k7 editor skins\r
+ if (pr && co.ListBox) {\r
+ if (pr.Button || pr.SplitButton)\r
+ h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->'));\r
+ }\r
+\r
+ // Render control HTML\r
+\r
+ // IE 8 quick fix, needed to propertly generate a hit area for anchors\r
+ if (dom.stdMode)\r
+ h += '<td style="position: relative">' + co.renderHTML() + '</td>';\r
+ else\r
+ h += '<td>' + co.renderHTML() + '</td>';\r
+\r
+ // Add toolbar start after list box and before the next button\r
+ // This is to fix the o2k7 editor skins\r
+ if (nx && co.ListBox) {\r
+ if (nx.Button || nx.SplitButton)\r
+ h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->'));\r
+ }\r
+ }\r
+\r
+ c = 'mceToolbarEnd';\r
+\r
+ if (co.Button)\r
+ c += ' mceToolbarEndButton';\r
+ else if (co.SplitButton)\r
+ c += ' mceToolbarEndSplitButton';\r
+ else if (co.ListBox)\r
+ c += ' mceToolbarEndListBox';\r
+\r
+ h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->'));\r
+\r
+ return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>');\r
+ }\r
+});\r
+\r
+(function(tinymce) {\r
+ var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each;\r
+\r
+ tinymce.create('tinymce.AddOnManager', {\r
+ items : [],\r
+ urls : {},\r
+ lookup : {},\r
+\r
+ onAdd : new Dispatcher(this),\r
+\r
+ get : function(n) {\r
+ return this.lookup[n];\r
+ },\r
+\r
+ requireLangPack : function(n) {\r
+ var s = tinymce.settings;\r
+\r
+ if (s && s.language)\r
+ tinymce.ScriptLoader.add(this.urls[n] + '/langs/' + s.language + '.js');\r
+ },\r
+\r
+ add : function(id, o) {\r
+ this.items.push(o);\r
+ this.lookup[id] = o;\r
+ this.onAdd.dispatch(this, id, o);\r
+\r
+ return o;\r
+ },\r
+\r
+ load : function(n, u, cb, s) {\r
+ var t = this;\r
+\r
+ if (t.urls[n])\r
+ return;\r
+\r
+ if (u.indexOf('/') != 0 && u.indexOf('://') == -1)\r
+ u = tinymce.baseURL + '/' + u;\r
+\r
+ t.urls[n] = u.substring(0, u.lastIndexOf('/'));\r
+ tinymce.ScriptLoader.add(u, cb, s);\r
+ }\r
+ });\r
+\r
+ // Create plugin and theme managers\r
+ tinymce.PluginManager = new tinymce.AddOnManager();\r
+ tinymce.ThemeManager = new tinymce.AddOnManager();\r
+}(tinymce));\r
+\r
+(function(tinymce) {\r
+ // Shorten names\r
+ var each = tinymce.each, extend = tinymce.extend,\r
+ DOM = tinymce.DOM, Event = tinymce.dom.Event,\r
+ ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
+ explode = tinymce.explode,\r
+ Dispatcher = tinymce.util.Dispatcher, undefined, instanceCounter = 0;\r
+\r
+ // Setup some URLs where the editor API is located and where the document is\r
+ tinymce.documentBaseURL = window.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');\r
+ if (!/[\/\\]$/.test(tinymce.documentBaseURL))\r
+ tinymce.documentBaseURL += '/';\r
+\r
+ tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL);\r
+\r
+ tinymce.baseURI = new tinymce.util.URI(tinymce.baseURL);\r
+\r
+ // Add before unload listener\r
+ // This was required since IE was leaking memory if you added and removed beforeunload listeners\r
+ // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event\r
+ tinymce.onBeforeUnload = new Dispatcher(tinymce);\r
+\r
+ // Must be on window or IE will leak if the editor is placed in frame or iframe\r
+ Event.add(window, 'beforeunload', function(e) {\r
+ tinymce.onBeforeUnload.dispatch(tinymce, e);\r
+ });\r
+\r
+ tinymce.onAddEditor = new Dispatcher(tinymce);\r
+\r
+ tinymce.onRemoveEditor = new Dispatcher(tinymce);\r
+\r
+ tinymce.EditorManager = extend(tinymce, {\r
+ editors : [],\r
+\r
+ i18n : {},\r
+\r
+ activeEditor : null,\r
+\r
+ init : function(s) {\r
+ var t = this, pl, sl = tinymce.ScriptLoader, e, el = [], ed;\r
+\r
+ function execCallback(se, n, s) {\r
+ var f = se[n];\r
+\r
+ if (!f)\r
+ return;\r
+\r
+ if (tinymce.is(f, 'string')) {\r
+ s = f.replace(/\.\w+$/, '');\r
+ s = s ? tinymce.resolve(s) : 0;\r
+ f = tinymce.resolve(f);\r
+ }\r
+\r
+ return f.apply(s || this, Array.prototype.slice.call(arguments, 2));\r
+ };\r
+\r
+ s = extend({\r
+ theme : "simple",\r
+ language : "en"\r
+ }, s);\r
+\r
+ t.settings = s;\r
+\r
+ // Legacy call\r
+ Event.add(document, 'init', function() {\r
+ var l, co;\r
+\r
+ execCallback(s, 'onpageload');\r
+\r
+ switch (s.mode) {\r
+ case "exact":\r
+ l = s.elements || '';\r
+\r
+ if(l.length > 0) {\r
+ each(explode(l), function(v) {\r
+ if (DOM.get(v)) {\r
+ ed = new tinymce.Editor(v, s);\r
+ el.push(ed);\r
+ ed.render(1);\r
+ } else {\r
+ each(document.forms, function(f) {\r
+ each(f.elements, function(e) {\r
+ if (e.name === v) {\r
+ v = 'mce_editor_' + instanceCounter++;\r
+ DOM.setAttrib(e, 'id', v);\r
+\r
+ ed = new tinymce.Editor(v, s);\r
+ el.push(ed);\r
+ ed.render(1);\r
+ }\r
+ });\r
+ });\r
+ }\r
+ });\r
+ }\r
+ break;\r
+\r
+ case "textareas":\r
+ case "specific_textareas":\r
+ function hasClass(n, c) {\r
+ return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c);\r
+ };\r
+\r
+ each(DOM.select('textarea'), function(v) {\r
+ if (s.editor_deselector && hasClass(v, s.editor_deselector))\r
+ return;\r
+\r
+ if (!s.editor_selector || hasClass(v, s.editor_selector)) {\r
+ // Can we use the name\r
+ e = DOM.get(v.name);\r
+ if (!v.id && !e)\r
+ v.id = v.name;\r
+\r
+ // Generate unique name if missing or already exists\r
+ if (!v.id || t.get(v.id))\r
+ v.id = DOM.uniqueId();\r
+\r
+ ed = new tinymce.Editor(v.id, s);\r
+ el.push(ed);\r
+ ed.render(1);\r
+ }\r
+ });\r
+ break;\r
+ }\r
+\r
+ // Call onInit when all editors are initialized\r
+ if (s.oninit) {\r
+ l = co = 0;\r
+\r
+ each(el, function(ed) {\r
+ co++;\r
+\r
+ if (!ed.initialized) {\r
+ // Wait for it\r
+ ed.onInit.add(function() {\r
+ l++;\r
+\r
+ // All done\r
+ if (l == co)\r
+ execCallback(s, 'oninit');\r
+ });\r
+ } else\r
+ l++;\r
+\r
+ // All done\r
+ if (l == co)\r
+ execCallback(s, 'oninit'); \r
+ });\r
+ }\r
+ });\r
+ },\r
+\r
+ get : function(id) {\r
+ if (id === undefined)\r
+ return this.editors;\r
+\r
+ return this.editors[id];\r
+ },\r
+\r
+ getInstanceById : function(id) {\r
+ return this.get(id);\r
+ },\r
+\r
+ add : function(editor) {\r
+ var self = this, editors = self.editors;\r
+\r
+ // Add named and index editor instance\r
+ editors[editor.id] = editor;\r
+ editors.push(editor);\r
+\r
+ self._setActive(editor);\r
+ self.onAddEditor.dispatch(self, editor);\r
+\r
+\r
+ return editor;\r
+ },\r
+\r
+ remove : function(editor) {\r
+ var t = this, i, editors = t.editors;\r
+\r
+ // Not in the collection\r
+ if (!editors[editor.id])\r
+ return null;\r
+\r
+ delete editors[editor.id];\r
+\r
+ for (i = 0; i < editors.length; i++) {\r
+ if (editors[i] == editor) {\r
+ editors.splice(i, 1);\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Select another editor since the active one was removed\r
+ if (t.activeEditor == editor)\r
+ t._setActive(editors[0]);\r
+\r
+ editor.destroy();\r
+ t.onRemoveEditor.dispatch(t, editor);\r
+\r
+ return editor;\r
+ },\r
+\r
+ execCommand : function(c, u, v) {\r
+ var t = this, ed = t.get(v), w;\r
+\r
+ // Manager commands\r
+ switch (c) {\r
+ case "mceFocus":\r
+ ed.focus();\r
+ return true;\r
+\r
+ case "mceAddEditor":\r
+ case "mceAddControl":\r
+ if (!t.get(v))\r
+ new tinymce.Editor(v, t.settings).render();\r
+\r
+ return true;\r
+\r
+ case "mceAddFrameControl":\r
+ w = v.window;\r
+\r
+ // Add tinyMCE global instance and tinymce namespace to specified window\r
+ w.tinyMCE = tinyMCE;\r
+ w.tinymce = tinymce;\r
+\r
+ tinymce.DOM.doc = w.document;\r
+ tinymce.DOM.win = w;\r
+\r
+ ed = new tinymce.Editor(v.element_id, v);\r
+ ed.render();\r
+\r
+ // Fix IE memory leaks\r
+ if (tinymce.isIE) {\r
+ function clr() {\r
+ ed.destroy();\r
+ w.detachEvent('onunload', clr);\r
+ w = w.tinyMCE = w.tinymce = null; // IE leak\r
+ };\r
+\r
+ w.attachEvent('onunload', clr);\r
+ }\r
+\r
+ v.page_window = null;\r
+\r
+ return true;\r
+\r
+ case "mceRemoveEditor":\r
+ case "mceRemoveControl":\r
+ if (ed)\r
+ ed.remove();\r
+\r
+ return true;\r
+\r
+ case 'mceToggleEditor':\r
+ if (!ed) {\r
+ t.execCommand('mceAddControl', 0, v);\r
+ return true;\r
+ }\r
+\r
+ if (ed.isHidden())\r
+ ed.show();\r
+ else\r
+ ed.hide();\r
+\r
+ return true;\r
+ }\r
+\r
+ // Run command on active editor\r
+ if (t.activeEditor)\r
+ return t.activeEditor.execCommand(c, u, v);\r
+\r
+ return false;\r
+ },\r
+\r
+ execInstanceCommand : function(id, c, u, v) {\r
+ var ed = this.get(id);\r
+\r
+ if (ed)\r
+ return ed.execCommand(c, u, v);\r
+\r
+ return false;\r
+ },\r
+\r
+ triggerSave : function() {\r
+ each(this.editors, function(e) {\r
+ e.save();\r
+ });\r
+ },\r
+\r
+ addI18n : function(p, o) {\r
+ var lo, i18n = this.i18n;\r
+\r
+ if (!tinymce.is(p, 'string')) {\r
+ each(p, function(o, lc) {\r
+ each(o, function(o, g) {\r
+ each(o, function(o, k) {\r
+ if (g === 'common')\r
+ i18n[lc + '.' + k] = o;\r
+ else\r
+ i18n[lc + '.' + g + '.' + k] = o;\r
+ });\r
+ });\r
+ });\r
+ } else {\r
+ each(o, function(o, k) {\r
+ i18n[p + '.' + k] = o;\r
+ });\r
+ }\r
+ },\r
+\r
+ // Private methods\r
+\r
+ _setActive : function(editor) {\r
+ this.selectedInstance = this.activeEditor = editor;\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ // Shorten these names\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend,\r
+ Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isGecko = tinymce.isGecko,\r
+ isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, is = tinymce.is,\r
+ ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager,\r
+ inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode;\r
+\r
+ tinymce.create('tinymce.Editor', {\r
+ Editor : function(id, s) {\r
+ var t = this;\r
+\r
+ t.id = t.editorId = id;\r
+\r
+ t.execCommands = {};\r
+ t.queryStateCommands = {};\r
+ t.queryValueCommands = {};\r
+\r
+ t.isNotDirty = false;\r
+\r
+ t.plugins = {};\r
+\r
+ // Add events to the editor\r
+ each([\r
+ 'onPreInit',\r
+\r
+ 'onBeforeRenderUI',\r
+\r
+ 'onPostRender',\r
+\r
+ 'onInit',\r
+\r
+ 'onRemove',\r
+\r
+ 'onActivate',\r
+\r
+ 'onDeactivate',\r
+\r
+ 'onClick',\r
+\r
+ 'onEvent',\r
+\r
+ 'onMouseUp',\r
+\r
+ 'onMouseDown',\r
+\r
+ 'onDblClick',\r
+\r
+ 'onKeyDown',\r
+\r
+ 'onKeyUp',\r
+\r
+ 'onKeyPress',\r
+\r
+ 'onContextMenu',\r
+\r
+ 'onSubmit',\r
+\r
+ 'onReset',\r
+\r
+ 'onPaste',\r
+\r
+ 'onPreProcess',\r
+\r
+ 'onPostProcess',\r
+\r
+ 'onBeforeSetContent',\r
+\r
+ 'onBeforeGetContent',\r
+\r
+ 'onSetContent',\r
+\r
+ 'onGetContent',\r
+\r
+ 'onLoadContent',\r
+\r
+ 'onSaveContent',\r
+\r
+ 'onNodeChange',\r
+\r
+ 'onChange',\r
+\r
+ 'onBeforeExecCommand',\r
+\r
+ 'onExecCommand',\r
+\r
+ 'onUndo',\r
+\r
+ 'onRedo',\r
+\r
+ 'onVisualAid',\r
+\r
+ 'onSetProgressState'\r
+ ], function(e) {\r
+ t[e] = new Dispatcher(t);\r
+ });\r
+\r
+ t.settings = s = extend({\r
+ id : id,\r
+ language : 'en',\r
+ docs_language : 'en',\r
+ theme : 'simple',\r
+ skin : 'default',\r
+ delta_width : 0,\r
+ delta_height : 0,\r
+ popup_css : '',\r
+ plugins : '',\r
+ document_base_url : tinymce.documentBaseURL,\r
+ add_form_submit_trigger : 1,\r
+ submit_patch : 1,\r
+ add_unload_trigger : 1,\r
+ convert_urls : 1,\r
+ relative_urls : 1,\r
+ remove_script_host : 1,\r
+ table_inline_editing : 0,\r
+ object_resizing : 1,\r
+ cleanup : 1,\r
+ accessibility_focus : 1,\r
+ custom_shortcuts : 1,\r
+ custom_undo_redo_keyboard_shortcuts : 1,\r
+ custom_undo_redo_restore_selection : 1,\r
+ custom_undo_redo : 1,\r
+ doctype : tinymce.isIE6 ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' : '<!DOCTYPE>', // Use old doctype on IE 6 to avoid horizontal scroll\r
+ visual_table_class : 'mceItemTable',\r
+ visual : 1,\r
+ font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large',\r
+ apply_source_formatting : 1,\r
+ directionality : 'ltr',\r
+ forced_root_block : 'p',\r
+ valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big',\r
+ hidden_input : 1,\r
+ padd_empty_editor : 1,\r
+ render_ui : 1,\r
+ init_theme : 1,\r
+ force_p_newlines : 1,\r
+ indentation : '30px',\r
+ keep_styles : 1,\r
+ fix_table_elements : 1,\r
+ inline_styles : 1,\r
+ convert_fonts_to_spans : true\r
+ }, s);\r
+\r
+ t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, {\r
+ base_uri : tinyMCE.baseURI\r
+ });\r
+\r
+ t.baseURI = tinymce.baseURI;\r
+\r
+ // Call setup\r
+ t.execCallback('setup', t);\r
+ },\r
+\r
+ render : function(nst) {\r
+ var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader;\r
+\r
+ // Page is not loaded yet, wait for it\r
+ if (!Event.domLoaded) {\r
+ Event.add(document, 'init', function() {\r
+ t.render();\r
+ });\r
+ return;\r
+ }\r
+\r
+ tinyMCE.settings = s;\r
+\r
+ // Element not found, then skip initialization\r
+ if (!t.getElement())\r
+ return;\r
+\r
+ // Is a iPad/iPhone, then skip initialization. We need to sniff here since the\r
+ // browser says it has contentEditable support but there is no visible caret\r
+ // We will remove this check ones Apple implements full contentEditable support\r
+ if (tinymce.isIDevice)\r
+ return;\r
+\r
+ // Add hidden input for non input elements inside form elements\r
+ if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form'))\r
+ DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id);\r
+\r
+ if (tinymce.WindowManager)\r
+ t.windowManager = new tinymce.WindowManager(t);\r
+\r
+ if (s.encoding == 'xml') {\r
+ t.onGetContent.add(function(ed, o) {\r
+ if (o.save)\r
+ o.content = DOM.encode(o.content);\r
+ });\r
+ }\r
+\r
+ if (s.add_form_submit_trigger) {\r
+ t.onSubmit.addToTop(function() {\r
+ if (t.initialized) {\r
+ t.save();\r
+ t.isNotDirty = 1;\r
+ }\r
+ });\r
+ }\r
+\r
+ if (s.add_unload_trigger) {\r
+ t._beforeUnload = tinyMCE.onBeforeUnload.add(function() {\r
+ if (t.initialized && !t.destroyed && !t.isHidden())\r
+ t.save({format : 'raw', no_events : true});\r
+ });\r
+ }\r
+\r
+ tinymce.addUnload(t.destroy, t);\r
+\r
+ if (s.submit_patch) {\r
+ t.onBeforeRenderUI.add(function() {\r
+ var n = t.getElement().form;\r
+\r
+ if (!n)\r
+ return;\r
+\r
+ // Already patched\r
+ if (n._mceOldSubmit)\r
+ return;\r
+\r
+ // Check page uses id="submit" or name="submit" for it's submit button\r
+ if (!n.submit.nodeType && !n.submit.length) {\r
+ t.formElement = n;\r
+ n._mceOldSubmit = n.submit;\r
+ n.submit = function() {\r
+ // Save all instances\r
+ tinymce.triggerSave();\r
+ t.isNotDirty = 1;\r
+\r
+ return t.formElement._mceOldSubmit(t.formElement);\r
+ };\r
+ }\r
+\r
+ n = null;\r
+ });\r
+ }\r
+\r
+ // Load scripts\r
+ function loadScripts() {\r
+ if (s.language)\r
+ sl.add(tinymce.baseURL + '/langs/' + s.language + '.js');\r
+\r
+ if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme])\r
+ ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js');\r
+\r
+ each(explode(s.plugins), function(p) {\r
+ if (p && p.charAt(0) != '-' && !PluginManager.urls[p]) {\r
+ // Skip safari plugin, since it is removed as of 3.3b1\r
+ if (p == 'safari')\r
+ return;\r
+\r
+ PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js');\r
+ }\r
+ });\r
+\r
+ // Init when que is loaded\r
+ sl.loadQueue(function() {\r
+ if (!t.removed)\r
+ t.init();\r
+ });\r
+ };\r
+\r
+ loadScripts();\r
+ },\r
+\r
+ init : function() {\r
+ var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re;\r
+\r
+ tinymce.add(t);\r
+\r
+ if (s.theme) {\r
+ s.theme = s.theme.replace(/-/, '');\r
+ o = ThemeManager.get(s.theme);\r
+ t.theme = new o();\r
+\r
+ if (t.theme.init && s.init_theme)\r
+ t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, ''));\r
+ }\r
+\r
+ // Create all plugins\r
+ each(explode(s.plugins.replace(/\-/g, '')), function(p) {\r
+ var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po;\r
+\r
+ if (c) {\r
+ po = new c(t, u);\r
+\r
+ t.plugins[p] = po;\r
+\r
+ if (po.init)\r
+ po.init(t, u);\r
+ }\r
+ });\r
+\r
+ // Setup popup CSS path(s)\r
+ if (s.popup_css !== false) {\r
+ if (s.popup_css)\r
+ s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css);\r
+ else\r
+ s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css");\r
+ }\r
+\r
+ if (s.popup_css_add)\r
+ s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add);\r
+\r
+ t.controlManager = new tinymce.ControlManager(t);\r
+\r
+ if (s.custom_undo_redo) {\r
+ // Add initial undo level\r
+ t.onBeforeExecCommand.add(function(ed, cmd, ui, val, a) {\r
+ if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) {\r
+ if (!t.undoManager.hasUndo())\r
+ t.undoManager.add();\r
+ }\r
+ });\r
+\r
+ t.onExecCommand.add(function(ed, cmd, ui, val, a) {\r
+ if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo))\r
+ t.undoManager.add();\r
+ });\r
+ }\r
+\r
+ t.onExecCommand.add(function(ed, c) {\r
+ // Don't refresh the select lists until caret move\r
+ if (!/^(FontName|FontSize)$/.test(c))\r
+ t.nodeChanged();\r
+ });\r
+\r
+ // Remove ghost selections on images and tables in Gecko\r
+ if (isGecko) {\r
+ function repaint(a, o) {\r
+ if (!o || !o.initial)\r
+ t.execCommand('mceRepaint');\r
+ };\r
+\r
+ t.onUndo.add(repaint);\r
+ t.onRedo.add(repaint);\r
+ t.onSetContent.add(repaint);\r
+ }\r
+\r
+ // Enables users to override the control factory\r
+ t.onBeforeRenderUI.dispatch(t, t.controlManager);\r
+\r
+ // Measure box\r
+ if (s.render_ui) {\r
+ w = s.width || e.style.width || e.offsetWidth;\r
+ h = s.height || e.style.height || e.offsetHeight;\r
+ t.orgDisplay = e.style.display;\r
+ re = /^[0-9\.]+(|px)$/i;\r
+\r
+ if (re.test('' + w))\r
+ w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100);\r
+\r
+ if (re.test('' + h))\r
+ h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100);\r
+\r
+ // Render UI\r
+ o = t.theme.renderUI({\r
+ targetNode : e,\r
+ width : w,\r
+ height : h,\r
+ deltaWidth : s.delta_width,\r
+ deltaHeight : s.delta_height\r
+ });\r
+\r
+ t.editorContainer = o.editorContainer;\r
+ }\r
+\r
+\r
+ // User specified a document.domain value\r
+ if (document.domain && location.hostname != document.domain)\r
+ tinymce.relaxedDomain = document.domain;\r
+\r
+ // Resize editor\r
+ DOM.setStyles(o.sizeContainer || o.editorContainer, {\r
+ width : w,\r
+ height : h\r
+ });\r
+\r
+ h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : '');\r
+ if (h < 100)\r
+ h = 100;\r
+\r
+ t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">';\r
+\r
+ // We only need to override paths if we have to\r
+ // IE has a bug where it remove site absolute urls to relative ones if this is specified\r
+ if (s.document_base_url != tinymce.documentBaseURL)\r
+ t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />';\r
+\r
+ t.iframeHTML += '<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';\r
+\r
+ if (tinymce.relaxedDomain)\r
+ t.iframeHTML += '<script type="text/javascript">document.domain = "' + tinymce.relaxedDomain + '";</script>';\r
+\r
+ bi = s.body_id || 'tinymce';\r
+ if (bi.indexOf('=') != -1) {\r
+ bi = t.getParam('body_id', '', 'hash');\r
+ bi = bi[t.id] || bi;\r
+ }\r
+\r
+ bc = s.body_class || '';\r
+ if (bc.indexOf('=') != -1) {\r
+ bc = t.getParam('body_class', '', 'hash');\r
+ bc = bc[t.id] || '';\r
+ }\r
+\r
+ t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"></body></html>';\r
+\r
+ // Domain relaxing enabled, then set document domain\r
+ if (tinymce.relaxedDomain) {\r
+ // We need to write the contents here in IE since multiple writes messes up refresh button and back button\r
+ if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5))\r
+ u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';\r
+ else if (tinymce.isOpera)\r
+ u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; \r
+ }\r
+\r
+ // Create iframe\r
+ n = DOM.add(o.iframeContainer, 'iframe', {\r
+ id : t.id + "_ifr",\r
+ src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7\r
+ frameBorder : '0',\r
+ style : {\r
+ width : '100%',\r
+ height : h\r
+ }\r
+ });\r
+\r
+ t.contentAreaContainer = o.iframeContainer;\r
+ DOM.get(o.editorContainer).style.display = t.orgDisplay;\r
+ DOM.get(t.id).style.display = 'none';\r
+\r
+ if (!isIE || !tinymce.relaxedDomain)\r
+ t.setupIframe();\r
+\r
+ e = n = o = null; // Cleanup\r
+ },\r
+\r
+ setupIframe : function() {\r
+ var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b;\r
+\r
+ // Setup iframe body\r
+ if (!isIE || !tinymce.relaxedDomain) {\r
+ d.open();\r
+ d.write(t.iframeHTML);\r
+ d.close();\r
+ }\r
+\r
+ // Design mode needs to be added here Ctrl+A will fail otherwise\r
+ if (!isIE) {\r
+ try {\r
+ if (!s.readonly)\r
+ d.designMode = 'On';\r
+ } catch (ex) {\r
+ // Will fail on Gecko if the editor is placed in an hidden container element\r
+ // The design mode will be set ones the editor is focused\r
+ }\r
+ }\r
+\r
+ // IE needs to use contentEditable or it will display non secure items for HTTPS\r
+ if (isIE) {\r
+ // It will not steal focus if we hide it while setting contentEditable\r
+ b = t.getBody();\r
+ DOM.hide(b);\r
+\r
+ if (!s.readonly)\r
+ b.contentEditable = true;\r
+\r
+ DOM.show(b);\r
+ }\r
+\r
+ t.dom = new tinymce.dom.DOMUtils(t.getDoc(), {\r
+ keep_values : true,\r
+ url_converter : t.convertURL,\r
+ url_converter_scope : t,\r
+ hex_colors : s.force_hex_style_colors,\r
+ class_filter : s.class_filter,\r
+ update_styles : 1,\r
+ fix_ie_paragraphs : 1,\r
+ valid_styles : s.valid_styles\r
+ });\r
+\r
+ t.schema = new tinymce.dom.Schema();\r
+\r
+ t.serializer = new tinymce.dom.Serializer(extend(s, {\r
+ valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements,\r
+ dom : t.dom,\r
+ schema : t.schema\r
+ }));\r
+\r
+ t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer);\r
+\r
+ t.formatter = new tinymce.Formatter(this);\r
+\r
+ // Register default formats\r
+ t.formatter.register({\r
+ alignleft : [\r
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},\r
+ {selector : 'img,table', styles : {'float' : 'left'}}\r
+ ],\r
+\r
+ aligncenter : [\r
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},\r
+ {selector : 'img', styles : {display : 'block', marginLeft : 'auto', marginRight : 'auto'}},\r
+ {selector : 'table', styles : {marginLeft : 'auto', marginRight : 'auto'}}\r
+ ],\r
+\r
+ alignright : [\r
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},\r
+ {selector : 'img,table', styles : {'float' : 'right'}}\r
+ ],\r
+\r
+ alignfull : [\r
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'justify'}}\r
+ ],\r
+\r
+ bold : [\r
+ {inline : 'strong'},\r
+ {inline : 'span', styles : {fontWeight : 'bold'}},\r
+ {inline : 'b'}\r
+ ],\r
+\r
+ italic : [\r
+ {inline : 'em'},\r
+ {inline : 'span', styles : {fontStyle : 'italic'}},\r
+ {inline : 'i'}\r
+ ],\r
+\r
+ underline : [\r
+ {inline : 'span', styles : {textDecoration : 'underline'}, exact : true},\r
+ {inline : 'u'}\r
+ ],\r
+\r
+ strikethrough : [\r
+ {inline : 'span', styles : {textDecoration : 'line-through'}, exact : true},\r
+ {inline : 'u'}\r
+ ],\r
+\r
+ forecolor : {inline : 'span', styles : {color : '%value'}},\r
+ hilitecolor : {inline : 'span', styles : {backgroundColor : '%value'}},\r
+ fontname : {inline : 'span', styles : {fontFamily : '%value'}},\r
+ fontsize : {inline : 'span', styles : {fontSize : '%value'}},\r
+ fontsize_class : {inline : 'span', attributes : {'class' : '%value'}},\r
+ blockquote : {block : 'blockquote', wrapper : 1, remove : 'all'},\r
+\r
+ removeformat : [\r
+ {selector : 'b,strong,em,i,font,u,strike', remove : 'all', split : true, expand : false, block_expand : true, deep : true},\r
+ {selector : 'span', attributes : ['style', 'class'], remove : 'empty', split : true, expand : false, deep : true},\r
+ {selector : '*', attributes : ['style', 'class'], split : false, expand : false, deep : true}\r
+ ]\r
+ });\r
+\r
+ // Register default block formats\r
+ each('p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp'.split(/\s/), function(name) {\r
+ t.formatter.register(name, {block : name, remove : 'all'});\r
+ });\r
+\r
+ // Register user defined formats\r
+ t.formatter.register(t.settings.formats);\r
+\r
+ t.undoManager = new tinymce.UndoManager(t);\r
+\r
+ // Pass through\r
+ t.undoManager.onAdd.add(function(um, l) {\r
+ if (!l.initial)\r
+ return t.onChange.dispatch(t, l, um);\r
+ });\r
+\r
+ t.undoManager.onUndo.add(function(um, l) {\r
+ return t.onUndo.dispatch(t, l, um);\r
+ });\r
+\r
+ t.undoManager.onRedo.add(function(um, l) {\r
+ return t.onRedo.dispatch(t, l, um);\r
+ });\r
+\r
+ t.forceBlocks = new tinymce.ForceBlocks(t, {\r
+ forced_root_block : s.forced_root_block\r
+ });\r
+\r
+ t.editorCommands = new tinymce.EditorCommands(t);\r
+\r
+ // Pass through\r
+ t.serializer.onPreProcess.add(function(se, o) {\r
+ return t.onPreProcess.dispatch(t, o, se);\r
+ });\r
+\r
+ t.serializer.onPostProcess.add(function(se, o) {\r
+ return t.onPostProcess.dispatch(t, o, se);\r
+ });\r
+\r
+ t.onPreInit.dispatch(t);\r
+\r
+ if (!s.gecko_spellcheck)\r
+ t.getBody().spellcheck = 0;\r
+\r
+ if (!s.readonly)\r
+ t._addEvents();\r
+\r
+ t.controlManager.onPostRender.dispatch(t, t.controlManager);\r
+ t.onPostRender.dispatch(t);\r
+\r
+ if (s.directionality)\r
+ t.getBody().dir = s.directionality;\r
+\r
+ if (s.nowrap)\r
+ t.getBody().style.whiteSpace = "nowrap";\r
+\r
+ if (s.custom_elements) {\r
+ function handleCustom(ed, o) {\r
+ each(explode(s.custom_elements), function(v) {\r
+ var n;\r
+\r
+ if (v.indexOf('~') === 0) {\r
+ v = v.substring(1);\r
+ n = 'span';\r
+ } else\r
+ n = 'div';\r
+\r
+ o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' _mce_name="$1"$2>');\r
+ o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>');\r
+ });\r
+ };\r
+\r
+ t.onBeforeSetContent.add(handleCustom);\r
+ t.onPostProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ handleCustom(ed, o);\r
+ });\r
+ }\r
+\r
+ if (s.handle_node_change_callback) {\r
+ t.onNodeChange.add(function(ed, cm, n) {\r
+ t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed());\r
+ });\r
+ }\r
+\r
+ if (s.save_callback) {\r
+ t.onSaveContent.add(function(ed, o) {\r
+ var h = t.execCallback('save_callback', t.id, o.content, t.getBody());\r
+\r
+ if (h)\r
+ o.content = h;\r
+ });\r
+ }\r
+\r
+ if (s.onchange_callback) {\r
+ t.onChange.add(function(ed, l) {\r
+ t.execCallback('onchange_callback', t, l);\r
+ });\r
+ }\r
+\r
+ if (s.convert_newlines_to_brs) {\r
+ t.onBeforeSetContent.add(function(ed, o) {\r
+ if (o.initial)\r
+ o.content = o.content.replace(/\r?\n/g, '<br />');\r
+ });\r
+ }\r
+\r
+ if (s.fix_nesting && isIE) {\r
+ t.onBeforeSetContent.add(function(ed, o) {\r
+ o.content = t._fixNesting(o.content);\r
+ });\r
+ }\r
+\r
+ if (s.preformatted) {\r
+ t.onPostProcess.add(function(ed, o) {\r
+ o.content = o.content.replace(/^\s*<pre.*?>/, '');\r
+ o.content = o.content.replace(/<\/pre>\s*$/, '');\r
+\r
+ if (o.set)\r
+ o.content = '<pre class="mceItemHidden">' + o.content + '</pre>';\r
+ });\r
+ }\r
+\r
+ if (s.verify_css_classes) {\r
+ t.serializer.attribValueFilter = function(n, v) {\r
+ var s, cl;\r
+\r
+ if (n == 'class') {\r
+ // Build regexp for classes\r
+ if (!t.classesRE) {\r
+ cl = t.dom.getClasses();\r
+\r
+ if (cl.length > 0) {\r
+ s = '';\r
+\r
+ each (cl, function(o) {\r
+ s += (s ? '|' : '') + o['class'];\r
+ });\r
+\r
+ t.classesRE = new RegExp('(' + s + ')', 'gi');\r
+ }\r
+ }\r
+\r
+ return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : '';\r
+ }\r
+\r
+ return v;\r
+ };\r
+ }\r
+\r
+ if (s.cleanup_callback) {\r
+ t.onBeforeSetContent.add(function(ed, o) {\r
+ o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
+ });\r
+\r
+ t.onPreProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o);\r
+\r
+ if (o.get)\r
+ t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o);\r
+ });\r
+\r
+ t.onPostProcess.add(function(ed, o) {\r
+ if (o.set)\r
+ o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o);\r
+\r
+ if (o.get) \r
+ o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o);\r
+ });\r
+ }\r
+\r
+ if (s.save_callback) {\r
+ t.onGetContent.add(function(ed, o) {\r
+ if (o.save)\r
+ o.content = t.execCallback('save_callback', t.id, o.content, t.getBody());\r
+ });\r
+ }\r
+\r
+ if (s.handle_event_callback) {\r
+ t.onEvent.add(function(ed, e, o) {\r
+ if (t.execCallback('handle_event_callback', e, ed, o) === false)\r
+ Event.cancel(e);\r
+ });\r
+ }\r
+\r
+ // Add visual aids when new contents is added\r
+ t.onSetContent.add(function() {\r
+ t.addVisual(t.getBody());\r
+ });\r
+\r
+ // Remove empty contents\r
+ if (s.padd_empty_editor) {\r
+ t.onPostProcess.add(function(ed, o) {\r
+ o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, '');\r
+ });\r
+ }\r
+\r
+ if (isGecko) {\r
+ // Fix gecko link bug, when a link is placed at the end of block elements there is\r
+ // no way to move the caret behind the link. This fix adds a bogus br element after the link\r
+ function fixLinks(ed, o) {\r
+ each(ed.dom.select('a'), function(n) {\r
+ var pn = n.parentNode;\r
+\r
+ if (ed.dom.isBlock(pn) && pn.lastChild === n)\r
+ ed.dom.add(pn, 'br', {'_mce_bogus' : 1});\r
+ });\r
+ };\r
+\r
+ t.onExecCommand.add(function(ed, cmd) {\r
+ if (cmd === 'CreateLink')\r
+ fixLinks(ed);\r
+ });\r
+\r
+ t.onSetContent.add(t.selection.onSetContent.add(fixLinks));\r
+\r
+ if (!s.readonly) {\r
+ try {\r
+ // Design mode must be set here once again to fix a bug where\r
+ // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again\r
+ d.designMode = 'Off';\r
+ d.designMode = 'On';\r
+ } catch (ex) {\r
+ // Will fail on Gecko if the editor is placed in an hidden container element\r
+ // The design mode will be set ones the editor is focused\r
+ }\r
+ }\r
+ }\r
+\r
+ // A small timeout was needed since firefox will remove. Bug: #1838304\r
+ setTimeout(function () {\r
+ if (t.removed)\r
+ return;\r
+\r
+ t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')});\r
+ t.startContent = t.getContent({format : 'raw'});\r
+ t.initialized = true;\r
+\r
+ t.onInit.dispatch(t);\r
+ t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc());\r
+ t.execCallback('init_instance_callback', t);\r
+ t.focus(true);\r
+ t.nodeChanged({initial : 1});\r
+\r
+ // Load specified content CSS last\r
+ if (s.content_css) {\r
+ tinymce.each(explode(s.content_css), function(u) {\r
+ t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));\r
+ });\r
+ }\r
+\r
+ // Handle auto focus\r
+ if (s.auto_focus) {\r
+ setTimeout(function () {\r
+ var ed = tinymce.get(s.auto_focus);\r
+\r
+ ed.selection.select(ed.getBody(), 1);\r
+ ed.selection.collapse(1);\r
+ ed.getWin().focus();\r
+ }, 100);\r
+ }\r
+ }, 1);\r
+ \r
+ e = null;\r
+ },\r
+\r
+\r
+ focus : function(sf) {\r
+ var oed, t = this, ce = t.settings.content_editable, ieRng, controlElm, doc = t.getDoc();\r
+\r
+ if (!sf) {\r
+ // Get selected control element\r
+ ieRng = t.selection.getRng();\r
+ if (ieRng.item) {\r
+ controlElm = ieRng.item(0);\r
+ }\r
+\r
+ // Is not content editable\r
+ if (!ce)\r
+ t.getWin().focus();\r
+\r
+ // Restore selected control element\r
+ // This is needed when for example an image is selected within a\r
+ // layer a call to focus will then remove the control selection\r
+ if (controlElm && controlElm.ownerDocument == doc) {\r
+ ieRng = doc.body.createControlRange();\r
+ ieRng.addElement(controlElm);\r
+ ieRng.select();\r
+ }\r
+\r
+ }\r
+\r
+ if (tinymce.activeEditor != t) {\r
+ if ((oed = tinymce.activeEditor) != null)\r
+ oed.onDeactivate.dispatch(oed, t);\r
+\r
+ t.onActivate.dispatch(t, oed);\r
+ }\r
+\r
+ tinymce._setActive(t);\r
+ },\r
+\r
+ execCallback : function(n) {\r
+ var t = this, f = t.settings[n], s;\r
+\r
+ if (!f)\r
+ return;\r
+\r
+ // Look through lookup\r
+ if (t.callbackLookup && (s = t.callbackLookup[n])) {\r
+ f = s.func;\r
+ s = s.scope;\r
+ }\r
+\r
+ if (is(f, 'string')) {\r
+ s = f.replace(/\.\w+$/, '');\r
+ s = s ? tinymce.resolve(s) : 0;\r
+ f = tinymce.resolve(f);\r
+ t.callbackLookup = t.callbackLookup || {};\r
+ t.callbackLookup[n] = {func : f, scope : s};\r
+ }\r
+\r
+ return f.apply(s || t, Array.prototype.slice.call(arguments, 1));\r
+ },\r
+\r
+ translate : function(s) {\r
+ var c = this.settings.language || 'en', i18n = tinymce.i18n;\r
+\r
+ if (!s)\r
+ return '';\r
+\r
+ return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) {\r
+ return i18n[c + '.' + b] || '{#' + b + '}';\r
+ });\r
+ },\r
+\r
+ getLang : function(n, dv) {\r
+ return tinymce.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}');\r
+ },\r
+\r
+ getParam : function(n, dv, ty) {\r
+ var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o;\r
+\r
+ if (ty === 'hash') {\r
+ o = {};\r
+\r
+ if (is(v, 'string')) {\r
+ each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) {\r
+ v = v.split('=');\r
+\r
+ if (v.length > 1)\r
+ o[tr(v[0])] = tr(v[1]);\r
+ else\r
+ o[tr(v[0])] = tr(v);\r
+ });\r
+ } else\r
+ o = v;\r
+\r
+ return o;\r
+ }\r
+\r
+ return v;\r
+ },\r
+\r
+ nodeChanged : function(o) {\r
+ var t = this, s = t.selection, n = (isIE ? s.getNode() : s.getStart()) || t.getBody();\r
+\r
+ // Fix for bug #1896577 it seems that this can not be fired while the editor is loading\r
+ if (t.initialized) {\r
+ o = o || {};\r
+ n = isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n; // Fix for IE initial state\r
+\r
+ // Get parents and add them to object\r
+ o.parents = [];\r
+ t.dom.getParent(n, function(node) {\r
+ if (node.nodeName == 'BODY')\r
+ return true;\r
+\r
+ o.parents.push(node);\r
+ });\r
+\r
+ t.onNodeChange.dispatch(\r
+ t,\r
+ o ? o.controlManager || t.controlManager : t.controlManager,\r
+ n,\r
+ s.isCollapsed(),\r
+ o\r
+ );\r
+ }\r
+ },\r
+\r
+ addButton : function(n, s) {\r
+ var t = this;\r
+\r
+ t.buttons = t.buttons || {};\r
+ t.buttons[n] = s;\r
+ },\r
+\r
+ addCommand : function(n, f, s) {\r
+ this.execCommands[n] = {func : f, scope : s || this};\r
+ },\r
+\r
+ addQueryStateHandler : function(n, f, s) {\r
+ this.queryStateCommands[n] = {func : f, scope : s || this};\r
+ },\r
+\r
+ addQueryValueHandler : function(n, f, s) {\r
+ this.queryValueCommands[n] = {func : f, scope : s || this};\r
+ },\r
+\r
+ addShortcut : function(pa, desc, cmd_func, sc) {\r
+ var t = this, c;\r
+\r
+ if (!t.settings.custom_shortcuts)\r
+ return false;\r
+\r
+ t.shortcuts = t.shortcuts || {};\r
+\r
+ if (is(cmd_func, 'string')) {\r
+ c = cmd_func;\r
+\r
+ cmd_func = function() {\r
+ t.execCommand(c, false, null);\r
+ };\r
+ }\r
+\r
+ if (is(cmd_func, 'object')) {\r
+ c = cmd_func;\r
+\r
+ cmd_func = function() {\r
+ t.execCommand(c[0], c[1], c[2]);\r
+ };\r
+ }\r
+\r
+ each(explode(pa), function(pa) {\r
+ var o = {\r
+ func : cmd_func,\r
+ scope : sc || this,\r
+ desc : desc,\r
+ alt : false,\r
+ ctrl : false,\r
+ shift : false\r
+ };\r
+\r
+ each(explode(pa, '+'), function(v) {\r
+ switch (v) {\r
+ case 'alt':\r
+ case 'ctrl':\r
+ case 'shift':\r
+ o[v] = true;\r
+ break;\r
+\r
+ default:\r
+ o.charCode = v.charCodeAt(0);\r
+ o.keyCode = v.toUpperCase().charCodeAt(0);\r
+ }\r
+ });\r
+\r
+ t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o;\r
+ });\r
+\r
+ return true;\r
+ },\r
+\r
+ execCommand : function(cmd, ui, val, a) {\r
+ var t = this, s = 0, o, st;\r
+\r
+ if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus))\r
+ t.focus();\r
+\r
+ o = {};\r
+ t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o);\r
+ if (o.terminate)\r
+ return false;\r
+\r
+ // Command callback\r
+ if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) {\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ return true;\r
+ }\r
+\r
+ // Registred commands\r
+ if (o = t.execCommands[cmd]) {\r
+ st = o.func.call(o.scope, ui, val);\r
+\r
+ // Fall through on true\r
+ if (st !== true) {\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ return st;\r
+ }\r
+ }\r
+\r
+ // Plugin commands\r
+ each(t.plugins, function(p) {\r
+ if (p.execCommand && p.execCommand(cmd, ui, val)) {\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ s = 1;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ if (s)\r
+ return true;\r
+\r
+ // Theme commands\r
+ if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) {\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ return true;\r
+ }\r
+\r
+ // Execute global commands\r
+ if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) {\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ return true;\r
+ }\r
+\r
+ // Editor commands\r
+ if (t.editorCommands.execCommand(cmd, ui, val)) {\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ return true;\r
+ }\r
+\r
+ // Browser commands\r
+ t.getDoc().execCommand(cmd, ui, val);\r
+ t.onExecCommand.dispatch(t, cmd, ui, val, a);\r
+ },\r
+\r
+ queryCommandState : function(cmd) {\r
+ var t = this, o, s;\r
+\r
+ // Is hidden then return undefined\r
+ if (t._isHidden())\r
+ return;\r
+\r
+ // Registred commands\r
+ if (o = t.queryStateCommands[cmd]) {\r
+ s = o.func.call(o.scope);\r
+\r
+ // Fall though on true\r
+ if (s !== true)\r
+ return s;\r
+ }\r
+\r
+ // Registred commands\r
+ o = t.editorCommands.queryCommandState(cmd);\r
+ if (o !== -1)\r
+ return o;\r
+\r
+ // Browser commands\r
+ try {\r
+ return this.getDoc().queryCommandState(cmd);\r
+ } catch (ex) {\r
+ // Fails sometimes see bug: 1896577\r
+ }\r
+ },\r
+\r
+ queryCommandValue : function(c) {\r
+ var t = this, o, s;\r
+\r
+ // Is hidden then return undefined\r
+ if (t._isHidden())\r
+ return;\r
+\r
+ // Registred commands\r
+ if (o = t.queryValueCommands[c]) {\r
+ s = o.func.call(o.scope);\r
+\r
+ // Fall though on true\r
+ if (s !== true)\r
+ return s;\r
+ }\r
+\r
+ // Registred commands\r
+ o = t.editorCommands.queryCommandValue(c);\r
+ if (is(o))\r
+ return o;\r
+\r
+ // Browser commands\r
+ try {\r
+ return this.getDoc().queryCommandValue(c);\r
+ } catch (ex) {\r
+ // Fails sometimes see bug: 1896577\r
+ }\r
+ },\r
+\r
+ show : function() {\r
+ var t = this;\r
+\r
+ DOM.show(t.getContainer());\r
+ DOM.hide(t.id);\r
+ t.load();\r
+ },\r
+\r
+ hide : function() {\r
+ var t = this, d = t.getDoc();\r
+\r
+ // Fixed bug where IE has a blinking cursor left from the editor\r
+ if (isIE && d)\r
+ d.execCommand('SelectAll');\r
+\r
+ // We must save before we hide so Safari doesn't crash\r
+ t.save();\r
+ DOM.hide(t.getContainer());\r
+ DOM.setStyle(t.id, 'display', t.orgDisplay);\r
+ },\r
+\r
+ isHidden : function() {\r
+ return !DOM.isHidden(this.id);\r
+ },\r
+\r
+ setProgressState : function(b, ti, o) {\r
+ this.onSetProgressState.dispatch(this, b, ti, o);\r
+\r
+ return b;\r
+ },\r
+\r
+ load : function(o) {\r
+ var t = this, e = t.getElement(), h;\r
+\r
+ if (e) {\r
+ o = o || {};\r
+ o.load = true;\r
+\r
+ // Double encode existing entities in the value\r
+ h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);\r
+ o.element = e;\r
+\r
+ if (!o.no_events)\r
+ t.onLoadContent.dispatch(t, o);\r
+\r
+ o.element = e = null;\r
+\r
+ return h;\r
+ }\r
+ },\r
+\r
+ save : function(o) {\r
+ var t = this, e = t.getElement(), h, f;\r
+\r
+ if (!e || !t.initialized)\r
+ return;\r
+\r
+ o = o || {};\r
+ o.save = true;\r
+\r
+ // Add undo level will trigger onchange event\r
+ if (!o.no_events) {\r
+ t.undoManager.typing = 0;\r
+ t.undoManager.add();\r
+ }\r
+\r
+ o.element = e;\r
+ h = o.content = t.getContent(o);\r
+\r
+ if (!o.no_events)\r
+ t.onSaveContent.dispatch(t, o);\r
+\r
+ h = o.content;\r
+\r
+ if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {\r
+ e.innerHTML = h;\r
+\r
+ // Update hidden form element\r
+ if (f = DOM.getParent(t.id, 'form')) {\r
+ each(f.elements, function(e) {\r
+ if (e.name == t.id) {\r
+ e.value = h;\r
+ return false;\r
+ }\r
+ });\r
+ }\r
+ } else\r
+ e.value = h;\r
+\r
+ o.element = e = null;\r
+\r
+ return h;\r
+ },\r
+\r
+ setContent : function(h, o) {\r
+ var t = this;\r
+\r
+ o = o || {};\r
+ o.format = o.format || 'html';\r
+ o.set = true;\r
+ o.content = h;\r
+\r
+ if (!o.no_events)\r
+ t.onBeforeSetContent.dispatch(t, o);\r
+\r
+ // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content\r
+ // It will also be impossible to place the caret in the editor unless there is a BR element present\r
+ if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) {\r
+ o.content = t.dom.setHTML(t.getBody(), '<br _mce_bogus="1" />');\r
+ o.format = 'raw';\r
+ }\r
+\r
+ o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content));\r
+\r
+ if (o.format != 'raw' && t.settings.cleanup) {\r
+ o.getInner = true;\r
+ o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o));\r
+ }\r
+\r
+ if (!o.no_events)\r
+ t.onSetContent.dispatch(t, o);\r
+\r
+ return o.content;\r
+ },\r
+\r
+ getContent : function(o) {\r
+ var t = this, h;\r
+\r
+ o = o || {};\r
+ o.format = o.format || 'html';\r
+ o.get = true;\r
+\r
+ if (!o.no_events)\r
+ t.onBeforeGetContent.dispatch(t, o);\r
+\r
+ if (o.format != 'raw' && t.settings.cleanup) {\r
+ o.getInner = true;\r
+ h = t.serializer.serialize(t.getBody(), o);\r
+ } else\r
+ h = t.getBody().innerHTML;\r
+\r
+ h = h.replace(/^\s*|\s*$/g, '');\r
+ o.content = h;\r
+\r
+ if (!o.no_events)\r
+ t.onGetContent.dispatch(t, o);\r
+\r
+ return o.content;\r
+ },\r
+\r
+ isDirty : function() {\r
+ var t = this;\r
+\r
+ return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty;\r
+ },\r
+\r
+ getContainer : function() {\r
+ var t = this;\r
+\r
+ if (!t.container)\r
+ t.container = DOM.get(t.editorContainer || t.id + '_parent');\r
+\r
+ return t.container;\r
+ },\r
+\r
+ getContentAreaContainer : function() {\r
+ return this.contentAreaContainer;\r
+ },\r
+\r
+ getElement : function() {\r
+ return DOM.get(this.settings.content_element || this.id);\r
+ },\r
+\r
+ getWin : function() {\r
+ var t = this, e;\r
+\r
+ if (!t.contentWindow) {\r
+ e = DOM.get(t.id + "_ifr");\r
+\r
+ if (e)\r
+ t.contentWindow = e.contentWindow;\r
+ }\r
+\r
+ return t.contentWindow;\r
+ },\r
+\r
+ getDoc : function() {\r
+ var t = this, w;\r
+\r
+ if (!t.contentDocument) {\r
+ w = t.getWin();\r
+\r
+ if (w)\r
+ t.contentDocument = w.document;\r
+ }\r
+\r
+ return t.contentDocument;\r
+ },\r
+\r
+ getBody : function() {\r
+ return this.bodyElement || this.getDoc().body;\r
+ },\r
+\r
+ convertURL : function(u, n, e) {\r
+ var t = this, s = t.settings;\r
+\r
+ // Use callback instead\r
+ if (s.urlconverter_callback)\r
+ return t.execCallback('urlconverter_callback', u, e, true, n);\r
+\r
+ // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs\r
+ if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0)\r
+ return u;\r
+\r
+ // Convert to relative\r
+ if (s.relative_urls)\r
+ return t.documentBaseURI.toRelative(u);\r
+\r
+ // Convert to absolute\r
+ u = t.documentBaseURI.toAbsolute(u, s.remove_script_host);\r
+\r
+ return u;\r
+ },\r
+\r
+ addVisual : function(e) {\r
+ var t = this, s = t.settings;\r
+\r
+ e = e || t.getBody();\r
+\r
+ if (!is(t.hasVisual))\r
+ t.hasVisual = s.visual;\r
+\r
+ each(t.dom.select('table,a', e), function(e) {\r
+ var v;\r
+\r
+ switch (e.nodeName) {\r
+ case 'TABLE':\r
+ v = t.dom.getAttrib(e, 'border');\r
+\r
+ if (!v || v == '0') {\r
+ if (t.hasVisual)\r
+ t.dom.addClass(e, s.visual_table_class);\r
+ else\r
+ t.dom.removeClass(e, s.visual_table_class);\r
+ }\r
+\r
+ return;\r
+\r
+ case 'A':\r
+ v = t.dom.getAttrib(e, 'name');\r
+\r
+ if (v) {\r
+ if (t.hasVisual)\r
+ t.dom.addClass(e, 'mceItemAnchor');\r
+ else\r
+ t.dom.removeClass(e, 'mceItemAnchor');\r
+ }\r
+\r
+ return;\r
+ }\r
+ });\r
+\r
+ t.onVisualAid.dispatch(t, e, t.hasVisual);\r
+ },\r
+\r
+ remove : function() {\r
+ var t = this, e = t.getContainer();\r
+\r
+ t.removed = 1; // Cancels post remove event execution\r
+ t.hide();\r
+\r
+ t.execCallback('remove_instance_callback', t);\r
+ t.onRemove.dispatch(t);\r
+\r
+ // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command\r
+ t.onExecCommand.listeners = [];\r
+\r
+ tinymce.remove(t);\r
+ DOM.remove(e);\r
+ },\r
+\r
+ destroy : function(s) {\r
+ var t = this;\r
+\r
+ // One time is enough\r
+ if (t.destroyed)\r
+ return;\r
+\r
+ if (!s) {\r
+ tinymce.removeUnload(t.destroy);\r
+ tinyMCE.onBeforeUnload.remove(t._beforeUnload);\r
+\r
+ // Manual destroy\r
+ if (t.theme && t.theme.destroy)\r
+ t.theme.destroy();\r
+\r
+ // Destroy controls, selection and dom\r
+ t.controlManager.destroy();\r
+ t.selection.destroy();\r
+ t.dom.destroy();\r
+\r
+ // Remove all events\r
+\r
+ // Don't clear the window or document if content editable\r
+ // is enabled since other instances might still be present\r
+ if (!t.settings.content_editable) {\r
+ Event.clear(t.getWin());\r
+ Event.clear(t.getDoc());\r
+ }\r
+\r
+ Event.clear(t.getBody());\r
+ Event.clear(t.formElement);\r
+ }\r
+\r
+ if (t.formElement) {\r
+ t.formElement.submit = t.formElement._mceOldSubmit;\r
+ t.formElement._mceOldSubmit = null;\r
+ }\r
+\r
+ t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null;\r
+\r
+ if (t.selection)\r
+ t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null;\r
+\r
+ t.destroyed = 1;\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _addEvents : function() {\r
+ // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset\r
+ var t = this, i, s = t.settings, lo = {\r
+ mouseup : 'onMouseUp',\r
+ mousedown : 'onMouseDown',\r
+ click : 'onClick',\r
+ keyup : 'onKeyUp',\r
+ keydown : 'onKeyDown',\r
+ keypress : 'onKeyPress',\r
+ submit : 'onSubmit',\r
+ reset : 'onReset',\r
+ contextmenu : 'onContextMenu',\r
+ dblclick : 'onDblClick',\r
+ paste : 'onPaste' // Doesn't work in all browsers yet\r
+ };\r
+\r
+ function eventHandler(e, o) {\r
+ var ty = e.type;\r
+\r
+ // Don't fire events when it's removed\r
+ if (t.removed)\r
+ return;\r
+\r
+ // Generic event handler\r
+ if (t.onEvent.dispatch(t, e, o) !== false) {\r
+ // Specific event handler\r
+ t[lo[e.fakeType || e.type]].dispatch(t, e, o);\r
+ }\r
+ };\r
+\r
+ // Add DOM events\r
+ each(lo, function(v, k) {\r
+ switch (k) {\r
+ case 'contextmenu':\r
+ if (tinymce.isOpera) {\r
+ // Fake contextmenu on Opera\r
+ t.dom.bind(t.getBody(), 'mousedown', function(e) {\r
+ if (e.ctrlKey) {\r
+ e.fakeType = 'contextmenu';\r
+ eventHandler(e);\r
+ }\r
+ });\r
+ } else\r
+ t.dom.bind(t.getBody(), k, eventHandler);\r
+ break;\r
+\r
+ case 'paste':\r
+ t.dom.bind(t.getBody(), k, function(e) {\r
+ eventHandler(e);\r
+ });\r
+ break;\r
+\r
+ case 'submit':\r
+ case 'reset':\r
+ t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler);\r
+ break;\r
+\r
+ default:\r
+ t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler);\r
+ }\r
+ });\r
+\r
+ t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) {\r
+ t.focus(true);\r
+ });\r
+\r
+\r
+ // Fixes bug where a specified document_base_uri could result in broken images\r
+ // This will also fix drag drop of images in Gecko\r
+ if (tinymce.isGecko) {\r
+ // Convert all images to absolute URLs\r
+/* t.onSetContent.add(function(ed, o) {\r
+ each(ed.dom.select('img'), function(e) {\r
+ var v;\r
+\r
+ if (v = e.getAttribute('_mce_src'))\r
+ e.src = t.documentBaseURI.toAbsolute(v);\r
+ })\r
+ });*/\r
+\r
+ t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) {\r
+ var v;\r
+\r
+ e = e.target;\r
+\r
+ if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('_mce_src')))\r
+ e.src = t.documentBaseURI.toAbsolute(v);\r
+ });\r
+ }\r
+\r
+ // Set various midas options in Gecko\r
+ if (isGecko) {\r
+ function setOpts() {\r
+ var t = this, d = t.getDoc(), s = t.settings;\r
+\r
+ if (isGecko && !s.readonly) {\r
+ if (t._isHidden()) {\r
+ try {\r
+ if (!s.content_editable)\r
+ d.designMode = 'On';\r
+ } catch (ex) {\r
+ // Fails if it's hidden\r
+ }\r
+ }\r
+\r
+ try {\r
+ // Try new Gecko method\r
+ d.execCommand("styleWithCSS", 0, false);\r
+ } catch (ex) {\r
+ // Use old method\r
+ if (!t._isHidden())\r
+ try {d.execCommand("useCSS", 0, true);} catch (ex) {}\r
+ }\r
+\r
+ if (!s.table_inline_editing)\r
+ try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {}\r
+\r
+ if (!s.object_resizing)\r
+ try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {}\r
+ }\r
+ };\r
+\r
+ t.onBeforeExecCommand.add(setOpts);\r
+ t.onMouseDown.add(setOpts);\r
+ }\r
+\r
+ // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250\r
+ // WebKit can't even do simple things like selecting an image\r
+ // This also fixes so it's possible to select mceItemAnchors\r
+ if (tinymce.isWebKit) {\r
+ t.onClick.add(function(ed, e) {\r
+ e = e.target;\r
+\r
+ // Needs tobe the setBaseAndExtend or it will fail to select floated images\r
+ if (e.nodeName == 'IMG' || (e.nodeName == 'A' && t.dom.hasClass(e, 'mceItemAnchor')))\r
+ t.selection.getSel().setBaseAndExtent(e, 0, e, 1);\r
+ });\r
+ }\r
+\r
+ // Add node change handlers\r
+ t.onMouseUp.add(t.nodeChanged);\r
+ //t.onClick.add(t.nodeChanged);\r
+ t.onKeyUp.add(function(ed, e) {\r
+ var c = e.keyCode;\r
+\r
+ if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey)\r
+ t.nodeChanged();\r
+ });\r
+\r
+ // Add reset handler\r
+ t.onReset.add(function() {\r
+ t.setContent(t.startContent, {format : 'raw'});\r
+ });\r
+\r
+ // Add shortcuts\r
+ if (s.custom_shortcuts) {\r
+ if (s.custom_undo_redo_keyboard_shortcuts) {\r
+ t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo');\r
+ t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo');\r
+ }\r
+\r
+ // Add default shortcuts for gecko\r
+ t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold');\r
+ t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic');\r
+ t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline');\r
+\r
+ // BlockFormat shortcuts keys\r
+ for (i=1; i<=6; i++)\r
+ t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]);\r
+\r
+ t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']);\r
+ t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']);\r
+ t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']);\r
+\r
+ function find(e) {\r
+ var v = null;\r
+\r
+ if (!e.altKey && !e.ctrlKey && !e.metaKey)\r
+ return v;\r
+\r
+ each(t.shortcuts, function(o) {\r
+ if (tinymce.isMac && o.ctrl != e.metaKey)\r
+ return;\r
+ else if (!tinymce.isMac && o.ctrl != e.ctrlKey)\r
+ return;\r
+\r
+ if (o.alt != e.altKey)\r
+ return;\r
+\r
+ if (o.shift != e.shiftKey)\r
+ return;\r
+\r
+ if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) {\r
+ v = o;\r
+ return false;\r
+ }\r
+ });\r
+\r
+ return v;\r
+ };\r
+\r
+ t.onKeyUp.add(function(ed, e) {\r
+ var o = find(e);\r
+\r
+ if (o)\r
+ return Event.cancel(e);\r
+ });\r
+\r
+ t.onKeyPress.add(function(ed, e) {\r
+ var o = find(e);\r
+\r
+ if (o)\r
+ return Event.cancel(e);\r
+ });\r
+\r
+ t.onKeyDown.add(function(ed, e) {\r
+ var o = find(e);\r
+\r
+ if (o) {\r
+ o.func.call(o.scope);\r
+ return Event.cancel(e);\r
+ }\r
+ });\r
+ }\r
+\r
+ if (tinymce.isIE) {\r
+ // Fix so resize will only update the width and height attributes not the styles of an image\r
+ // It will also block mceItemNoResize items\r
+ t.dom.bind(t.getDoc(), 'controlselect', function(e) {\r
+ var re = t.resizeInfo, cb;\r
+\r
+ e = e.target;\r
+\r
+ // Don't do this action for non image elements\r
+ if (e.nodeName !== 'IMG')\r
+ return;\r
+\r
+ if (re)\r
+ t.dom.unbind(re.node, re.ev, re.cb);\r
+\r
+ if (!t.dom.hasClass(e, 'mceItemNoResize')) {\r
+ ev = 'resizeend';\r
+ cb = t.dom.bind(e, ev, function(e) {\r
+ var v;\r
+\r
+ e = e.target;\r
+\r
+ if (v = t.dom.getStyle(e, 'width')) {\r
+ t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, ''));\r
+ t.dom.setStyle(e, 'width', '');\r
+ }\r
+\r
+ if (v = t.dom.getStyle(e, 'height')) {\r
+ t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, ''));\r
+ t.dom.setStyle(e, 'height', '');\r
+ }\r
+ });\r
+ } else {\r
+ ev = 'resizestart';\r
+ cb = t.dom.bind(e, 'resizestart', Event.cancel, Event);\r
+ }\r
+\r
+ re = t.resizeInfo = {\r
+ node : e,\r
+ ev : ev,\r
+ cb : cb\r
+ };\r
+ });\r
+\r
+ t.onKeyDown.add(function(ed, e) {\r
+ switch (e.keyCode) {\r
+ case 8:\r
+ // Fix IE control + backspace browser bug\r
+ if (t.selection.getRng().item) {\r
+ ed.dom.remove(t.selection.getRng().item(0));\r
+ return Event.cancel(e);\r
+ }\r
+ }\r
+ });\r
+\r
+ /*if (t.dom.boxModel) {\r
+ t.getBody().style.height = '100%';\r
+\r
+ Event.add(t.getWin(), 'resize', function(e) {\r
+ var docElm = t.getDoc().documentElement;\r
+\r
+ docElm.style.height = (docElm.offsetHeight - 10) + 'px';\r
+ });\r
+ }*/\r
+ }\r
+\r
+ if (tinymce.isOpera) {\r
+ t.onClick.add(function(ed, e) {\r
+ Event.prevent(e);\r
+ });\r
+ }\r
+\r
+ // Add custom undo/redo handlers\r
+ if (s.custom_undo_redo) {\r
+ function addUndo() {\r
+ t.undoManager.typing = 0;\r
+ t.undoManager.add();\r
+ };\r
+\r
+ t.dom.bind(t.getDoc(), 'focusout', function(e) {\r
+ if (!t.removed && t.undoManager.typing)\r
+ addUndo();\r
+ });\r
+\r
+ t.onKeyUp.add(function(ed, e) {\r
+ if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey)\r
+ addUndo();\r
+ });\r
+\r
+ t.onKeyDown.add(function(ed, e) {\r
+ var rng, parent, bookmark;\r
+\r
+ // IE has a really odd bug where the DOM might include an node that doesn't have\r
+ // a proper structure. If you try to access nodeValue it would throw an illegal value exception.\r
+ // This seems to only happen when you delete contents and it seems to be avoidable if you refresh the element\r
+ // after you delete contents from it. See: #3008923\r
+ if (isIE && e.keyCode == 46) {\r
+ rng = t.selection.getRng();\r
+\r
+ if (rng.parentElement) {\r
+ parent = rng.parentElement();\r
+\r
+ // Select next word when ctrl key is used in combo with delete\r
+ if (e.ctrlKey) {\r
+ rng.moveEnd('word', 1);\r
+ rng.select();\r
+ }\r
+\r
+ // Delete contents\r
+ t.selection.getSel().clear();\r
+\r
+ // Check if we are within the same parent\r
+ if (rng.parentElement() == parent) {\r
+ bookmark = t.selection.getBookmark();\r
+\r
+ try {\r
+ // Update the HTML and hopefully it will remove the artifacts\r
+ parent.innerHTML = parent.innerHTML;\r
+ } catch (ex) {\r
+ // And since it's IE it can sometimes produce an unknown runtime error\r
+ }\r
+\r
+ // Restore the caret position\r
+ t.selection.moveToBookmark(bookmark);\r
+ }\r
+\r
+ // Block the default delete behavior since it might be broken\r
+ e.preventDefault();\r
+ return;\r
+ }\r
+ }\r
+\r
+ // Is caracter positon keys\r
+ if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) {\r
+ if (t.undoManager.typing)\r
+ addUndo();\r
+\r
+ return;\r
+ }\r
+\r
+ if (!t.undoManager.typing) {\r
+ t.undoManager.add();\r
+ t.undoManager.typing = 1;\r
+ }\r
+ });\r
+\r
+ t.onMouseDown.add(function() {\r
+ if (t.undoManager.typing)\r
+ addUndo();\r
+ });\r
+ }\r
+ },\r
+\r
+ _isHidden : function() {\r
+ var s;\r
+\r
+ if (!isGecko)\r
+ return 0;\r
+\r
+ // Weird, wheres that cursor selection?\r
+ s = this.selection.getSel();\r
+ return (!s || !s.rangeCount || s.rangeCount == 0);\r
+ },\r
+\r
+ // Fix for bug #1867292\r
+ _fixNesting : function(s) {\r
+ var d = [], i;\r
+\r
+ s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) {\r
+ var e;\r
+\r
+ // Handle end element\r
+ if (b === '/') {\r
+ if (!d.length)\r
+ return '';\r
+\r
+ if (c !== d[d.length - 1].tag) {\r
+ for (i=d.length - 1; i>=0; i--) {\r
+ if (d[i].tag === c) {\r
+ d[i].close = 1;\r
+ break;\r
+ }\r
+ }\r
+\r
+ return '';\r
+ } else {\r
+ d.pop();\r
+\r
+ if (d.length && d[d.length - 1].close) {\r
+ a = a + '</' + d[d.length - 1].tag + '>';\r
+ d.pop();\r
+ }\r
+ }\r
+ } else {\r
+ // Ignore these\r
+ if (/^(br|hr|input|meta|img|link|param)$/i.test(c))\r
+ return a;\r
+\r
+ // Ignore closed ones\r
+ if (/\/>$/.test(a))\r
+ return a;\r
+\r
+ d.push({tag : c}); // Push start element\r
+ }\r
+\r
+ return a;\r
+ });\r
+\r
+ // End all open tags\r
+ for (i=d.length - 1; i>=0; i--)\r
+ s += '</' + d[i].tag + '>';\r
+\r
+ return s;\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ // Added for compression purposes\r
+ var each = tinymce.each, undefined, TRUE = true, FALSE = false;\r
+\r
+ tinymce.EditorCommands = function(editor) {\r
+ var dom = editor.dom,\r
+ selection = editor.selection,\r
+ commands = {state: {}, exec : {}, value : {}},\r
+ settings = editor.settings,\r
+ bookmark;\r
+\r
+ function execCommand(command, ui, value) {\r
+ var func;\r
+\r
+ command = command.toLowerCase();\r
+ if (func = commands.exec[command]) {\r
+ func(command, ui, value);\r
+ return TRUE;\r
+ }\r
+\r
+ return FALSE;\r
+ };\r
+\r
+ function queryCommandState(command) {\r
+ var func;\r
+\r
+ command = command.toLowerCase();\r
+ if (func = commands.state[command])\r
+ return func(command);\r
+\r
+ return -1;\r
+ };\r
+\r
+ function queryCommandValue(command) {\r
+ var func;\r
+\r
+ command = command.toLowerCase();\r
+ if (func = commands.value[command])\r
+ return func(command);\r
+\r
+ return FALSE;\r
+ };\r
+\r
+ function addCommands(command_list, type) {\r
+ type = type || 'exec';\r
+\r
+ each(command_list, function(callback, command) {\r
+ each(command.toLowerCase().split(','), function(command) {\r
+ commands[type][command] = callback;\r
+ });\r
+ });\r
+ };\r
+\r
+ // Expose public methods\r
+ tinymce.extend(this, {\r
+ execCommand : execCommand,\r
+ queryCommandState : queryCommandState,\r
+ queryCommandValue : queryCommandValue,\r
+ addCommands : addCommands\r
+ });\r
+\r
+ // Private methods\r
+\r
+ function execNativeCommand(command, ui, value) {\r
+ if (ui === undefined)\r
+ ui = FALSE;\r
+\r
+ if (value === undefined)\r
+ value = null;\r
+\r
+ return editor.getDoc().execCommand(command, ui, value);\r
+ };\r
+\r
+ function isFormatMatch(name) {\r
+ return editor.formatter.match(name);\r
+ };\r
+\r
+ function toggleFormat(name, value) {\r
+ editor.formatter.toggle(name, value ? {value : value} : undefined);\r
+ };\r
+\r
+ function storeSelection(type) {\r
+ bookmark = selection.getBookmark(type);\r
+ };\r
+\r
+ function restoreSelection() {\r
+ selection.moveToBookmark(bookmark);\r
+ };\r
+\r
+ // Add execCommand overrides\r
+ addCommands({\r
+ // Ignore these, added for compatibility\r
+ 'mceResetDesignMode,mceBeginUndoLevel' : function() {},\r
+\r
+ // Add undo manager logic\r
+ 'mceEndUndoLevel,mceAddUndoLevel' : function() {\r
+ editor.undoManager.add();\r
+ },\r
+\r
+ 'Cut,Copy,Paste' : function(command) {\r
+ var doc = editor.getDoc(), failed;\r
+\r
+ // Try executing the native command\r
+ try {\r
+ execNativeCommand(command);\r
+ } catch (ex) {\r
+ // Command failed\r
+ failed = TRUE;\r
+ }\r
+\r
+ // Present alert message about clipboard access not being available\r
+ if (failed || !doc.queryCommandSupported(command)) {\r
+ if (tinymce.isGecko) {\r
+ editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) {\r
+ if (state)\r
+ open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank');\r
+ });\r
+ } else\r
+ editor.windowManager.alert(editor.getLang('clipboard_no_support'));\r
+ }\r
+ },\r
+\r
+ // Override unlink command\r
+ unlink : function(command) {\r
+ if (selection.isCollapsed())\r
+ selection.select(selection.getNode());\r
+\r
+ execNativeCommand(command);\r
+ selection.collapse(FALSE);\r
+ },\r
+\r
+ // Override justify commands to use the text formatter engine\r
+ 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
+ var align = command.substring(7);\r
+\r
+ // Remove all other alignments first\r
+ each('left,center,right,full'.split(','), function(name) {\r
+ if (align != name)\r
+ editor.formatter.remove('align' + name);\r
+ });\r
+\r
+ toggleFormat('align' + align);\r
+ },\r
+\r
+ // Override list commands to fix WebKit bug\r
+ 'InsertUnorderedList,InsertOrderedList' : function(command) {\r
+ var listElm, listParent;\r
+\r
+ execNativeCommand(command);\r
+\r
+ // WebKit produces lists within block elements so we need to split them\r
+ // we will replace the native list creation logic to custom logic later on\r
+ // TODO: Remove this when the list creation logic is removed\r
+ listElm = dom.getParent(selection.getNode(), 'ol,ul');\r
+ if (listElm) {\r
+ listParent = listElm.parentNode;\r
+\r
+ // If list is within a text block then split that block\r
+ if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {\r
+ storeSelection();\r
+ dom.split(listParent, listElm);\r
+ restoreSelection();\r
+ }\r
+ }\r
+ },\r
+\r
+ // Override commands to use the text formatter engine\r
+ 'Bold,Italic,Underline,Strikethrough' : function(command) {\r
+ toggleFormat(command);\r
+ },\r
+\r
+ // Override commands to use the text formatter engine\r
+ 'ForeColor,HiliteColor,FontName' : function(command, ui, value) {\r
+ toggleFormat(command, value);\r
+ },\r
+\r
+ FontSize : function(command, ui, value) {\r
+ var fontClasses, fontSizes;\r
+\r
+ // Convert font size 1-7 to styles\r
+ if (value >= 1 && value <= 7) {\r
+ fontSizes = tinymce.explode(settings.font_size_style_values);\r
+ fontClasses = tinymce.explode(settings.font_size_classes);\r
+\r
+ if (fontClasses)\r
+ value = fontClasses[value - 1] || value;\r
+ else\r
+ value = fontSizes[value - 1] || value;\r
+ }\r
+\r
+ toggleFormat(command, value);\r
+ },\r
+\r
+ RemoveFormat : function(command) {\r
+ editor.formatter.remove(command);\r
+ },\r
+\r
+ mceBlockQuote : function(command) {\r
+ toggleFormat('blockquote');\r
+ },\r
+\r
+ FormatBlock : function(command, ui, value) {\r
+ return toggleFormat(value || 'p');\r
+ },\r
+\r
+ mceCleanup : function() {\r
+ var bookmark = selection.getBookmark();\r
+\r
+ editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE});\r
+\r
+ selection.moveToBookmark(bookmark);\r
+ },\r
+\r
+ mceRemoveNode : function(command, ui, value) {\r
+ var node = value || selection.getNode();\r
+\r
+ // Make sure that the body node isn't removed\r
+ if (node != editor.getBody()) {\r
+ storeSelection();\r
+ editor.dom.remove(node, TRUE);\r
+ restoreSelection();\r
+ }\r
+ },\r
+\r
+ mceSelectNodeDepth : function(command, ui, value) {\r
+ var counter = 0;\r
+\r
+ dom.getParent(selection.getNode(), function(node) {\r
+ if (node.nodeType == 1 && counter++ == value) {\r
+ selection.select(node);\r
+ return FALSE;\r
+ }\r
+ }, editor.getBody());\r
+ },\r
+\r
+ mceSelectNode : function(command, ui, value) {\r
+ selection.select(value);\r
+ },\r
+\r
+ mceInsertContent : function(command, ui, value) {\r
+ selection.setContent(value);\r
+ },\r
+\r
+ mceInsertRawHTML : function(command, ui, value) {\r
+ selection.setContent('tiny_mce_marker');\r
+ editor.setContent(editor.getContent().replace(/tiny_mce_marker/g, value));\r
+ },\r
+\r
+ mceSetContent : function(command, ui, value) {\r
+ editor.setContent(value);\r
+ },\r
+\r
+ 'Indent,Outdent' : function(command) {\r
+ var intentValue, indentUnit, value;\r
+\r
+ // Setup indent level\r
+ intentValue = settings.indentation;\r
+ indentUnit = /[a-z%]+$/i.exec(intentValue);\r
+ intentValue = parseInt(intentValue);\r
+\r
+ if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) {\r
+ each(selection.getSelectedBlocks(), function(element) {\r
+ if (command == 'outdent') {\r
+ value = Math.max(0, parseInt(element.style.paddingLeft || 0) - intentValue);\r
+ dom.setStyle(element, 'paddingLeft', value ? value + indentUnit : '');\r
+ } else\r
+ dom.setStyle(element, 'paddingLeft', (parseInt(element.style.paddingLeft || 0) + intentValue) + indentUnit);\r
+ });\r
+ } else\r
+ execNativeCommand(command);\r
+ },\r
+\r
+ mceRepaint : function() {\r
+ var bookmark;\r
+\r
+ if (tinymce.isGecko) {\r
+ try {\r
+ storeSelection(TRUE);\r
+\r
+ if (selection.getSel())\r
+ selection.getSel().selectAllChildren(editor.getBody());\r
+\r
+ selection.collapse(TRUE);\r
+ restoreSelection();\r
+ } catch (ex) {\r
+ // Ignore\r
+ }\r
+ }\r
+ },\r
+\r
+ mceToggleFormat : function(command, ui, value) {\r
+ editor.formatter.toggle(value);\r
+ },\r
+\r
+ InsertHorizontalRule : function() {\r
+ selection.setContent('<hr />');\r
+ },\r
+\r
+ mceToggleVisualAid : function() {\r
+ editor.hasVisual = !editor.hasVisual;\r
+ editor.addVisual();\r
+ },\r
+\r
+ mceReplaceContent : function(command, ui, value) {\r
+ selection.setContent(value.replace(/\{\$selection\}/g, selection.getContent({format : 'text'})));\r
+ },\r
+\r
+ mceInsertLink : function(command, ui, value) {\r
+ var link = dom.getParent(selection.getNode(), 'a');\r
+\r
+ if (tinymce.is(value, 'string'))\r
+ value = {href : value};\r
+\r
+ if (!link) {\r
+ execNativeCommand('CreateLink', FALSE, 'javascript:mctmp(0);');\r
+ each(dom.select('a[href=javascript:mctmp(0);]'), function(link) {\r
+ dom.setAttribs(link, value);\r
+ });\r
+ } else {\r
+ if (value.href)\r
+ dom.setAttribs(link, value);\r
+ else\r
+ editor.dom.remove(link, TRUE);\r
+ }\r
+ },\r
+ \r
+ selectAll : function() {\r
+ var root = dom.getRoot(), rng = dom.createRng();\r
+\r
+ rng.setStart(root, 0);\r
+ rng.setEnd(root, root.childNodes.length);\r
+\r
+ editor.selection.setRng(rng);\r
+ }\r
+ });\r
+\r
+ // Add queryCommandState overrides\r
+ addCommands({\r
+ // Override justify commands\r
+ 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull' : function(command) {\r
+ return isFormatMatch('align' + command.substring(7));\r
+ },\r
+\r
+ 'Bold,Italic,Underline,Strikethrough' : function(command) {\r
+ return isFormatMatch(command);\r
+ },\r
+\r
+ mceBlockQuote : function() {\r
+ return isFormatMatch('blockquote');\r
+ },\r
+\r
+ Outdent : function() {\r
+ var node;\r
+\r
+ if (settings.inline_styles) {\r
+ if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)\r
+ return TRUE;\r
+\r
+ if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft) > 0)\r
+ return TRUE;\r
+ }\r
+\r
+ return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE'));\r
+ },\r
+\r
+ 'InsertUnorderedList,InsertOrderedList' : function(command) {\r
+ return dom.getParent(selection.getNode(), command == 'insertunorderedlist' ? 'UL' : 'OL');\r
+ }\r
+ }, 'state');\r
+\r
+ // Add queryCommandValue overrides\r
+ addCommands({\r
+ 'FontSize,FontName' : function(command) {\r
+ var value = 0, parent;\r
+\r
+ if (parent = dom.getParent(selection.getNode(), 'span')) {\r
+ if (command == 'fontsize')\r
+ value = parent.style.fontSize;\r
+ else\r
+ value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase();\r
+ }\r
+\r
+ return value;\r
+ }\r
+ }, 'value');\r
+\r
+ // Add undo manager logic\r
+ if (settings.custom_undo_redo) {\r
+ addCommands({\r
+ Undo : function() {\r
+ editor.undoManager.undo();\r
+ },\r
+\r
+ Redo : function() {\r
+ editor.undoManager.redo();\r
+ }\r
+ });\r
+ }\r
+ };\r
+})(tinymce);\r
+(function(tinymce) {\r
+ var Dispatcher = tinymce.util.Dispatcher;\r
+\r
+ tinymce.UndoManager = function(editor) {\r
+ var self, index = 0, data = [];\r
+\r
+ function getContent() {\r
+ return tinymce.trim(editor.getContent({format : 'raw', no_events : 1}));\r
+ };\r
+\r
+ return self = {\r
+ typing : 0,\r
+\r
+ onAdd : new Dispatcher(self),\r
+ onUndo : new Dispatcher(self),\r
+ onRedo : new Dispatcher(self),\r
+\r
+ add : function(level) {\r
+ var i, settings = editor.settings, lastLevel;\r
+\r
+ level = level || {};\r
+ level.content = getContent();\r
+\r
+ // Add undo level if needed\r
+ lastLevel = data[index];\r
+ if (lastLevel && lastLevel.content == level.content) {\r
+ if (index > 0 || data.length == 1)\r
+ return null;\r
+ }\r
+\r
+ // Time to compress\r
+ if (settings.custom_undo_redo_levels) {\r
+ if (data.length > settings.custom_undo_redo_levels) {\r
+ for (i = 0; i < data.length - 1; i++)\r
+ data[i] = data[i + 1];\r
+\r
+ data.length--;\r
+ index = data.length;\r
+ }\r
+ }\r
+\r
+ // Get a non intrusive normalized bookmark\r
+ level.bookmark = editor.selection.getBookmark(2, true);\r
+\r
+ // Crop array if needed\r
+ if (index < data.length - 1) {\r
+ // Treat first level as initial\r
+ if (index == 0)\r
+ data = [];\r
+ else\r
+ data.length = index + 1;\r
+ }\r
+\r
+ data.push(level);\r
+ index = data.length - 1;\r
+\r
+ self.onAdd.dispatch(self, level);\r
+ editor.isNotDirty = 0;\r
+\r
+ return level;\r
+ },\r
+\r
+ undo : function() {\r
+ var level, i;\r
+\r
+ if (self.typing) {\r
+ self.add();\r
+ self.typing = 0;\r
+ }\r
+\r
+ if (index > 0) {\r
+ level = data[--index];\r
+\r
+ editor.setContent(level.content, {format : 'raw'});\r
+ editor.selection.moveToBookmark(level.bookmark);\r
+\r
+ self.onUndo.dispatch(self, level);\r
+ }\r
+\r
+ return level;\r
+ },\r
+\r
+ redo : function() {\r
+ var level;\r
+\r
+ if (index < data.length - 1) {\r
+ level = data[++index];\r
+\r
+ editor.setContent(level.content, {format : 'raw'});\r
+ editor.selection.moveToBookmark(level.bookmark);\r
+\r
+ self.onRedo.dispatch(self, level);\r
+ }\r
+\r
+ return level;\r
+ },\r
+\r
+ clear : function() {\r
+ data = [];\r
+ index = self.typing = 0;\r
+ },\r
+\r
+ hasUndo : function() {\r
+ return index > 0 || self.typing;\r
+ },\r
+\r
+ hasRedo : function() {\r
+ return index < data.length - 1;\r
+ }\r
+ };\r
+ };\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ // Shorten names\r
+ var Event = tinymce.dom.Event,\r
+ isIE = tinymce.isIE,\r
+ isGecko = tinymce.isGecko,\r
+ isOpera = tinymce.isOpera,\r
+ each = tinymce.each,\r
+ extend = tinymce.extend,\r
+ TRUE = true,\r
+ FALSE = false;\r
+\r
+ function cloneFormats(node) {\r
+ var clone, temp, inner;\r
+\r
+ do {\r
+ if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(node.nodeName)) {\r
+ if (clone) {\r
+ temp = node.cloneNode(false);\r
+ temp.appendChild(clone);\r
+ clone = temp;\r
+ } else {\r
+ clone = inner = node.cloneNode(false);\r
+ }\r
+\r
+ clone.removeAttribute('id');\r
+ }\r
+ } while (node = node.parentNode);\r
+\r
+ if (clone)\r
+ return {wrapper : clone, inner : inner};\r
+ };\r
+\r
+ // Checks if the selection/caret is at the end of the specified block element\r
+ function isAtEnd(rng, par) {\r
+ var rng2 = par.ownerDocument.createRange();\r
+\r
+ rng2.setStart(rng.endContainer, rng.endOffset);\r
+ rng2.setEndAfter(par);\r
+\r
+ // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element\r
+ return rng2.cloneContents().textContent.length == 0;\r
+ };\r
+\r
+ function isEmpty(n) {\r
+ n = n.innerHTML;\r
+\r
+ n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars\r
+ n = n.replace(/<[^>]+>/g, ''); // Remove all tags\r
+\r
+ return n.replace(/[ \u00a0\t\r\n]+/g, '') == '';\r
+ };\r
+\r
+ function splitList(selection, dom, li) {\r
+ var listBlock, block;\r
+\r
+ if (isEmpty(li)) {\r
+ listBlock = dom.getParent(li, 'ul,ol');\r
+\r
+ if (!dom.getParent(listBlock.parentNode, 'ul,ol')) {\r
+ dom.split(listBlock, li);\r
+ block = dom.create('p', 0, '<br _mce_bogus="1" />');\r
+ dom.replace(block, li);\r
+ selection.select(block, 1);\r
+ }\r
+\r
+ return FALSE;\r
+ }\r
+\r
+ return TRUE;\r
+ };\r
+\r
+ tinymce.create('tinymce.ForceBlocks', {\r
+ ForceBlocks : function(ed) {\r
+ var t = this, s = ed.settings, elm;\r
+\r
+ t.editor = ed;\r
+ t.dom = ed.dom;\r
+ elm = (s.forced_root_block || 'p').toLowerCase();\r
+ s.element = elm.toUpperCase();\r
+\r
+ ed.onPreInit.add(t.setup, t);\r
+\r
+ t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi');\r
+ t.rePadd = new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g, elm), 'gi');\r
+ t.reNbsp2BR1 = new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi');\r
+ t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi');\r
+ t.reBR2Nbsp = new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi');\r
+\r
+ function padd(ed, o) {\r
+ if (isOpera)\r
+ o.content = o.content.replace(t.reOpera, '</' + elm + '>');\r
+\r
+ o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0</' + elm + '>');\r
+\r
+ if (!isIE && !isOpera && o.set) {\r
+ // Use instead of BR in padded paragraphs\r
+ o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2><br /></' + elm + '>');\r
+ o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2><br /></' + elm + '>');\r
+ } else\r
+ o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0</' + elm + '>');\r
+ };\r
+\r
+ ed.onBeforeSetContent.add(padd);\r
+ ed.onPostProcess.add(padd);\r
+\r
+ if (s.forced_root_block) {\r
+ ed.onInit.add(t.forceRoots, t);\r
+ ed.onSetContent.add(t.forceRoots, t);\r
+ ed.onBeforeGetContent.add(t.forceRoots, t);\r
+ }\r
+ },\r
+\r
+ setup : function() {\r
+ var t = this, ed = t.editor, s = ed.settings, dom = ed.dom, selection = ed.selection;\r
+\r
+ // Force root blocks when typing and when getting output\r
+ if (s.forced_root_block) {\r
+ ed.onBeforeExecCommand.add(t.forceRoots, t);\r
+ ed.onKeyUp.add(t.forceRoots, t);\r
+ ed.onPreProcess.add(t.forceRoots, t);\r
+ }\r
+\r
+ if (s.force_br_newlines) {\r
+ // Force IE to produce BRs on enter\r
+ if (isIE) {\r
+ ed.onKeyPress.add(function(ed, e) {\r
+ var n;\r
+\r
+ if (e.keyCode == 13 && selection.getNode().nodeName != 'LI') {\r
+ selection.setContent('<br id="__" /> ', {format : 'raw'});\r
+ n = dom.get('__');\r
+ n.removeAttribute('id');\r
+ selection.select(n);\r
+ selection.collapse();\r
+ return Event.cancel(e);\r
+ }\r
+ });\r
+ }\r
+ }\r
+\r
+ if (s.force_p_newlines) {\r
+ if (!isIE) {\r
+ ed.onKeyPress.add(function(ed, e) {\r
+ if (e.keyCode == 13 && !e.shiftKey && !t.insertPara(e))\r
+ Event.cancel(e);\r
+ });\r
+ } else {\r
+ // Ungly hack to for IE to preserve the formatting when you press\r
+ // enter at the end of a block element with formatted contents\r
+ // This logic overrides the browsers default logic with\r
+ // custom logic that enables us to control the output\r
+ tinymce.addUnload(function() {\r
+ t._previousFormats = 0; // Fix IE leak\r
+ });\r
+\r
+ ed.onKeyPress.add(function(ed, e) {\r
+ t._previousFormats = 0;\r
+\r
+ // Clone the current formats, this will later be applied to the new block contents\r
+ if (e.keyCode == 13 && !e.shiftKey && ed.selection.isCollapsed() && s.keep_styles)\r
+ t._previousFormats = cloneFormats(ed.selection.getStart());\r
+ });\r
+\r
+ ed.onKeyUp.add(function(ed, e) {\r
+ // Let IE break the element and the wrap the new caret location in the previous formats\r
+ if (e.keyCode == 13 && !e.shiftKey) {\r
+ var parent = ed.selection.getStart(), fmt = t._previousFormats;\r
+\r
+ // Parent is an empty block\r
+ if (!parent.hasChildNodes()) {\r
+ parent = dom.getParent(parent, dom.isBlock);\r
+\r
+ if (parent) {\r
+ parent.innerHTML = '';\r
+ \r
+ if (t._previousFormats) {\r
+ parent.appendChild(fmt.wrapper);\r
+ fmt.inner.innerHTML = '\uFEFF';\r
+ } else\r
+ parent.innerHTML = '\uFEFF';\r
+\r
+ selection.select(parent, 1);\r
+ ed.getDoc().execCommand('Delete', false, null);\r
+ }\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ if (isGecko) {\r
+ ed.onKeyDown.add(function(ed, e) {\r
+ if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey)\r
+ t.backspaceDelete(e, e.keyCode == 8);\r
+ });\r
+ }\r
+ }\r
+\r
+ // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973\r
+ if (tinymce.isWebKit) {\r
+ function insertBr(ed) {\r
+ var rng = selection.getRng(), br, div = dom.create('div', null, ' '), divYPos, vpHeight = dom.getViewPort(ed.getWin()).h;\r
+\r
+ // Insert BR element\r
+ rng.insertNode(br = dom.create('br'));\r
+\r
+ // Place caret after BR\r
+ rng.setStartAfter(br);\r
+ rng.setEndAfter(br);\r
+ selection.setRng(rng);\r
+\r
+ // Could not place caret after BR then insert an nbsp entity and move the caret\r
+ if (selection.getSel().focusNode == br.previousSibling) {\r
+ selection.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br));\r
+ selection.collapse(TRUE);\r
+ }\r
+\r
+ // Create a temporary DIV after the BR and get the position as it\r
+ // seems like getPos() returns 0 for text nodes and BR elements.\r
+ dom.insertAfter(div, br);\r
+ divYPos = dom.getPos(div).y;\r
+ dom.remove(div);\r
+\r
+ // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117\r
+ if (divYPos > vpHeight) // It is not necessary to scroll if the DIV is inside the view port.\r
+ ed.getWin().scrollTo(0, divYPos);\r
+ };\r
+\r
+ ed.onKeyPress.add(function(ed, e) {\r
+ if (e.keyCode == 13 && (e.shiftKey || (s.force_br_newlines && !dom.getParent(selection.getNode(), 'h1,h2,h3,h4,h5,h6,ol,ul')))) {\r
+ insertBr(ed);\r
+ Event.cancel(e);\r
+ }\r
+ });\r
+ }\r
+\r
+ // Padd empty inline elements within block elements\r
+ // For example: <p><strong><em></em></strong></p> becomes <p><strong><em> </em></strong></p>\r
+ ed.onPreProcess.add(function(ed, o) {\r
+ each(dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) {\r
+ if (isEmpty(p)) {\r
+ each(dom.select('span,em,strong,b,i', o.node), function(n) {\r
+ if (!n.hasChildNodes()) {\r
+ n.appendChild(ed.getDoc().createTextNode('\u00a0'));\r
+ return FALSE; // Break the loop one padding is enough\r
+ }\r
+ });\r
+ }\r
+ });\r
+ });\r
+\r
+ // IE specific fixes\r
+ if (isIE) {\r
+ // Replaces IE:s auto generated paragraphs with the specified element name\r
+ if (s.element != 'P') {\r
+ ed.onKeyPress.add(function(ed, e) {\r
+ t.lastElm = selection.getNode().nodeName;\r
+ });\r
+\r
+ ed.onKeyUp.add(function(ed, e) {\r
+ var bl, n = selection.getNode(), b = ed.getBody();\r
+\r
+ if (b.childNodes.length === 1 && n.nodeName == 'P') {\r
+ n = dom.rename(n, s.element);\r
+ selection.select(n);\r
+ selection.collapse();\r
+ ed.nodeChanged();\r
+ } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') {\r
+ bl = dom.getParent(n, 'p');\r
+\r
+ if (bl) {\r
+ dom.rename(bl, s.element);\r
+ ed.nodeChanged();\r
+ }\r
+ }\r
+ });\r
+ }\r
+ }\r
+ },\r
+\r
+ find : function(n, t, s) {\r
+ var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, FALSE), c = -1;\r
+\r
+ while (n = w.nextNode()) {\r
+ c++;\r
+\r
+ // Index by node\r
+ if (t == 0 && n == s)\r
+ return c;\r
+\r
+ // Node by index\r
+ if (t == 1 && c == s)\r
+ return n;\r
+ }\r
+\r
+ return -1;\r
+ },\r
+\r
+ forceRoots : function(ed, e) {\r
+ var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF;\r
+ var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid;\r
+\r
+ // Fix for bug #1863847\r
+ //if (e && e.keyCode == 13)\r
+ // return TRUE;\r
+\r
+ // Wrap non blocks into blocks\r
+ for (i = nl.length - 1; i >= 0; i--) {\r
+ nx = nl[i];\r
+\r
+ // Ignore internal elements\r
+ if (nx.nodeType === 1 && nx.getAttribute('_mce_type')) {\r
+ bl = null;\r
+ continue;\r
+ }\r
+\r
+ // Is text or non block element\r
+ if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) {\r
+ if (!bl) {\r
+ // Create new block but ignore whitespace\r
+ if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) {\r
+ // Store selection\r
+ if (si == -2 && r) {\r
+ if (!isIE) {\r
+ // If selection is element then mark it\r
+ if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) {\r
+ // Save the id of the selected element\r
+ eid = n.getAttribute("id");\r
+ n.setAttribute("id", "__mce");\r
+ } else {\r
+ // If element is inside body, might not be the case in contentEdiable mode\r
+ if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) {\r
+ so = r.startOffset;\r
+ eo = r.endOffset;\r
+ si = t.find(b, 0, r.startContainer);\r
+ ei = t.find(b, 0, r.endContainer);\r
+ }\r
+ }\r
+ } else {\r
+ // Force control range into text range\r
+ if (r.item) {\r
+ tr = d.body.createTextRange();\r
+ tr.moveToElementText(r.item(0));\r
+ r = tr;\r
+ }\r
+\r
+ tr = d.body.createTextRange();\r
+ tr.moveToElementText(b);\r
+ tr.collapse(1);\r
+ bp = tr.move('character', c) * -1;\r
+\r
+ tr = r.duplicate();\r
+ tr.collapse(1);\r
+ sp = tr.move('character', c) * -1;\r
+\r
+ tr = r.duplicate();\r
+ tr.collapse(0);\r
+ le = (tr.move('character', c) * -1) - sp;\r
+\r
+ si = sp - bp;\r
+ ei = le;\r
+ }\r
+ }\r
+\r
+ // Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE\r
+ // See: http://support.microsoft.com/kb/829907\r
+ bl = ed.dom.create(ed.settings.forced_root_block);\r
+ nx.parentNode.replaceChild(bl, nx);\r
+ bl.appendChild(nx);\r
+ }\r
+ } else {\r
+ if (bl.hasChildNodes())\r
+ bl.insertBefore(nx, bl.firstChild);\r
+ else\r
+ bl.appendChild(nx);\r
+ }\r
+ } else\r
+ bl = null; // Time to create new block\r
+ }\r
+\r
+ // Restore selection\r
+ if (si != -2) {\r
+ if (!isIE) {\r
+ bl = b.getElementsByTagName(ed.settings.element)[0];\r
+ r = d.createRange();\r
+\r
+ // Select last location or generated block\r
+ if (si != -1)\r
+ r.setStart(t.find(b, 1, si), so);\r
+ else\r
+ r.setStart(bl, 0);\r
+\r
+ // Select last location or generated block\r
+ if (ei != -1)\r
+ r.setEnd(t.find(b, 1, ei), eo);\r
+ else\r
+ r.setEnd(bl, 0);\r
+\r
+ if (s) {\r
+ s.removeAllRanges();\r
+ s.addRange(r);\r
+ }\r
+ } else {\r
+ try {\r
+ r = s.createRange();\r
+ r.moveToElementText(b);\r
+ r.collapse(1);\r
+ r.moveStart('character', si);\r
+ r.moveEnd('character', ei);\r
+ r.select();\r
+ } catch (ex) {\r
+ // Ignore\r
+ }\r
+ }\r
+ } else if (!isIE && (n = ed.dom.get('__mce'))) {\r
+ // Restore the id of the selected element\r
+ if (eid)\r
+ n.setAttribute('id', eid);\r
+ else\r
+ n.removeAttribute('id');\r
+\r
+ // Move caret before selected element\r
+ r = d.createRange();\r
+ r.setStartBefore(n);\r
+ r.setEndBefore(n);\r
+ se.setRng(r);\r
+ }\r
+ },\r
+\r
+ getParentBlock : function(n) {\r
+ var d = this.dom;\r
+\r
+ return d.getParent(n, d.isBlock);\r
+ },\r
+\r
+ insertPara : function(e) {\r
+ var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body;\r
+ var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car;\r
+\r
+ // If root blocks are forced then use Operas default behavior since it's really good\r
+// Removed due to bug: #1853816\r
+// if (se.forced_root_block && isOpera)\r
+// return TRUE;\r
+\r
+ // Setup before range\r
+ rb = d.createRange();\r
+\r
+ // If is before the first block element and in body, then move it into first block element\r
+ rb.setStart(s.anchorNode, s.anchorOffset);\r
+ rb.collapse(TRUE);\r
+\r
+ // Setup after range\r
+ ra = d.createRange();\r
+\r
+ // If is before the first block element and in body, then move it into first block element\r
+ ra.setStart(s.focusNode, s.focusOffset);\r
+ ra.collapse(TRUE);\r
+\r
+ // Setup start/end points\r
+ dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0;\r
+ sn = dir ? s.anchorNode : s.focusNode;\r
+ so = dir ? s.anchorOffset : s.focusOffset;\r
+ en = dir ? s.focusNode : s.anchorNode;\r
+ eo = dir ? s.focusOffset : s.anchorOffset;\r
+\r
+ // If selection is in empty table cell\r
+ if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) {\r
+ if (sn.firstChild.nodeName == 'BR')\r
+ dom.remove(sn.firstChild); // Remove BR\r
+\r
+ // Create two new block elements\r
+ if (sn.childNodes.length == 0) {\r
+ ed.dom.add(sn, se.element, null, '<br />');\r
+ aft = ed.dom.add(sn, se.element, null, '<br />');\r
+ } else {\r
+ n = sn.innerHTML;\r
+ sn.innerHTML = '';\r
+ ed.dom.add(sn, se.element, null, n);\r
+ aft = ed.dom.add(sn, se.element, null, '<br />');\r
+ }\r
+\r
+ // Move caret into the last one\r
+ r = d.createRange();\r
+ r.selectNodeContents(aft);\r
+ r.collapse(1);\r
+ ed.selection.setRng(r);\r
+\r
+ return FALSE;\r
+ }\r
+\r
+ // If the caret is in an invalid location in FF we need to move it into the first block\r
+ if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) {\r
+ sn = en = sn.firstChild;\r
+ so = eo = 0;\r
+ rb = d.createRange();\r
+ rb.setStart(sn, 0);\r
+ ra = d.createRange();\r
+ ra.setStart(en, 0);\r
+ }\r
+\r
+ // Never use body as start or end node\r
+ sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes\r
+ sn = sn.nodeName == "BODY" ? sn.firstChild : sn;\r
+ en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes\r
+ en = en.nodeName == "BODY" ? en.firstChild : en;\r
+\r
+ // Get start and end blocks\r
+ sb = t.getParentBlock(sn);\r
+ eb = t.getParentBlock(en);\r
+ bn = sb ? sb.nodeName : se.element; // Get block name to create\r
+\r
+ // Return inside list use default browser behavior\r
+ if (n = t.dom.getParent(sb, 'li,pre')) {\r
+ if (n.nodeName == 'LI')\r
+ return splitList(ed.selection, t.dom, n);\r
+\r
+ return TRUE;\r
+ }\r
+\r
+ // If caption or absolute layers then always generate new blocks within\r
+ if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {\r
+ bn = se.element;\r
+ sb = null;\r
+ }\r
+\r
+ // If caption or absolute layers then always generate new blocks within\r
+ if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) {\r
+ bn = se.element;\r
+ eb = null;\r
+ }\r
+\r
+ // Use P instead\r
+ if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) {\r
+ bn = se.element;\r
+ sb = eb = null;\r
+ }\r
+\r
+ // Setup new before and after blocks\r
+ bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn);\r
+ aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn);\r
+\r
+ // Remove id from after clone\r
+ aft.removeAttribute('id');\r
+\r
+ // Is header and cursor is at the end, then force paragraph under\r
+ if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb))\r
+ aft = ed.dom.create(se.element);\r
+\r
+ // Find start chop node\r
+ n = sc = sn;\r
+ do {\r
+ if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))\r
+ break;\r
+\r
+ sc = n;\r
+ } while ((n = n.previousSibling ? n.previousSibling : n.parentNode));\r
+\r
+ // Find end chop node\r
+ n = ec = en;\r
+ do {\r
+ if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName))\r
+ break;\r
+\r
+ ec = n;\r
+ } while ((n = n.nextSibling ? n.nextSibling : n.parentNode));\r
+\r
+ // Place first chop part into before block element\r
+ if (sc.nodeName == bn)\r
+ rb.setStart(sc, 0);\r
+ else\r
+ rb.setStartBefore(sc);\r
+\r
+ rb.setEnd(sn, so);\r
+ bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari\r
+\r
+ // Place secnd chop part within new block element\r
+ try {\r
+ ra.setEndAfter(ec);\r
+ } catch(ex) {\r
+ //console.debug(s.focusNode, s.focusOffset);\r
+ }\r
+\r
+ ra.setStart(en, eo);\r
+ aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari\r
+\r
+ // Create range around everything\r
+ r = d.createRange();\r
+ if (!sc.previousSibling && sc.parentNode.nodeName == bn) {\r
+ r.setStartBefore(sc.parentNode);\r
+ } else {\r
+ if (rb.startContainer.nodeName == bn && rb.startOffset == 0)\r
+ r.setStartBefore(rb.startContainer);\r
+ else\r
+ r.setStart(rb.startContainer, rb.startOffset);\r
+ }\r
+\r
+ if (!ec.nextSibling && ec.parentNode.nodeName == bn)\r
+ r.setEndAfter(ec.parentNode);\r
+ else\r
+ r.setEnd(ra.endContainer, ra.endOffset);\r
+\r
+ // Delete and replace it with new block elements\r
+ r.deleteContents();\r
+\r
+ if (isOpera)\r
+ ed.getWin().scrollTo(0, vp.y);\r
+\r
+ // Never wrap blocks in blocks\r
+ if (bef.firstChild && bef.firstChild.nodeName == bn)\r
+ bef.innerHTML = bef.firstChild.innerHTML;\r
+\r
+ if (aft.firstChild && aft.firstChild.nodeName == bn)\r
+ aft.innerHTML = aft.firstChild.innerHTML;\r
+\r
+ // Padd empty blocks\r
+ if (isEmpty(bef))\r
+ bef.innerHTML = '<br />';\r
+\r
+ function appendStyles(e, en) {\r
+ var nl = [], nn, n, i;\r
+\r
+ e.innerHTML = '';\r
+\r
+ // Make clones of style elements\r
+ if (se.keep_styles) {\r
+ n = en;\r
+ do {\r
+ // We only want style specific elements\r
+ if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) {\r
+ nn = n.cloneNode(FALSE);\r
+ dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique\r
+ nl.push(nn);\r
+ }\r
+ } while (n = n.parentNode);\r
+ }\r
+\r
+ // Append style elements to aft\r
+ if (nl.length > 0) {\r
+ for (i = nl.length - 1, nn = e; i >= 0; i--)\r
+ nn = nn.appendChild(nl[i]);\r
+\r
+ // Padd most inner style element\r
+ nl[0].innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there\r
+ return nl[0]; // Move caret to most inner element\r
+ } else\r
+ e.innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there\r
+ };\r
+\r
+ // Fill empty afterblook with current style\r
+ if (isEmpty(aft))\r
+ car = appendStyles(aft, en);\r
+\r
+ // Opera needs this one backwards for older versions\r
+ if (isOpera && parseFloat(opera.version()) < 9.5) {\r
+ r.insertNode(bef);\r
+ r.insertNode(aft);\r
+ } else {\r
+ r.insertNode(aft);\r
+ r.insertNode(bef);\r
+ }\r
+\r
+ // Normalize\r
+ aft.normalize();\r
+ bef.normalize();\r
+\r
+ function first(n) {\r
+ return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE).nextNode() || n;\r
+ };\r
+\r
+ // Move cursor and scroll into view\r
+ r = d.createRange();\r
+ r.selectNodeContents(isGecko ? first(car || aft) : car || aft);\r
+ r.collapse(1);\r
+ s.removeAllRanges();\r
+ s.addRange(r);\r
+\r
+ // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs\r
+ y = ed.dom.getPos(aft).y;\r
+ ch = aft.clientHeight;\r
+\r
+ // Is element within viewport\r
+ if (y < vp.y || y + ch > vp.y + vp.h) {\r
+ ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks\r
+ //console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight));\r
+ }\r
+\r
+ return FALSE;\r
+ },\r
+\r
+ backspaceDelete : function(e, bs) {\r
+ var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn, walker;\r
+\r
+ // Delete when caret is behind a element doesn't work correctly on Gecko see #3011651\r
+ if (!bs && r.collapsed && sc.nodeType == 1 && r.startOffset == sc.childNodes.length) {\r
+ walker = new tinymce.dom.TreeWalker(sc.lastChild, sc);\r
+\r
+ // Walk the dom backwards until we find a text node\r
+ for (n = sc.lastChild; n; n = walker.prev()) {\r
+ if (n.nodeType == 3) {\r
+ r.setStart(n, n.nodeValue.length);\r
+ r.collapse(true);\r
+ se.setRng(r);\r
+ return;\r
+ }\r
+ }\r
+ }\r
+\r
+ // The caret sometimes gets stuck in Gecko if you delete empty paragraphs\r
+ // This workaround removes the element by hand and moves the caret to the previous element\r
+ if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) {\r
+ if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) {\r
+ // Find previous block element\r
+ n = sc;\r
+ while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ;\r
+\r
+ if (n) {\r
+ if (sc != b.firstChild) {\r
+ // Find last text node\r
+ w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, FALSE);\r
+ while (tn = w.nextNode())\r
+ n = tn;\r
+\r
+ // Place caret at the end of last text node\r
+ r = ed.getDoc().createRange();\r
+ r.setStart(n, n.nodeValue ? n.nodeValue.length : 0);\r
+ r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0);\r
+ se.setRng(r);\r
+\r
+ // Remove the target container\r
+ ed.dom.remove(sc);\r
+ }\r
+\r
+ return Event.cancel(e);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ // Shorten names\r
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend;\r
+\r
+ tinymce.create('tinymce.ControlManager', {\r
+ ControlManager : function(ed, s) {\r
+ var t = this, i;\r
+\r
+ s = s || {};\r
+ t.editor = ed;\r
+ t.controls = {};\r
+ t.onAdd = new tinymce.util.Dispatcher(t);\r
+ t.onPostRender = new tinymce.util.Dispatcher(t);\r
+ t.prefix = s.prefix || ed.id + '_';\r
+ t._cls = {};\r
+\r
+ t.onPostRender.add(function() {\r
+ each(t.controls, function(c) {\r
+ c.postRender();\r
+ });\r
+ });\r
+ },\r
+\r
+ get : function(id) {\r
+ return this.controls[this.prefix + id] || this.controls[id];\r
+ },\r
+\r
+ setActive : function(id, s) {\r
+ var c = null;\r
+\r
+ if (c = this.get(id))\r
+ c.setActive(s);\r
+\r
+ return c;\r
+ },\r
+\r
+ setDisabled : function(id, s) {\r
+ var c = null;\r
+\r
+ if (c = this.get(id))\r
+ c.setDisabled(s);\r
+\r
+ return c;\r
+ },\r
+\r
+ add : function(c) {\r
+ var t = this;\r
+\r
+ if (c) {\r
+ t.controls[c.id] = c;\r
+ t.onAdd.dispatch(c, t);\r
+ }\r
+\r
+ return c;\r
+ },\r
+\r
+ createControl : function(n) {\r
+ var c, t = this, ed = t.editor;\r
+\r
+ each(ed.plugins, function(p) {\r
+ if (p.createControl) {\r
+ c = p.createControl(n, t);\r
+\r
+ if (c)\r
+ return false;\r
+ }\r
+ });\r
+\r
+ switch (n) {\r
+ case "|":\r
+ case "separator":\r
+ return t.createSeparator();\r
+ }\r
+\r
+ if (!c && ed.buttons && (c = ed.buttons[n]))\r
+ return t.createButton(n, c);\r
+\r
+ return t.add(c);\r
+ },\r
+\r
+ createDropMenu : function(id, s, cc) {\r
+ var t = this, ed = t.editor, c, bm, v, cls;\r
+\r
+ s = extend({\r
+ 'class' : 'mceDropDown',\r
+ constrain : ed.settings.constrain_menus\r
+ }, s);\r
+\r
+ s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin';\r
+ if (v = ed.getParam('skin_variant'))\r
+ s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);\r
+\r
+ id = t.prefix + id;\r
+ cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;\r
+ c = t.controls[id] = new cls(id, s);\r
+ c.onAddItem.add(function(c, o) {\r
+ var s = o.settings;\r
+\r
+ s.title = ed.getLang(s.title, s.title);\r
+\r
+ if (!s.onclick) {\r
+ s.onclick = function(v) {\r
+ if (s.cmd)\r
+ ed.execCommand(s.cmd, s.ui || false, s.value);\r
+ };\r
+ }\r
+ });\r
+\r
+ ed.onRemove.add(function() {\r
+ c.destroy();\r
+ });\r
+\r
+ // Fix for bug #1897785, #1898007\r
+ if (tinymce.isIE) {\r
+ c.onShowMenu.add(function() {\r
+ // IE 8 needs focus in order to store away a range with the current collapsed caret location\r
+ ed.focus();\r
+\r
+ bm = ed.selection.getBookmark(1);\r
+ });\r
+\r
+ c.onHideMenu.add(function() {\r
+ if (bm) {\r
+ ed.selection.moveToBookmark(bm);\r
+ bm = 0;\r
+ }\r
+ });\r
+ }\r
+\r
+ return t.add(c);\r
+ },\r
+\r
+ createListBox : function(id, s, cc) {\r
+ var t = this, ed = t.editor, cmd, c, cls;\r
+\r
+ if (t.get(id))\r
+ return null;\r
+\r
+ s.title = ed.translate(s.title);\r
+ s.scope = s.scope || ed;\r
+\r
+ if (!s.onselect) {\r
+ s.onselect = function(v) {\r
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+ };\r
+ }\r
+\r
+ s = extend({\r
+ title : s.title,\r
+ 'class' : 'mce_' + id,\r
+ scope : s.scope,\r
+ control_manager : t\r
+ }, s);\r
+\r
+ id = t.prefix + id;\r
+\r
+ if (ed.settings.use_native_selects)\r
+ c = new tinymce.ui.NativeListBox(id, s);\r
+ else {\r
+ cls = cc || t._cls.listbox || tinymce.ui.ListBox;\r
+ c = new cls(id, s);\r
+ }\r
+\r
+ t.controls[id] = c;\r
+\r
+ // Fix focus problem in Safari\r
+ if (tinymce.isWebKit) {\r
+ c.onPostRender.add(function(c, n) {\r
+ // Store bookmark on mousedown\r
+ Event.add(n, 'mousedown', function() {\r
+ ed.bookmark = ed.selection.getBookmark(1);\r
+ });\r
+\r
+ // Restore on focus, since it might be lost\r
+ Event.add(n, 'focus', function() {\r
+ ed.selection.moveToBookmark(ed.bookmark);\r
+ ed.bookmark = null;\r
+ });\r
+ });\r
+ }\r
+\r
+ if (c.hideMenu)\r
+ ed.onMouseDown.add(c.hideMenu, c);\r
+\r
+ return t.add(c);\r
+ },\r
+\r
+ createButton : function(id, s, cc) {\r
+ var t = this, ed = t.editor, o, c, cls;\r
+\r
+ if (t.get(id))\r
+ return null;\r
+\r
+ s.title = ed.translate(s.title);\r
+ s.label = ed.translate(s.label);\r
+ s.scope = s.scope || ed;\r
+\r
+ if (!s.onclick && !s.menu_button) {\r
+ s.onclick = function() {\r
+ ed.execCommand(s.cmd, s.ui || false, s.value);\r
+ };\r
+ }\r
+\r
+ s = extend({\r
+ title : s.title,\r
+ 'class' : 'mce_' + id,\r
+ unavailable_prefix : ed.getLang('unavailable', ''),\r
+ scope : s.scope,\r
+ control_manager : t\r
+ }, s);\r
+\r
+ id = t.prefix + id;\r
+\r
+ if (s.menu_button) {\r
+ cls = cc || t._cls.menubutton || tinymce.ui.MenuButton;\r
+ c = new cls(id, s);\r
+ ed.onMouseDown.add(c.hideMenu, c);\r
+ } else {\r
+ cls = t._cls.button || tinymce.ui.Button;\r
+ c = new cls(id, s);\r
+ }\r
+\r
+ return t.add(c);\r
+ },\r
+\r
+ createMenuButton : function(id, s, cc) {\r
+ s = s || {};\r
+ s.menu_button = 1;\r
+\r
+ return this.createButton(id, s, cc);\r
+ },\r
+\r
+ createSplitButton : function(id, s, cc) {\r
+ var t = this, ed = t.editor, cmd, c, cls;\r
+\r
+ if (t.get(id))\r
+ return null;\r
+\r
+ s.title = ed.translate(s.title);\r
+ s.scope = s.scope || ed;\r
+\r
+ if (!s.onclick) {\r
+ s.onclick = function(v) {\r
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+ };\r
+ }\r
+\r
+ if (!s.onselect) {\r
+ s.onselect = function(v) {\r
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+ };\r
+ }\r
+\r
+ s = extend({\r
+ title : s.title,\r
+ 'class' : 'mce_' + id,\r
+ scope : s.scope,\r
+ control_manager : t\r
+ }, s);\r
+\r
+ id = t.prefix + id;\r
+ cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton;\r
+ c = t.add(new cls(id, s));\r
+ ed.onMouseDown.add(c.hideMenu, c);\r
+\r
+ return c;\r
+ },\r
+\r
+ createColorSplitButton : function(id, s, cc) {\r
+ var t = this, ed = t.editor, cmd, c, cls, bm;\r
+\r
+ if (t.get(id))\r
+ return null;\r
+\r
+ s.title = ed.translate(s.title);\r
+ s.scope = s.scope || ed;\r
+\r
+ if (!s.onclick) {\r
+ s.onclick = function(v) {\r
+ if (tinymce.isIE)\r
+ bm = ed.selection.getBookmark(1);\r
+\r
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+ };\r
+ }\r
+\r
+ if (!s.onselect) {\r
+ s.onselect = function(v) {\r
+ ed.execCommand(s.cmd, s.ui || false, v || s.value);\r
+ };\r
+ }\r
+\r
+ s = extend({\r
+ title : s.title,\r
+ 'class' : 'mce_' + id,\r
+ 'menu_class' : ed.getParam('skin') + 'Skin',\r
+ scope : s.scope,\r
+ more_colors_title : ed.getLang('more_colors')\r
+ }, s);\r
+\r
+ id = t.prefix + id;\r
+ cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton;\r
+ c = new cls(id, s);\r
+ ed.onMouseDown.add(c.hideMenu, c);\r
+\r
+ // Remove the menu element when the editor is removed\r
+ ed.onRemove.add(function() {\r
+ c.destroy();\r
+ });\r
+\r
+ // Fix for bug #1897785, #1898007\r
+ if (tinymce.isIE) {\r
+ c.onShowMenu.add(function() {\r
+ // IE 8 needs focus in order to store away a range with the current collapsed caret location\r
+ ed.focus();\r
+ bm = ed.selection.getBookmark(1);\r
+ });\r
+\r
+ c.onHideMenu.add(function() {\r
+ if (bm) {\r
+ ed.selection.moveToBookmark(bm);\r
+ bm = 0;\r
+ }\r
+ });\r
+ }\r
+\r
+ return t.add(c);\r
+ },\r
+\r
+ createToolbar : function(id, s, cc) {\r
+ var c, t = this, cls;\r
+\r
+ id = t.prefix + id;\r
+ cls = cc || t._cls.toolbar || tinymce.ui.Toolbar;\r
+ c = new cls(id, s);\r
+\r
+ if (t.get(id))\r
+ return null;\r
+\r
+ return t.add(c);\r
+ },\r
+\r
+ createSeparator : function(cc) {\r
+ var cls = cc || this._cls.separator || tinymce.ui.Separator;\r
+\r
+ return new cls();\r
+ },\r
+\r
+ setControlType : function(n, c) {\r
+ return this._cls[n.toLowerCase()] = c;\r
+ },\r
+ \r
+ destroy : function() {\r
+ each(this.controls, function(c) {\r
+ c.destroy();\r
+ });\r
+\r
+ this.controls = null;\r
+ }\r
+ });\r
+})(tinymce);\r
+\r
+(function(tinymce) {\r
+ var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera;\r
+\r
+ tinymce.create('tinymce.WindowManager', {\r
+ WindowManager : function(ed) {\r
+ var t = this;\r
+\r
+ t.editor = ed;\r
+ t.onOpen = new Dispatcher(t);\r
+ t.onClose = new Dispatcher(t);\r
+ t.params = {};\r
+ t.features = {};\r
+ },\r
+\r
+ open : function(s, p) {\r
+ var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u;\r
+\r
+ // Default some options\r
+ s = s || {};\r
+ p = p || {};\r
+ sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window\r
+ sh = isOpera ? vp.h : screen.height;\r
+ s.name = s.name || 'mc_' + new Date().getTime();\r
+ s.width = parseInt(s.width || 320);\r
+ s.height = parseInt(s.height || 240);\r
+ s.resizable = true;\r
+ s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0);\r
+ s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0);\r
+ p.inline = false;\r
+ p.mce_width = s.width;\r
+ p.mce_height = s.height;\r
+ p.mce_auto_focus = s.auto_focus;\r
+\r
+ if (mo) {\r
+ if (isIE) {\r
+ s.center = true;\r
+ s.help = false;\r
+ s.dialogWidth = s.width + 'px';\r
+ s.dialogHeight = s.height + 'px';\r
+ s.scroll = s.scrollbars || false;\r
+ }\r
+ }\r
+\r
+ // Build features string\r
+ each(s, function(v, k) {\r
+ if (tinymce.is(v, 'boolean'))\r
+ v = v ? 'yes' : 'no';\r
+\r
+ if (!/^(name|url)$/.test(k)) {\r
+ if (isIE && mo)\r
+ f += (f ? ';' : '') + k + ':' + v;\r
+ else\r
+ f += (f ? ',' : '') + k + '=' + v;\r
+ }\r
+ });\r
+\r
+ t.features = s;\r
+ t.params = p;\r
+ t.onOpen.dispatch(t, s, p);\r
+\r
+ u = s.url || s.file;\r
+ u = tinymce._addVer(u);\r
+\r
+ try {\r
+ if (isIE && mo) {\r
+ w = 1;\r
+ window.showModalDialog(u, window, f);\r
+ } else\r
+ w = window.open(u, s.name, f);\r
+ } catch (ex) {\r
+ // Ignore\r
+ }\r
+\r
+ if (!w)\r
+ alert(t.editor.getLang('popup_blocked'));\r
+ },\r
+\r
+ close : function(w) {\r
+ w.close();\r
+ this.onClose.dispatch(this);\r
+ },\r
+\r
+ createInstance : function(cl, a, b, c, d, e) {\r
+ var f = tinymce.resolve(cl);\r
+\r
+ return new f(a, b, c, d, e);\r
+ },\r
+\r
+ confirm : function(t, cb, s, w) {\r
+ w = w || window;\r
+\r
+ cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t))));\r
+ },\r
+\r
+ alert : function(tx, cb, s, w) {\r
+ var t = this;\r
+\r
+ w = w || window;\r
+ w.alert(t._decode(t.editor.getLang(tx, tx)));\r
+\r
+ if (cb)\r
+ cb.call(s || t);\r
+ },\r
+\r
+ resizeBy : function(dw, dh, win) {\r
+ win.resizeBy(dw, dh);\r
+ },\r
+\r
+ // Internal functions\r
+\r
+ _decode : function(s) {\r
+ return tinymce.DOM.decode(s).replace(/\\n/g, '\n');\r
+ }\r
+ });\r
+}(tinymce));\r
+(function(tinymce) {\r
+ function CommandManager() {\r
+ var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};\r
+\r
+ function add(collection, cmd, func, scope) {\r
+ if (typeof(cmd) == 'string')\r
+ cmd = [cmd];\r
+\r
+ tinymce.each(cmd, function(cmd) {\r
+ collection[cmd.toLowerCase()] = {func : func, scope : scope};\r
+ });\r
+ };\r
+\r
+ tinymce.extend(this, {\r
+ add : function(cmd, func, scope) {\r
+ add(execCommands, cmd, func, scope);\r
+ },\r
+\r
+ addQueryStateHandler : function(cmd, func, scope) {\r
+ add(queryStateCommands, cmd, func, scope);\r
+ },\r
+\r
+ addQueryValueHandler : function(cmd, func, scope) {\r
+ add(queryValueCommands, cmd, func, scope);\r
+ },\r
+\r
+ execCommand : function(scope, cmd, ui, value, args) {\r
+ if (cmd = execCommands[cmd.toLowerCase()]) {\r
+ if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false)\r
+ return true;\r
+ }\r
+ },\r
+\r
+ queryCommandValue : function() {\r
+ if (cmd = queryValueCommands[cmd.toLowerCase()])\r
+ return cmd.func.call(scope || cmd.scope, ui, value, args);\r
+ },\r
+\r
+ queryCommandState : function() {\r
+ if (cmd = queryStateCommands[cmd.toLowerCase()])\r
+ return cmd.func.call(scope || cmd.scope, ui, value, args);\r
+ }\r
+ });\r
+ };\r
+\r
+ tinymce.GlobalCommands = new CommandManager();\r
+})(tinymce);\r
+(function(tinymce) {\r
+ tinymce.Formatter = function(ed) {\r
+ var formats = {},\r
+ each = tinymce.each,\r
+ dom = ed.dom,\r
+ selection = ed.selection,\r
+ TreeWalker = tinymce.dom.TreeWalker,\r
+ rangeUtils = new tinymce.dom.RangeUtils(dom),\r
+ isValid = ed.schema.isValid,\r
+ isBlock = dom.isBlock,\r
+ forcedRootBlock = ed.settings.forced_root_block,\r
+ nodeIndex = dom.nodeIndex,\r
+ INVISIBLE_CHAR = '\uFEFF',\r
+ MCE_ATTR_RE = /^(src|href|style)$/,\r
+ FALSE = false,\r
+ TRUE = true,\r
+ undefined,\r
+ pendingFormats = {apply : [], remove : []};\r
+\r
+ function isArray(obj) {\r
+ return obj instanceof Array;\r
+ };\r
+\r
+ function getParents(node, selector) {\r
+ return dom.getParents(node, selector, dom.getRoot());\r
+ };\r
+\r
+ function isCaretNode(node) {\r
+ return node.nodeType === 1 && (node.face === 'mceinline' || node.style.fontFamily === 'mceinline');\r
+ };\r
+\r
+ // Public functions\r
+\r
+ function get(name) {\r
+ return name ? formats[name] : formats;\r
+ };\r
+\r
+ function register(name, format) {\r
+ if (name) {\r
+ if (typeof(name) !== 'string') {\r
+ each(name, function(format, name) {\r
+ register(name, format);\r
+ });\r
+ } else {\r
+ // Force format into array and add it to internal collection\r
+ format = format.length ? format : [format];\r
+\r
+ each(format, function(format) {\r
+ // Set deep to false by default on selector formats this to avoid removing\r
+ // alignment on images inside paragraphs when alignment is changed on paragraphs\r
+ if (format.deep === undefined)\r
+ format.deep = !format.selector;\r
+\r
+ // Default to true\r
+ if (format.split === undefined)\r
+ format.split = !format.selector || format.inline;\r
+\r
+ // Default to true\r
+ if (format.remove === undefined && format.selector && !format.inline)\r
+ format.remove = 'none';\r
+\r
+ // Mark format as a mixed format inline + block level\r
+ if (format.selector && format.inline) {\r
+ format.mixed = true;\r
+ format.block_expand = true;\r
+ }\r
+\r
+ // Split classes if needed\r
+ if (typeof(format.classes) === 'string')\r
+ format.classes = format.classes.split(/\s+/);\r
+ });\r
+\r
+ formats[name] = format;\r
+ }\r
+ }\r
+ };\r
+\r
+ function apply(name, vars, node) {\r
+ var formatList = get(name), format = formatList[0], bookmark, rng, i;\r
+\r
+ function moveStart(rng) {\r
+ var container = rng.startContainer,\r
+ offset = rng.startOffset,\r
+ walker, node;\r
+\r
+ // Move startContainer/startOffset in to a suitable node\r
+ if (container.nodeType == 1 || container.nodeValue === "") {\r
+ container = container.nodeType == 1 ? container.childNodes[offset] : container;\r
+\r
+ // Might fail if the offset is behind the last element in it's container\r
+ if (container) {\r
+ walker = new TreeWalker(container, container.parentNode);\r
+ for (node = walker.current(); node; node = walker.next()) {\r
+ if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {\r
+ rng.setStart(node, 0);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return rng;\r
+ };\r
+\r
+ function setElementFormat(elm, fmt) {\r
+ fmt = fmt || format;\r
+\r
+ if (elm) {\r
+ each(fmt.styles, function(value, name) {\r
+ dom.setStyle(elm, name, replaceVars(value, vars));\r
+ });\r
+\r
+ each(fmt.attributes, function(value, name) {\r
+ dom.setAttrib(elm, name, replaceVars(value, vars));\r
+ });\r
+\r
+ each(fmt.classes, function(value) {\r
+ value = replaceVars(value, vars);\r
+\r
+ if (!dom.hasClass(elm, value))\r
+ dom.addClass(elm, value);\r
+ });\r
+ }\r
+ };\r
+\r
+ function applyRngStyle(rng) {\r
+ var newWrappers = [], wrapName, wrapElm;\r
+\r
+ // Setup wrapper element\r
+ wrapName = format.inline || format.block;\r
+ wrapElm = dom.create(wrapName);\r
+ setElementFormat(wrapElm);\r
+\r
+ rangeUtils.walk(rng, function(nodes) {\r
+ var currentWrapElm;\r
+\r
+ function process(node) {\r
+ var nodeName = node.nodeName.toLowerCase(), parentName = node.parentNode.nodeName.toLowerCase(), found;\r
+\r
+ // Stop wrapping on br elements\r
+ if (isEq(nodeName, 'br')) {\r
+ currentWrapElm = 0;\r
+\r
+ // Remove any br elements when we wrap things\r
+ if (format.block)\r
+ dom.remove(node);\r
+\r
+ return;\r
+ }\r
+\r
+ // If node is wrapper type\r
+ if (format.wrapper && matchNode(node, name, vars)) {\r
+ currentWrapElm = 0;\r
+ return;\r
+ }\r
+\r
+ // Can we rename the block\r
+ if (format.block && !format.wrapper && isTextBlock(nodeName)) {\r
+ node = dom.rename(node, wrapName);\r
+ setElementFormat(node);\r
+ newWrappers.push(node);\r
+ currentWrapElm = 0;\r
+ return;\r
+ }\r
+\r
+ // Handle selector patterns\r
+ if (format.selector) {\r
+ // Look for matching formats\r
+ each(formatList, function(format) {\r
+ if (dom.is(node, format.selector) && !isCaretNode(node)) {\r
+ setElementFormat(node, format);\r
+ found = true;\r
+ }\r
+ });\r
+\r
+ // Continue processing if a selector match wasn't found and a inline element is defined\r
+ if (!format.inline || found) {\r
+ currentWrapElm = 0;\r
+ return;\r
+ }\r
+ }\r
+\r
+ // Is it valid to wrap this item\r
+ if (isValid(wrapName, nodeName) && isValid(parentName, wrapName)) {\r
+ // Start wrapping\r
+ if (!currentWrapElm) {\r
+ // Wrap the node\r
+ currentWrapElm = wrapElm.cloneNode(FALSE);\r
+ node.parentNode.insertBefore(currentWrapElm, node);\r
+ newWrappers.push(currentWrapElm);\r
+ }\r
+\r
+ currentWrapElm.appendChild(node);\r
+ } else {\r
+ // Start a new wrapper for possible children\r
+ currentWrapElm = 0;\r
+\r
+ each(tinymce.grep(node.childNodes), process);\r
+\r
+ // End the last wrapper\r
+ currentWrapElm = 0;\r
+ }\r
+ };\r
+\r
+ // Process siblings from range\r
+ each(nodes, process);\r
+ });\r
+\r
+ // Cleanup\r
+ each(newWrappers, function(node) {\r
+ var childCount;\r
+\r
+ function getChildCount(node) {\r
+ var count = 0;\r
+\r
+ each(node.childNodes, function(node) {\r
+ if (!isWhiteSpaceNode(node) && !isBookmarkNode(node))\r
+ count++;\r
+ });\r
+\r
+ return count;\r
+ };\r
+\r
+ function mergeStyles(node) {\r
+ var child, clone;\r
+\r
+ each(node.childNodes, function(node) {\r
+ if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) {\r
+ child = node;\r
+ return FALSE; // break loop\r
+ }\r
+ });\r
+\r
+ // If child was found and of the same type as the current node\r
+ if (child && matchName(child, format)) {\r
+ clone = child.cloneNode(FALSE);\r
+ setElementFormat(clone);\r
+\r
+ dom.replace(clone, node, TRUE);\r
+ dom.remove(child, 1);\r
+ }\r
+\r
+ return clone || node;\r
+ };\r
+\r
+ childCount = getChildCount(node);\r
+\r
+ // Remove empty nodes\r
+ if (childCount === 0) {\r
+ dom.remove(node, 1);\r
+ return;\r
+ }\r
+\r
+ if (format.inline || format.wrapper) {\r
+ // Merges the current node with it's children of similar type to reduce the number of elements\r
+ if (!format.exact && childCount === 1)\r
+ node = mergeStyles(node);\r
+\r
+ // Remove/merge children\r
+ each(formatList, function(format) {\r
+ // Merge all children of similar type will move styles from child to parent\r
+ // this: <span style="color:red"><b><span style="color:red; font-size:10px">text</span></b></span>\r
+ // will become: <span style="color:red"><b><span style="font-size:10px">text</span></b></span>\r
+ each(dom.select(format.inline, node), function(child) {\r
+ removeFormat(format, vars, child, format.exact ? child : null);\r
+ });\r
+ });\r
+\r
+ // Remove child if direct parent is of same type\r
+ if (matchNode(node.parentNode, name, vars)) {\r
+ dom.remove(node, 1);\r
+ node = 0;\r
+ return TRUE;\r
+ }\r
+\r
+ // Look for parent with similar style format\r
+ if (format.merge_with_parents) {\r
+ dom.getParent(node.parentNode, function(parent) {\r
+ if (matchNode(parent, name, vars)) {\r
+ dom.remove(node, 1);\r
+ node = 0;\r
+ return TRUE;\r
+ }\r
+ });\r
+ }\r
+\r
+ // Merge next and previous siblings if they are similar <b>text</b><b>text</b> becomes <b>texttext</b>\r
+ if (node) {\r
+ node = mergeSiblings(getNonWhiteSpaceSibling(node), node);\r
+ node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE));\r
+ }\r
+ }\r
+ });\r
+ };\r
+\r
+ if (format) {\r
+ if (node) {\r
+ rng = dom.createRng();\r
+\r
+ rng.setStartBefore(node);\r
+ rng.setEndAfter(node);\r
+\r
+ applyRngStyle(expandRng(rng, formatList));\r
+ } else {\r
+ if (!selection.isCollapsed() || !format.inline) {\r
+ // Apply formatting to selection\r
+ bookmark = selection.getBookmark();\r
+ applyRngStyle(expandRng(selection.getRng(TRUE), formatList));\r
+\r
+ selection.moveToBookmark(bookmark);\r
+ selection.setRng(moveStart(selection.getRng(TRUE)));\r
+ ed.nodeChanged();\r
+ } else\r
+ performCaretAction('apply', name, vars);\r
+ }\r
+ }\r
+ };\r
+\r
+ function remove(name, vars, node) {\r
+ var formatList = get(name), format = formatList[0], bookmark, i, rng;\r
+\r
+ function moveStart(rng) {\r
+ var container = rng.startContainer,\r
+ offset = rng.startOffset,\r
+ walker, node, nodes, tmpNode;\r
+\r
+ // Convert text node into index if possible\r
+ if (container.nodeType == 3 && offset >= container.nodeValue.length - 1) {\r
+ container = container.parentNode;\r
+ offset = nodeIndex(container) + 1;\r
+ }\r
+\r
+ // Move startContainer/startOffset in to a suitable node\r
+ if (container.nodeType == 1) {\r
+ nodes = container.childNodes;\r
+ container = nodes[Math.min(offset, nodes.length - 1)];\r
+ walker = new TreeWalker(container);\r
+\r
+ // If offset is at end of the parent node walk to the next one\r
+ if (offset > nodes.length - 1)\r
+ walker.next();\r
+\r
+ for (node = walker.current(); node; node = walker.next()) {\r
+ if (node.nodeType == 3 && !isWhiteSpaceNode(node)) {\r
+ // IE has a "neat" feature where it moves the start node into the closest element\r
+ // we can avoid this by inserting an element before it and then remove it after we set the selection\r
+ tmpNode = dom.create('a', null, INVISIBLE_CHAR);\r
+ node.parentNode.insertBefore(tmpNode, node);\r
+\r
+ // Set selection and remove tmpNode\r
+ rng.setStart(node, 0);\r
+ selection.setRng(rng);\r
+ dom.remove(tmpNode);\r
+\r
+ return;\r
+ }\r
+ }\r
+ }\r
+ };\r
+\r
+ // Merges the styles for each node\r
+ function process(node) {\r
+ var children, i, l;\r
+\r
+ // Grab the children first since the nodelist might be changed\r
+ children = tinymce.grep(node.childNodes);\r
+\r
+ // Process current node\r
+ for (i = 0, l = formatList.length; i < l; i++) {\r
+ if (removeFormat(formatList[i], vars, node, node))\r
+ break;\r
+ }\r
+\r
+ // Process the children\r
+ if (format.deep) {\r
+ for (i = 0, l = children.length; i < l; i++)\r
+ process(children[i]);\r
+ }\r
+ };\r
+\r
+ function findFormatRoot(container) {\r
+ var formatRoot;\r
+\r
+ // Find format root\r
+ each(getParents(container.parentNode).reverse(), function(parent) {\r
+ var format;\r
+\r
+ // Find format root element\r
+ if (!formatRoot && parent.id != '_start' && parent.id != '_end') {\r
+ // Is the node matching the format we are looking for\r
+ format = matchNode(parent, name, vars);\r
+ if (format && format.split !== false)\r
+ formatRoot = parent;\r
+ }\r
+ });\r
+\r
+ return formatRoot;\r
+ };\r
+\r
+ function wrapAndSplit(format_root, container, target, split) {\r
+ var parent, clone, lastClone, firstClone, i, formatRootParent;\r
+\r
+ // Format root found then clone formats and split it\r
+ if (format_root) {\r
+ formatRootParent = format_root.parentNode;\r
+\r
+ for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) {\r
+ clone = parent.cloneNode(FALSE);\r
+\r
+ for (i = 0; i < formatList.length; i++) {\r
+ if (removeFormat(formatList[i], vars, clone, clone)) {\r
+ clone = 0;\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Build wrapper node\r
+ if (clone) {\r
+ if (lastClone)\r
+ clone.appendChild(lastClone);\r
+\r
+ if (!firstClone)\r
+ firstClone = clone;\r
+\r
+ lastClone = clone;\r
+ }\r
+ }\r
+\r
+ // Never split block elements if the format is mixed\r
+ if (split && (!format.mixed || !isBlock(format_root)))\r
+ container = dom.split(format_root, container);\r
+\r
+ // Wrap container in cloned formats\r
+ if (lastClone) {\r
+ target.parentNode.insertBefore(lastClone, target);\r
+ firstClone.appendChild(target);\r
+ }\r
+ }\r
+\r
+ return container;\r
+ };\r
+\r
+ function splitToFormatRoot(container) {\r
+ return wrapAndSplit(findFormatRoot(container), container, container, true);\r
+ };\r
+\r
+ function unwrap(start) {\r
+ var node = dom.get(start ? '_start' : '_end'),\r
+ out = node[start ? 'firstChild' : 'lastChild'];\r
+\r
+ // If the end is placed within the start the result will be removed\r
+ // So this checks if the out node is a bookmark node if it is it\r
+ // checks for another more suitable node\r
+ if (isBookmarkNode(out))\r
+ out = out[start ? 'firstChild' : 'lastChild'];\r
+\r
+ dom.remove(node, true);\r
+\r
+ return out;\r
+ };\r
+\r
+ function removeRngStyle(rng) {\r
+ var startContainer, endContainer;\r
+\r
+ rng = expandRng(rng, formatList, TRUE);\r
+\r
+ if (format.split) {\r
+ startContainer = getContainer(rng, TRUE);\r
+ endContainer = getContainer(rng);\r
+\r
+ if (startContainer != endContainer) {\r
+ // Wrap start/end nodes in span element since these might be cloned/moved\r
+ startContainer = wrap(startContainer, 'span', {id : '_start', _mce_type : 'bookmark'});\r
+ endContainer = wrap(endContainer, 'span', {id : '_end', _mce_type : 'bookmark'});\r
+\r
+ // Split start/end\r
+ splitToFormatRoot(startContainer);\r
+ splitToFormatRoot(endContainer);\r
+\r
+ // Unwrap start/end to get real elements again\r
+ startContainer = unwrap(TRUE);\r
+ endContainer = unwrap();\r
+ } else\r
+ startContainer = endContainer = splitToFormatRoot(startContainer);\r
+\r
+ // Update range positions since they might have changed after the split operations\r
+ rng.startContainer = startContainer.parentNode;\r
+ rng.startOffset = nodeIndex(startContainer);\r
+ rng.endContainer = endContainer.parentNode;\r
+ rng.endOffset = nodeIndex(endContainer) + 1;\r
+ }\r
+\r
+ // Remove items between start/end\r
+ rangeUtils.walk(rng, function(nodes) {\r
+ each(nodes, function(node) {\r
+ process(node);\r
+ });\r
+ });\r
+ };\r
+\r
+ // Handle node\r
+ if (node) {\r
+ rng = dom.createRng();\r
+ rng.setStartBefore(node);\r
+ rng.setEndAfter(node);\r
+ removeRngStyle(rng);\r
+ return;\r
+ }\r
+\r
+ if (!selection.isCollapsed() || !format.inline) {\r
+ bookmark = selection.getBookmark();\r
+ removeRngStyle(selection.getRng(TRUE));\r
+ selection.moveToBookmark(bookmark);\r
+\r
+ // Check if start element still has formatting then we are at: "<b>text|</b>text" and need to move the start into the next text node\r
+ if (match(name, vars, selection.getStart())) {\r
+ moveStart(selection.getRng(true));\r
+ }\r
+\r
+ ed.nodeChanged();\r
+ } else\r
+ performCaretAction('remove', name, vars);\r
+ };\r
+\r
+ function toggle(name, vars, node) {\r
+ if (match(name, vars, node))\r
+ remove(name, vars, node);\r
+ else\r
+ apply(name, vars, node);\r
+ };\r
+\r
+ function matchNode(node, name, vars, similar) {\r
+ var formatList = get(name), format, i, classes;\r
+\r
+ function matchItems(node, format, item_name) {\r
+ var key, value, items = format[item_name], i;\r
+\r
+ // Check all items\r
+ if (items) {\r
+ // Non indexed object\r
+ if (items.length === undefined) {\r
+ for (key in items) {\r
+ if (items.hasOwnProperty(key)) {\r
+ if (item_name === 'attributes')\r
+ value = dom.getAttrib(node, key);\r
+ else\r
+ value = getStyle(node, key);\r
+\r
+ if (similar && !value && !format.exact)\r
+ return;\r
+\r
+ if ((!similar || format.exact) && !isEq(value, replaceVars(items[key], vars)))\r
+ return;\r
+ }\r
+ }\r
+ } else {\r
+ // Only one match needed for indexed arrays\r
+ for (i = 0; i < items.length; i++) {\r
+ if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i]))\r
+ return format;\r
+ }\r
+ }\r
+ }\r
+\r
+ return format;\r
+ };\r
+\r
+ if (formatList && node) {\r
+ // Check each format in list\r
+ for (i = 0; i < formatList.length; i++) {\r
+ format = formatList[i];\r
+\r
+ // Name name, attributes, styles and classes\r
+ if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) {\r
+ // Match classes\r
+ if (classes = format.classes) {\r
+ for (i = 0; i < classes.length; i++) {\r
+ if (!dom.hasClass(node, classes[i]))\r
+ return;\r
+ }\r
+ }\r
+\r
+ return format;\r
+ }\r
+ }\r
+ }\r
+ };\r
+\r
+ function match(name, vars, node) {\r
+ var startNode, i;\r
+\r
+ function matchParents(node) {\r
+ // Find first node with similar format settings\r
+ node = dom.getParent(node, function(node) {\r
+ return !!matchNode(node, name, vars, true);\r
+ });\r
+\r
+ // Do an exact check on the similar format element\r
+ return matchNode(node, name, vars);\r
+ };\r
+\r
+ // Check specified node\r
+ if (node)\r
+ return matchParents(node);\r
+\r
+ // Check pending formats\r
+ if (selection.isCollapsed()) {\r
+ for (i = pendingFormats.apply.length - 1; i >= 0; i--) {\r
+ if (pendingFormats.apply[i].name == name)\r
+ return true;\r
+ }\r
+\r
+ for (i = pendingFormats.remove.length - 1; i >= 0; i--) {\r
+ if (pendingFormats.remove[i].name == name)\r
+ return false;\r
+ }\r
+\r
+ return matchParents(selection.getNode());\r
+ }\r
+\r
+ // Check selected node\r
+ node = selection.getNode();\r
+ if (matchParents(node))\r
+ return TRUE;\r
+\r
+ // Check start node if it's different\r
+ startNode = selection.getStart();\r
+ if (startNode != node) {\r
+ if (matchParents(startNode))\r
+ return TRUE;\r
+ }\r
+\r
+ return FALSE;\r
+ };\r
+\r
+ function matchAll(names, vars) {\r
+ var startElement, matchedFormatNames = [], checkedMap = {}, i, ni, name;\r
+\r
+ // If the selection is collapsed then check pending formats\r
+ if (selection.isCollapsed()) {\r
+ for (ni = 0; ni < names.length; ni++) {\r
+ // If the name is to be removed, then stop it from being added\r
+ for (i = pendingFormats.remove.length - 1; i >= 0; i--) {\r
+ name = names[ni];\r
+\r
+ if (pendingFormats.remove[i].name == name) {\r
+ checkedMap[name] = true;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ // If the format is to be applied\r
+ for (i = pendingFormats.apply.length - 1; i >= 0; i--) {\r
+ for (ni = 0; ni < names.length; ni++) {\r
+ name = names[ni];\r
+\r
+ if (!checkedMap[name] && pendingFormats.apply[i].name == name) {\r
+ checkedMap[name] = true;\r
+ matchedFormatNames.push(name);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Check start of selection for formats\r
+ startElement = selection.getStart();\r
+ dom.getParent(startElement, function(node) {\r
+ var i, name;\r
+\r
+ for (i = 0; i < names.length; i++) {\r
+ name = names[i];\r
+\r
+ if (!checkedMap[name] && matchNode(node, name, vars)) {\r
+ checkedMap[name] = true;\r
+ matchedFormatNames.push(name);\r
+ }\r
+ }\r
+ });\r
+\r
+ return matchedFormatNames;\r
+ };\r
+\r
+ function canApply(name) {\r
+ var formatList = get(name), startNode, parents, i, x, selector;\r
+\r
+ if (formatList) {\r
+ startNode = selection.getStart();\r
+ parents = getParents(startNode);\r
+\r
+ for (x = formatList.length - 1; x >= 0; x--) {\r
+ selector = formatList[x].selector;\r
+\r
+ // Format is not selector based, then always return TRUE\r
+ if (!selector)\r
+ return TRUE;\r
+\r
+ for (i = parents.length - 1; i >= 0; i--) {\r
+ if (dom.is(parents[i], selector))\r
+ return TRUE;\r
+ }\r
+ }\r
+ }\r
+\r
+ return FALSE;\r
+ };\r
+\r
+ // Expose to public\r
+ tinymce.extend(this, {\r
+ get : get,\r
+ register : register,\r
+ apply : apply,\r
+ remove : remove,\r
+ toggle : toggle,\r
+ match : match,\r
+ matchAll : matchAll,\r
+ matchNode : matchNode,\r
+ canApply : canApply\r
+ });\r
+\r
+ // Private functions\r
+\r
+ function matchName(node, format) {\r
+ // Check for inline match\r
+ if (isEq(node, format.inline))\r
+ return TRUE;\r
+\r
+ // Check for block match\r
+ if (isEq(node, format.block))\r
+ return TRUE;\r
+\r
+ // Check for selector match\r
+ if (format.selector)\r
+ return dom.is(node, format.selector);\r
+ };\r
+\r
+ function isEq(str1, str2) {\r
+ str1 = str1 || '';\r
+ str2 = str2 || '';\r
+\r
+ str1 = '' + (str1.nodeName || str1);\r
+ str2 = '' + (str2.nodeName || str2);\r
+\r
+ return str1.toLowerCase() == str2.toLowerCase();\r
+ };\r
+\r
+ function getStyle(node, name) {\r
+ var styleVal = dom.getStyle(node, name);\r
+\r
+ // Force the format to hex\r
+ if (name == 'color' || name == 'backgroundColor')\r
+ styleVal = dom.toHex(styleVal);\r
+\r
+ // Opera will return bold as 700\r
+ if (name == 'fontWeight' && styleVal == 700)\r
+ styleVal = 'bold';\r
+\r
+ return '' + styleVal;\r
+ };\r
+\r
+ function replaceVars(value, vars) {\r
+ if (typeof(value) != "string")\r
+ value = value(vars);\r
+ else if (vars) {\r
+ value = value.replace(/%(\w+)/g, function(str, name) {\r
+ return vars[name] || str;\r
+ });\r
+ }\r
+\r
+ return value;\r
+ };\r
+\r
+ function isWhiteSpaceNode(node) {\r
+ return node && node.nodeType === 3 && /^([\s\r\n]+|)$/.test(node.nodeValue);\r
+ };\r
+\r
+ function wrap(node, name, attrs) {\r
+ var wrapper = dom.create(name, attrs);\r
+\r
+ node.parentNode.insertBefore(wrapper, node);\r
+ wrapper.appendChild(node);\r
+\r
+ return wrapper;\r
+ };\r
+\r
+ function expandRng(rng, format, remove) {\r
+ var startContainer = rng.startContainer,\r
+ startOffset = rng.startOffset,\r
+ endContainer = rng.endContainer,\r
+ endOffset = rng.endOffset, sibling, lastIdx;\r
+\r
+ // This function walks up the tree if there is no siblings before/after the node\r
+ function findParentContainer(container, child_name, sibling_name, root) {\r
+ var parent, child;\r
+\r
+ root = root || dom.getRoot();\r
+\r
+ for (;;) {\r
+ // Check if we can move up are we at root level or body level\r
+ parent = container.parentNode;\r
+\r
+ // Stop expanding on block elements or root depending on format\r
+ if (parent == root || (!format[0].block_expand && isBlock(parent)))\r
+ return container;\r
+\r
+ for (sibling = parent[child_name]; sibling && sibling != container; sibling = sibling[sibling_name]) {\r
+ if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
+ return container;\r
+\r
+ if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling))\r
+ return container;\r
+ }\r
+\r
+ container = container.parentNode;\r
+ }\r
+\r
+ return container;\r
+ };\r
+\r
+ // If index based start position then resolve it\r
+ if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {\r
+ lastIdx = startContainer.childNodes.length - 1;\r
+ startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset];\r
+\r
+ if (startContainer.nodeType == 3)\r
+ startOffset = 0;\r
+ }\r
+\r
+ // If index based end position then resolve it\r
+ if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {\r
+ lastIdx = endContainer.childNodes.length - 1;\r
+ endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1];\r
+\r
+ if (endContainer.nodeType == 3)\r
+ endOffset = endContainer.nodeValue.length;\r
+ }\r
+\r
+ // Exclude bookmark nodes if possible\r
+ if (isBookmarkNode(startContainer.parentNode))\r
+ startContainer = startContainer.parentNode;\r
+\r
+ if (isBookmarkNode(startContainer))\r
+ startContainer = startContainer.nextSibling || startContainer;\r
+\r
+ if (isBookmarkNode(endContainer.parentNode))\r
+ endContainer = endContainer.parentNode;\r
+\r
+ if (isBookmarkNode(endContainer))\r
+ endContainer = endContainer.previousSibling || endContainer;\r
+\r
+ // Move start/end point up the tree if the leaves are sharp and if we are in different containers\r
+ // Example * becomes !: !<p><b><i>*text</i><i>text*</i></b></p>!\r
+ // This will reduce the number of wrapper elements that needs to be created\r
+ // Move start point up the tree\r
+ if (format[0].inline || format[0].block_expand) {\r
+ startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling');\r
+ endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling');\r
+ }\r
+\r
+ // Expand start/end container to matching selector\r
+ if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) {\r
+ function findSelectorEndPoint(container, sibling_name) {\r
+ var parents, i, y;\r
+\r
+ if (container.nodeType == 3 && container.nodeValue.length == 0 && container[sibling_name])\r
+ container = container[sibling_name];\r
+\r
+ parents = getParents(container);\r
+ for (i = 0; i < parents.length; i++) {\r
+ for (y = 0; y < format.length; y++) {\r
+ if (dom.is(parents[i], format[y].selector))\r
+ return parents[i];\r
+ }\r
+ }\r
+\r
+ return container;\r
+ };\r
+\r
+ // Find new startContainer/endContainer if there is better one\r
+ startContainer = findSelectorEndPoint(startContainer, 'previousSibling');\r
+ endContainer = findSelectorEndPoint(endContainer, 'nextSibling');\r
+ }\r
+\r
+ // Expand start/end container to matching block element or text node\r
+ if (format[0].block || format[0].selector) {\r
+ function findBlockEndPoint(container, sibling_name, sibling_name2) {\r
+ var node;\r
+\r
+ // Expand to block of similar type\r
+ if (!format[0].wrapper)\r
+ node = dom.getParent(container, format[0].block);\r
+\r
+ // Expand to first wrappable block element or any block element\r
+ if (!node)\r
+ node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isBlock);\r
+\r
+ // Exclude inner lists from wrapping\r
+ if (node && format[0].wrapper)\r
+ node = getParents(node, 'ul,ol').reverse()[0] || node;\r
+\r
+ // Didn't find a block element look for first/last wrappable element\r
+ if (!node) {\r
+ node = container;\r
+\r
+ while (node[sibling_name] && !isBlock(node[sibling_name])) {\r
+ node = node[sibling_name];\r
+\r
+ // Break on BR but include it will be removed later on\r
+ // we can't remove it now since we need to check if it can be wrapped\r
+ if (isEq(node, 'br'))\r
+ break;\r
+ }\r
+ }\r
+\r
+ return node || container;\r
+ };\r
+\r
+ // Find new startContainer/endContainer if there is better one\r
+ startContainer = findBlockEndPoint(startContainer, 'previousSibling');\r
+ endContainer = findBlockEndPoint(endContainer, 'nextSibling');\r
+\r
+ // Non block element then try to expand up the leaf\r
+ if (format[0].block) {\r
+ if (!isBlock(startContainer))\r
+ startContainer = findParentContainer(startContainer, 'firstChild', 'nextSibling');\r
+\r
+ if (!isBlock(endContainer))\r
+ endContainer = findParentContainer(endContainer, 'lastChild', 'previousSibling');\r
+ }\r
+ }\r
+\r
+ // Setup index for startContainer\r
+ if (startContainer.nodeType == 1) {\r
+ startOffset = nodeIndex(startContainer);\r
+ startContainer = startContainer.parentNode;\r
+ }\r
+\r
+ // Setup index for endContainer\r
+ if (endContainer.nodeType == 1) {\r
+ endOffset = nodeIndex(endContainer) + 1;\r
+ endContainer = endContainer.parentNode;\r
+ }\r
+\r
+ // Return new range like object\r
+ return {\r
+ startContainer : startContainer,\r
+ startOffset : startOffset,\r
+ endContainer : endContainer,\r
+ endOffset : endOffset\r
+ };\r
+ }\r
+\r
+ function removeFormat(format, vars, node, compare_node) {\r
+ var i, attrs, stylesModified;\r
+\r
+ // Check if node matches format\r
+ if (!matchName(node, format))\r
+ return FALSE;\r
+\r
+ // Should we compare with format attribs and styles\r
+ if (format.remove != 'all') {\r
+ // Remove styles\r
+ each(format.styles, function(value, name) {\r
+ value = replaceVars(value, vars);\r
+\r
+ // Indexed array\r
+ if (typeof(name) === 'number') {\r
+ name = value;\r
+ compare_node = 0;\r
+ }\r
+\r
+ if (!compare_node || isEq(getStyle(compare_node, name), value))\r
+ dom.setStyle(node, name, '');\r
+\r
+ stylesModified = 1;\r
+ });\r
+\r
+ // Remove style attribute if it's empty\r
+ if (stylesModified && dom.getAttrib(node, 'style') == '') {\r
+ node.removeAttribute('style');\r
+ node.removeAttribute('_mce_style');\r
+ }\r
+\r
+ // Remove attributes\r
+ each(format.attributes, function(value, name) {\r
+ var valueOut;\r
+\r
+ value = replaceVars(value, vars);\r
+\r
+ // Indexed array\r
+ if (typeof(name) === 'number') {\r
+ name = value;\r
+ compare_node = 0;\r
+ }\r
+\r
+ if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) {\r
+ // Keep internal classes\r
+ if (name == 'class') {\r
+ value = dom.getAttrib(node, name);\r
+ if (value) {\r
+ // Build new class value where everything is removed except the internal prefixed classes\r
+ valueOut = '';\r
+ each(value.split(/\s+/), function(cls) {\r
+ if (/mce\w+/.test(cls))\r
+ valueOut += (valueOut ? ' ' : '') + cls;\r
+ });\r
+\r
+ // We got some internal classes left\r
+ if (valueOut) {\r
+ dom.setAttrib(node, name, valueOut);\r
+ return;\r
+ }\r
+ }\r
+ }\r
+\r
+ // IE6 has a bug where the attribute doesn't get removed correctly\r
+ if (name == "class")\r
+ node.removeAttribute('className');\r
+\r
+ // Remove mce prefixed attributes\r
+ if (MCE_ATTR_RE.test(name))\r
+ node.removeAttribute('_mce_' + name);\r
+\r
+ node.removeAttribute(name);\r
+ }\r
+ });\r
+\r
+ // Remove classes\r
+ each(format.classes, function(value) {\r
+ value = replaceVars(value, vars);\r
+\r
+ if (!compare_node || dom.hasClass(compare_node, value))\r
+ dom.removeClass(node, value);\r
+ });\r
+\r
+ // Check for non internal attributes\r
+ attrs = dom.getAttribs(node);\r
+ for (i = 0; i < attrs.length; i++) {\r
+ if (attrs[i].nodeName.indexOf('_') !== 0)\r
+ return FALSE;\r
+ }\r
+ }\r
+\r
+ // Remove the inline child if it's empty for example <b> or <span>\r
+ if (format.remove != 'none') {\r
+ removeNode(node, format);\r
+ return TRUE;\r
+ }\r
+ };\r
+\r
+ function removeNode(node, format) {\r
+ var parentNode = node.parentNode, rootBlockElm;\r
+\r
+ if (format.block) {\r
+ if (!forcedRootBlock) {\r
+ function find(node, next, inc) {\r
+ node = getNonWhiteSpaceSibling(node, next, inc);\r
+\r
+ return !node || (node.nodeName == 'BR' || isBlock(node));\r
+ };\r
+\r
+ // Append BR elements if needed before we remove the block\r
+ if (isBlock(node) && !isBlock(parentNode)) {\r
+ if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1))\r
+ node.insertBefore(dom.create('br'), node.firstChild);\r
+\r
+ if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1))\r
+ node.appendChild(dom.create('br'));\r
+ }\r
+ } else {\r
+ // Wrap the block in a forcedRootBlock if we are at the root of document\r
+ if (parentNode == dom.getRoot()) {\r
+ if (!format.list_block || !isEq(node, format.list_block)) {\r
+ each(tinymce.grep(node.childNodes), function(node) {\r
+ if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) {\r
+ if (!rootBlockElm)\r
+ rootBlockElm = wrap(node, forcedRootBlock);\r
+ else\r
+ rootBlockElm.appendChild(node);\r
+ } else\r
+ rootBlockElm = 0;\r
+ });\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Never remove nodes that isn't the specified inline element if a selector is specified too\r
+ if (format.selector && format.inline && !isEq(format.inline, node))\r
+ return;\r
+\r
+ dom.remove(node, 1);\r
+ };\r
+\r
+ function getNonWhiteSpaceSibling(node, next, inc) {\r
+ if (node) {\r
+ next = next ? 'nextSibling' : 'previousSibling';\r
+\r
+ for (node = inc ? node : node[next]; node; node = node[next]) {\r
+ if (node.nodeType == 1 || !isWhiteSpaceNode(node))\r
+ return node;\r
+ }\r
+ }\r
+ };\r
+\r
+ function isBookmarkNode(node) {\r
+ return node && node.nodeType == 1 && node.getAttribute('_mce_type') == 'bookmark';\r
+ };\r
+\r
+ function mergeSiblings(prev, next) {\r
+ var marker, sibling, tmpSibling;\r
+\r
+ function compareElements(node1, node2) {\r
+ // Not the same name\r
+ if (node1.nodeName != node2.nodeName)\r
+ return FALSE;\r
+\r
+ function getAttribs(node) {\r
+ var attribs = {};\r
+\r
+ each(dom.getAttribs(node), function(attr) {\r
+ var name = attr.nodeName.toLowerCase();\r
+\r
+ // Don't compare internal attributes or style\r
+ if (name.indexOf('_') !== 0 && name !== 'style')\r
+ attribs[name] = dom.getAttrib(node, name);\r
+ });\r
+\r
+ return attribs;\r
+ };\r
+\r
+ function compareObjects(obj1, obj2) {\r
+ var value, name;\r
+\r
+ for (name in obj1) {\r
+ // Obj1 has item obj2 doesn't have\r
+ if (obj1.hasOwnProperty(name)) {\r
+ value = obj2[name];\r
+\r
+ // Obj2 doesn't have obj1 item\r
+ if (value === undefined)\r
+ return FALSE;\r
+\r
+ // Obj2 item has a different value\r
+ if (obj1[name] != value)\r
+ return FALSE;\r
+\r
+ // Delete similar value\r
+ delete obj2[name];\r
+ }\r
+ }\r
+\r
+ // Check if obj 2 has something obj 1 doesn't have\r
+ for (name in obj2) {\r
+ // Obj2 has item obj1 doesn't have\r
+ if (obj2.hasOwnProperty(name))\r
+ return FALSE;\r
+ }\r
+\r
+ return TRUE;\r
+ };\r
+\r
+ // Attribs are not the same\r
+ if (!compareObjects(getAttribs(node1), getAttribs(node2)))\r
+ return FALSE;\r
+\r
+ // Styles are not the same\r
+ if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style'))))\r
+ return FALSE;\r
+\r
+ return TRUE;\r
+ };\r
+\r
+ // Check if next/prev exists and that they are elements\r
+ if (prev && next) {\r
+ function findElementSibling(node, sibling_name) {\r
+ for (sibling = node; sibling; sibling = sibling[sibling_name]) {\r
+ if (sibling.nodeType == 3 && !isWhiteSpaceNode(sibling))\r
+ return node;\r
+\r
+ if (sibling.nodeType == 1 && !isBookmarkNode(sibling))\r
+ return sibling;\r
+ }\r
+\r
+ return node;\r
+ };\r
+\r
+ // If previous sibling is empty then jump over it\r
+ prev = findElementSibling(prev, 'previousSibling');\r
+ next = findElementSibling(next, 'nextSibling');\r
+\r
+ // Compare next and previous nodes\r
+ if (compareElements(prev, next)) {\r
+ // Append nodes between\r
+ for (sibling = prev.nextSibling; sibling && sibling != next;) {\r
+ tmpSibling = sibling;\r
+ sibling = sibling.nextSibling;\r
+ prev.appendChild(tmpSibling);\r
+ }\r
+\r
+ // Remove next node\r
+ dom.remove(next);\r
+\r
+ // Move children into prev node\r
+ each(tinymce.grep(next.childNodes), function(node) {\r
+ prev.appendChild(node);\r
+ });\r
+\r
+ return prev;\r
+ }\r
+ }\r
+\r
+ return next;\r
+ };\r
+\r
+ function isTextBlock(name) {\r
+ return /^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(name);\r
+ };\r
+\r
+ function getContainer(rng, start) {\r
+ var container, offset, lastIdx;\r
+\r
+ container = rng[start ? 'startContainer' : 'endContainer'];\r
+ offset = rng[start ? 'startOffset' : 'endOffset'];\r
+\r
+ if (container.nodeType == 1) {\r
+ lastIdx = container.childNodes.length - 1;\r
+\r
+ if (!start && offset)\r
+ offset--;\r
+\r
+ container = container.childNodes[offset > lastIdx ? lastIdx : offset];\r
+ }\r
+\r
+ return container;\r
+ };\r
+\r
+ function performCaretAction(type, name, vars) {\r
+ var i, currentPendingFormats = pendingFormats[type],\r
+ otherPendingFormats = pendingFormats[type == 'apply' ? 'remove' : 'apply'];\r
+\r
+ function hasPending() {\r
+ return pendingFormats.apply.length || pendingFormats.remove.length;\r
+ };\r
+\r
+ function resetPending() {\r
+ pendingFormats.apply = [];\r
+ pendingFormats.remove = [];\r
+ };\r
+\r
+ function perform(caret_node) {\r
+ // Apply pending formats\r
+ each(pendingFormats.apply.reverse(), function(item) {\r
+ apply(item.name, item.vars, caret_node);\r
+ });\r
+\r
+ // Remove pending formats\r
+ each(pendingFormats.remove.reverse(), function(item) {\r
+ remove(item.name, item.vars, caret_node);\r
+ });\r
+\r
+ dom.remove(caret_node, 1);\r
+ resetPending();\r
+ };\r
+\r
+ // Check if it already exists then ignore it\r
+ for (i = currentPendingFormats.length - 1; i >= 0; i--) {\r
+ if (currentPendingFormats[i].name == name)\r
+ return;\r
+ }\r
+\r
+ currentPendingFormats.push({name : name, vars : vars});\r
+\r
+ // Check if it's in the other type, then remove it\r
+ for (i = otherPendingFormats.length - 1; i >= 0; i--) {\r
+ if (otherPendingFormats[i].name == name)\r
+ otherPendingFormats.splice(i, 1);\r
+ }\r
+\r
+ // Pending apply or remove formats\r
+ if (hasPending()) {\r
+ ed.getDoc().execCommand('FontName', false, 'mceinline');\r
+ pendingFormats.lastRng = selection.getRng();\r
+\r
+ // IE will convert the current word\r
+ each(dom.select('font,span'), function(node) {\r
+ var bookmark;\r
+\r
+ if (isCaretNode(node)) {\r
+ bookmark = selection.getBookmark();\r
+ perform(node);\r
+ selection.moveToBookmark(bookmark);\r
+ ed.nodeChanged();\r
+ }\r
+ });\r
+\r
+ // Only register listeners once if we need to\r
+ if (!pendingFormats.isListening && hasPending()) {\r
+ pendingFormats.isListening = true;\r
+\r
+ each('onKeyDown,onKeyUp,onKeyPress,onMouseUp'.split(','), function(event) {\r
+ ed[event].addToTop(function(ed, e) {\r
+ // Do we have pending formats and is the selection moved has moved\r
+ if (hasPending() && !tinymce.dom.RangeUtils.compareRanges(pendingFormats.lastRng, selection.getRng())) {\r
+ each(dom.select('font,span'), function(node) {\r
+ var textNode, rng;\r
+\r
+ // Look for marker\r
+ if (isCaretNode(node)) {\r
+ textNode = node.firstChild;\r
+\r
+ if (textNode) {\r
+ perform(node);\r
+\r
+ rng = dom.createRng();\r
+ rng.setStart(textNode, textNode.nodeValue.length);\r
+ rng.setEnd(textNode, textNode.nodeValue.length);\r
+ selection.setRng(rng);\r
+ ed.nodeChanged();\r
+ } else\r
+ dom.remove(node);\r
+ }\r
+ });\r
+\r
+ // Always unbind and clear pending styles on keyup\r
+ if (e.type == 'keyup' || e.type == 'mouseup')\r
+ resetPending();\r
+ }\r
+ });\r
+ });\r
+ }\r
+ }\r
+ };\r
+ };\r
+})(tinymce);\r
+\r
+tinymce.onAddEditor.add(function(tinymce, ed) {\r
+ var filters, fontSizes, dom, settings = ed.settings;\r
+\r
+ if (settings.inline_styles) {\r
+ fontSizes = tinymce.explode(settings.font_size_style_values);\r
+\r
+ function replaceWithSpan(node, styles) {\r
+ dom.replace(dom.create('span', {\r
+ style : styles\r
+ }), node, 1);\r
+ };\r
+\r
+ filters = {\r
+ font : function(dom, node) {\r
+ replaceWithSpan(node, {\r
+ backgroundColor : node.style.backgroundColor,\r
+ color : node.color,\r
+ fontFamily : node.face,\r
+ fontSize : fontSizes[parseInt(node.size) - 1]\r
+ });\r
+ },\r
+\r
+ u : function(dom, node) {\r
+ replaceWithSpan(node, {\r
+ textDecoration : 'underline'\r
+ });\r
+ },\r
+\r
+ strike : function(dom, node) {\r
+ replaceWithSpan(node, {\r
+ textDecoration : 'line-through'\r
+ });\r
+ }\r
+ };\r
+\r
+ function convert(editor, params) {\r
+ dom = editor.dom;\r
+\r
+ if (settings.convert_fonts_to_spans) {\r
+ tinymce.each(dom.select('font,u,strike', params.node), function(node) {\r
+ filters[node.nodeName.toLowerCase()](ed.dom, node);\r
+ });\r
+ }\r
+ };\r
+\r
+ ed.onPreProcess.add(convert);\r
+\r
+ ed.onInit.add(function() {\r
+ ed.selection.onSetContent.add(convert);\r
+ });\r
+ }\r
+});\r
+\r
--- /dev/null
+/**\r
+ * editable_selects.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+var TinyMCE_EditableSelects = {\r
+ editSelectElm : null,\r
+\r
+ init : function() {\r
+ var nl = document.getElementsByTagName("select"), i, d = document, o;\r
+\r
+ for (i=0; i<nl.length; i++) {\r
+ if (nl[i].className.indexOf('mceEditableSelect') != -1) {\r
+ o = new Option('(value)', '__mce_add_custom__');\r
+\r
+ o.className = 'mceAddSelectValue';\r
+\r
+ nl[i].options[nl[i].options.length] = o;\r
+ nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;\r
+ }\r
+ }\r
+ },\r
+\r
+ onChangeEditableSelect : function(e) {\r
+ var d = document, ne, se = window.event ? window.event.srcElement : e.target;\r
+\r
+ if (se.options[se.selectedIndex].value == '__mce_add_custom__') {\r
+ ne = d.createElement("input");\r
+ ne.id = se.id + "_custom";\r
+ ne.name = se.name + "_custom";\r
+ ne.type = "text";\r
+\r
+ ne.style.width = se.offsetWidth + 'px';\r
+ se.parentNode.insertBefore(ne, se);\r
+ se.style.display = 'none';\r
+ ne.focus();\r
+ ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;\r
+ ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;\r
+ TinyMCE_EditableSelects.editSelectElm = se;\r
+ }\r
+ },\r
+\r
+ onBlurEditableSelectInput : function() {\r
+ var se = TinyMCE_EditableSelects.editSelectElm;\r
+\r
+ if (se) {\r
+ if (se.previousSibling.value != '') {\r
+ addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);\r
+ selectByValue(document.forms[0], se.id, se.previousSibling.value);\r
+ } else\r
+ selectByValue(document.forms[0], se.id, '');\r
+\r
+ se.style.display = 'inline';\r
+ se.parentNode.removeChild(se.previousSibling);\r
+ TinyMCE_EditableSelects.editSelectElm = null;\r
+ }\r
+ },\r
+\r
+ onKeyDown : function(e) {\r
+ e = e || window.event;\r
+\r
+ if (e.keyCode == 13)\r
+ TinyMCE_EditableSelects.onBlurEditableSelectInput();\r
+ }\r
+};\r
--- /dev/null
+/**\r
+ * form_utils.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));\r
+\r
+function getColorPickerHTML(id, target_form_element) {\r
+ var h = "";\r
+\r
+ h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';\r
+ h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> </span></a>';\r
+\r
+ return h;\r
+}\r
+\r
+function updateColor(img_id, form_element_id) {\r
+ document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;\r
+}\r
+\r
+function setBrowserDisabled(id, state) {\r
+ var img = document.getElementById(id);\r
+ var lnk = document.getElementById(id + "_link");\r
+\r
+ if (lnk) {\r
+ if (state) {\r
+ lnk.setAttribute("realhref", lnk.getAttribute("href"));\r
+ lnk.removeAttribute("href");\r
+ tinyMCEPopup.dom.addClass(img, 'disabled');\r
+ } else {\r
+ if (lnk.getAttribute("realhref"))\r
+ lnk.setAttribute("href", lnk.getAttribute("realhref"));\r
+\r
+ tinyMCEPopup.dom.removeClass(img, 'disabled');\r
+ }\r
+ }\r
+}\r
+\r
+function getBrowserHTML(id, target_form_element, type, prefix) {\r
+ var option = prefix + "_" + type + "_browser_callback", cb, html;\r
+\r
+ cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));\r
+\r
+ if (!cb)\r
+ return "";\r
+\r
+ html = "";\r
+ html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';\r
+ html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> </span></a>';\r
+\r
+ return html;\r
+}\r
+\r
+function openBrowser(img_id, target_form_element, type, option) {\r
+ var img = document.getElementById(img_id);\r
+\r
+ if (img.className != "mceButtonDisabled")\r
+ tinyMCEPopup.openBrowser(target_form_element, type, option);\r
+}\r
+\r
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {\r
+ if (!form_obj || !form_obj.elements[field_name])\r
+ return;\r
+\r
+ var sel = form_obj.elements[field_name];\r
+\r
+ var found = false;\r
+ for (var i=0; i<sel.options.length; i++) {\r
+ var option = sel.options[i];\r
+\r
+ if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {\r
+ option.selected = true;\r
+ found = true;\r
+ } else\r
+ option.selected = false;\r
+ }\r
+\r
+ if (!found && add_custom && value != '') {\r
+ var option = new Option(value, value);\r
+ option.selected = true;\r
+ sel.options[sel.options.length] = option;\r
+ sel.selectedIndex = sel.options.length - 1;\r
+ }\r
+\r
+ return found;\r
+}\r
+\r
+function getSelectValue(form_obj, field_name) {\r
+ var elm = form_obj.elements[field_name];\r
+\r
+ if (elm == null || elm.options == null || elm.selectedIndex === -1)\r
+ return "";\r
+\r
+ return elm.options[elm.selectedIndex].value;\r
+}\r
+\r
+function addSelectValue(form_obj, field_name, name, value) {\r
+ var s = form_obj.elements[field_name];\r
+ var o = new Option(name, value);\r
+ s.options[s.options.length] = o;\r
+}\r
+\r
+function addClassesToList(list_id, specific_option) {\r
+ // Setup class droplist\r
+ var styleSelectElm = document.getElementById(list_id);\r
+ var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);\r
+ styles = tinyMCEPopup.getParam(specific_option, styles);\r
+\r
+ if (styles) {\r
+ var stylesAr = styles.split(';');\r
+\r
+ for (var i=0; i<stylesAr.length; i++) {\r
+ if (stylesAr != "") {\r
+ var key, value;\r
+\r
+ key = stylesAr[i].split('=')[0];\r
+ value = stylesAr[i].split('=')[1];\r
+\r
+ styleSelectElm.options[styleSelectElm.length] = new Option(key, value);\r
+ }\r
+ }\r
+ } else {\r
+ tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {\r
+ styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);\r
+ });\r
+ }\r
+}\r
+\r
+function isVisible(element_id) {\r
+ var elm = document.getElementById(element_id);\r
+\r
+ return elm && elm.style.display != "none";\r
+}\r
+\r
+function convertRGBToHex(col) {\r
+ var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");\r
+\r
+ var rgb = col.replace(re, "$1,$2,$3").split(',');\r
+ if (rgb.length == 3) {\r
+ r = parseInt(rgb[0]).toString(16);\r
+ g = parseInt(rgb[1]).toString(16);\r
+ b = parseInt(rgb[2]).toString(16);\r
+\r
+ r = r.length == 1 ? '0' + r : r;\r
+ g = g.length == 1 ? '0' + g : g;\r
+ b = b.length == 1 ? '0' + b : b;\r
+\r
+ return "#" + r + g + b;\r
+ }\r
+\r
+ return col;\r
+}\r
+\r
+function convertHexToRGB(col) {\r
+ if (col.indexOf('#') != -1) {\r
+ col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');\r
+\r
+ r = parseInt(col.substring(0, 2), 16);\r
+ g = parseInt(col.substring(2, 4), 16);\r
+ b = parseInt(col.substring(4, 6), 16);\r
+\r
+ return "rgb(" + r + "," + g + "," + b + ")";\r
+ }\r
+\r
+ return col;\r
+}\r
+\r
+function trimSize(size) {\r
+ return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2');\r
+}\r
+\r
+function getCSSSize(size) {\r
+ size = trimSize(size);\r
+\r
+ if (size == "")\r
+ return "";\r
+\r
+ // Add px\r
+ if (/^[0-9]+$/.test(size))\r
+ size += 'px';\r
+\r
+ return size;\r
+}\r
+\r
+function getStyle(elm, attrib, style) {\r
+ var val = tinyMCEPopup.dom.getAttrib(elm, attrib);\r
+\r
+ if (val != '')\r
+ return '' + val;\r
+\r
+ if (typeof(style) == 'undefined')\r
+ style = attrib;\r
+\r
+ return tinyMCEPopup.dom.getStyle(elm, style);\r
+}\r
--- /dev/null
+/**\r
+ * mctabs.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+function MCTabs() {\r
+ this.settings = [];\r
+};\r
+\r
+MCTabs.prototype.init = function(settings) {\r
+ this.settings = settings;\r
+};\r
+\r
+MCTabs.prototype.getParam = function(name, default_value) {\r
+ var value = null;\r
+\r
+ value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];\r
+\r
+ // Fix bool values\r
+ if (value == "true" || value == "false")\r
+ return (value == "true");\r
+\r
+ return value;\r
+};\r
+\r
+MCTabs.prototype.displayTab = function(tab_id, panel_id) {\r
+ var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i;\r
+\r
+ panelElm= document.getElementById(panel_id);\r
+ panelContainerElm = panelElm ? panelElm.parentNode : null;\r
+ tabElm = document.getElementById(tab_id);\r
+ tabContainerElm = tabElm ? tabElm.parentNode : null;\r
+ selectionClass = this.getParam('selection_class', 'current');\r
+\r
+ if (tabElm && tabContainerElm) {\r
+ nodes = tabContainerElm.childNodes;\r
+\r
+ // Hide all other tabs\r
+ for (i = 0; i < nodes.length; i++) {\r
+ if (nodes[i].nodeName == "LI")\r
+ nodes[i].className = '';\r
+ }\r
+\r
+ // Show selected tab\r
+ tabElm.className = 'current';\r
+ }\r
+\r
+ if (panelElm && panelContainerElm) {\r
+ nodes = panelContainerElm.childNodes;\r
+\r
+ // Hide all other panels\r
+ for (i = 0; i < nodes.length; i++) {\r
+ if (nodes[i].nodeName == "DIV")\r
+ nodes[i].className = 'panel';\r
+ }\r
+\r
+ // Show selected panel\r
+ panelElm.className = 'current';\r
+ }\r
+};\r
+\r
+MCTabs.prototype.getAnchor = function() {\r
+ var pos, url = document.location.href;\r
+\r
+ if ((pos = url.lastIndexOf('#')) != -1)\r
+ return url.substring(pos + 1);\r
+\r
+ return "";\r
+};\r
+\r
+// Global instance\r
+var mcTabs = new MCTabs();\r
--- /dev/null
+/**\r
+ * validate.js\r
+ *\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
+ */\r
+\r
+/**\r
+ // String validation:\r
+\r
+ if (!Validator.isEmail('myemail'))\r
+ alert('Invalid email.');\r
+\r
+ // Form validation:\r
+\r
+ var f = document.forms['myform'];\r
+\r
+ if (!Validator.isEmail(f.myemail))\r
+ alert('Invalid email.');\r
+*/\r
+\r
+var Validator = {\r
+ isEmail : function(s) {\r
+ return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');\r
+ },\r
+\r
+ isAbsUrl : function(s) {\r
+ return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');\r
+ },\r
+\r
+ isSize : function(s) {\r
+ return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$');\r
+ },\r
+\r
+ isId : function(s) {\r
+ return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');\r
+ },\r
+\r
+ isEmpty : function(s) {\r
+ var nl, i;\r
+\r
+ if (s.nodeName == 'SELECT' && s.selectedIndex < 1)\r
+ return true;\r
+\r
+ if (s.type == 'checkbox' && !s.checked)\r
+ return true;\r
+\r
+ if (s.type == 'radio') {\r
+ for (i=0, nl = s.form.elements; i<nl.length; i++) {\r
+ if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)\r
+ return false;\r
+ }\r
+\r
+ return true;\r
+ }\r
+\r
+ return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);\r
+ },\r
+\r
+ isNumber : function(s, d) {\r
+ return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));\r
+ },\r
+\r
+ test : function(s, p) {\r
+ s = s.nodeType == 1 ? s.value : s;\r
+\r
+ return s == '' || new RegExp(p).test(s);\r
+ }\r
+};\r
+\r
+var AutoValidator = {\r
+ settings : {\r
+ id_cls : 'id',\r
+ int_cls : 'int',\r
+ url_cls : 'url',\r
+ number_cls : 'number',\r
+ email_cls : 'email',\r
+ size_cls : 'size',\r
+ required_cls : 'required',\r
+ invalid_cls : 'invalid',\r
+ min_cls : 'min',\r
+ max_cls : 'max'\r
+ },\r
+\r
+ init : function(s) {\r
+ var n;\r
+\r
+ for (n in s)\r
+ this.settings[n] = s[n];\r
+ },\r
+\r
+ validate : function(f) {\r
+ var i, nl, s = this.settings, c = 0;\r
+\r
+ nl = this.tags(f, 'label');\r
+ for (i=0; i<nl.length; i++)\r
+ this.removeClass(nl[i], s.invalid_cls);\r
+\r
+ c += this.validateElms(f, 'input');\r
+ c += this.validateElms(f, 'select');\r
+ c += this.validateElms(f, 'textarea');\r
+\r
+ return c == 3;\r
+ },\r
+\r
+ invalidate : function(n) {\r
+ this.mark(n.form, n);\r
+ },\r
+\r
+ reset : function(e) {\r
+ var t = ['label', 'input', 'select', 'textarea'];\r
+ var i, j, nl, s = this.settings;\r
+\r
+ if (e == null)\r
+ return;\r
+\r
+ for (i=0; i<t.length; i++) {\r
+ nl = this.tags(e.form ? e.form : e, t[i]);\r
+ for (j=0; j<nl.length; j++)\r
+ this.removeClass(nl[j], s.invalid_cls);\r
+ }\r
+ },\r
+\r
+ validateElms : function(f, e) {\r
+ var nl, i, n, s = this.settings, st = true, va = Validator, v;\r
+\r
+ nl = this.tags(f, e);\r
+ for (i=0; i<nl.length; i++) {\r
+ n = nl[i];\r
+\r
+ this.removeClass(n, s.invalid_cls);\r
+\r
+ if (this.hasClass(n, s.required_cls) && va.isEmpty(n))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.number_cls) && !va.isNumber(n))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.email_cls) && !va.isEmail(n))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.size_cls) && !va.isSize(n))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.id_cls) && !va.isId(n))\r
+ st = this.mark(f, n);\r
+\r
+ if (this.hasClass(n, s.min_cls, true)) {\r
+ v = this.getNum(n, s.min_cls);\r
+\r
+ if (isNaN(v) || parseInt(n.value) < parseInt(v))\r
+ st = this.mark(f, n);\r
+ }\r
+\r
+ if (this.hasClass(n, s.max_cls, true)) {\r
+ v = this.getNum(n, s.max_cls);\r
+\r
+ if (isNaN(v) || parseInt(n.value) > parseInt(v))\r
+ st = this.mark(f, n);\r
+ }\r
+ }\r
+\r
+ return st;\r
+ },\r
+\r
+ hasClass : function(n, c, d) {\r
+ return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);\r
+ },\r
+\r
+ getNum : function(n, c) {\r
+ c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];\r
+ c = c.replace(/[^0-9]/g, '');\r
+\r
+ return c;\r
+ },\r
+\r
+ addClass : function(n, c, b) {\r
+ var o = this.removeClass(n, c);\r
+ n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;\r
+ },\r
+\r
+ removeClass : function(n, c) {\r
+ c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');\r
+ return n.className = c != ' ' ? c : '';\r
+ },\r
+\r
+ tags : function(f, s) {\r
+ return f.getElementsByTagName(s);\r
+ },\r
+\r
+ mark : function(f, n) {\r
+ var s = this.settings;\r
+\r
+ this.addClass(n, s.invalid_cls);\r
+ this.markLabels(f, n, s.invalid_cls);\r
+\r
+ return false;\r
+ },\r
+\r
+ markLabels : function(f, n, ic) {\r
+ var nl, i;\r
+\r
+ nl = this.tags(f, "label");\r
+ for (i=0; i<nl.length; i++) {\r
+ if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)\r
+ this.addClass(nl[i], ic);\r
+ }\r
+\r
+ return null;\r
+ }\r
+};\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <?php require $this->out_file("views/head.php"); ?>
+ <script type="text/javascript" src="<?= $this->path("libs") ?>tiny_mce/tiny_mce.js"></script>
+ <script type="text/javascript" src="<?= $this->path("libs") ?>tiny_mce/plugins/tinybrowser/tb_tinymce.js.php"></script>
+ </head>
+ <body>
+
+ <div id="header">
+ <div class="content">
+<?php require $this->out_file("views/header.php"); ?>
+ </div>
+ </div>
+
+ <div id="main">
+ <div class="content">
+
+ <div id="colonne">
+<?php require $this->out_file("views/admin/colonne.php"); ?>
+ </div>
+
+ <div id="center">
+<?php require $this->out_file("views/messages.php"); ?>
+<?php
+
+ if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+
+?>
+ </div>
+
+ <div class="clear"><!-- --></div>
+
+ </div>
+ </div>
+
+ <div id="footer">
+ <div class="content">
+<?php require $this->out_file("views/footer.php"); ?>
+ </div>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <?php require $this->out_file("views/head.php"); ?>
+ <script type="text/javascript" src="<?= $this->path("libs") ?>tiny_mce/tiny_mce.js"></script>
+ <script type="text/javascript" src="<?= $this->path("libs") ?>tiny_mce/plugins/tinybrowser/tb_tinymce.js.php"></script>
+ </head>
+ <body>
+
+ <div id="header">
+ <div class="content">
+<?php require $this->out_file("views/header.php"); ?>
+ </div>
+ </div>
+
+ <div id="main">
+ <div class="content">
+
+ <div id="colonne">
+<?php require $this->out_file("views/users/colonne.php"); ?>
+ </div>
+
+ <div id="center">
+<?php require $this->out_file("views/messages.php"); ?>
+<?php
+
+ if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+
+?>
+ </div>
+
+ <div class="clear"><!-- --></div>
+
+ </div>
+ </div>
+
+ <div id="footer">
+ <div class="content">
+<?php require $this->out_file("views/footer.php"); ?>
+ </div>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+
+ <navig_menu_top type="checkbox" default="0"><![CDATA[Afficher le menu de navigation sous l'entête]]></navig_menu_top>
+ <colonne type="checkbox" default="0"><![CDATA[Afficher la colonne]]></colonne>
+
+</config>
--- /dev/null
+<?php
+
+ if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+
+?>
\ No newline at end of file
--- /dev/null
+table.admin
+{ width: 100%;
+}
+
+table.admin tr.hl td
+{ padding: 3px;
+}
+
+table.admin td.action
+{ text-align: center;
+ width: 50px;
+}
+
+ul.admin
+{ list-style-type: none;
+ margin: 10px 10px 20px 10px;
+ text-align: right;
+ padding-bottom: 10px;
+}
+
+ul.admin li
+{ display: inline;
+}
+
+ul.admin li a
+{ padding: 3px 7px 3px 7px;
+}
+
+ul li a.add
+{ padding: 3px 7px 3px 18px;
+}
+
+ul.admin li.admin_form_title
+{ display: block;
+ float: left;
+ padding: 0px 7px 3px 7px;
+}
+
+ul.form
+{ clear: both;
+ list-style-type: none;
+}
+
+ul.form li
+{ clear: both;
+ padding: 5px;
+}
+
+ul.form li label
+{ float: left;
+ display: block;
+ width: 100px;
+ text-align: right;
+ padding: 0 15px 0 15px;
+}
+
+ul.form li div p
+{ float: left;
+ display: block;
+ width: 350px;
+ text-align: left;
+ padding: 0 0px 15px 0px;
+}
+
+ul.form li p span
+{ display: block;
+ padding: 5px;
+ font-size: 0.9em;
+}
+
+ul.admin_form_head
+{ clear: both;
+ list-style-type: none;
+ margin: 10px 0px 0px 0px;
+}
+
+ul.admin_form_head li
+{ clear: both;
+ padding: 5px;
+ text-align: right;
+ line-height: 20px;
+}
+
+ul.admin_form_head li input
+{ margin: 0px 10px 0px 10px;
+}
+
+ul.admin_form_content
+{ list-style-type: none;
+ margin: 0px 0px 0px 0px;
+ padding: 10px 0px 10px 0px;
+}
+
+ul.admin_form_content ul.admin
+{ list-style-type: none;
+ margin: 10px 10px 20px 10px;
+ text-align: right;
+ padding-bottom: 10px;
+}
+
+ul.admin_form_content ul.admin li
+{ display: inline;
+}
+
+ul.admin_form_content ul.admin li a
+{ padding: 3px 7px 3px 7px;
+}
+
+ul.admin_form_content ul li a.add
+{ padding: 3px 7px 3px 18px;
+}
+
+ul.admin_form_content ul.admin li.admin_form_title
+{ display: block;
+ float: left;
+ padding: 0px 7px 3px 7px;
+}
+
+.admin_source_infos
+{ margin: 0px 10px 10px 20px;
+}
+
+.admin_source_infos ul.admin_source_head
+{ list-style-type: none;
+ margin: 0px 0px 0px 0px;
+ text-align: right;
+ padding-bottom: 10px;
+ padding-top: 5px;
+}
+
+ul.admin_source_head li
+{ display: inline;
+}
+
+ul.admin_source_head li a
+{ padding: 3px 7px 3px 7px;
+}
+
+ul.admin_source_head li.admin_form_title
+{ display: block;
+ float: left;
+ padding: 0px 7px 3px 7px;
+ font-size: 1.2em;
+}
+
+.admin_source_url
+{ margin: 10px 0px 0px 20px;
+}
+
+input[type=text], input[type=file], input[type=password], textarea, select
+{ padding: 3px;
+}
+
+input[type=submit], a.button
+{ padding: 3px 7px 3px 7px;
+ cursor: pointer;
+}
+
+ul.form li.buttons
+{ text-align: center;
+}
+
+.tinymce
+{ width: 500px;
+ height: 400px;
+}
+
+.document
+{ margin: 5px;
+ padding: 5px;
+}
+
+.document .delete
+{ float: right;
+}
+
+.document .clear
+{ height: 5px;
+}
+
+.xml_edit_content
+{ display: block;
+ margin: 5px 10px 30px 0px;
+ text-align: right;
+}
+
+.xml_edit_content textarea
+{ width: 97%;
+}
+
+ul.xml_infos
+{ margin: 10px 10px 0px 20px;
+}
+
+ul.xml_infos li
+{ padding: 5px;
+ margin: 0px 0px 0px 20px;
+}
+
--- /dev/null
+ul.plugins
+{ list-style-type: none;
+ margin: 20px 10px;
+}
+
+ul.plugins li
+{ padding: 5px 10px;
+ margin: 10px;
+}
+
+ul.plugins p.folder
+{ float: right;
+ font-size: 0.9em;
+}
+
+ul.plugins li ul.plugin_links
+{ text-align: right;
+}
+
+ul.plugins li ul.plugin_links li
+{ display: inline;
+ padding: 1px 7px;
+ margin: 0;
+}
+
+ul.plugins li ul.plugin_links li input
+{ width: 2em;
+}
+
+ul.plugins li.buttons
+{ text-align: right;
+}
\ No newline at end of file
--- /dev/null
+@import url("admin.css");
+
+#contact form
+{ margin: 20px 0px 10px 0px;
+}
+
+#contact form .ptitcaptcha img
+{ float: left;
+ margin: 0px 10px 0px 0px;
+}
+
+#contact ul.form li label
+{ float: left;
+ display: block;
+ width: 50px;
+ text-align: right;
+ padding: 0 15px 0 15px;
+}
+
+#contact ul.form li p
+{ float: left;
+ display: block;
+ width: 380px;
+ text-align: left;
+ padding: 0 15px 5px 15px;
+}
+
+#contact ul.form li p span
+{ display: block;
+ padding: 5px;
+ font-size: 0.9em;
+}
\ No newline at end of file
--- /dev/null
+@import url("admin.css");
--- /dev/null
+/*\r
+ ColorBox Core Style:\r
+ The following CSS is consistent between example themes and should not be altered.\r
+*/\r
+#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}\r
+#cboxOverlay{position:fixed; width:100%; height:100%;}\r
+#cboxMiddleLeft, #cboxBottomLeft{clear:left;}\r
+#cboxContent{position:relative;}\r
+#cboxLoadedContent{overflow:auto;}\r
+#cboxTitle{margin:0;}\r
+#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}\r
+#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}\r
+.cboxPhoto{float:left; margin:auto; border:0; display:block;}\r
+.cboxIframe{width:100%; height:100%; display:block; border:0;}\r
+\r
+/* \r
+ User Style:\r
+ Change the following styles to modify the appearance of ColorBox. They are\r
+ ordered & tabbed in a way that represents the nesting of the generated HTML.\r
+*/\r
+#cboxOverlay{background:url(../images/colorbox/overlay.png) repeat 0 0;}\r
+#colorbox{}\r
+/*
+ #cboxTopLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -100px 0;}\r
+ #cboxTopRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -129px 0;}\r
+ #cboxBottomLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -100px -29px;}\r
+ #cboxBottomRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -129px -29px;}\r
+ #cboxMiddleLeft{width:21px; background:url(../images/colorbox/controls.png) left top repeat-y;}\r
+ #cboxMiddleRight{width:21px; background:url(../images/colorbox/controls.png) right top repeat-y;}\r
+ #cboxTopCenter{height:21px; background:url(../images/colorbox/border.png) 0 0 repeat-x;}\r
+ #cboxBottomCenter{height:21px; background:url(../images/colorbox/border.png) 0 -29px repeat-x;}\r
+*/
+ #cboxTopLeft{width:21px; height:21px;}\r
+ #cboxTopRight{width:21px; height:21px;}\r
+ #cboxBottomLeft{width:21px; height:21px;}\r
+ #cboxBottomRight{width:21px; height:21px;}
+ #cboxMiddleLeft{width:21px;}\r
+ #cboxMiddleRight{width:21px;}\r
+ #cboxTopCenter{height:21px;}\r
+ #cboxBottomCenter{height:21px;}
+ #cboxContent{background:#ffffff; overflow:hidden; color: #555555; padding: 10px 10px 0px 10px; border-radius: 3px 3px 3px 3px; -moz-border-radius: 3px 3px 3px 3px;}\r
+ #cboxError{padding:50px; border:1px solid #ccc;}\r
+ #cboxLoadedContent{margin-bottom:28px;}\r
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}\r
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}\r
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}\r
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/colorbox/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}\r
+ #cboxPrevious.hover{background-position:-75px -25px;}\r
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/colorbox/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}\r
+ #cboxNext.hover{background-position:-50px -25px;}\r
+ #cboxLoadingOverlay{}\r
+ #cboxLoadingGraphic{background:url(../images/colorbox/loading.gif) no-repeat center center;}\r
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(../images/colorbox/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}\r
+ #cboxClose.hover{background-position:-25px -25px;}\r
+\r
+/*\r
+ The following fixes a problem where IE7+ replaces a PNG's alpha transparency with a black fill\r
+ when an alpha filter (opacity change) is set on the element or ancestor element.\r
+*/\r
+.cboxIE #cboxTopLeft,\r
+.cboxIE #cboxTopCenter,\r
+.cboxIE #cboxTopRight,\r
+.cboxIE #cboxBottomLeft,\r
+.cboxIE #cboxBottomCenter,\r
+.cboxIE #cboxBottomRight,\r
+.cboxIE #cboxMiddleLeft,\r
+.cboxIE #cboxMiddleRight {\r
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);\r
+}\r
+\r
+/*\r
+ The following provides PNG transparency support for IE6\r
+*/\r
+.cboxIE6 #cboxTopLeft{background:url(../images/colorbox/ie6/borderTopLeft.png);}\r
+.cboxIE6 #cboxTopCenter{background:url(../images/colorbox/ie6/borderTopCenter.png);}\r
+.cboxIE6 #cboxTopRight{background:url(../images/colorbox/ie6/borderTopRight.png);}\r
+.cboxIE6 #cboxBottomLeft{background:url(../images/colorbox/ie6/borderBottomLeft.png);}\r
+.cboxIE6 #cboxBottomCenter{background:url(../images/colorbox/ie6/borderBottomCenter.png);}\r
+.cboxIE6 #cboxBottomRight{background:url(../images/colorbox/ie6/borderBottomRight.png);}\r
+.cboxIE6 #cboxMiddleLeft{background:url(../images/colorbox/ie6/borderMiddleLeft.png);}\r
+.cboxIE6 #cboxMiddleRight{background:url(../images/colorbox/ie6/borderMiddleRight.png);}\r
+\r
+.cboxIE6 #cboxTopLeft,\r
+.cboxIE6 #cboxTopCenter,\r
+.cboxIE6 #cboxTopRight,\r
+.cboxIE6 #cboxBottomLeft,\r
+.cboxIE6 #cboxBottomCenter,\r
+.cboxIE6 #cboxBottomRight,\r
+.cboxIE6 #cboxMiddleLeft,\r
+.cboxIE6 #cboxMiddleRight {\r
+ _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");\r
+}\r
--- /dev/null
+body
+{ background-color: #ffffff;
+ color: #333333;
+}
+
+a
+{ text-decoration: none;
+ color: #000066;
+}
+
+a img
+{ border: none;
+}
+
+a:hover
+{ color: #c0c0c0;
+}
+
+.navig
+{ color: #333333;
+ border: solid 1px #c0c0c0;
+ background-color: #ffffff;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+.loading
+{ background-image: url("../icons/ajax-loader.gif");
+ background-repeat: no-repeat;
+ background-position: 5px 5px;
+}
+
+/* ------------------------- messages --------------- */
+
+.messages
+{ border: solid 1px #c0c0c0;
+}
+
+.erreur
+{ border: solid 1px #c0c0c0;
+}
+
+.redirect_message div
+{ border: solid 1px #c0c0c0;
+}
+
+/* ------------------------- blocs generaux --------- */
+
+#header
+{ padding-top: 10px;
+}
+
+#header .content
+{ border-bottom: solid 1px #d9d9d9;
+}
+
+#colonne
+{ /*border-right: dashed 1px #555555; */
+}
+
+#footer .content
+{ border-top: solid 1px #e9e9e9;
+}
+
+#footer .content p
+{ color: #777777;
+}
+
+/* ----------------------------------- menu top ----- */
+
+#menu_top ul.menu li a
+{ border: solid 1px #e9e9e9;
+ background-color: #ffffff;
+}
+
+#menu_top ul.menu li ul li a
+{ border-top: none;
+ border-right: solid 1px #333333;
+ border-bottom: none;
+ border-left: solid 1px #333333;
+ background-color: #050505;
+}
+
+#menu_top ul.menu li ul li.last a
+{ border-top: none;
+ border-right: solid 1px #333333;
+ border-bottom: solid 1px #333333;
+ border-left: solid 1px #333333;
+ background-color: #050505;
+}
+
+/* ----------------------------------- admin --------- */
+
+table.admin tr.hl td
+{ border: solid 1px #d1d1d1;
+}
+
+table.admin tr.hl:hover
+{ background-color: #f9f9f9;
+}
+
+input[type=text], input[type=file], input[type=password], textarea, select
+{ border: solid 1px #999999;
+ color: #333333;
+}
+
+input[type=submit], a.button
+{ border: solid 1px #d1d1d1;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+input[type=submit]:hover, a.button:hover
+{ border: solid 1px #d1d1d1;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+ul.admin
+{ border-bottom: dashed 1px #c0c0c0;
+}
+
+ul.admin_form_head
+{ border: solid 1px #c0c0c0;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+ul.admin_form_content ul.admin
+{ border-bottom: none;
+}
+
+ul.admin li a
+{ border: solid 1px #d1d1d1;
+}
+
+.admin_source_infos ul.admin li a
+{ border: none;
+ background-color: #101010;
+ color: #c0c0c0;
+}
+
+ul.admin li a.add
+{ background-image: url("../icons/add.gif");
+ background-repeat: no-repeat;
+ background-position: 3px 6px;
+ border: solid 1px #d1d1d1;
+}
+
+ul.admin li a:hover
+{
+}
+
+.admin_source_infos
+{ border: solid 1px #c0c0c0;
+/* background-color: #0a0a0a;*/
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+.admin_source_infos ul.admin li a:hover
+{ border: none;
+ background-color: #333333;
+ color: #c0c0c0;
+}
+
+#documents .document
+{ border: solid 1px #c0c0c0;
+}
+
+/* ------------------------------- plugins ----------- */
+
+ul.plugins li
+{ border: solid 1px #c0c0c0;
+}
+
+ul.plugins li.enabled
+{ background-color: #ffffff;
+}
+
+ul.plugins li.disabled
+{ background-color: #f7f7f7;
+}
+
+ul.plugins li.uninstalled
+{ background-color: #e5e5e5;
+}
+
+ul.plugins li ul.plugin_links li
+{ border-top: none;
+ border-right: none;
+ border-bottom: none;
+ border-left: solid 1px #c0c0c0;
+}
+
+ul.plugins li ul.plugin_links li input
+{ border: solid 1px #c0c0c0;
+}
+
+/* ------------------------------- liste groupes ----------- */
+
+ul.groupes li h4 a
+{ border: solid 1px #d9d9d9;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+/* ------------------------------- page album ----------- */
+
+p#play_all a
+{ border: solid 1px #c0c0c0;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+ background-image: url("../icons/ecouter.png");
+ background-repeat: no-repeat;
+ background-position: 6px 6px;
+ background-color: #ffffff;
+}
+
+/* ----------------------------------- sources --------- */
+
+ul.albums li a
+{ border: solid 1px #555555;
+}
+
+.logo_groupe
+{ /*border: solid 1px #e9e9e9;*/
+ background-color: #ffffff;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+ul#lien_contact li a
+{ border-bottom: solid 1px #d9d9d9;
+}
+
+#colonne ul#album_links
+{ /*border-bottom: solid 1px #333333;*/
+}
+
+#colonne ul#album_links li
+{
+}
+
+#colonne ul.menu_albums li
+{ border: solid 1px #d9d9d9;
+ background-color: #ffffff;
+}
+
+#center ul.menu_albums li
+{ border: solid 1px #d9d9d9;
+ float: left;
+}
+
+.track
+{ border: solid 1px #ffffff;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+.track h5
+{ background-color: #ffffff;
+ border-radius: 3px 3px 0px 0px;
+ -moz-border-radius: 3px 3px 0px 0px;
+}
+
+.playing_track
+{ border: solid 1px #dedede;
+ background-color: #ffffff;
+ border-radius: 3px 3px 3px 3px;
+ -moz-border-radius: 3px 3px 3px 3px;
+}
+
+.player_progress
+{ background-color: #ececec;
+}
+
+.player_progress .loaded
+{ background-color: #dedede;
+}
+
+.player_progress .position
+{ background-color: #999999;
+}
+
+.player_controls a img
+{ border: none;
+}
+
+.source_arbo ul.menu_source
+{ float: right;
+ margin: 0px 10px 1px 0px;
+}
+
+.source_arbo ul.menu_source li
+{ float: right;
+ padding: 1px;
+}
+
+.source_arbo ul.menu_source li a
+{ display: block;
+ text-align: center;
+ background-color: #151515;
+ border-radius: 3px 3px 0px 0px;
+ -moz-border-radius: 3px 3px 0px 0px;
+ padding: 2px 5px 2px 5px;
+}
+
+.source_arbo ul.menu_source li a:hover
+{
+}
+
+.source_arbo ul.menu_source li.icon a
+{ border: none;
+ padding: 2px 2px 2px 2px;
+}
+
+.pistes
+{ border-left: none;
+}
+
+.derivation
+{ border-left: none;
+}
--- /dev/null
+#footer .content
+{ height: 100px;
+}
+
+#footer .content p
+{ text-align: right;
+}
+
+#footer .content p#a_propos_links
+{ text-align: left;
+ float: left;
+}
--- /dev/null
+body
+{ font: normal 12px Verdana, Helvetica, Arial, sans-serif;
+}
+
+ul
+{ margin: 5px 5px 5px 15px;
+}
+
+h1
+{ margin: 5px
+}
+
+h2
+{ margin: 5px
+}
+
+h2 span
+{ font-weight: normal;
+ font-size: 0.8em;
+}
+
+h3
+{ margin: 5px
+}
+
+p
+{ margin: 5px
+ text-align: justify;
+}
+
+.messages
+{ margin: 10px;
+ padding: 10px;
+}
+
+.erreur
+{ margin: 50px 100px 50px 100px;
+ padding: 20px;
+}
+
+.redirect_message div
+{ margin: 50px 100px 50px 100px;
+ padding: 20px;
+}
+
+ul.list
+{ margin: 5px 10px 10px 15px;
+}
+
+ul.list li
+{ margin: 5px 5px 5px 15px;
+ padding: 5px;
+}
+
+.navig
+{ text-align: right;
+ padding: 3px;
+ margin: 10px;
+}
+
+.loading
+{ margin: 5px 0px 10px 15px;
+ padding: 0px;
+ height: 40px;
+ width: 40px;
+}
+
+.loading span
+{ display: none;
+}
--- /dev/null
+#header h1
+{ padding-top: 5px;
+ padding: 5px 0px 0px 0px;
+ margin: 0px;
+}
+
+#header h1 a
+{ text-decoration: none;
+ display: block;
+ padding: 10px;
+}
--- /dev/null
+#main .content
+{ padding: 10px 0px 10px 0px;
+ width: 800px;
+}
+
+#colonne
+{ float: left;
+ width: 240px;
+ padding: 0px 0px 50px 0px;
+}
+
+#center
+{ float: left;
+ width: 540px;
+ padding: 10px;
+}
+
+#center.no_colonne
+{ width: 800px;
+}
+
+#colonne ul.menu
+{ margin-left: 15px;
+}
+
+#colonne ul.menu li
+{ margin-left: 15px;
+}
+
+#colonne ul.navig_menu
+{ margin-top: 20px;
+}
--- /dev/null
+#menu_top ul.menu
+{ margin: 5px 0px 0px 0px;
+ float: right;
+ position: relative;
+}
+
+#menu_top ul.menu li
+{ list-style-type: none;
+ margin-left: 15px;
+ float: left;
+}
+
+#menu_top ul.menu li a
+{ display: block;
+ padding: 5px 10px 5px 10px;
+}
+
+#menu_top ul.menu li ul
+{ position: absolute;
+ margin: 0px 0px 0px -15px;
+ z-index: 1;
+ display: none;
+}
+
+#menu_top ul.menu li ul li
+{ float: none;
+}
+
+#menu_top ul.menu li ul li a
+{ padding: 5px 10px 5px 10px;
+}
--- /dev/null
+@import url("general.css");
+@import url("header.css");
+@import url("menu_top.css");
+@import url("main.css");
+@import url("footer.css");
+
+*
+{ margin: 0;
+ padding: 0;
+}
+
+html
+{ height: 100%;
+}
+
+body
+{ text-align: center;
+ height: 100%;
+}
+
+pre, div { text-align: left; }
+
+.content
+{ margin-left: auto;
+ margin-right: auto;
+ width: 800px;
+}
+
+.clear
+{ clear: both;
+ font-size: 0px;
+ line-height: 0px;
+ height: 0px;
+}
--- /dev/null
+body, td, pre
+{
+}
\ No newline at end of file
--- /dev/null
+/*
+ * jQuery UI CSS Framework 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+
+/*
+ * jQuery UI CSS Framework 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
+.ui-widget-content a { color: #333333; }
+.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
+.ui-widget-header a { color: #ffffff; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; }
+.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; }
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; }
+.ui-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
+.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); }
+.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
+ * jQuery UI Resizable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
+ /* http://bugs.jqueryui.com/ticket/7233
+ - Resizable: resizable handles fail to work in IE if transparent and content overlaps
+ */
+ background-image:url(data:);
+}
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
+ * jQuery UI Selectable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectable#theming
+ */
+.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+/*
+ * jQuery UI Accordion 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*
+ * jQuery UI Autocomplete 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.12
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/*
+ * jQuery UI Button 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4; }
+.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+/*
+ * jQuery UI Dialog 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/*
+ * jQuery UI Slider 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
+ * jQuery UI Tabs 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs#theming
+ */
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+/*
+ * jQuery UI Datepicker 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+ display: none; /*sorry for IE5*/
+ display/**/: block; /*sorry for IE5*/
+ position: absolute; /*must have*/
+ z-index: -1; /*must have*/
+ filter: mask(); /*must have*/
+ top: -4px; /*must have*/
+ left: -4px; /*must have*/
+ width: 200px; /*must have*/
+ height: 200px; /*must have*/
+}/*
+ * jQuery UI Progressbar 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file
--- /dev/null
+<?php
+
+ function mw_navig($current, $total, $max, $base_url, $start_param, $legende = null)
+ { $navig = "";
+ if($max && $total > $max)
+ { if(isset($legende))
+ { $navig .=
+ $legende." ".($current + 1)." à "
+ .(($current + $max) > $total ? $total : $current + $max)
+ ." sur ".$total." - aller à la ";
+ }
+ $get_params = array();
+ if(($q = strpos($base_url, "?")) !== false)
+ { $v_query = explode("&", substr($base_url, $q + 1));
+ $base_url = substr($base_url, 0, $q);
+ foreach($v_query as $query)
+ { if($query)
+ { $v = explode("=", $query);
+ $get_params[$v[0]] = $v[1];
+ }
+ }
+ }
+ if(isset($get_params[$start_param])) unset($get_params[$start_param]);
+ $base_url .= "?";
+ foreach($get_params as $key => $value) $base_url .= $key."=".$value."&";
+ $nb_pages = ceil($total / $max);
+ $navig .=
+ "page : "
+ ."<select onchange=\"document.location=this.options[this.selectedIndex].value;\">\n";
+ $np = 1;
+ $ni = 0;
+ while($ni < $total)
+ { $navig .=
+ " <option value=\"".$base_url.$start_param."=".$ni."\"".($current >= $ni && $current <= $ni ? " SELECTED" : "").">"
+ .$np
+ ."</option>\n";
+ $np++;
+ $ni += $max;
+ }
+ $navig .=
+ "</select>\n";
+ if($current >= $max)
+ { $navig .=
+ "<a href=\"".$base_url.$start_param."=".($current - $max)."\">«</a>\n";
+ }
+ if($current < $total - $max)
+ { $navig .=
+ "<a href=\"".$base_url.$start_param."=".($current + $max)."\">»</a>\n";
+ }
+ }
+ return $navig;
+ }
+
+ function aff_date($date)
+ { if(preg_match("/([0-9]{2,4})-([0-9]{1,2})-([0-9]{1,2})/", $date, $regs))
+ { $date = $regs[3]." ".mois($regs[2])." ".$regs[1];
+ }
+ return $date;
+ }
+
+ function mois($n)
+ { switch($n)
+ { case 1: $mois = "jan"; break;
+ case 2: $mois = "fev"; break;
+ case 3: $mois = "mars"; break;
+ case 4: $mois = "avr"; break;
+ case 5: $mois = "mai"; break;
+ case 6: $mois = "juin"; break;
+ case 7: $mois = "juil"; break;
+ case 8: $mois = "aout"; break;
+ case 9: $mois = "sept"; break;
+ case 10: $mois = "oct"; break;
+ case 11: $mois = "nov"; break;
+ case 12: $mois = "dec"; break;
+ default: $mois = $n;
+ }
+ return $mois;
+ }
+
+?>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <?php require $this->out_file("views/head.php"); ?>
+ </head>
+ <body>
+
+ <div id="header">
+ <div class="content">
+<?php require $this->out_file("views/header.php"); ?>
+ </div>
+ </div>
+
+ <div id="main">
+ <div class="content">
+<?php require $this->out_file("views/messages.php"); ?>
+<?php
+
+ if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+
+?>
+ </div>
+ </div>
+
+ <div id="footer">
+ <div class="content">
+<?php require $this->out_file("views/footer.php"); ?>
+ </div>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+<?php
+
+ if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+
+?>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <?php require $this->out_file("views/head.php"); ?>
+ </head>
+ <body>
+
+ <div id="header">
+ <div class="content">
+<?php require $this->out_file("views/header.php"); ?>
+ </div>
+ </div>
+
+ <div id="menu_top">
+ <div class="content">
+<?php if($this->out_config("navig_menu_top")) require $this->out_file("views/top_menu.php"); ?>
+ </div>
+ </div>
+
+ <div class="clear"><!-- --></div>
+
+ <div id="main">
+ <div class="content">
+
+<?php if($this->out_config("colonne")) : ?>
+ <div id="colonne">
+<?php require $this->out_file("views/index/colonne.php"); ?>
+ </div>
+<?php endif; ?>
+
+ <div id="center"<?= $this->out_config("colonne") ? "" : " class=\"no_colonne\"" ?>>
+<?php require $this->out_file("views/messages.php"); ?>
+<?php
+
+ if($layout["content"] && $this->out_file_exists($layout["content"])) require $this->out_file($layout["content"]);
+
+?>
+
+ </div>
+
+ <div class="clear"><!-- --></div>
+
+ </div>
+ </div>
+
+ <div id="footer">
+ <div class="content">
+<?php require $this->out_file("views/footer.php"); ?>
+ </div>
+ </div>
+
+ </body>
+</html>
--- /dev/null
+$(document).ready
+( function()
+ { init_contact_form_ckeckbox();
+ }
+);
+
+function init_contact_form_ckeckbox()
+{ $("#contact_form").click
+ ( function()
+ { if($(this).get(0).checked) $("#email_li").slideDown(200);
+ else $("#email_li").slideUp(200);
+ }
+ );
+}
--- /dev/null
+$(document).ready
+( function()
+ { init_tinymce();
+ }
+);
+
+function init_tinymce()
+{ $(".tinymce").each
+ ( function()
+ { tinyMCE.execCommand("mceAddControl", true, $(this).attr("id"));
+ }
+ );
+}
+
--- /dev/null
+/*!
+ * jQuery JavaScript Library v1.5.2
+ * http://jquery.com/
+ *
+ * Copyright 2011, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2011, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Mar 31 15:28:23 2011 -0400
+ */
+(function(a,b){function ci(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cf(a){if(!b_[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bR(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bQ(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bs.test(a)?e(a,f):bQ(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bQ(a+"["+f+"]",b[f],c,e)}function bP(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bJ,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bP(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bP(a,c,d,e,"*",g));return l}function bO(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bD),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bq(a,b,c){var e=b==="width"?bk:bl,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function bc(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function bb(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function ba(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function _(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function $(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Q(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(L.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(r,"")===a.type?q.push(g.selector):t.splice(i--,1);f=d(a.target).closest(q,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){f=p[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:D?function(a){return a==null?"":D.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){F["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),E&&(d.inArray=function(a,b){return E.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?y=function(){c.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:c.attachEvent&&(y=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",y),d.ready())});return d}(),e="then done fail isResolved isRejected promise".split(" "),f=[].slice;d.extend({_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),f;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(f)return f;f=a={}}var c=e.length;while(c--)a[e[c]]=b[e[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;c<e;c++)b[c]&&d.isFunction(b[c].promise)?b[c].promise().then(i(c),h.reject):--g;g||h.resolveWith(h,b)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}}),function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i<j;i++)g=f[i].name,g.indexOf("data-")===0&&(g=g.substr(5),h(this[0],g,e[g]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=h(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var j=/[\n\t\r]/g,k=/\s+/,l=/\r/g,m=/^(?:href|src|style)$/,n=/^(?:button|input)$/i,o=/^(?:button|input|object|select|textarea)$/i,p=/^a(?:rea)?$/i,q=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(k);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(k);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(j," ");for(var i=0,l=c.length;i<l;i++)h=h.replace(" "+c[i]+" "," ");g.className=d.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),i=b,j=a.split(k);while(f=j[g++])i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(j," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j<k;j++){var m=h[j];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(q.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(l,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&q.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,H(a.origType,a.selector),d.extend({},a,{handler:G,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:x):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var z=function(a){var b=a.relatedTarget;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},A=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?A:z,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?A:z)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&E("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&E("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var B,C=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var F={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=r.exec(h),k="",j&&(k=j[0],h=h.replace(r,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(F[h]+k),h=h+k):h=(F[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)d.event.add(n[p],"live."+H(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+H(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var I=/Until$/,J=/^(?:parents|prevUntil|prevAll)/,K=/,/,L=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,N=d.expr.match.POS,O={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(Q(this,a,!1),"not",a)},filter:function(a){return this.pushStack(Q(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/<tbody/i,W=/<|&#?\w+;/,X=/<(?:script|object|embed|option|style)/i,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,Z={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&Y.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?$(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,bc)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!X.test(a[0])&&(d.support.checkClone||!Y.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1></$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bC=/^(?:select|textarea)/i,bD=/\s+/,bE=/([?&])_=[^&]*/,bF=/(^|\-)([a-z])/g,bG=function(a,b,c){return b+c.toUpperCase()},bH=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bI=d.fn.load,bJ={},bK={},bL,bM;try{bL=c.location.href}catch(bN){bL=c.createElement("a"),bL.href="",bL=bL.href}bM=bH.exec(bL.toLowerCase())||[],d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bI)return bI.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bB,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bC.test(this.nodeName)||bw.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bt,"\r\n")}}):{name:b.name,value:c.replace(bt,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bL,isLocal:bx.test(bM[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bO(bJ),ajaxTransport:bO(bK),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bR(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bS(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bF,bG)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bv.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bu,"").replace(bz,bM[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bD),e.crossDomain==null&&(q=bH.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bM[1]||q[2]!=bM[2]||(q[3]||(q[1]==="http:"?80:443))!=(bM[3]||(bM[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bP(bJ,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!by.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bA.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bE,"$1_="+w);e.url=x+(x===e.url?(bA.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bP(bK,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bQ(g,a[g],c,f);return e.join("&").replace(br,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bT=d.now(),bU=/(\=)\?(&|$)|\?\?/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bT++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bU.test(b.url)||f&&bU.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bU,l),b.url===j&&(f&&(k=k.replace(bU,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bV=d.now(),bW,bX;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bZ()||b$()}:bZ,bX=d.ajaxSettings.xhr(),d.support.ajax=!!bX,d.support.cors=bX&&"withCredentials"in bX,bX=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),!a.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bW[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bW||(bW={},bY()),h=bV++,g.onreadystatechange=bW[h]=c):c()},abort:function(){c&&c(0,1)}}}});var b_={},ca=/^(?:toggle|show|hide)$/,cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,cd=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(ce("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cf(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ce("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(ce("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cf(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(ca.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=cb.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:ce("show",1),slideUp:ce("hide",1),slideToggle:ce("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!cc&&(cc=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(cc),cc=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var cg=/^t(?:able|d|h)$/i,ch=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=ci(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!cg.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=(e==="absolute"||e==="fixed")&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=ch.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!ch.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=ci(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=ci(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);
\ No newline at end of file
--- /dev/null
+/*!
+ * jQuery UI 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI
+ */
+(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.12",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
+NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
+"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
+if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
+"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
+d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
+c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
+b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
+;/*!
+ * jQuery UI Widget 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
+a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
+e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
+this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
+widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
+enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
+;/*!
+ * jQuery UI Mouse 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Mouse
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ */
+(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
+a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,e=a.which==1,f=typeof this.options.cancel=="string"?b(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
+this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(d){return c._mouseMove(d)};this._mouseUpDelegate=function(d){return c._mouseUp(d)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=
+true}},_mouseMove:function(a){if(b.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
+if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
+;/*
+ * jQuery UI Position 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
+left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
+k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
+m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
+d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
+a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
+g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
+;/*
+ * jQuery UI Draggable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
+"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
+this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
+this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
+d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
+this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
+this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
+a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
+0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
+this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
+(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),
+height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?
+document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),
+10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),
+10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&
+d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
+this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=
+this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?
+e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
+f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,
+offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.12"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g.refreshPositions();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},
+b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=
+d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};
+a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&
+this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",
+{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+
+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",
+a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+
+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<
+c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+
+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),
+f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=
+c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=
+c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),
+{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=
+parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
+;/*
+ * jQuery UI Droppable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ * jquery.ui.draggable.js
+ */
+(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
+a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
+this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
+this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
+d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
+a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.12"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
+switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
+i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
+"none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
+a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=
+d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})}}})(jQuery);
+;/*
+ * jQuery UI Resizable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
+_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
+top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
+this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
+nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
+String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
+this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
+if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
+d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=
+this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
+this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
+b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;
+f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");
+this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=
+null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+
+this.size.height,k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=
+[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=
+this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,
+a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,
+c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,
+originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.12"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=
+b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width",
+"height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};
+if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-
+g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,
+height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=
+e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,
+d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?
+d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=
+a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&
+/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");
+b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/
+(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
+;/*
+ * jQuery UI Selectable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
+selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
+c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
+c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
+this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
+a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
+!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
+e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.12"})})(jQuery);
+;/*
+ * jQuery UI Sortable 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Sortables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");
+this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=
+b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;
+d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-
+this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
+this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=
+document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);
+return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<
+b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
+b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,
+a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],
+e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();
+c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
+this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,
+dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},
+toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
+this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();
+var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},
+_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();
+if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
+this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),
+this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&
+this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=
+this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=
+d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||
+0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",
+a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-
+f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=
+this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==
+""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=
+this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a=
+{top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
+10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?
+document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
+10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=
+this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&
+this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
+var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-
+this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-
+this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],
+this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]=
+"";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",
+f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,
+this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",
+a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
+_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.12"})})(jQuery);
+;/*
+ * jQuery UI Accordion 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
+a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
+if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
+function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
+this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
+this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
+b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
+a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
+c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
+if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
+if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
+e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
+e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
+"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.12",
+animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
+f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
+paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
+;/*
+ * jQuery UI Autocomplete 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.position.js
+ */
+(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
+false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
+a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
+this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
+a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
+d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
+b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
+this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
+this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
+b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
+d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
+"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
+(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
+-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0)this.element.attr("scrollTop",g+b);else b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},
+deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);
+e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,
+g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));
+this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
+;/*
+ * jQuery UI Button 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(a){var g,i=function(b){a(":ui-button",b.target.form).each(function(){var c=a(this).data("button");setTimeout(function(){c.refresh()},1)})},h=function(b){var c=b.name,d=b.form,f=a([]);if(c)f=d?a(d).find("[name='"+c+"']"):a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form});return f};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",
+i);if(typeof this.options.disabled!=="boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,c=this.options,d=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!d?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",
+function(){if(!c.disabled){a(this).addClass("ui-state-hover");this===g&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||a(this).removeClass(f)}).bind("focus.button",function(){a(this).addClass("ui-state-focus")}).bind("blur.button",function(){a(this).removeClass("ui-state-focus")});d&&this.element.bind("change.button",function(){b.refresh()});if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).toggleClass("ui-state-active");
+b.buttonElement.attr("aria-pressed",b.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed",true);var e=b.element[0];h(e).not(e).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");
+g=this;a(document).one("mouseup",function(){g=null})}).bind("mouseup.button",function(){if(c.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(e){if(c.disabled)return false;if(e.keyCode==a.ui.keyCode.SPACE||e.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",
+c.disabled)},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){var b=this.element.parents().filter(":last"),c="label[for="+this.element.attr("id")+"]";this.buttonElement=b.find(c);if(!this.buttonElement.length){b=b.length?b.siblings():this.element.siblings();this.buttonElement=b.filter(c);if(!this.buttonElement.length)this.buttonElement=b.find(c)}this.element.addClass("ui-helper-hidden-accessible");
+(b=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",b)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());
+this.hasTitle||this.buttonElement.removeAttr("title");a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b);if(this.type==="radio")h(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
+true):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
+c=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,f=d.primary&&d.secondary,e=[];if(d.primary||d.secondary){if(this.options.text)e.push("ui-button-text-icon"+(f?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>");d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>");if(!this.options.text){e.push(f?"ui-button-icons-only":
+"ui-button-icon-only");this.hasTitle||b.attr("title",c)}}else e.push("ui-button-text-only");b.addClass(e.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},
+destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery);
+;/*
+ * jQuery UI Dialog 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.button.js
+ * jquery.ui.draggable.js
+ * jquery.ui.mouse.js
+ * jquery.ui.position.js
+ * jquery.ui.resizable.js
+ */
+(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
+position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
+h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",
+e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
+a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==
+b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=
+1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
+f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,
+function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
+handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,
+originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",
+f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):
+[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);
+if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):
+e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=
+this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-
+b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.12",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
+create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
+height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
+b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,
+function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
+;/*
+ * jQuery UI Slider 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */
+(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");a.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
+this.range=d([]);if(a.range){if(a.range===true){this.range=d("<div></div>");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
+if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length<a.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();
+else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=
+false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h===
+b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
+this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b,
+g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},
+_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;
+if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=
+this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c<e))c=e;if(c!==this.values(a)){e=this.values();e[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:e});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],
+value:c});b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
+this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,a){var c,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
+this.value();else return this._values()},_setOption:function(b,a){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
+this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
+return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
+_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate);
+if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
+1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.12"})})(jQuery);
+;/*
+ * jQuery UI Tabs 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
+e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
+d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
+(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
+this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
+this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
+if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
+this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
+g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
+function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
+this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
+-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
+d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
+d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
+e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
+j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
+if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
+this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
+load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
+"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
+url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.12"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
+a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
+;/*
+ * jQuery UI Datepicker 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker
+ *
+ * Depends:
+ * jquery.ui.core.js
+ */
+(function(d,A){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
+"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
+"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
+minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function F(a,b){d.extend(a,b);for(var c in b)if(b[c]==
+null||b[c]==A)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.12"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){F(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();
+f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
+_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
+b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==
+""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,
+c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),
+true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}F(a.settings,e||{});
+b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);
+this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",
+this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,
+function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:
+f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},
+e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");F(e.settings,f);if(i!==null&&f.dateFormat!==A&&f.minDate===A)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==A&&f.maxDate===A)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},
+_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");
+b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),
+"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?
+-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,
++7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==A?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);
+if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);
+d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");F(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=
+document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");
+var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=
+b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");
+this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+
+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&
+a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():
+0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),
+"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?
+"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=
+d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=
+d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c==
+"M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=
+b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();
+this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);
+a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?
+c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){var v=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&v?4:p=="o"?3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,v,H){p=o(p)?H:v;for(v=0;v<p.length;v++)if(b.substr(s,p[v].length).toLowerCase()==p[v].toLowerCase()){s+=p[v].length;return v+1}throw"Unknown name at position "+
+s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(k)if(a.charAt(z)=="'"&&!o("'"))k=false;else r();else switch(a.charAt(z)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var w=new Date(m("@"));c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case "!":w=new Date((m("!")-this._ticksTo1970)/1E4);c=w.getFullYear();j=w.getMonth()+
+1;l=w.getDate();break;case "'":if(o("'"))r();else k=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",
+RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&
+a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",
+b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
+"0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==A?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
+f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
+(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
+l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
+a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
+b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
+this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+
+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,
+"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=
+this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",D=0;D<i[0];D++){for(var M="",E=0;E<i[1];E++){var N=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(E){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-
+1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&D==0?c?f:n:"")+(/all|right/.test(t)&&D==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,D>0||E>0,z,w)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var B=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=
+(t+h)%7;B+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=B+"</tr></thead><tbody>";B=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,B);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;B=l?6:Math.ceil((t+B)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<B;O++){x+="<tr>";var P=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var G=
+p?p.apply(a.input?a.input[0]:null,[q]):[true,""],C=q.getMonth()!=g,J=C&&!H||!G[0]||k&&q<k||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(C?" ui-datepicker-other-month":"")+(q.getTime()==N.getTime()&&g==a.selectedMonth&&a._keyEvent||L.getTime()==q.getTime()&&L.getTime()==N.getTime()?" "+this._dayOverClass:"")+(J?" "+this._unselectableClass+" ui-state-disabled":"")+(C&&!v?"":" "+G[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":
+""))+'"'+((!C||v)&&G[2]?' title="'+G[2]+'"':"")+(J?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(C&&!v?" ":J?'<span class="ui-state-default">'+q.getDate()+"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==u.getTime()?" ui-state-active":"")+(C?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=
+P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&E==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',
+o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&
+l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+
+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";if(d.browser.mozilla)k+='<select class="ui-datepicker-year"><option value="'+c+'" selected="selected">'+c+"</option></select>";else{k+=a.yearshtml;a.yearshtml=null}}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=
+a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,
+"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
+c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
+"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
+function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,
+[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.12";window["DP_jQuery_"+y]=d})(jQuery);
+;/*
+ * jQuery UI Progressbar 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
+this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
+this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.12"})})(jQuery);
+;/*
+ * jQuery UI Effects 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/
+ */
+jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
+16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
+a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
+a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
+"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
+0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
+211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
+d){if(f.isFunction(b)){d=b;b=null}return this.queue("fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l=h.splice(h.length-1,1)[0];
+h.splice(1,0,l);f.dequeue(this)})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,
+a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.12",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,
+a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",
+border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);
+return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments);
+else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),
+b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,
+a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,
+a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==
+e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=
+g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
+h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,
+a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
+;/*
+ * jQuery UI Effects Blind 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Blind
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
+g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
+;/*
+ * jQuery UI Effects Bounce 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Bounce
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
+3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
+b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
+;/*
+ * jQuery UI Effects Clip 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Clip
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
+c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Drop 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Drop
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
+"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Explode 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Explode
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
+0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
+e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
+;/*
+ * jQuery UI Effects Fade 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Fade
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Fold 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Fold
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
+10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
+;/*
+ * jQuery UI Effects Highlight 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Highlight
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
+this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Pulsate 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Pulsate
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
+a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
+;/*
+ * jQuery UI Effects Scale 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Scale
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
+b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
+1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
+p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
+if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
+a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
+child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
+n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Shake 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Shake
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
+(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
+;/*
+ * jQuery UI Effects Slide 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Slide
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
+var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
+;/*
+ * jQuery UI Effects Transfer 1.8.12
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Transfer
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */
+(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
+b.dequeue()})})}})(jQuery);
+;
\ No newline at end of file
--- /dev/null
+// ColorBox v1.3.16 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+\r
+// Copyright (c) 2011 Jack Moore - jack@colorpowered.com\r
+// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php\r
+(function(a,b,c){function ba(b){if(!T){O=b,Z(a.extend(J,a.data(O,e))),x=a(O),P=0,J.rel!=="nofollow"&&(x=a("."+V).filter(function(){var b=a.data(this,e).rel||this.rel;return b===J.rel}),P=x.index(O),P===-1&&(x=x.add(O),P=x.length-1));if(!R){R=S=!0,q.show();if(J.returnFocus)try{O.blur(),a(O).one(k,function(){try{this.focus()}catch(a){}})}catch(c){}p.css({opacity:+J.opacity,cursor:J.overlayClose?"pointer":"auto"}).show(),J.w=X(J.initialWidth,"x"),J.h=X(J.initialHeight,"y"),U.position(0),n&&y.bind("resize."+o+" scroll."+o,function(){p.css({width:y.width(),height:y.height(),top:y.scrollTop(),left:y.scrollLeft()})}).trigger("resize."+o),$(g,J.onOpen),I.add(C).hide(),H.html(J.close).show()}U.load(!0)}}function _(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;J.slideshow&&x[1]&&(d=function(){E.text(J.slideshowStop).unbind(c).bind(i,function(){if(P<x.length-1||J.loop)a=setTimeout(U.next,J.slideshowSpeed)}).bind(h,function(){clearTimeout(a)}).one(c+" "+j,e),q.removeClass(b+"off").addClass(b+"on"),a=setTimeout(U.next,J.slideshowSpeed)},e=function(){clearTimeout(a),E.text(J.slideshowStart).unbind([i,h,j,c].join(" ")).one(c,d),q.removeClass(b+"on").addClass(b+"off")},J.slideshowAuto?d():e())}function $(b,c){c&&c.call(O),a.event.trigger(b)}function Z(b){for(var c in b)a.isFunction(b[c])&&c.substring(0,2)!=="on"&&(b[c]=b[c].call(O));b.rel=b.rel||O.rel||"nofollow",b.href=a.trim(b.href||a(O).attr("href")),b.title=b.title||O.title}function Y(a){return J.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function X(a,b){b=b==="x"?y.width():y.height();return typeof a=="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function W(c,d){var e=b.createElement("div");c&&(e.id=f+c),e.style.cssText=d||!1;return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0},e="colorbox",f="cbox",g=f+"_open",h=f+"_load",i=f+"_complete",j=f+"_cleanup",k=f+"_closed",l=f+"_purge",m=a.browser.msie&&!a.support.opacity,n=m&&a.browser.version<7,o=f+"_IE6",p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K,L,M,N,O,P,Q,R,S,T=!1,U,V=f+"Element";U=a.fn[e]=a[e]=function(b,c){var f=this,g;if(!f[0]&&f.selector)return f;b=b||{},c&&(b.onComplete=c);if(!f[0]||f.selector===undefined)f=a("<a/>"),b.open=!0;f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(V)}),g=b.open,a.isFunction(g)&&(g=g.call(f)),g&&ba(f[0]);return f},U.init=function(){y=a(c),q=W().attr({id:e,"class":m?f+(n?"IE6":"IE"):""}),p=W("Overlay",n?"position:absolute":"").hide(),r=W("Wrapper"),s=W("Content").append(z=W("LoadedContent","width:0; height:0; overflow:hidden"),B=W("LoadingOverlay").add(W("LoadingGraphic")),C=W("Title"),D=W("Current"),F=W("Next"),G=W("Previous"),E=W("Slideshow").bind(g,_),H=W("Close")),r.append(W().append(W("TopLeft"),t=W("TopCenter"),W("TopRight")),W(!1,"clear:left").append(u=W("MiddleLeft"),s,v=W("MiddleRight")),W(!1,"clear:left").append(W("BottomLeft"),w=W("BottomCenter"),W("BottomRight"))).children().children().css({"float":"left"}),A=W(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(p,q.append(r,A)),s.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),K=t.height()+w.height()+s.outerHeight(!0)-s.height(),L=u.width()+v.width()+s.outerWidth(!0)-s.width(),M=z.outerHeight(!0),N=z.outerWidth(!0),q.css({"padding-bottom":K,"padding-right":L}).hide(),F.click(function(){U.next()}),G.click(function(){U.prev()}),H.click(function(){U.close()}),I=F.add(G).add(D).add(E),s.children().removeClass("hover"),a("."+V).live("click",function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),ba(this))}),p.click(function(){J.overlayClose&&U.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;R&&J.escKey&&b===27&&(a.preventDefault(),U.close()),R&&J.arrowKey&&x[1]&&(b===37?(a.preventDefault(),G.click()):b===39&&(a.preventDefault(),F.click()))})},U.remove=function(){q.add(p).remove(),a("."+V).die("click").removeData(e).removeClass(V)},U.position=function(a,c){function g(a){t[0].style.width=w[0].style.width=s[0].style.width=a.style.width,B[0].style.height=B[1].style.height=s[0].style.height=u[0].style.height=v[0].style.height=a.style.height}var d,e=Math.max(b.documentElement.clientHeight-J.h-M-K,0)/2+y.scrollTop(),f=Math.max(y.width()-J.w-N-L,0)/2+y.scrollLeft();d=q.width()===J.w+N&&q.height()===J.h+M?0:a,r[0].style.width=r[0].style.height="9999px",q.dequeue().animate({width:J.w+N,height:J.h+M,top:e,left:f},{duration:d,complete:function(){g(this),S=!1,r[0].style.width=J.w+N+L+"px",r[0].style.height=J.h+M+K+"px",c&&c()},step:function(){g(this)}})},U.resize=function(a){if(R){a=a||{},a.width&&(J.w=X(a.width,"x")-N-L),a.innerWidth&&(J.w=X(a.innerWidth,"x")),z.css({width:J.w}),a.height&&(J.h=X(a.height,"y")-M-K),a.innerHeight&&(J.h=X(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=z.wrapInner("<div style='overflow:auto'></div>").children();J.h=b.height(),b.replaceWith(b.children())}z.css({height:J.h}),U.position(J.transition==="none"?0:J.speed)}},U.prep=function(b){function h(b){U.position(b,function(){var b,d,g,h,j=x.length,k,n;!R||(n=function(){B.hide(),$(i,J.onComplete)},m&&Q&&z.fadeIn(100),C.html(J.title).add(z).show(),j>1?(typeof J.current=="string"&&D.html(J.current.replace(/\{current\}/,P+1).replace(/\{total\}/,j)).show(),F[J.loop||P<j-1?"show":"hide"]().html(J.next),G[J.loop||P?"show":"hide"]().html(J.previous),b=P?x[P-1]:x[j-1],g=P<j-1?x[P+1]:x[0],J.slideshow&&E.show(),J.preloading&&(h=a.data(g,e).href||g.href,d=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,d=a.isFunction(d)?d.call(b):d,Y(h)&&(a("<img/>")[0].src=h),Y(d)&&(a("<img/>")[0].src=d))):I.hide(),J.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],J.fastIframe?n():a(k).load(n),k.name=f+ +(new Date),k.src=J.href,J.scrolling||(k.scrolling="no"),m&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(z).one(l,function(){k.src="//about:blank"})):n(),J.transition==="fade"?q.fadeTo(c,1,function(){q[0].style.filter=""}):q[0].style.filter="",y.bind("resize."+f,function(){U.position(0)}))})}function g(){J.h=J.h||z.height(),J.h=J.mh&&J.mh<J.h?J.mh:J.h;return J.h}function d(){J.w=J.w||z.width(),J.w=J.mw&&J.mw<J.w?J.mw:J.w;return J.w}if(!!R){var c=J.transition==="none"?0:J.speed;y.unbind("resize."+f),z.remove(),z=W("LoadedContent").html(b),z.hide().appendTo(A.show()).css({width:d(),overflow:J.scrolling?"auto":"hidden"}).css({height:g()}).prependTo(s),A.hide(),a(Q).css({"float":"none"}),n&&a("select").not(q.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(j,function(){this.style.visibility="inherit"}),J.transition==="fade"?q.fadeTo(c,0,function(){h(0)}):h(c)}},U.load=function(b){var c,d,g=U.prep;S=!0,Q=!1,O=x[P],b||Z(a.extend(J,a.data(O,e))),$(l),$(h,J.onLoad),J.h=J.height?X(J.height,"y")-M-K:J.innerHeight&&X(J.innerHeight,"y"),J.w=J.width?X(J.width,"x")-N-L:J.innerWidth&&X(J.innerWidth,"x"),J.mw=J.w,J.mh=J.h,J.maxWidth&&(J.mw=X(J.maxWidth,"x")-N-L,J.mw=J.w&&J.w<J.mw?J.w:J.mw),J.maxHeight&&(J.mh=X(J.maxHeight,"y")-M-K,J.mh=J.h&&J.h<J.mh?J.h:J.mh),c=J.href,B.show(),J.inline?(W().hide().insertBefore(a(c)[0]).one(l,function(){a(this).replaceWith(z.children())}),g(a(c))):J.iframe?g(" "):J.html?g(J.html):Y(c)?(a(Q=new Image).addClass(f+"Photo").error(function(){J.title=!1,g(W("Error").text("This image could not be loaded"))}).load(function(){var a;Q.onload=null,J.scalePhotos&&(d=function(){Q.height-=Q.height*a,Q.width-=Q.width*a},J.mw&&Q.width>J.mw&&(a=(Q.width-J.mw)/Q.width,d()),J.mh&&Q.height>J.mh&&(a=(Q.height-J.mh)/Q.height,d())),J.h&&(Q.style.marginTop=Math.max(J.h-Q.height,0)/2+"px"),x[1]&&(P<x.length-1||J.loop)&&(Q.style.cursor="pointer",Q.onclick=function(){U.next()}),m&&(Q.style.msInterpolationMode="bicubic"),setTimeout(function(){g(Q)},1)}),setTimeout(function(){Q.src=c},1)):c&&A.load(c,function(b,c,d){g(c==="error"?W("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},U.next=function(){!S&&x[1]&&(P<x.length-1||J.loop)&&(P=P<x.length-1?P+1:0,U.load())},U.prev=function(){!S&&x[1]&&(P||J.loop)&&(P=P?P-1:x.length-1,U.load())},U.close=function(){R&&!T&&(T=!0,R=!1,$(j,J.onCleanup),y.unbind("."+f+" ."+o),p.fadeTo(200,0),q.stop().fadeTo(300,0,function(){q.add(p).css({opacity:1,cursor:"auto"}).hide(),$(l),z.remove(),setTimeout(function(){T=!1,$(k,J.onClosed)},1)}))},U.element=function(){return a(O)},U.settings=d,a(U.init)})(jQuery,document,this);
\ No newline at end of file
--- /dev/null
+function prepare_password(session_id)
+{ document.forms["login_form"].pass.value = MD5(MD5(document.forms["login_form"].password.value) + session_id);
+ document.forms['login_form'].password.value = "";
+ return true;
+}
--- /dev/null
+/*
+ * md5.js 1.0b 27/06/96
+ *
+ * Javascript implementation of the RSA Data Security, Inc. MD5
+ * Message-Digest Algorithm.
+ *
+ * Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for any purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies.
+ *
+ * Of course, this soft is provided "as is" without express or implied
+ * warranty of any kind.
+ *
+ *
+ * Modified with german comments and some information about collisions.
+ * (Ralf Mieke, ralf@miekenet.de, http://mieke.home.pages.de)
+ * French translation: Serge François, serge@selfhtml.org, http://fr.selfhtml.org
+ */
+
+
+
+function array(n) {
+ for(i=0;i<n;i++) this[i]=0;
+ this.length=n;
+}
+
+
+
+/* Quelques fonctions fondamentales doivent être transformées à cause
+ * d'erreurs Javascript.
+ * Essayez par exemple de calculer 0xffffffff >> 4 ...
+ * Les fonctions utilisées maintenant sont il est vrai plus lentes que les
+ * fonctions originales mais elles fonctionnent.
+ */
+
+function integer(n) { return n%(0xffffffff+1); }
+
+function shr(a,b) {
+ a=integer(a);
+ b=integer(b);
+ if (a-0x80000000>=0) {
+ a=a%0x80000000;
+ a>>=b;
+ a+=0x40000000>>(b-1);
+ } else
+ a>>=b;
+ return a;
+}
+
+function shl1(a) {
+ a=a%0x80000000;
+ if (a&0x40000000==0x40000000)
+ {
+ a-=0x40000000;
+ a*=2;
+ a+=0x80000000;
+ } else
+ a*=2;
+ return a;
+}
+
+function shl(a,b) {
+ a=integer(a);
+ b=integer(b);
+ for (var i=0;i<b;i++) a=shl1(a);
+ return a;
+}
+
+function and(a,b) {
+ a=integer(a);
+ b=integer(b);
+ var t1=(a-0x80000000);
+ var t2=(b-0x80000000);
+ if (t1>=0)
+ if (t2>=0)
+ return ((t1&t2)+0x80000000);
+ else
+ return (t1&b);
+ else
+ if (t2>=0)
+ return (a&t2);
+ else
+ return (a&b);
+}
+
+function or(a,b) {
+ a=integer(a);
+ b=integer(b);
+ var t1=(a-0x80000000);
+ var t2=(b-0x80000000);
+ if (t1>=0)
+ if (t2>=0)
+ return ((t1|t2)+0x80000000);
+ else
+ return ((t1|b)+0x80000000);
+ else
+ if (t2>=0)
+ return ((a|t2)+0x80000000);
+ else
+ return (a|b);
+}
+
+function xor(a,b) {
+ a=integer(a);
+ b=integer(b);
+ var t1=(a-0x80000000);
+ var t2=(b-0x80000000);
+ if (t1>=0)
+ if (t2>=0)
+ return (t1^t2);
+ else
+ return ((t1^b)+0x80000000);
+ else
+ if (t2>=0)
+ return ((a^t2)+0x80000000);
+ else
+ return (a^b);
+}
+
+function not(a) {
+ a=integer(a);
+ return (0xffffffff-a);
+}
+
+/* Début de l'algorithme */
+
+ var state = new array(4);
+ var count = new array(2);
+ count[0] = 0;
+ count[1] = 0;
+ var buffer = new array(64);
+ var transformBuffer = new array(16);
+ var digestBits = new array(16);
+
+ var S11 = 7;
+ var S12 = 12;
+ var S13 = 17;
+ var S14 = 22;
+ var S21 = 5;
+ var S22 = 9;
+ var S23 = 14;
+ var S24 = 20;
+ var S31 = 4;
+ var S32 = 11;
+ var S33 = 16;
+ var S34 = 23;
+ var S41 = 6;
+ var S42 = 10;
+ var S43 = 15;
+ var S44 = 21;
+
+ function F(x,y,z) {
+ return or(and(x,y),and(not(x),z));
+ }
+
+ function G(x,y,z) {
+ return or(and(x,z),and(y,not(z)));
+ }
+
+ function H(x,y,z) {
+ return xor(xor(x,y),z);
+ }
+
+ function I(x,y,z) {
+ return xor(y ,or(x , not(z)));
+ }
+
+ function rotateLeft(a,n) {
+ return or(shl(a, n),(shr(a,(32 - n))));
+ }
+
+ function FF(a,b,c,d,x,s,ac) {
+ a = a+F(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a+b;
+ return a;
+ }
+
+ function GG(a,b,c,d,x,s,ac) {
+ a = a+G(b, c, d) +x + ac;
+ a = rotateLeft(a, s);
+ a = a+b;
+ return a;
+ }
+
+ function HH(a,b,c,d,x,s,ac) {
+ a = a+H(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a+b;
+ return a;
+ }
+
+ function II(a,b,c,d,x,s,ac) {
+ a = a+I(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a+b;
+ return a;
+ }
+
+ function transform(buf,offset) {
+ var a=0, b=0, c=0, d=0;
+ var x = transformBuffer;
+
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+
+ for (i = 0; i < 16; i++) {
+ x[i] = and(buf[i*4+offset],0xff);
+ for (j = 1; j < 4; j++) {
+ x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8);
+ }
+ }
+
+ /* tour 1 */
+ a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+ d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+ c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+ b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+ a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+ d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+ c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+ b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+ a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+ d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+ c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+ b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+ a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+ d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+ c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+ b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+ /* tour 2 */
+ a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+ d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+ c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+ b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+ a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+ d = GG ( d, a, b, c, x[10], S22, 0x2441453); /* 22 */
+ c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+ b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+ a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+ d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+ c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+ b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+ a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+ d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+ c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+ b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+ /* tour 3 */
+ a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+ d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+ c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+ b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+ a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+ d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+ c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+ b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+ a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+ d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+ c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+ b = HH ( b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
+ a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+ d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+ c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+ b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+ /* tour 4 */
+ a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+ d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+ c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+ b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+ a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+ d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+ c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+ b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+ a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+ d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+ c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+ b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+ a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+ d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+ c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+ b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+ state[0] +=a;
+ state[1] +=b;
+ state[2] +=c;
+ state[3] +=d;
+
+ }
+ /* Avec l'initialisation de Dobbertin:
+ state[0] = 0x12ac2375;
+ state[1] = 0x3b341042;
+ state[2] = 0x5f62b97c;
+ state[3] = 0x4ba763ed;
+ s'il y a une collision:
+
+ begin 644 Message1
+ M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
+ 39GIK9>TF$W()/MEHR%C4:G1R:Q"=
+ `
+ end
+
+ begin 644 Message2
+ M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
+ 39GIK9>TF$W()/MEHREC4:G1R:Q"=
+ `
+ end
+ */
+ function init() {
+ count[0]=count[1] = 0;
+ state[0] = 0x67452301;
+ state[1] = 0xefcdab89;
+ state[2] = 0x98badcfe;
+ state[3] = 0x10325476;
+ for (i = 0; i < digestBits.length; i++)
+ digestBits[i] = 0;
+ }
+
+ function update(b) {
+ var index,i;
+
+ index = and(shr(count[0],3) , 0x3f);
+ if (count[0]<0xffffffff-7)
+ count[0] += 8;
+ else {
+ count[1]++;
+ count[0]-=0xffffffff+1;
+ count[0]+=8;
+ }
+ buffer[index] = and(b,0xff);
+ if (index >= 63) {
+ transform(buffer, 0);
+ }
+ }
+
+ function finish() {
+ var bits = new array(8);
+ var padding;
+ var i=0, index=0, padLen=0;
+
+ for (i = 0; i < 4; i++) {
+ bits[i] = and(shr(count[0],(i * 8)), 0xff);
+ }
+ for (i = 0; i < 4; i++) {
+ bits[i+4]=and(shr(count[1],(i * 8)), 0xff);
+ }
+ index = and(shr(count[0], 3) ,0x3f);
+ padLen = (index < 56) ? (56 - index) : (120 - index);
+ padding = new array(64);
+ padding[0] = 0x80;
+ for (i=0;i<padLen;i++)
+ update(padding[i]);
+ for (i=0;i<8;i++)
+ update(bits[i]);
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff);
+ }
+ }
+ }
+
+/* Fin de l'algorithme MD5 */
+
+function hexa(n) {
+ var hexa_h = "0123456789abcdef";
+ var hexa_c="";
+ var hexa_m=n;
+ for (hexa_i=0;hexa_i<8;hexa_i++) {
+ hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;
+ hexa_m=Math.floor(hexa_m/16);
+ }
+ return hexa_c;
+}
+
+
+var ascii="01234567890123456789012345678901" +
+ " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
+ "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
+
+function MD5(message)
+{
+ var l,s,k,ka,kb,kc,kd;
+
+ init();
+ for (k=0;k<message.length;k++) {
+ l=message.charAt(k);
+ update(ascii.lastIndexOf(l));
+ }
+ finish();
+ ka=kb=kc=kd=0;
+ for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8));
+ for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8));
+ for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8));
+ for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8));
+ s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka);
+ return s;
+}
--- /dev/null
+$(document).ready
+( function ()
+ { init_menu_links();
+ }
+);
+
+// ---------------------------------------- menus header
+
+var menu = null;
+
+function checkHover()
+{ if(menu) menu.find('ul').fadeOut('fast');
+}
+
+function init_menu_links()
+{ $('.menu li').hover
+ ( function()
+ { if(menu)
+ { menu.find('ul').fadeOut('fast');
+ menu = null;
+ }
+ $(this).find('ul').fadeIn('fast');
+ },
+ function()
+ { menu = $(this);
+ setTimeout("checkHover()", 80);
+ }
+ );
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+
+ <admin page="admin.php">
+ <index content="views/admin/index.php" />
+ <users>
+ <index content="views/admin/users/list.php" />
+ <add content="views/admin/users/add.php" />
+ <edit content="views/admin/users/edit.php" />
+ </users>
+ <config content="views/admin/config.php" />
+ <plugins>
+ <index content="views/admin/plugins/list.php" />
+ </plugins>
+ </admin>
+
+</layout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+
+ <content page="content.php">
+ </content>
+
+</layout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+
+ <forms page="pages.php">
+ <contact>
+ <index content="views/forms/contact/index.php" />
+ </contact>
+ </forms>
+
+</layout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+
+ <index page="index.php" />
+
+</layout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+
+ <reponses page="content.php">
+ <html>
+ <erreur page="html_reponse.php" content="views/erreur.php" />
+ <redirect_javascript page="html_reponse.php" content="views/redirect_javascript.php" />
+ </html>
+ </reponses>
+
+</layout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+
+ <users page="index.php">
+ <identification content="views/users/identification.php" />
+ <infos page="compte.php" content="views/users/infos/edit.php" />
+ </users>
+
+</layout>
\ No newline at end of file
--- /dev/null
+<?php $data = $this->data(); if(($admin_menu = $data->get_link("admin")) && $admin_menu["subs"]) : ?>
+<ul class="menu">
+ <?php foreach($admin_menu["subs"] as $link) : ?>
+ <li><a href="<?= $link["url"] ?>"><?= $link["intitule"] ?></a></li>
+ <?php endforeach; ?>
+</ul>
+<?php endif; ?>
\ No newline at end of file
--- /dev/null
+<h2>Configuration</h2>
+
+<h3>Générale</h3>
+
+<form name="config_form" action="<?= $this->url("admin/config") ?>" method="post">
+ <ul class="form">
+ <li>
+ <label for="site_name">nom du site</label>
+ <p>
+ <input type="text" name="site_name" id="site_name" value="<?= $this->out["config"]["site_name"] ?>" />
+ </p>
+ </li>
+ <li>
+ <label for="description">description</label>
+ <p>
+ <textarea cols="50" rows="10" name="description" id="description"><?= $this->out["config"]["description"] ?></textarea>
+ </p>
+ </li>
+<?php if($this->out["groupes"]["list"]) : ?>
+ <li>
+ <label for="start_action">Accueil du site</label>
+ <p>
+ <select name="start_action" id="start_action" onchange="select_start_action(this.options[this.selectedIndex].value)">
+ <option value="sources/groupe"<?= "sources/groupe" == $this->out["config"]["start_action"] ? " selected" : "" ?>>Liste des groupes</option>
+ <option value="sources/groupe/view"<?= "sources/groupe/view" == $this->out["config"]["start_action"] ? " selected" : "" ?>>Un groupe</option>
+<?php if($this->out["albums"]["list"]) : ?>
+ <option value="sources/album/view"<?= "sources/album/view" == $this->out["config"]["start_action"] ? " selected" : "" ?>>Un album</option>
+<?php endif; ?>
+ </select>
+ <select name="groupe_param" id="groupe_param"<?php if($this->out["config"]["start_action"] != "sources/groupe/view") : ?> style="display:none;"<?php endif; ?>>
+ <?php foreach($this->out["groupes"]["list"] as $id_groupe => $groupe) : ?>
+ <option value="<?= $id_groupe ?>"<?= $this->out["config"]["start_action_params"]["id"] == $id_groupe ? " selected=\"selected\"" : "" ?>><?= $groupe["nom"] ?></option>
+ <?php endforeach; ?>
+ </select>
+<?php if($this->out["albums"]["list"]) : ?>
+ <select name="album_param" id="album_param"<?php if($this->out["config"]["start_action"] != "sources/album/view") : ?> style="display:none;"<?php endif; ?>>
+ <?php foreach($this->out["albums"]["list"] as $id_album => $album) : ?>
+ <option value="<?= $id_album ?>"<?= $this->out["config"]["start_action_params"]["album"] == $id_album ? " selected=\"selected\"" : "" ?>><?= $album["titre"] ?></option>
+ <?php endforeach; ?>
+ </select>
+<?php endif; ?>
+ </p>
+ </li>
+<?php endif; ?>
+ <li>
+ <label for="contact_form">formulaire de contact</label>
+ <p>
+ <input type="checkbox" name="contact_form" id="contact_form"<?= $this->out["config"]["contact_form"] ? " checked=\"checked\"" : "" ?> />
+ </p>
+ </li>
+ <li id="email_li"<?= $this->out["config"]["contact_form"] ? "" : " style=\"display:none;\"" ?>>
+ <label for="email">email</label>
+ <div>
+ <div><p>
+ <input type="text" name="email" id="email" value="<?= $this->out["config"]["email"] ?>" /><br />
+ <br /><input type="checkbox" name="captcha" id="captcha"<?= $this->out["config"]["captcha"] ? " checked=\"checked\"" : "" ?> /> anti-spam
+ </p></div>
+ </div>
+ </li>
+ <li>
+ <label for="max_list">taille maximum des listes</label>
+ <p>
+ <span>nombre d'éléments à afficher dans une liste avant de paginer :</span>
+ <input type="text" name="max_list" id="max_list" value="<?= $this->out["config"]["max_list"] ?>" />
+ </p>
+ </li>
+ </ul>
+
+<h3>Affichage du site</h3>
+
+ <ul class="form">
+
+
+ <li>
+ <label for="out">template</label>
+<?php
+
+ $template = $this->config("out");
+ $FOUND = false;
+ foreach($this->out["out_pathes"] as $out_path) { if($template == $out_path."/") { $FOUND = true; break; } }
+ if(!$FOUND) $template = $this->path("dist_out");
+
+?>
+ <p>
+<?php if($this->out["out_pathes"]) : ?>
+ <select name="out" id="out">
+<?php foreach($this->out["out_pathes"] as $out_path) : ?>
+ <option value="<?= $out_path ?>"<?= $template == $out_path."/" ? " selected=\"selected\"" : "" ?>><?= $out_path ?></option>
+<?php endforeach; ?>
+ </select>
+<?php else : ?>
+ <strong class="warn">Aucun dossier d'affichage ! ... ?</strong>
+<?php endif; ?>
+
+ </p>
+ </li>
+
+<?php foreach($this->out["out_config"] as $key => $config) : ?>
+<?php if($config["type"] == "checkbox") : ?>
+ <li>
+ <label for="<?= "out_".$key ?>"> </label>
+ <p>
+ <input type="checkbox" name="<?= "out_".$key ?>" id="<?= "out_".$key ?>"<?= (isset($this->out["config"]["out_".$key]) ? $this->out["config"]["out_".$key] : $config["default"]) ? " checked=\"checked\"" : "" ?> />
+ <?= $config["text"] ?>
+ </p>
+ </li>
+<?php endif; ?>
+<?php endforeach; ?>
+ <li class="buttons">
+ <input type="submit" value="Enregistrer" />
+ </li>
+ </ul>
+</form>
--- /dev/null
+<h2>Admin</h2>
\ No newline at end of file
--- /dev/null
+<h2>Les plugins</h2>
+
+<?php if($this->out["plugins"]) : ?>
+
+<form name="plugins_form" action="<?= $this->url("admin/plugins") ?>" method="post">
+ <ul class="plugins">
+ <?php $data = $this->data(); foreach($this->out["plugins"] as $plugin_name => $plugin) : ?>
+ <li class="<?= $plugin["installed"] ? ($plugin["enabled"] ? "enabled" : "disabled") : "uninstalled" ?>">
+ <div>
+ <p class="folder">dossier <strong><?= $plugin_name ?></strong></p>
+ <h3><?= $plugin["title"] ?></h3>
+ <div class="clear"><!-- --></div>
+ <?= $plugin["description"] ?>
+ <ul class="plugin_links">
+ <?php if($plugin["installed"]) : ?>
+ <li><a href="<?= $this->url("admin/plugins/uninstall", array("id" => $plugin_name)) ?>"
+ onclick="return confirm('si le plugin stocke des donnees, elles seront perdues')">désinstaller</a></li>
+ <?php if($plugin["enabled"]) : ?>
+ <?php if(($admin_link = $data->get_link("plugins/admin/".$plugin_name)) && $admin_link["url"]) : ?>
+ <li><a href="<?= $admin_link["url"] ?>"><?= $admin_link["intitule"] ?></a></li>
+ <?php endif; ?>
+ <li><a href="<?= $this->url("admin/plugins/disable", array("id" => $plugin_name)) ?>">désactiver</a></li>
+ <?php else : ?>
+ <li><a href="<?= $this->url("admin/plugins/enable", array("id" => $plugin_name)) ?>">activer</a></li>
+ <?php endif; ?>
+ <?php else : ?>
+ <li><a href="<?= $this->url("admin/plugins/install", array("id" => $plugin_name)) ?>">installer</a></li>
+ <?php endif; ?>
+ <li>priorité : <input type="text" size="4" name="priorite_<?= $plugin_name ?>" value="<?= $plugin["priorite"] ? $plugin["priorite"] : "0" ?>" /></li>
+ </ul>
+ </div>
+ </li>
+ <?php endforeach; ?>
+ <li class="buttons">
+ <input type="submit" value="Enregistrer les priorités" />
+ </li>
+ </ul>
+</form>
+
+<?php else : ?>
+
+<p>Aucun plugin pour le moment.</p>
+
+<?php endif; ?>
--- /dev/null
+<h2>Nouvel utilisateur</h2>
+
+<ul class="admin">
+ <li><a href="<?= $this->url("admin/users") ?>">Retour à la liste des utilisateurs</a></li>
+</ul>
+
+<form name="user_form" action="<?= $this->url("admin/users/add") ?>" method="post">
+ <ul class="form">
+ <li>
+ <label for="login">login</label>
+ <input type="text" name="login" id="login" value="<?= isset($this->out["user"]["login"]) ? $this->out["user"]["login"] : "" ?>" />
+ </li>
+ <li>
+ <label for="status">statut</label>
+ <select name="status" id="status">
+ <?php foreach($this->out["status"] as $id_status => $status) : ?>
+ <option value="<?= $id_status ?>"<?= $this->out["user"]["status"] == $id_status ? " selected" : "" ?>>
+ <?= $status["nom"] ?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li>
+ <label for="email">email</label>
+ <input type="text" name="email" id="email" value="<?= isset($this->out["user"]["email"]) ? $this->out["user"]["email"] : "" ?>" />
+ </li>
+ <li>
+ <label for="password">mot de passe</label>
+ <input type="password" name="password" id="password" />
+ </li>
+ <li>
+ <label for="password_confirm">confirmer le mot de passe</label>
+ <input type="password" name="password_confirm" id="password_confirm" />
+ </li>
+ <li class="buttons">
+ <input type="submit" value="Ajouter" />
+ </li>
+ </ul>
+</form>
\ No newline at end of file
--- /dev/null
+<h2>Modifier un utilisateur</h2>
+
+<ul class="admin">
+ <li><a href="<?= $this->url("admin/users") ?>">Retour à la liste des utilisateurs</a></li>
+</ul>
+
+<form name="user_form" action="<?= $this->url("admin/users/edit", array("id" => $_GET[$this->param("id")])) ?>" method="post">
+ <ul class="form">
+ <li>
+ <label for="login">login</label>
+ <input type="text" name="login" id="login" value="<?= $this->out["user"]["login"] ?>" disabled="disabled" />
+ </li>
+ <li>
+ <label for="status">statut</label>
+ <select name="status" id="status">
+ <?php foreach($this->out["status"] as $id_status => $status) : ?>
+ <option value="<?= $id_status ?>"<?= $this->out["user"]["status"] == $id_status ? " selected" : "" ?>>
+ <?= $status["nom"] ?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <li>
+ <label for="email">email</label>
+ <input type="text" name="email" id="email" value="<?= $this->out["user"]["email"] ?>" />
+ </li>
+ <li>
+ <label for="change_password">changer le mot de passe</label>
+ <input type="checkbox" name="change_password" id="change_password" <?= isset($_POST["change_password"]) && $_POST["change_password"] ? "checked=\"checked\"" : "" ?>/>
+ </li>
+ <li>
+ <label for="password">mot de passe</label>
+ <input type="password" name="password" id="password" />
+ </li>
+ <li>
+ <label for="password_confirm">confirmer le mot de passe</label>
+ <input type="password" name="password_confirm" id="password_confirm" />
+ </li>
+ <li class="buttons">
+ <input type="submit" value="Enregistrer" />
+ </li>
+ </ul>
+</form>
\ No newline at end of file
--- /dev/null
+<h2>Les utilisateurs</h2>
+
+<ul class="admin">
+ <li><a class="add" href="<?= $this->url("admin/users/add") ?>">Nouvel utilisateur</a></li>
+</ul>
+
+<?php
+
+ $users_params = array();
+ if($_GET[$this->param("status")]) $users_params["status"] = $_GET[$this->param("status")];
+
+?>
+<ul class="admin">
+ <li>Afficher les utilisateurs pour</li>
+ <li>
+ <select onchange="document.location=this.options[this.selectedIndex].value;">
+ <option value="<?= $this->url("admin/users", $users_params) ?>"<?= $_GET[$this->param("alpha")] ? "" : " selected=\"selected\"" ?>>Tous les logins</option>
+ <?php for($i = 65; $i <= 90; $i++) : $users_params["alpha"] = chr($i); ?>
+ <option value="<?= $this->url("admin/users", $users_params) ?>"<?= $_GET[$this->param("alpha")] == chr($i) ? " selected=\"selected\"" : "" ?>><?= chr($i) ?></option>
+ <?php endfor; ?>
+ </select>
+ </li>
+ <?php
+
+ if($this->out["status"]) :
+ if($_GET[$this->param("alpha")]) $users_params["alpha"] = $_GET[$this->param("alpha")];
+ else unset($users_params["alpha"]);
+ unset($users_params["status"]);
+
+?>
+ <li>
+ <select onchange="document.location=this.options[this.selectedIndex].value;">
+ <option value="<?= $this->url("admin/users", $users_params) ?>"<?= $_GET[$this->param("status")] ? "" : " selected=\"selected\"" ?>>Tous les status</option>
+ <?php foreach($this->out["status"] as $user_status) : $users_params["status"] = $user_status["id"]; ?>
+ <option value="<?= $this->url("admin/users", $users_params) ?>"<?= $_GET[$this->param("status")] == $user_status["id"] ? " selected=\"selected\"" : "" ?>><?= $user_status["nom"] ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+ <?php endif; ?>
+</ul>
+
+
+
+
+<br/><br/>
+
+<?php if($this->out["users"]["total"] > $this->config("max_list")) : ?>
+
+<?php $items = "users"; $legend = "utilisateurs"; require $this->out_file("views/navig.php"); ?>
+
+<?php endif; ?>
+
+<table class="admin">
+ <tr>
+ <th>login</th>
+ <th>email</th>
+ <th>statut</th>
+ <th align="center" colspan="2">actions</th>
+ </tr>
+<?php if($this->out["users"]["list"]) : ?>
+<?php foreach($this->out["users"]["list"] as $id_user => $user) : ?>
+ <tr class="hl">
+ <td><?= $user["login"] ?></td>
+ <td><a href="mailto:<?= $user["email"] ?>"><?= $user["email"] ?></a></td>
+ <td><?= $this->out["status"][$user["status"]]["nom"] ?></td>
+ <td class="action">
+ <a href="<?= $this->url("admin/users/edit", array("id" => $user["login"])) ?>"
+ class="admin_link"
+ title="modifier cet utilisateur"><img src="<?= $this->out_file("icons/edit.gif") ?>" /></a>
+ </td>
+ <td class="action">
+ <a href="<?= $this->url("admin/users/del", array("id" => $user["login"])) ?>"
+ class="admin_link"
+ title="supprimer cet utilisateur"><img src="<?= $this->out_file("icons/del.gif") ?>"
+ onclick="return confirm('Supprimer cet utilisateur ?')"/></a>
+ </td>
+ </tr>
+<?php endforeach; ?>
+<?php else : ?>
+ <tr>
+ <td colspan="5"><p>Aucun utilisateur pour le moment...</p></td>
+ </tr>
+<?php endif; ?>
+</table>
--- /dev/null
+<div class="erreur">
+<strong>Erreur</strong>
+<?php if(isset($this->out["erreur"]["messages"]) && $this->out["erreur"]["messages"]) : ?>
+ <ul>
+<?php foreach($this->out["erreur"]["messages"] as $message) : ?>
+ <li><?php echo $message ?></li>
+<?php endforeach; ?>
+ </ul>
+<?php endif; ?>
+</div>
\ No newline at end of file
--- /dev/null
+<p id="a_propos_links">
+<?php if($this->config("contact_form")) : ?>
+ <a href="<?= $this->url("forms/contact") ?>">contact</a>
+<?php endif; ?>
+</p>
+
+<p>
+<?php if(!($user = $this->user())) : ?>
+ <a href="<?= $this->url("users/identification") ?>">s'identifier</a>
+<?php else : ?>
+ Bienvenue <strong><?= $user["login"] ?></strong>
+ | <a href="<?= $this->url("users") ?>">compte</a>
+<?php if($this->status_ok("admin")) : ?>
+ | <a href="<?= $this->url("admin") ?>">admin</a>
+<?php endif; ?>
+ | <a href="<?= $this->url("users/identification/logout") ?>">deconnexion</a>
+<?php endif; ?>
+ | <?= $this->config("version") ?>
+</p>
--- /dev/null
+<div id="contact" class="description">
+
+ <h2>Contact</h2>
+
+ <form action="<?= $this->url("forms/contact") ?>" method="post">
+ <ul class="form">
+ <li>
+ <label for="email">email</label>
+ <p>
+ <input type="text" name="email" id="email" value="<?= $_POST["email"] ?>" />
+ </p>
+ </li>
+ <li>
+ <label for="message">message</label>
+ <p>
+ <textarea name="message" id="message" rows="16" cols="50"><?= $_POST["message"] ?></textarea>
+ </p>
+ </li>
+<?php if($this->config("captcha")) : ?>
+ <li>
+ <label for="ptitcaptcha_entry">anti-spam</label>
+ <p>
+ <?= PtitCaptchaHelper::generateImgTags($this->path("libs")) ?>
+ <?= PtitCaptchaHelper::generateHiddenTags() ?>
+ <?= PtitCaptchaHelper::generateInputTags() ?>
+ </p>
+ </li>
+<?php endif; ?>
+ <li class="buttons">
+ <input type="submit" value="Envoyer" />
+ </li>
+ </ul>
+ </form>
+
+</div>
--- /dev/null
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <!-- METAS -->
+
+ <title><?php echo $this->config("site_name"); ?></title>
+ <meta name="description" content="<?php echo $this->config("site_description"); ?>" />
+
+ <!-- SCRIPTS -->
+
+ <script type="text/javascript"> site_url = "<?= $this->path("web") ?>"; </script>
+ <script type="text/javascript" src="<?= $this->out_file("js/md5.js") ?>"></script>
+ <script type="text/javascript" src="<?= $this->out_file("js/login.js") ?>"></script>
+ <script type="text/javascript" src="<?= $this->out_file("js/jquery-1.5.2.min.js") ?>"></script>
+ <script type="text/javascript" src="<?= $this->out_file("js/jquery.colorbox-min.js") ?>"></script>
+ <script type="text/javascript" src="<?= $this->out_file("js/jquery-ui-1.8.12.custom.min.js") ?>"></script>
+ <script type="text/javascript" src="<?= $this->out_file("js/menu.js") ?>"></script>
+<?php if($this->out_file_exists("js/actions/".$this->etat("mod")."_".$this->etat("controller")."_".$this->etat("action").".js")) : ?>
+ <script type="text/javascript" src="<?= $this->out_file("js/actions/".$this->etat("mod")."_".$this->etat("controller")."_".$this->etat("action").".js") ?>"></script>
+<?php endif; ?>
+<?php if($this->out_file_exists("js/actions/".$this->etat("mod")."_".$this->etat("controller").".js")) : ?>
+ <script type="text/javascript" src="<?= $this->out_file("js/actions/".$this->etat("mod")."_".$this->etat("controller").".js") ?>"></script>
+<?php endif; ?>
+<?php if($this->out_file_exists("js/actions/".$this->etat("mod").".js")) : ?>
+ <script type="text/javascript" src="<?= $this->out_file("js/actions/".$this->etat("mod").".js") ?>"></script>
+<?php endif; ?>
+
+ <!-- CSS -->
+
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/style.css") ?>" />
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/colors.css") ?>" />
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/colorbox.css") ?>" />
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/ui-lightness/jquery-ui-1.8.12.custom.css") ?>" />
+<?php if($this->out_file_exists("css/actions/".$this->etat("mod")."_".$this->etat("controller")."_".$this->etat("action").".css")) : ?>
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/actions/".$this->etat("mod")."_".$this->etat("controller")."_".$this->etat("action").".css") ?>" />
+<?php endif; ?>
+<?php if($this->out_file_exists("css/actions/".$this->etat("mod")."_".$this->etat("controller").".css")) : ?>
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/actions/".$this->etat("mod")."_".$this->etat("controller").".css") ?>" />
+<?php endif; ?>
+<?php if($this->out_file_exists("css/actions/".$this->etat("mod").".css")) : ?>
+ <link rel="stylesheet" type="text/css" href="<?= $this->out_file("css/actions/".$this->etat("mod").".css") ?>" />
+<?php endif; ?>
--- /dev/null
+<h1><a href="<?= $this->url() ?>"><span><?= $this->config("site_name") ?></span></a></h1>
--- /dev/null
+<div id="login_box">
+<?php if(!($user = $this->user())) : ?>
+<form id="login_form"
+ action="<?= $this->url("users/identification/login") ?>"
+ method="post">
+ <div>
+ <input type="hidden" name="pass" value="" />
+ <input type="hidden" name="from" value="<?= isset($_POST["from"]) ? $_POST["from"] : urlencode($_SERVER["REQUEST_URI"]) ?>" />
+ </div>
+ <table>
+ <tr>
+ <th>login</th>
+ <td><input type="text" name="login" size="14" maxlength="25" /></td>
+ </tr>
+ <tr>
+ <th>pass</th>
+ <td><input type="password" name="password" size="14" maxlength="16" /></td>
+ </tr>
+ <tr>
+ <td colspan="2" align="right"><input type="submit" value="Login" onclick="prepare_password('<?= $_SESSION["id"]?>')" /></td>
+ </tr>
+ </table>
+ <div class="clear"><!-- --></div>
+</form>
+
+<?php else : ?>
+ Bienvenue <b><?= $user["login"] ?></b>
+ <ul>
+ <li><a href="<?= $this->url("users/compte") ?>">compte</a></li>
+ <li><a href="<?= $this->url("users/identification/logout") ?>">deconnexion</a></li>
+<?php if($this->status_ok("admin")) : ?>
+ <li><a href="<?= $this->url("admin") ?>">admin</a></li>
+<?php endif; ?>
+ </ul>
+<?php endif; ?>
+<div class="clear"><!-- --></div>
+</div>
\ No newline at end of file
--- /dev/null
+<?php if(isset($this->out["messages"]) && $this->out["messages"]) : ?>
+<div class="messages">
+ <ul>
+<?php foreach($this->out["messages"] as $message) : ?>
+ <li><?= $message ?></li>
+<?php endforeach; ?>
+ </ul>
+</div>
+<?php endif; ?>
\ No newline at end of file
--- /dev/null
+<?php if($this->config("max_list") && isset($this->out[$items]["total"]) && ($this->out[$items]["total"] > $this->config("max_list"))) : ?>
+<div class="navig">
+<?php
+
+ echo mw_navig
+ ( $_GET[$this->param("start")],
+ $this->out[$items]["total"],
+ $this->config("max_list"),
+ $_SERVER["REQUEST_URI"],
+ $this->param("start"),
+ " ".$legend
+ );
+
+?>
+</div>
+<?php endif; ?>
\ No newline at end of file
--- /dev/null
+<div class="redirect_message">
+ <div>
+<?= $this->out["redirect"]["message"] ?>
+ <br /><br /><br />
+ ---------------------------------------------------<br />
+ Vous allez être redirigé vers <a href="<?= $this->out["redirect"]["url"] ?>"><?= $this->out["redirect"]["url"] ?></a>
+ dans <?= $this->out["redirect"]["wait"] ?> secondes.<br />
+ (cliquez sur le lien si la redirection ne se fait pas)
+ </div>
+</div>
+<script type="text/javascript">
+//<![CDATA[
+ setTimeout("js_redirect('<?= $this->out["redirect"]["url"] ?>')", 1000 * <?= $this->out["redirect"]["wait"] ?>);
+ function js_redirect(redirect_url) { document.location = redirect_url; }
+//]]>
+</script>
--- /dev/null
+<script type="text/javascript">
+
+ tinyMCE.init({\r
+ // General options
+ mode : "none",\r
+ theme : "advanced",\r
+ plugins : "pagebreak,style,layer,table,advhr,advimage,advlink,iespell,inlinepopups,media,searchreplace,print,contextmenu,directionality,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist",\r
+\r
+ // Theme options\r
+ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontsizeselect",\r
+ theme_advanced_buttons2 : "bullist,numlist,|blockquote,|,link,unlink,anchor,image,cleanup,help,|,hr,charmap,|,forecolor,backcolor",\r
+ theme_advanced_buttons3 : "",
+ theme_advanced_toolbar_location : "top",\r
+ theme_advanced_toolbar_align : "left",\r
+ theme_advanced_statusbar_location : "bottom",\r
+ theme_advanced_resizing : true,\r
+\r
+ // Example content CSS (should be your site CSS)\r
+<?php if($this->out_file_exists("css/tinymce.css")) : ?>
+ content_css : "<?= $this->out_file("css/tinymce.css") ?>",
+<?php endif; ?>\r
+\r
+ // Drop lists for link/image/media/template dialogs\r
+ template_external_list_url : "lists/template_list.js",\r
+ external_link_list_url : "lists/link_list.js",\r
+ external_image_list_url : "lists/image_list.js",\r
+ media_external_list_url : "lists/media_list.js",\r
+
+ file_browser_callback : "tinyBrowser",
+
+ invalid_elements : "script",
+\r
+ // Style formats\r
+ style_formats : [\r
+ {title : 'Bold text', inline : 'b'},\r
+ {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},\r
+ {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},\r
+ {title : 'Example 1', inline : 'span', classes : 'example1'},\r
+ {title : 'Example 2', inline : 'span', classes : 'example2'},\r
+ {title : 'Table styles'},\r
+ {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}\r
+ ],\r
+\r
+ // Replace values for the template plugin\r
+ template_replace_values : {\r
+ username : "Some User",\r
+ staffid : "991234"\r
+ }\r
+ });
+
+</script>
--- /dev/null
+<?php $data = $this->data(); if(($menu_top = $data->get_link("menu_top")) && $menu_top["subs"]) : ?>
+<ul class="menu navig_menu">
+ <?php foreach($menu_top["subs"] as $link) : ?>
+ <li><a href="<?= $link["url"] ?>"><?= $link["intitule"] ?></a></li>
+ <?php endforeach; ?>
+</ul>
+<?php endif; ?>
\ No newline at end of file
--- /dev/null
+<div id="identification_page">
+<h2>Identification</h2>
+<?php require $this->out_file("views/login.php"); ?>
+<ul>
+ <li><a href="<?= $this->url() ?>">accueil</a></li>
+</ul>
+</div>
\ No newline at end of file
--- /dev/null
+<h1>Informations du compte</h1>
+
+<form name="user_form" action="<?= $this->url("users/infos/edit") ?>" method="post">
+ <ul class="form">
+ <li>
+ <label for="login">login</label>
+ <input type="text" name="login" id="login" value="<?= $this->out["user"]["login"] ?>" disabled="disabled" />
+ </li>
+ <li>
+ <label for="status_name">statut</label>
+ <input type="text" name="status_name" id="status_name" value="<?= $this->out["status"][$this->out["user"]["status"]]["nom"] ?>" disabled="disabled" />
+ </li>
+ <li>
+ <label for="email">email</label>
+ <input type="text" name="email" id="email" value="<?= $this->out["user"]["email"] ?>" />
+ </li>
+ <li>
+ <label for="change_password">changer le mot de passe</label>
+ <input type="checkbox" name="change_password" id="change_password" <?= isset($_POST["change_password"]) && $_POST["change_password"] ? "checked=\"checked\"" : "" ?>/>
+ </li>
+ <li>
+ <label for="password">mot de passe</label>
+ <input type="password" name="password" id="password" />
+ </li>
+ <li>
+ <label for="password_confirm">confirmer le mot de passe</label>
+ <input type="password" name="password_confirm" id="password_confirm" />
+ </li>
+ <li class="buttons">
+ <input type="submit" value="Enregistrer" />
+ </li>
+ </ul>
+</form>
\ No newline at end of file