commit d75eb444fc6cd6de9d110fd6b5640eb6efa0660e Author: genuineparts Date: Fri Jun 20 19:10:23 2025 +0200 Initial checkin diff --git a/admin/addgroup.apnl.php b/admin/addgroup.apnl.php new file mode 100644 index 0000000..22b9f80 --- /dev/null +++ b/admin/addgroup.apnl.php @@ -0,0 +1,151 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: addgroup.apnl.php 41 2009-06-21 19:24:29Z genuineparts $ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$addnav["right"]=FALSE; +$session->page_begin("addgroup", True); + +class addgroup_panel extends admin_module{ + + function output(){ + global $session,$config,$db,$panel,$admin,$module,$root,$firephp,$log; + if(isset($_POST["send"])){ + if(!empty($_POST["name"])){ + $db->query("BEGIN"); + $db->query("INSERT INTO `" . $config["prefix"] . "role` (`role_name`) VALUES ('".$db->escape($_POST["name"])."')"); + $role_id=$db->last_id(); + unset($_POST["name"]); + unset($_POST["submit"]); + unset($_POST["send"]); + foreach($_POST as $key=>$value){ + $db->query("INSERT INTO `" . $config["prefix"] . "roleset` (`role_id`,`role_value_id`,`value`) VALUES ('".intval($role_id)."','".intval($key)."','".$db->escape($value)."')"); + } + $db->query("COMMIT"); + $panel->admin_message("Daten übernommen!","Die Daten wurden erfolgreich übernommen.",True,"addgroup",3); + }else{ + $panel->admin_message("Fehler!","Der Rollenname muss ausgefüllt werden.",True,"addgroup",3); + } + + }else{ + $result = $db->query("SELECT * FROM " . $config["prefix"] . "role_values"); + $panel->title="Gruppe anlegen"; + $panel->content='Hier kann man Benutzergruppen anlegen.'; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addgroup")); + $panel->content.="

Gruppename:

"; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["name"])); + $panel->content.="

"; + $panel->content.=" + + + "; + while ($row = $db->fetch_array($result)){ + $panel->content.=""; + } + $panel->content.="
Rechte
".$row["text"].":
".$this->get_option($row["type"],$row["id"])."

"; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); + } + } + + function get_option($option,$name) { + global $config,$db,$panel,$userinfo,$admin,$root,$firephp; + + if($option=="yesno"){ + $checked["yes"]=""; + $checked["no"]=""; + $yn=$panel->radio(array("name"=>$name,"value"=>"1"),NULL,TRUE); + $yn.="Ja"; + $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),NULL,TRUE); + $yn.="Nein"; + return $yn; + } + if($option=="onoff"){ + $checked["on"]=""; + $checked["off"]=""; + $yn=$panel->radio(array("name"=>$name,"value"=>"1"),NULL,TRUE); + $yn.="An"; + $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),NULL,TRUE); + $yn.="Aus"; + return $yn; + } + + if($option=="text"){ + $text=$panel->field(array("name"=>$name,"typ"=>"text"),"",TRUE); + return $text; + } + + if(strstr($option,"wysiwyg")){ + $string=str_replace("wysiwyg(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$panel->textarea(array("name"=>$name, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); + }else{ + $text=$panel->textarea(array("name"=>$name),"class=\"mceEditor\"",TRUE); + } + return $text; + } + + if(strstr($option,"textarea")){ + $string=str_replace("textarea(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$panel->textarea(array("name"=>$name, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); + }else{ + $text=$panel->textarea(array("name"=>$name),"",TRUE); + } + return $text; + } + + if(strstr($option,"select")){ + //$text=$panel->field("text",$name,"value=\"".$config[$name]."\"",TRUE); + $string=str_replace("select(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $values[$substr[0]]=$substr[1]; + } + $select=$panel->select($values,NULL,$name,"",TRUE); + return $select; + } + + } + +} +?> \ No newline at end of file diff --git a/admin/adduser.apnl.php b/admin/adduser.apnl.php new file mode 100644 index 0000000..08085ef --- /dev/null +++ b/admin/adduser.apnl.php @@ -0,0 +1,75 @@ +page_begin("adduser", True); + +class adduser_panel extends admin_module{ + + function output(){ + global $plugin,$session,$config,$db,$panel,$admin,$module,$root,$firephp,$log,$lang; + if(isset($_POST["send"])){ + if($_POST['role']==2 && $session->userdata['role']!=2){ + $panel->admin_message("Error","You cannot assign a role higher then yours!",True,"editusers",3); + } + if(!empty($_POST["name"]) && !empty($_POST["password"])){ + $key=$session->generate_key(50); + $plugin->run_hook('admin_user_before_create',array('data'=>$_POST,'key'=>$key,'user_fid'=>$session->userdata['fuid'])); + $db->query("INSERT INTO `" . $config["prefix"] . "users` (`username`,`realname`,`password`,`loginkey`,`role`,`email`,`active`) VALUES ('".$db->escape($_POST["name"])."','".$db->escape($_POST["realname"])."','".hash("sha256",$db->escape($_POST["password"]))."','".$key."','".$db->escape($_POST["role"])."','".$db->escape($_POST["email"])."','".$_POST["active"]."')"); + $_POST['uid']=$db->last_id(); + $plugin->run_hook('admin_user_after_create',array('data'=>$_POST)); + $panel->admin_message("Daten übernommen!","Die Daten wurden erfolgreich übernommen.",True,"adduser",3); + }else{ + $panel->admin_message("Fehler!","Der Name und das Passwort müssen ausgefült werden.",True,"adduser",3); + } + + }else{ + + $panel->title=$lang->_('ADDUSER'); + $panel->content=$lang->_('ADDUSERTEXT'); + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=adduser")); + $panel->content.="

".$lang->_('USERNAME').":

"; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["name"])); + $panel->content.="

".$lang->_('REALNAME').":

"; + $panel->field(array("name"=>"realname","typ"=>"text","value"=>$data["realname"])); + $panel->content.="

".$lang->_('MAIL').":

"; + $panel->field(array("name"=>"email","value"=>$data["email"],"typ"=>"text")); + $panel->content.="

".$lang->_('PASSWORD').":

"; + $panel->field(array("name"=>"password","value"=>$data["password"],"typ"=>"password")); + $panel->content.="

".$lang->_('LOCATION').":

"; + $panel->field(array("name"=>"from","value"=>$data["from"],"typ"=>"text")); + $panel->content.="

".$lang->_('GENDER').":

"; + $panel->select(array("N/A"=>"u", "weiblich"=>"f","männlich"=>"m"),$data["gender"],"gender"); + + $panel->content.="

".$lang->_('BANREASON').":

"; + $panel->textarea(array("name"=>"bio","value"=>$data["bio"],"typ"=>"text")); + $panel->content.="

".$lang->_('HOMEPAGE').":

"; + $panel->field(array("name"=>"homepage","value"=>$data["homepage"],"typ"=>"text")); + $panel->content.="

ICQ:

"; + $panel->field(array("name"=>"icq","value"=>$data["icq"],"typ"=>"text")); + $panel->content.="

AIM:

"; + $panel->field(array("name"=>"aim","value"=>$data["aim"],"typ"=>"text")); + $panel->content.="

Skype:

"; + $panel->field(array("name"=>"skype","value"=>$data["skype"],"typ"=>"text")); + + $panel->content.="

".$lang->_('ROLE').":

"; + $result=$db->query("SELECT `id`,`role_name` FROM `" . $config["prefix"] . "role`"); + while($data = $db->fetch_array($result)){ + $dd[$data["role_name"]]=$data["id"]; + } + $panel->select($dd,"1","role"); + $panel->content.="

".$lang->_('ACTIVE').":

"; + $panel->select(array($lang->_('YES')=>1,$lang->_('NO')=>0),"0","active"); + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
"; + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); + } + } + + + +} +?> diff --git a/admin/admin.css b/admin/admin.css new file mode 100644 index 0000000..f39763a --- /dev/null +++ b/admin/admin.css @@ -0,0 +1,287 @@ + +body{ + font: normal 12px/24px Verdana, Arial, Helvetica, sans-serif; + margin: 0; + padding: 0; + text-align: center; +} +a{ + color: #6699FF; +} +a:hover{ + color: #cccccc; +} +img{ + border:0px; +} +#sitetitle{ + width: 875px; + margin: 0 auto; + padding: 5px; + text-align: left; + border-right: 1px solid #d1d1d1; + border-left: 1px solid #d1d1d1; + border-bottom:1px solid #D1D1D1; + background-color: #fcfcfc; +} +table { + background:#E6E6E6; + border:2px solid #D1D1D1; + border-collapse:collapse; + border-spacing:1px; + color:#333333; +} +table td { + border:1px inset white; + padding:3px; +} +table th { + font-variant: small-caps; + border:1px inset white; + padding:3px; +} +#container{ + width: 1024px; + margin: 0 auto; + padding: 5px; + text-align: left; + border-right: 1px solid #d1d1d1; + border-left: 1px solid #d1d1d1; + border-bottom:1px solid #D1D1D1; + background-color: #fcfcfc; +} +#menu{ + float: left; + width: 190px; + margin: 0; +} +.menuitem_green{ + width: 175px; + height: 50px; + text-align: right; + background-image: url("images/green.gif"); +} +.menuitem_blue{ + width: 175px; + height: 50px; + text-align: right; + background-image: url("images/blue.gif"); +} +.menuitem_yellow{ + width: 175px; + height: 50px; + text-align: right; + background-image: url("images/yellow.gif"); +} +.menuitem_text{ + font-size:15px; + font-weight:bold; + text-decoration: bold; + font-variant:small-caps; + color: #FFFFFF; + padding:20px 12px 0 0; +} +#menu ul{ + list-style-type: none; + border-top: 1px solid #d1d1d1; + margin-top:5px; + padding: 0; +} +#menu li{ + text-indent: 1em; + + border-right: 1px solid #cccccc; + border-bottom:1px solid #D1D1D1; + border-left: 1px solid #d1d1d1 +} +#menu li a{ + color: #6699ff; + display: block; + padding: 2px 0 0 2px; + text-decoration: none; +} +#menu li a:hover{ + background-color: #CCCCCC; + text-decoration: underline; +} +#left p{ + margin: 1px; + padding-left: 1em; +} +#left form{ + padding: 1em 0 0 0; + margin: 0; +} +#left form input{ + margin: 0.2em 0; + background-color: #f3f3f3; + border: 1px solid #333333; + width: 125px; + font: 11px/22px Arial, Helvetica, sans-serif; + padding: 0.2em; +} +#left form .button{ + width: 75px; + background-color: #6699FF; + padding: 0; + margin: 0; +} +#content{ + border: 1px solid #d1d1d1; + float:left; + margin-bottom:5px; + margin-left:5px; + margin-top:5px; + min-height:300px; + padding-left:1em; + padding-right:1em; + padding-top:5px; + width:800px; +} +#minimal_content{ + float:left; + margin-left:-1px; + margin-right:-1px; + margin-top:-5px; + min-height:100px; + padding-left:1em; + padding-right:1em; + padding-top:5px; + width:800px; +} +#minimal_content h2{ + background-color: #B2EA6A; + text-indent: 1em; + font-size: 12px; + font-variant: small-caps; + color: #ffffff; + margin: 0; +} +#minimal_content h1{ + background-color:#B2EA6A; + color:#FFFFFF; + font-size:25px; + font-variant:small-caps; + height:25px; + margin:0; + text-indent:15px; +} +#minimal_content p{ + margin: 0; + padding: 1em; +} + +#content h2{ + background-color: #B2EA6A; + text-indent: 1em; + font-size: 12px; + font-variant: small-caps; + color: #ffffff; + margin: 0; +} +#content h1{ + background-color:#B2EA6A; + color:#FFFFFF; + font-size:25px; + font-variant:small-caps; + height:25px; + margin:0; + text-indent:15px; +} +#content p{ + margin: 0; + padding: 1em; +} #content form label{ + background-position:0 5px; + background-repeat:no-repeat; + clear:both; + margin-bottom:2px; + margin-right:3px; + padding-left:0.5em; + cursor:pointer; + padding:0.5em 0.5em 0.5em 20px; +} +.messageboxerror { + color: #ffffff; + background-color:#ff0000; + border: 1px solid #cc0000; +} + +.unchecked { + background-image:url("images/chk_off.png"); +} +.checked { + background-image:url("images/chk_on.png"); +} +.unselected { + background-image:url("images/rdo_off.png"); +} +.selected { + background-image:url("images/rdo_on.png"); +} +.sortcol { + cursor: pointer; + padding-right: 20px; + background-repeat: no-repeat; + background-position: right center; +} +.sortasc { + background-color: #DDFFAC; + background-image: url("images/up.gif"); +} +.sortdesc { + background-color: #B9DDFF; + background-image: url("images/down.gif"); +} +.nosort { + cursor: default; +} + +#footer{ + clear: both; + text-align: center; + margin: 0; + padding: 0; + background-color: #f9f9f9; + border: 1px solid #cccccc; +} + +.accordion_toggle { + display: block; + height: 30px; + width: 680px; + background: url(images/icons/arrow_left.png) no-repeat center left #a9d06a; + padding: 0 10px 0 10px; + line-height: 30px; + color: #ffffff; + font-weight: normal; + text-decoration: none; + outline: none; + font-size: 12px; + color: #000000; + border-bottom: 1px solid #cde99f; + cursor: pointer; + margin: 0 0 0 0; +} + +.accordion_toggle_active { + background: url(images/icons/arrow_down.png) no-repeat center left #e0542f; + color: #ffffff; + border-bottom: 1px solid #cde99f; +} + +.accordion_content { + background-color: #ffffff; + color: #444444; + overflow: hidden; +} + +.accordion_content h2 { + margin: 15px 0 5px 10px; + color: #0099FF; +} + +.accordion_content p { + line-height: 150%; + padding: 5px 10px 15px 10px; +} diff --git a/admin/banips.apnl.php b/admin/banips.apnl.php new file mode 100644 index 0000000..3f660c6 --- /dev/null +++ b/admin/banips.apnl.php @@ -0,0 +1,190 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$addnav["right"]=FALSE; +$session->page_begin("edituser", True); + + +class banips_panel extends admin_module{ + + function output(){ + global $plugin,$session,$config,$db,$panel,$admin,$module,$root,$firephp,$lang; + if(isset($_GET['action']) && $_GET['action']=='add'){ + if(isset($_POST['send']) && !empty($_POST['ip'])){ + $db->query("INSERT INTO `" . $config["prefix"] . "banned_ips` (`ip`,`date`,`reason`) VALUES ('".$db->escape($_POST['ip'])."','".time()."','".$db->escape($_POST["reason"])."')"); + $panel->admin_message($lang->_('SUCCESS'),$lang->_('DATASAVED'),True,"banips",3); + } + }elseif($_GET["action"]=='delete' && $_GET['id']){ + $db->query("DELETE FROM `" . $config["prefix"] . "banned_ips` WHERE `id`='".intval($_GET['id'])."'"); + $panel->admin_message("Ban lifted","The ban was lifted.",True,"banips",3); + }else{ + + $left=""; + $right=""; + $asmodule=""; + $mainmodule=""; + $result=$db->query("SELECT * FROM `" . $config["prefix"] . "banned_ips`"); + while ($row = $db->fetch_array($result)){ + $ips[]=$row; + } + $panel->title=$lang->_('BANNEDIPS'); + $panel->content.=" + + + + + + + "; + if(!empty($ips)){ + foreach($ips as $i){ + $panel->content.=" + + + + "; + $panel->content.=" + "; + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
".$lang->_('ID')."".$lang->_('IP')."".$lang->_('DATE')."".$lang->_('REASON')."".$lang->_('ACTION')."
".$i['id']."".$i['ip']."".date('d.m.Y, H:i',$i['date'])."".$i['reason']."
".$lang->_('NOBANNEDIPS')."

"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=banips&action=add")); + $panel->content.="

".$lang->_('IP').":

"; + $panel->field(array("name"=>"ip","typ"=>"text")); + $panel->content.="

".$lang->_('REASON')."

"; + $panel->textarea(array("name"=>"reason","typ"=>"text")); + $panel->content.="
"; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + } + } + + function meta() { + global $module,$config,$db,$panel,$userinfo,$admin,$root; + $meta=' + + + + + '; + return $meta; + + } + + +} +?> diff --git a/admin/config.apnl.php b/admin/config.apnl.php new file mode 100644 index 0000000..c6a85cc --- /dev/null +++ b/admin/config.apnl.php @@ -0,0 +1,187 @@ +page_begin("config", True); + + +class config_panel extends admin_module{ + + function output(){ + global $module,$config,$db,$panel,$admin,$module,$root,$firephp,$log,$lang; + + if(isset($_POST["send"]) && $_POST["send"]==1){ + foreach($_POST as $post=>$value){ + if($post!="send" and $config[$post]!=$value){ + $field=$db->escape($post); + $update=$db->escape($value); + $db->query("UPDATE " . $config["prefix"] . "config SET `value`='".$update."' WHERE `name`='".$field."'"); + } + } + $result = $db->query("SELECT name, value FROM " . $config["prefix"] . "config"); + while ($row = $db->fetch_array($result)){ + $config[$row["name"]] = $row["value"]; + } + } + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "config` v LEFT JOIN `" . $config["prefix"] . "config_categorys` c ON v.`category`=c.`cid`"); + while ($row = $db->fetch_array($result)){ + $data[$row["categoryname"]][]=$row; + } + $panel->title="Konfiguration"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=config")); + $panel->content.="
"; + foreach($data as $key=>$val){ + $panel->content.="

".$key."

+
"; + foreach($val as $v){ + $panel->content.=""; + } + + $panel->content.="
".$v["title"]."
".$v["description"]."
".$this->get_option($v["option"],$v["name"])."
"; + } + $panel->content.="


"; + $panel->field(array("typ"=>"hidden","name"=>"send","value"=>1)); + $panel->submit(); + $panel->formClose(); + $panel->foot.=''; + } + + function get_option($option,$name) { + global $config,$db,$panel,$userinfo,$admin,$root,$firephp,$lang; + + if($option=="yesno"){ + $checked["yes"]=""; + $checked["no"]=""; + if($config[$name]==1||$config[$name]==True||$config[$name]=="yes"){ + $checked["yes"]='checked="checked"'; + }else{ + $checked["no"]='checked="checked"'; + } + $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["yes"],TRUE); + $yn.="Ja"; + $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["no"],TRUE); + $yn.="Nein"; + return $yn; + } + if($option=="onoff"){ + $checked["on"]=""; + $checked["off"]=""; + if($config[$name]==1||$config[$name]==True||$config[$name]=="on"){ + $checked["on"]='checked="checked"'; + }else{ + $checked["off"]='checked="checked"'; + } + $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["on"],TRUE); + $yn.="An"; + $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["off"],TRUE); + $yn.="Aus"; + return $yn; + } + + if($option=="language"){ + $langs=$lang->getlanguages(); + foreach($langs as $lang){ + $values[$lang['name']]=$lang['short']; + } + $select=$panel->select($values,$config[$name],$name,"",TRUE); + return $select; + } + + if($option=="text"){ + $text=$panel->field(array("name"=>$name,"typ"=>"text","value"=>$config[$name]),"",TRUE); + return $text; + } + + if(strstr($option,"wysiwyg")){ + $string=str_replace("wysiwyg(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name], $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); + }else{ + $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name]),"class=\"mceEditor\"",TRUE); + } + return $text; + } + + if(strstr($option,"textarea")){ + $string=str_replace("textarea(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name], $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); + }else{ + $text=$panel->textarea(array("name"=>$name,"value"=>$config[$name]),"",TRUE); + } + return $text; + } + + if(strstr($option,"select")){ + //$text=$panel->field("text",$name,"value=\"".$config[$name]."\"",TRUE); + $string=str_replace("select(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $values[$substr[0]]=$substr[1]; + } + $select=$panel->select($values,$config[$name],$name,"",TRUE); + return $select; + } + + } + + function meta() { + global $module,$config,$db,$panel,$userinfo,$admin,$root; + $meta=' + + + + + + + '; + return $meta; + + } + + +} +?> diff --git a/admin/editgroup.apnl.php b/admin/editgroup.apnl.php new file mode 100644 index 0000000..47a176a --- /dev/null +++ b/admin/editgroup.apnl.php @@ -0,0 +1,304 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$addnav["right"]=FALSE; +$session->page_begin("editgroup", True); + +class editgroup_panel extends admin_module{ + + function output(){ + global $session,$config,$db,$panel,$admin,$module,$root,$firephp,$log; + if(isset($_GET["editgroup"]) && $_GET["editgroup"]!=""){ + if(isset($_POST["send"]) && !empty($_POST["name"]) && !empty($_POST["group"])){ + if(!empty($_POST["name"])){ + $id=intval($_POST["group"]); + $db->query("UPDATE `" . $config["prefix"] . "role` SET `role_name`='".$db->escape($_POST["name"])."' WHERE id='".$id."'"); + unset($_POST["name"]); + unset($_POST["submit"]); + unset($_POST["send"]); + unset($_POST["group"]); + $db->query("DELETE FROM `" . $config["prefix"] . "roleset` WHERE `role_id`='".$id."'"); + foreach($_POST as $key=>$value){ + $db->query("INSERT INTO `" . $config["prefix"] . "roleset` (`role_id`,`role_value_id`,`value`) VALUES ('".$id."','".intval($key)."','".$db->escape($value)."')"); + } + $panel->admin_message("Daten übernommen!","Die Daten wurden erfolgreich übernommen.",True,"editgroup",3); + }else{ + $panel->admin_message("Fehler!","Der Rollenname muss ausgefüllt werden.",True,"editgroup",3); + } + }else{ + + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "role` WHERE id='".intval($_GET["editgroup"])."'"); + $data = $db->fetch_array($result); + $panel->title="Gruppe editieren"; + $panel->content='Hier kann man Benutzergruppen bearbeiten.'; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editgroup&editgroup=".$data["id"])); + $panel->content.="

Gruppename:

"; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["role_name"])); + $panel->content.="

"; + $panel->content.=" + + + "; + $result = $db->query("SELECT * FROM " . $config["prefix"] . "role_values"); + while ($row = $db->fetch_array($result)){ + $rval =$db->fetch_array($db->query("SELECT value FROM `" . $config["prefix"] . "roleset` WHERE role_value_id='".$row["id"]."' AND role_id='".$data["id"]."'")); + $row["value"]=$rval["value"]; + $rdata[]=$row; + } + foreach ($rdata as $d){ + $panel->content.=""; + } + $panel->content.="
Rechte
".$d["text"].":
".$this->get_option($d["type"],$d["id"],$d["value"])."

"; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->field(array("name"=>"group","typ"=>"hidden","value"=>$data["id"])); + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); + + $panel->parse_page(); + } + }elseif($_GET["action"]=="delete" && $_GET["group"]){ + $result=$db->query("SELECT id FROM `" . $config["prefix"] . "role` where `role_name`='User' LIMIT 1"); + $row = $db->fetch_array($result); + $db->query("UPDATE `" . $config["prefix"] . "users` SET `role`='".$row["id"]."' WHERE `role`='".intval($_GET["group"])."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "role` WHERE id='".intval($_GET["group"])."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "roleset` WHERE role_id='".intval($_GET["group"])."'"); + $panel->admin_message("Usergruppe gelöscht!","Die Gruppe wurde erfolgreich gelöscht.",True,"editgroup",3); + + }else{ + $result=$db->query("SELECT * FROM `" . $config["prefix"] . "role`"); + while ($row = $db->fetch_array($result)){ + $role[]=$row; + } + $panel->title="Vorhandene Rollen"; + $panel->content.=" + + + + + "; + if(!empty($role)){ + foreach($role as $u){ + $panel->content.=" + + "; + if(!$u["special_group"]){ + $panel->content.=" + "; + }else{ + $panel->content.=" + "; + } + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
IDNameAktionen
".$u["id"]."".$u["role_name"]."
Keine Rollen vorhanden.

"; + } + } + + function get_option($option,$name,$value) { + global $config,$db,$panel,$userinfo,$admin,$root,$firephp; + + if($option=="yesno"){ + $checked["yes"]=""; + $checked["no"]=""; + if($value==1||$value==True||$value=="yes"){ + $checked["yes"]='checked="checked"'; + }else{ + $checked["no"]='checked="checked"'; + } + $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["yes"],TRUE); + $yn.="Ja"; + $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["no"],TRUE); + $yn.="Nein"; + return $yn; + } + if($option=="onoff"){ + $checked["on"]=""; + $checked["off"]=""; + if($value==1||$value==True||$value=="on"){ + $checked["on"]='checked="checked"'; + }else{ + $checked["off"]='checked="checked"'; + } + $yn=$panel->radio(array("name"=>$name,"value"=>"1"),$checked["on"],TRUE); + $yn.="An"; + $yn.=$panel->radio(array("name"=>$name,"value"=>"0"),$checked["off"],TRUE); + $yn.="Aus"; + return $yn; + } + + if($option=="text"){ + $text=$panel->field(array("name"=>$name,"typ"=>"text","value"=>$value),"",TRUE); + return $text; + } + + if(strstr($option,"wysiwyg")){ + $string=str_replace("wysiwyg(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$panel->textarea(array("name"=>$name,"value"=>$value, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"class=\"mceEditor\"",TRUE); + }else{ + $text=$panel->textarea(array("name"=>$name,"value"=>$value),"class=\"mceEditor\"",TRUE); + } + return $text; + } + + if(strstr($option,"textarea")){ + $string=str_replace("textarea(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $a_name[]=$substr[0]; + $value[]=$substr[1]; + } + if(is_array($sarr)){ + $text=$panel->textarea(array("name"=>$name,"value"=>$value, $a_name[0]=>$value[0],$a_name[1]=>$value[1]),"",TRUE); + }else{ + $text=$panel->textarea(array("name"=>$name,"value"=>$value),"",TRUE); + } + return $text; + } + + if(strstr($option,"select")){ + //$text=$panel->field("text",$name,"value=\"".$config[$name]."\"",TRUE); + $string=str_replace("select(","",substr($option, 0, -1)); + $sarr=explode(";",$string); + foreach($sarr as $str){ + $substr=explode("|",$str); + $values[$substr[0]]=$substr[1]; + } + $select=$panel->select($values,$value,$name,"",TRUE); + return $select; + } + + } + + function meta() { + global $module,$config,$db,$panel,$userinfo,$admin,$root; + $meta=' + + + + + '; + return $meta; + + } +} +?> diff --git a/admin/editusers.apnl.php b/admin/editusers.apnl.php new file mode 100644 index 0000000..17f4128 --- /dev/null +++ b/admin/editusers.apnl.php @@ -0,0 +1,260 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$addnav["right"]=FALSE; +$session->page_begin("edituser", True); + + +class editusers_panel extends admin_module{ + + function output(){ + global $plugin,$session,$config,$db,$panel,$admin,$module,$root,$firephp,$lang; + if(isset($_GET["edituser"]) && $_GET["edituser"]!=""){ + if(isset($_POST["send"]) && !empty($_POST["name"]) && !empty($_POST["uid"])){ + $pwd=""; + if($_POST['role']==2 && $session->userdata['role']!=2){ + $panel->admin_message("Error","You cannot assign a role higher then yours!",True,"editusers",3); + } + $_POST['key']=$session->generate_key(50); + if($_POST["password"]!=""){ + $pwd=", `password`='".hash("sha256",$db->escape($_POST["password"]))."', `loginkey`='".$_POST['key']."'"; + } + $plugin->run_hook('admin_user_before_update',array('data'=>$_POST,'key'=>$key,'user_fid'=>$session->userdata['fuid'])); + $db->query("UPDATE `" . $config["prefix"] . "users` SET `username`='".$db->escape($_POST["name"])."',`realname`='".$db->escape($_POST["realname"])."',`email`='".$db->escape($_POST["email"])."',`from`='".$db->escape($_POST["from"])."',`gender`='".$db->escape($_POST["gender"])."',`bio`='".$db->escape($_POST["bio"])."',`homepage`='".$db->escape($_POST["homepage"])."',`icq`='".$db->escape($_POST["icq"])."',`aim`='".$db->escape($_POST["aim"])."',`skype`='".$db->escape($_POST["skype"])."',`role`='".$db->escape($_POST["role"])."',`active`='".$db->escape($_POST["active"])."',`char_suspended`='".$db->escape($_POST["char_suspended"])."'".$pwd." WHERE `uid`='".intval($_POST["uid"])."'"); + $_POST['user_fid']=$session->userdata['fuid']; + $plugin->run_hook('admin_user_after_update',array('data'=>$_POST)); + $panel->admin_message($lang->_('SUCCESS'),$lang->_('DATASAVED'),True,"editusers",3); + }else{ + $panel->title=$lang->_('EDITUSER'); + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editusers&edituser=".$_GET["edituser"])); + $result=$db->query("SELECT * FROM `" . $config["prefix"] . "users` WHERE uid='".intval($_GET["edituser"])."'"); + $data = $db->fetch_array($result); + $panel->content.="

".$lang->_('USERNAME').":

"; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$data["username"])); + $panel->content.="

".$lang->_('REALNAME').":

"; + $panel->field(array("name"=>"realname","typ"=>"text","value"=>$data["realname"])); + $panel->content.="

".$lang->_('MAIL').":

"; + $panel->field(array("name"=>"email","value"=>$data["email"],"typ"=>"text")); + $panel->content.="

".$lang->_('PASSWORD').":

"; + $panel->field(array("name"=>"password","value"=>"","typ"=>"password")); + $panel->content.="

".$lang->_('LOCATION').":

"; + $panel->field(array("name"=>"from","value"=>$data["from"],"typ"=>"text")); + $panel->content.="

".$lang->_('GENDER').":

"; + $panel->select(array($lang->_('N/A')=>"u", $lang->_('FEMALE')=>"f",$lang->_('MALE')=>"m"),$data["gender"],"gender"); + $panel->content.="

".$lang->_('HOMEPAGE').":

"; + $panel->field(array("name"=>"homepage","value"=>$data["homepage"],"typ"=>"text")); + $panel->content.="

".$lang->_('ICQ').":

"; + $panel->field(array("name"=>"icq","value"=>$data["icq"],"typ"=>"text")); + $panel->content.="

".$lang->_('AIM').":

"; + $panel->field(array("name"=>"aim","value"=>$data["aim"],"typ"=>"text")); + $panel->content.="

".$lang->_('SKYPE').":

"; + $panel->field(array("name"=>"skype","value"=>$data["skype"],"typ"=>"text")); + $panel->content.="

".$lang->_('BANREASON').":

"; + $panel->textarea(array("name"=>"bio","value"=>$data["bio"],"typ"=>"text")); + $panel->content.="
"; + $panel->content.="

".$lang->_('ROLE').":

"; + $result=$db->query("SELECT `id`,`role_name` FROM `" . $config["prefix"] . "role`"); + while($rdata = $db->fetch_array($result)){ + $dd[$rdata["role_name"]]=$rdata["id"]; + } + $panel->select($dd,$data["role"],"role"); + $panel->content.="
"; + $panel->content.="

".$lang->_('STATUS').":

"; + $panel->select(array($lang->_('ACTIVE')=>1,$lang->_('INACTIVE')=>0,$lang->_('BANNED')=>2),$data["active"],"active"); + $panel->content.="
"; + $panel->content.="

Char Creation supended?

"; + $panel->select(array($lang->_('YES')=>1,$lang->_('NO')=>0),$data["char_suspended"],"char_suspended"); + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->field(array("name"=>"uid","typ"=>"hidden","value"=>$data["uid"])); + $panel->content.="
"; + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + } + }elseif($_GET["action"]=="delete" && $_GET["user"]){ + $result=$db->query("SELECT * FROM `" . $config["prefix"] . "users` WHERE `uid`='".intval($_GET["user"])."'"); + $data = $db->fetch_array($result); + $plugin->run_hook('admin_user_before_delete',array('data'=>$data)); + $db->query("DELETE FROM `" . $config["prefix"] . "users` WHERE `uid`='".intval($_GET["user"])."'"); + $plugin->run_hook('admin_user_after_delete',array('data'=>$data)); + $panel->admin_message("User gelöscht!","Der User wurde erfolgreich gelöscht.",True,"editusers",3); + }else{ + + $left=""; + $right=""; + $asmodule=""; + $mainmodule=""; + $result=$db->query("SELECT * FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON r.id=u.role ORDER BY u.`uid`"); + while ($row = $db->fetch_array($result)){ + $user[]=$row; + } + $panel->title=$lang->_('USERS'); + $panel->content.=" + + + + + + + + + "; + if(!empty($user)){ + foreach($user as $u){ + if($u['active']==1){ + $u['activetext']=$lang->_('ACTIVE'); + }elseif($u['active']==2){ + $u['activetext']=$lang->_('BANNED'); + }else{ + $u['activetext']=$lang->_('INACTIVE'); + } + $panel->content.=" + + + + + "; + if($u["uid"]==$session->userdata["uid"]){ + $panel->content.=" + "; + }else{ + $panel->content.=" + "; + } + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
".$lang->_('ID')."".$lang->_('USERNAME')."".$lang->_('REALNAME')."".$lang->_('ROLE')."".$lang->_('STATUS')."".$lang->_('ACTION')."
".$u["uid"]."".$u["username"]."".$u["realname"]."".$u["role_name"]."".$u['activetext']."
Keine User verfügbar.

"; + } + } + + function meta() { + global $module,$config,$db,$panel,$userinfo,$admin,$root; + $meta=' + + + + + + '; + return $meta; + + } + + +} +?> diff --git a/admin/images/down.gif b/admin/images/down.gif new file mode 100644 index 0000000..c527b4e Binary files /dev/null and b/admin/images/down.gif differ diff --git a/admin/images/icons/accept.png b/admin/images/icons/accept.png new file mode 100644 index 0000000..89c8129 Binary files /dev/null and b/admin/images/icons/accept.png differ diff --git a/admin/images/icons/add.png b/admin/images/icons/add.png new file mode 100644 index 0000000..6332fef Binary files /dev/null and b/admin/images/icons/add.png differ diff --git a/admin/images/icons/anchor.png b/admin/images/icons/anchor.png new file mode 100644 index 0000000..9b3422c Binary files /dev/null and b/admin/images/icons/anchor.png differ diff --git a/admin/images/icons/application.png b/admin/images/icons/application.png new file mode 100644 index 0000000..1dee9e3 Binary files /dev/null and b/admin/images/icons/application.png differ diff --git a/admin/images/icons/application_add.png b/admin/images/icons/application_add.png new file mode 100644 index 0000000..2e94507 Binary files /dev/null and b/admin/images/icons/application_add.png differ diff --git a/admin/images/icons/application_cascade.png b/admin/images/icons/application_cascade.png new file mode 100644 index 0000000..da5c622 Binary files /dev/null and b/admin/images/icons/application_cascade.png differ diff --git a/admin/images/icons/application_delete.png b/admin/images/icons/application_delete.png new file mode 100644 index 0000000..0a335ac Binary files /dev/null and b/admin/images/icons/application_delete.png differ diff --git a/admin/images/icons/application_double.png b/admin/images/icons/application_double.png new file mode 100644 index 0000000..647592f Binary files /dev/null and b/admin/images/icons/application_double.png differ diff --git a/admin/images/icons/application_edit.png b/admin/images/icons/application_edit.png new file mode 100644 index 0000000..fb2efb8 Binary files /dev/null and b/admin/images/icons/application_edit.png differ diff --git a/admin/images/icons/application_error.png b/admin/images/icons/application_error.png new file mode 100644 index 0000000..b35fa57 Binary files /dev/null and b/admin/images/icons/application_error.png differ diff --git a/admin/images/icons/application_form.png b/admin/images/icons/application_form.png new file mode 100644 index 0000000..807b862 Binary files /dev/null and b/admin/images/icons/application_form.png differ diff --git a/admin/images/icons/application_form_add.png b/admin/images/icons/application_form_add.png new file mode 100644 index 0000000..28c2175 Binary files /dev/null and b/admin/images/icons/application_form_add.png differ diff --git a/admin/images/icons/application_form_delete.png b/admin/images/icons/application_form_delete.png new file mode 100644 index 0000000..cd305ec Binary files /dev/null and b/admin/images/icons/application_form_delete.png differ diff --git a/admin/images/icons/application_form_edit.png b/admin/images/icons/application_form_edit.png new file mode 100644 index 0000000..af486c9 Binary files /dev/null and b/admin/images/icons/application_form_edit.png differ diff --git a/admin/images/icons/application_form_magnify.png b/admin/images/icons/application_form_magnify.png new file mode 100644 index 0000000..7b7fbd1 Binary files /dev/null and b/admin/images/icons/application_form_magnify.png differ diff --git a/admin/images/icons/application_get.png b/admin/images/icons/application_get.png new file mode 100644 index 0000000..28e41ea Binary files /dev/null and b/admin/images/icons/application_get.png differ diff --git a/admin/images/icons/application_go.png b/admin/images/icons/application_go.png new file mode 100644 index 0000000..5cc2b0d Binary files /dev/null and b/admin/images/icons/application_go.png differ diff --git a/admin/images/icons/application_home.png b/admin/images/icons/application_home.png new file mode 100644 index 0000000..b60d0c8 Binary files /dev/null and b/admin/images/icons/application_home.png differ diff --git a/admin/images/icons/application_key.png b/admin/images/icons/application_key.png new file mode 100644 index 0000000..998d65c Binary files /dev/null and b/admin/images/icons/application_key.png differ diff --git a/admin/images/icons/application_lightning.png b/admin/images/icons/application_lightning.png new file mode 100644 index 0000000..7e91545 Binary files /dev/null and b/admin/images/icons/application_lightning.png differ diff --git a/admin/images/icons/application_link.png b/admin/images/icons/application_link.png new file mode 100644 index 0000000..f8fbb3e Binary files /dev/null and b/admin/images/icons/application_link.png differ diff --git a/admin/images/icons/application_osx.png b/admin/images/icons/application_osx.png new file mode 100644 index 0000000..9f022ec Binary files /dev/null and b/admin/images/icons/application_osx.png differ diff --git a/admin/images/icons/application_osx_terminal.png b/admin/images/icons/application_osx_terminal.png new file mode 100644 index 0000000..b3d8ce0 Binary files /dev/null and b/admin/images/icons/application_osx_terminal.png differ diff --git a/admin/images/icons/application_put.png b/admin/images/icons/application_put.png new file mode 100644 index 0000000..c30cf59 Binary files /dev/null and b/admin/images/icons/application_put.png differ diff --git a/admin/images/icons/application_side_boxes.png b/admin/images/icons/application_side_boxes.png new file mode 100644 index 0000000..efbf3c4 Binary files /dev/null and b/admin/images/icons/application_side_boxes.png differ diff --git a/admin/images/icons/application_side_contract.png b/admin/images/icons/application_side_contract.png new file mode 100644 index 0000000..3585f94 Binary files /dev/null and b/admin/images/icons/application_side_contract.png differ diff --git a/admin/images/icons/application_side_expand.png b/admin/images/icons/application_side_expand.png new file mode 100644 index 0000000..030cf7c Binary files /dev/null and b/admin/images/icons/application_side_expand.png differ diff --git a/admin/images/icons/application_side_list.png b/admin/images/icons/application_side_list.png new file mode 100644 index 0000000..248eaf1 Binary files /dev/null and b/admin/images/icons/application_side_list.png differ diff --git a/admin/images/icons/application_side_tree.png b/admin/images/icons/application_side_tree.png new file mode 100644 index 0000000..f04a52b Binary files /dev/null and b/admin/images/icons/application_side_tree.png differ diff --git a/admin/images/icons/application_split.png b/admin/images/icons/application_split.png new file mode 100644 index 0000000..a91c78a Binary files /dev/null and b/admin/images/icons/application_split.png differ diff --git a/admin/images/icons/application_tile_horizontal.png b/admin/images/icons/application_tile_horizontal.png new file mode 100644 index 0000000..8a1191c Binary files /dev/null and b/admin/images/icons/application_tile_horizontal.png differ diff --git a/admin/images/icons/application_tile_vertical.png b/admin/images/icons/application_tile_vertical.png new file mode 100644 index 0000000..1d40383 Binary files /dev/null and b/admin/images/icons/application_tile_vertical.png differ diff --git a/admin/images/icons/application_view_columns.png b/admin/images/icons/application_view_columns.png new file mode 100644 index 0000000..dc2e9d5 Binary files /dev/null and b/admin/images/icons/application_view_columns.png differ diff --git a/admin/images/icons/application_view_detail.png b/admin/images/icons/application_view_detail.png new file mode 100644 index 0000000..aba044b Binary files /dev/null and b/admin/images/icons/application_view_detail.png differ diff --git a/admin/images/icons/application_view_gallery.png b/admin/images/icons/application_view_gallery.png new file mode 100644 index 0000000..851950d Binary files /dev/null and b/admin/images/icons/application_view_gallery.png differ diff --git a/admin/images/icons/application_view_icons.png b/admin/images/icons/application_view_icons.png new file mode 100644 index 0000000..6a93cda Binary files /dev/null and b/admin/images/icons/application_view_icons.png differ diff --git a/admin/images/icons/application_view_list.png b/admin/images/icons/application_view_list.png new file mode 100644 index 0000000..acc30b8 Binary files /dev/null and b/admin/images/icons/application_view_list.png differ diff --git a/admin/images/icons/application_view_tile.png b/admin/images/icons/application_view_tile.png new file mode 100644 index 0000000..3bc0bd3 Binary files /dev/null and b/admin/images/icons/application_view_tile.png differ diff --git a/admin/images/icons/application_xp.png b/admin/images/icons/application_xp.png new file mode 100644 index 0000000..d22860a Binary files /dev/null and b/admin/images/icons/application_xp.png differ diff --git a/admin/images/icons/application_xp_terminal.png b/admin/images/icons/application_xp_terminal.png new file mode 100644 index 0000000..c28dd63 Binary files /dev/null and b/admin/images/icons/application_xp_terminal.png differ diff --git a/admin/images/icons/arrow_branch.png b/admin/images/icons/arrow_branch.png new file mode 100644 index 0000000..7542db1 Binary files /dev/null and b/admin/images/icons/arrow_branch.png differ diff --git a/admin/images/icons/arrow_divide.png b/admin/images/icons/arrow_divide.png new file mode 100644 index 0000000..61a7b1d Binary files /dev/null and b/admin/images/icons/arrow_divide.png differ diff --git a/admin/images/icons/arrow_down.png b/admin/images/icons/arrow_down.png new file mode 100644 index 0000000..2c4e279 Binary files /dev/null and b/admin/images/icons/arrow_down.png differ diff --git a/admin/images/icons/arrow_in.png b/admin/images/icons/arrow_in.png new file mode 100644 index 0000000..745c651 Binary files /dev/null and b/admin/images/icons/arrow_in.png differ diff --git a/admin/images/icons/arrow_inout.png b/admin/images/icons/arrow_inout.png new file mode 100644 index 0000000..1b76367 Binary files /dev/null and b/admin/images/icons/arrow_inout.png differ diff --git a/admin/images/icons/arrow_join.png b/admin/images/icons/arrow_join.png new file mode 100644 index 0000000..a128413 Binary files /dev/null and b/admin/images/icons/arrow_join.png differ diff --git a/admin/images/icons/arrow_left.png b/admin/images/icons/arrow_left.png new file mode 100644 index 0000000..5dc6967 Binary files /dev/null and b/admin/images/icons/arrow_left.png differ diff --git a/admin/images/icons/arrow_merge.png b/admin/images/icons/arrow_merge.png new file mode 100644 index 0000000..7502dbb Binary files /dev/null and b/admin/images/icons/arrow_merge.png differ diff --git a/admin/images/icons/arrow_out.png b/admin/images/icons/arrow_out.png new file mode 100644 index 0000000..2e9bc42 Binary files /dev/null and b/admin/images/icons/arrow_out.png differ diff --git a/admin/images/icons/arrow_redo.png b/admin/images/icons/arrow_redo.png new file mode 100644 index 0000000..fdc394c Binary files /dev/null and b/admin/images/icons/arrow_redo.png differ diff --git a/admin/images/icons/arrow_refresh.png b/admin/images/icons/arrow_refresh.png new file mode 100644 index 0000000..0de2656 Binary files /dev/null and b/admin/images/icons/arrow_refresh.png differ diff --git a/admin/images/icons/arrow_refresh_small.png b/admin/images/icons/arrow_refresh_small.png new file mode 100644 index 0000000..d3087df Binary files /dev/null and b/admin/images/icons/arrow_refresh_small.png differ diff --git a/admin/images/icons/arrow_right.png b/admin/images/icons/arrow_right.png new file mode 100644 index 0000000..b1a1819 Binary files /dev/null and b/admin/images/icons/arrow_right.png differ diff --git a/admin/images/icons/arrow_rotate_anticlockwise.png b/admin/images/icons/arrow_rotate_anticlockwise.png new file mode 100644 index 0000000..46c75aa Binary files /dev/null and b/admin/images/icons/arrow_rotate_anticlockwise.png differ diff --git a/admin/images/icons/arrow_rotate_clockwise.png b/admin/images/icons/arrow_rotate_clockwise.png new file mode 100644 index 0000000..aa65210 Binary files /dev/null and b/admin/images/icons/arrow_rotate_clockwise.png differ diff --git a/admin/images/icons/arrow_switch.png b/admin/images/icons/arrow_switch.png new file mode 100644 index 0000000..258c16c Binary files /dev/null and b/admin/images/icons/arrow_switch.png differ diff --git a/admin/images/icons/arrow_turn_left.png b/admin/images/icons/arrow_turn_left.png new file mode 100644 index 0000000..a3d6c9e Binary files /dev/null and b/admin/images/icons/arrow_turn_left.png differ diff --git a/admin/images/icons/arrow_turn_right.png b/admin/images/icons/arrow_turn_right.png new file mode 100644 index 0000000..629f20d Binary files /dev/null and b/admin/images/icons/arrow_turn_right.png differ diff --git a/admin/images/icons/arrow_undo.png b/admin/images/icons/arrow_undo.png new file mode 100644 index 0000000..6972c5e Binary files /dev/null and b/admin/images/icons/arrow_undo.png differ diff --git a/admin/images/icons/arrow_up.png b/admin/images/icons/arrow_up.png new file mode 100644 index 0000000..1ebb193 Binary files /dev/null and b/admin/images/icons/arrow_up.png differ diff --git a/admin/images/icons/asterisk_orange.png b/admin/images/icons/asterisk_orange.png new file mode 100644 index 0000000..1ebebde Binary files /dev/null and b/admin/images/icons/asterisk_orange.png differ diff --git a/admin/images/icons/asterisk_yellow.png b/admin/images/icons/asterisk_yellow.png new file mode 100644 index 0000000..bab7cc9 Binary files /dev/null and b/admin/images/icons/asterisk_yellow.png differ diff --git a/admin/images/icons/attach.png b/admin/images/icons/attach.png new file mode 100644 index 0000000..ea897cc Binary files /dev/null and b/admin/images/icons/attach.png differ diff --git a/admin/images/icons/award_star_add.png b/admin/images/icons/award_star_add.png new file mode 100644 index 0000000..9c4be9b Binary files /dev/null and b/admin/images/icons/award_star_add.png differ diff --git a/admin/images/icons/award_star_bronze_1.png b/admin/images/icons/award_star_bronze_1.png new file mode 100644 index 0000000..658c711 Binary files /dev/null and b/admin/images/icons/award_star_bronze_1.png differ diff --git a/admin/images/icons/award_star_bronze_2.png b/admin/images/icons/award_star_bronze_2.png new file mode 100644 index 0000000..e47babd Binary files /dev/null and b/admin/images/icons/award_star_bronze_2.png differ diff --git a/admin/images/icons/award_star_bronze_3.png b/admin/images/icons/award_star_bronze_3.png new file mode 100644 index 0000000..396e4b3 Binary files /dev/null and b/admin/images/icons/award_star_bronze_3.png differ diff --git a/admin/images/icons/award_star_delete.png b/admin/images/icons/award_star_delete.png new file mode 100644 index 0000000..4721b15 Binary files /dev/null and b/admin/images/icons/award_star_delete.png differ diff --git a/admin/images/icons/award_star_gold_1.png b/admin/images/icons/award_star_gold_1.png new file mode 100644 index 0000000..97a22b7 Binary files /dev/null and b/admin/images/icons/award_star_gold_1.png differ diff --git a/admin/images/icons/award_star_gold_2.png b/admin/images/icons/award_star_gold_2.png new file mode 100644 index 0000000..0eaa571 Binary files /dev/null and b/admin/images/icons/award_star_gold_2.png differ diff --git a/admin/images/icons/award_star_gold_3.png b/admin/images/icons/award_star_gold_3.png new file mode 100644 index 0000000..124c991 Binary files /dev/null and b/admin/images/icons/award_star_gold_3.png differ diff --git a/admin/images/icons/award_star_silver_1.png b/admin/images/icons/award_star_silver_1.png new file mode 100644 index 0000000..028a546 Binary files /dev/null and b/admin/images/icons/award_star_silver_1.png differ diff --git a/admin/images/icons/award_star_silver_2.png b/admin/images/icons/award_star_silver_2.png new file mode 100644 index 0000000..e487c3a Binary files /dev/null and b/admin/images/icons/award_star_silver_2.png differ diff --git a/admin/images/icons/award_star_silver_3.png b/admin/images/icons/award_star_silver_3.png new file mode 100644 index 0000000..1d72d47 Binary files /dev/null and b/admin/images/icons/award_star_silver_3.png differ diff --git a/admin/images/icons/basket.png b/admin/images/icons/basket.png new file mode 100644 index 0000000..b0686d7 Binary files /dev/null and b/admin/images/icons/basket.png differ diff --git a/admin/images/icons/basket_add.png b/admin/images/icons/basket_add.png new file mode 100644 index 0000000..3554368 Binary files /dev/null and b/admin/images/icons/basket_add.png differ diff --git a/admin/images/icons/basket_delete.png b/admin/images/icons/basket_delete.png new file mode 100644 index 0000000..1349974 Binary files /dev/null and b/admin/images/icons/basket_delete.png differ diff --git a/admin/images/icons/basket_edit.png b/admin/images/icons/basket_edit.png new file mode 100644 index 0000000..8138bbd Binary files /dev/null and b/admin/images/icons/basket_edit.png differ diff --git a/admin/images/icons/basket_error.png b/admin/images/icons/basket_error.png new file mode 100644 index 0000000..3978b29 Binary files /dev/null and b/admin/images/icons/basket_error.png differ diff --git a/admin/images/icons/basket_go.png b/admin/images/icons/basket_go.png new file mode 100644 index 0000000..ed8b9a5 Binary files /dev/null and b/admin/images/icons/basket_go.png differ diff --git a/admin/images/icons/basket_put.png b/admin/images/icons/basket_put.png new file mode 100644 index 0000000..be62faa Binary files /dev/null and b/admin/images/icons/basket_put.png differ diff --git a/admin/images/icons/basket_remove.png b/admin/images/icons/basket_remove.png new file mode 100644 index 0000000..04dd7fd Binary files /dev/null and b/admin/images/icons/basket_remove.png differ diff --git a/admin/images/icons/bell.png b/admin/images/icons/bell.png new file mode 100644 index 0000000..6e0015d Binary files /dev/null and b/admin/images/icons/bell.png differ diff --git a/admin/images/icons/bell_add.png b/admin/images/icons/bell_add.png new file mode 100644 index 0000000..7db01d6 Binary files /dev/null and b/admin/images/icons/bell_add.png differ diff --git a/admin/images/icons/bell_delete.png b/admin/images/icons/bell_delete.png new file mode 100644 index 0000000..23907bb Binary files /dev/null and b/admin/images/icons/bell_delete.png differ diff --git a/admin/images/icons/bell_error.png b/admin/images/icons/bell_error.png new file mode 100644 index 0000000..a0ddc00 Binary files /dev/null and b/admin/images/icons/bell_error.png differ diff --git a/admin/images/icons/bell_go.png b/admin/images/icons/bell_go.png new file mode 100644 index 0000000..b89bb34 Binary files /dev/null and b/admin/images/icons/bell_go.png differ diff --git a/admin/images/icons/bell_link.png b/admin/images/icons/bell_link.png new file mode 100644 index 0000000..b8c64af Binary files /dev/null and b/admin/images/icons/bell_link.png differ diff --git a/admin/images/icons/bin.png b/admin/images/icons/bin.png new file mode 100644 index 0000000..ebad933 Binary files /dev/null and b/admin/images/icons/bin.png differ diff --git a/admin/images/icons/bin_closed.png b/admin/images/icons/bin_closed.png new file mode 100644 index 0000000..afe22ba Binary files /dev/null and b/admin/images/icons/bin_closed.png differ diff --git a/admin/images/icons/bin_empty.png b/admin/images/icons/bin_empty.png new file mode 100644 index 0000000..375b8bf Binary files /dev/null and b/admin/images/icons/bin_empty.png differ diff --git a/admin/images/icons/bomb.png b/admin/images/icons/bomb.png new file mode 100644 index 0000000..1be3797 Binary files /dev/null and b/admin/images/icons/bomb.png differ diff --git a/admin/images/icons/book.png b/admin/images/icons/book.png new file mode 100644 index 0000000..b0f4dd7 Binary files /dev/null and b/admin/images/icons/book.png differ diff --git a/admin/images/icons/book_add.png b/admin/images/icons/book_add.png new file mode 100644 index 0000000..e2f0847 Binary files /dev/null and b/admin/images/icons/book_add.png differ diff --git a/admin/images/icons/book_addresses.png b/admin/images/icons/book_addresses.png new file mode 100644 index 0000000..b73419b Binary files /dev/null and b/admin/images/icons/book_addresses.png differ diff --git a/admin/images/icons/book_delete.png b/admin/images/icons/book_delete.png new file mode 100644 index 0000000..d9a6340 Binary files /dev/null and b/admin/images/icons/book_delete.png differ diff --git a/admin/images/icons/book_edit.png b/admin/images/icons/book_edit.png new file mode 100644 index 0000000..6e756cc Binary files /dev/null and b/admin/images/icons/book_edit.png differ diff --git a/admin/images/icons/book_error.png b/admin/images/icons/book_error.png new file mode 100644 index 0000000..f3fbed0 Binary files /dev/null and b/admin/images/icons/book_error.png differ diff --git a/admin/images/icons/book_go.png b/admin/images/icons/book_go.png new file mode 100644 index 0000000..cd4e196 Binary files /dev/null and b/admin/images/icons/book_go.png differ diff --git a/admin/images/icons/book_key.png b/admin/images/icons/book_key.png new file mode 100644 index 0000000..d8e23ec Binary files /dev/null and b/admin/images/icons/book_key.png differ diff --git a/admin/images/icons/book_link.png b/admin/images/icons/book_link.png new file mode 100644 index 0000000..dd0820e Binary files /dev/null and b/admin/images/icons/book_link.png differ diff --git a/admin/images/icons/book_next.png b/admin/images/icons/book_next.png new file mode 100644 index 0000000..ff2ea1a Binary files /dev/null and b/admin/images/icons/book_next.png differ diff --git a/admin/images/icons/book_open.png b/admin/images/icons/book_open.png new file mode 100644 index 0000000..7d863f9 Binary files /dev/null and b/admin/images/icons/book_open.png differ diff --git a/admin/images/icons/book_previous.png b/admin/images/icons/book_previous.png new file mode 100644 index 0000000..2e53c69 Binary files /dev/null and b/admin/images/icons/book_previous.png differ diff --git a/admin/images/icons/box.png b/admin/images/icons/box.png new file mode 100644 index 0000000..8443c23 Binary files /dev/null and b/admin/images/icons/box.png differ diff --git a/admin/images/icons/brick.png b/admin/images/icons/brick.png new file mode 100644 index 0000000..7851cf3 Binary files /dev/null and b/admin/images/icons/brick.png differ diff --git a/admin/images/icons/brick_add.png b/admin/images/icons/brick_add.png new file mode 100644 index 0000000..fac186b Binary files /dev/null and b/admin/images/icons/brick_add.png differ diff --git a/admin/images/icons/brick_delete.png b/admin/images/icons/brick_delete.png new file mode 100644 index 0000000..3a8c373 Binary files /dev/null and b/admin/images/icons/brick_delete.png differ diff --git a/admin/images/icons/brick_edit.png b/admin/images/icons/brick_edit.png new file mode 100644 index 0000000..eb06df3 Binary files /dev/null and b/admin/images/icons/brick_edit.png differ diff --git a/admin/images/icons/brick_error.png b/admin/images/icons/brick_error.png new file mode 100644 index 0000000..18ab01e Binary files /dev/null and b/admin/images/icons/brick_error.png differ diff --git a/admin/images/icons/brick_go.png b/admin/images/icons/brick_go.png new file mode 100644 index 0000000..fe0d335 Binary files /dev/null and b/admin/images/icons/brick_go.png differ diff --git a/admin/images/icons/brick_link.png b/admin/images/icons/brick_link.png new file mode 100644 index 0000000..9ebf013 Binary files /dev/null and b/admin/images/icons/brick_link.png differ diff --git a/admin/images/icons/bricks.png b/admin/images/icons/bricks.png new file mode 100644 index 0000000..0905f93 Binary files /dev/null and b/admin/images/icons/bricks.png differ diff --git a/admin/images/icons/briefcase.png b/admin/images/icons/briefcase.png new file mode 100644 index 0000000..05c5649 Binary files /dev/null and b/admin/images/icons/briefcase.png differ diff --git a/admin/images/icons/bug.png b/admin/images/icons/bug.png new file mode 100644 index 0000000..2d5fb90 Binary files /dev/null and b/admin/images/icons/bug.png differ diff --git a/admin/images/icons/bug_add.png b/admin/images/icons/bug_add.png new file mode 100644 index 0000000..ced7817 Binary files /dev/null and b/admin/images/icons/bug_add.png differ diff --git a/admin/images/icons/bug_delete.png b/admin/images/icons/bug_delete.png new file mode 100644 index 0000000..e81d757 Binary files /dev/null and b/admin/images/icons/bug_delete.png differ diff --git a/admin/images/icons/bug_edit.png b/admin/images/icons/bug_edit.png new file mode 100644 index 0000000..e5c7dc0 Binary files /dev/null and b/admin/images/icons/bug_edit.png differ diff --git a/admin/images/icons/bug_error.png b/admin/images/icons/bug_error.png new file mode 100644 index 0000000..c4e8c28 Binary files /dev/null and b/admin/images/icons/bug_error.png differ diff --git a/admin/images/icons/bug_go.png b/admin/images/icons/bug_go.png new file mode 100644 index 0000000..4e4ae99 Binary files /dev/null and b/admin/images/icons/bug_go.png differ diff --git a/admin/images/icons/bug_link.png b/admin/images/icons/bug_link.png new file mode 100644 index 0000000..30e25ab Binary files /dev/null and b/admin/images/icons/bug_link.png differ diff --git a/admin/images/icons/building.png b/admin/images/icons/building.png new file mode 100644 index 0000000..11a017c Binary files /dev/null and b/admin/images/icons/building.png differ diff --git a/admin/images/icons/building_add.png b/admin/images/icons/building_add.png new file mode 100644 index 0000000..d88e2b9 Binary files /dev/null and b/admin/images/icons/building_add.png differ diff --git a/admin/images/icons/building_delete.png b/admin/images/icons/building_delete.png new file mode 100644 index 0000000..db6455d Binary files /dev/null and b/admin/images/icons/building_delete.png differ diff --git a/admin/images/icons/building_edit.png b/admin/images/icons/building_edit.png new file mode 100644 index 0000000..646db36 Binary files /dev/null and b/admin/images/icons/building_edit.png differ diff --git a/admin/images/icons/building_error.png b/admin/images/icons/building_error.png new file mode 100644 index 0000000..a342eef Binary files /dev/null and b/admin/images/icons/building_error.png differ diff --git a/admin/images/icons/building_go.png b/admin/images/icons/building_go.png new file mode 100644 index 0000000..cdcbcb3 Binary files /dev/null and b/admin/images/icons/building_go.png differ diff --git a/admin/images/icons/building_key.png b/admin/images/icons/building_key.png new file mode 100644 index 0000000..8b79e30 Binary files /dev/null and b/admin/images/icons/building_key.png differ diff --git a/admin/images/icons/building_link.png b/admin/images/icons/building_link.png new file mode 100644 index 0000000..a340629 Binary files /dev/null and b/admin/images/icons/building_link.png differ diff --git a/admin/images/icons/bullet_add.png b/admin/images/icons/bullet_add.png new file mode 100644 index 0000000..41ff833 Binary files /dev/null and b/admin/images/icons/bullet_add.png differ diff --git a/admin/images/icons/bullet_arrow_bottom.png b/admin/images/icons/bullet_arrow_bottom.png new file mode 100644 index 0000000..1a28d82 Binary files /dev/null and b/admin/images/icons/bullet_arrow_bottom.png differ diff --git a/admin/images/icons/bullet_arrow_down.png b/admin/images/icons/bullet_arrow_down.png new file mode 100644 index 0000000..9b23c06 Binary files /dev/null and b/admin/images/icons/bullet_arrow_down.png differ diff --git a/admin/images/icons/bullet_arrow_top.png b/admin/images/icons/bullet_arrow_top.png new file mode 100644 index 0000000..0ce86d2 Binary files /dev/null and b/admin/images/icons/bullet_arrow_top.png differ diff --git a/admin/images/icons/bullet_arrow_up.png b/admin/images/icons/bullet_arrow_up.png new file mode 100644 index 0000000..24df0f4 Binary files /dev/null and b/admin/images/icons/bullet_arrow_up.png differ diff --git a/admin/images/icons/bullet_black.png b/admin/images/icons/bullet_black.png new file mode 100644 index 0000000..5761970 Binary files /dev/null and b/admin/images/icons/bullet_black.png differ diff --git a/admin/images/icons/bullet_blue.png b/admin/images/icons/bullet_blue.png new file mode 100644 index 0000000..a7651ec Binary files /dev/null and b/admin/images/icons/bullet_blue.png differ diff --git a/admin/images/icons/bullet_delete.png b/admin/images/icons/bullet_delete.png new file mode 100644 index 0000000..bd6271b Binary files /dev/null and b/admin/images/icons/bullet_delete.png differ diff --git a/admin/images/icons/bullet_disk.png b/admin/images/icons/bullet_disk.png new file mode 100644 index 0000000..209c6a7 Binary files /dev/null and b/admin/images/icons/bullet_disk.png differ diff --git a/admin/images/icons/bullet_error.png b/admin/images/icons/bullet_error.png new file mode 100644 index 0000000..bca2b49 Binary files /dev/null and b/admin/images/icons/bullet_error.png differ diff --git a/admin/images/icons/bullet_feed.png b/admin/images/icons/bullet_feed.png new file mode 100644 index 0000000..1a0e0f1 Binary files /dev/null and b/admin/images/icons/bullet_feed.png differ diff --git a/admin/images/icons/bullet_go.png b/admin/images/icons/bullet_go.png new file mode 100644 index 0000000..bc4faa7 Binary files /dev/null and b/admin/images/icons/bullet_go.png differ diff --git a/admin/images/icons/bullet_green.png b/admin/images/icons/bullet_green.png new file mode 100644 index 0000000..058ad26 Binary files /dev/null and b/admin/images/icons/bullet_green.png differ diff --git a/admin/images/icons/bullet_key.png b/admin/images/icons/bullet_key.png new file mode 100644 index 0000000..3d37f2e Binary files /dev/null and b/admin/images/icons/bullet_key.png differ diff --git a/admin/images/icons/bullet_orange.png b/admin/images/icons/bullet_orange.png new file mode 100644 index 0000000..fa63024 Binary files /dev/null and b/admin/images/icons/bullet_orange.png differ diff --git a/admin/images/icons/bullet_picture.png b/admin/images/icons/bullet_picture.png new file mode 100644 index 0000000..386cb30 Binary files /dev/null and b/admin/images/icons/bullet_picture.png differ diff --git a/admin/images/icons/bullet_pink.png b/admin/images/icons/bullet_pink.png new file mode 100644 index 0000000..0c9f73e Binary files /dev/null and b/admin/images/icons/bullet_pink.png differ diff --git a/admin/images/icons/bullet_purple.png b/admin/images/icons/bullet_purple.png new file mode 100644 index 0000000..52ba503 Binary files /dev/null and b/admin/images/icons/bullet_purple.png differ diff --git a/admin/images/icons/bullet_red.png b/admin/images/icons/bullet_red.png new file mode 100644 index 0000000..0cd8031 Binary files /dev/null and b/admin/images/icons/bullet_red.png differ diff --git a/admin/images/icons/bullet_star.png b/admin/images/icons/bullet_star.png new file mode 100644 index 0000000..fab774a Binary files /dev/null and b/admin/images/icons/bullet_star.png differ diff --git a/admin/images/icons/bullet_toggle_minus.png b/admin/images/icons/bullet_toggle_minus.png new file mode 100644 index 0000000..b47ce55 Binary files /dev/null and b/admin/images/icons/bullet_toggle_minus.png differ diff --git a/admin/images/icons/bullet_toggle_plus.png b/admin/images/icons/bullet_toggle_plus.png new file mode 100644 index 0000000..9ab4a89 Binary files /dev/null and b/admin/images/icons/bullet_toggle_plus.png differ diff --git a/admin/images/icons/bullet_white.png b/admin/images/icons/bullet_white.png new file mode 100644 index 0000000..a9af8d4 Binary files /dev/null and b/admin/images/icons/bullet_white.png differ diff --git a/admin/images/icons/bullet_wrench.png b/admin/images/icons/bullet_wrench.png new file mode 100644 index 0000000..67817e6 Binary files /dev/null and b/admin/images/icons/bullet_wrench.png differ diff --git a/admin/images/icons/bullet_yellow.png b/admin/images/icons/bullet_yellow.png new file mode 100644 index 0000000..6469cea Binary files /dev/null and b/admin/images/icons/bullet_yellow.png differ diff --git a/admin/images/icons/cake.png b/admin/images/icons/cake.png new file mode 100644 index 0000000..4ef151a Binary files /dev/null and b/admin/images/icons/cake.png differ diff --git a/admin/images/icons/calculator.png b/admin/images/icons/calculator.png new file mode 100644 index 0000000..701a60a Binary files /dev/null and b/admin/images/icons/calculator.png differ diff --git a/admin/images/icons/calculator_add.png b/admin/images/icons/calculator_add.png new file mode 100644 index 0000000..fd377bd Binary files /dev/null and b/admin/images/icons/calculator_add.png differ diff --git a/admin/images/icons/calculator_delete.png b/admin/images/icons/calculator_delete.png new file mode 100644 index 0000000..ac96170 Binary files /dev/null and b/admin/images/icons/calculator_delete.png differ diff --git a/admin/images/icons/calculator_edit.png b/admin/images/icons/calculator_edit.png new file mode 100644 index 0000000..63b06b9 Binary files /dev/null and b/admin/images/icons/calculator_edit.png differ diff --git a/admin/images/icons/calculator_error.png b/admin/images/icons/calculator_error.png new file mode 100644 index 0000000..0bc4288 Binary files /dev/null and b/admin/images/icons/calculator_error.png differ diff --git a/admin/images/icons/calculator_link.png b/admin/images/icons/calculator_link.png new file mode 100644 index 0000000..a2a8fe6 Binary files /dev/null and b/admin/images/icons/calculator_link.png differ diff --git a/admin/images/icons/calendar.png b/admin/images/icons/calendar.png new file mode 100644 index 0000000..6589138 Binary files /dev/null and b/admin/images/icons/calendar.png differ diff --git a/admin/images/icons/calendar_add.png b/admin/images/icons/calendar_add.png new file mode 100644 index 0000000..17679db Binary files /dev/null and b/admin/images/icons/calendar_add.png differ diff --git a/admin/images/icons/calendar_delete.png b/admin/images/icons/calendar_delete.png new file mode 100644 index 0000000..69a3b10 Binary files /dev/null and b/admin/images/icons/calendar_delete.png differ diff --git a/admin/images/icons/calendar_edit.png b/admin/images/icons/calendar_edit.png new file mode 100644 index 0000000..d1d2d6e Binary files /dev/null and b/admin/images/icons/calendar_edit.png differ diff --git a/admin/images/icons/calendar_link.png b/admin/images/icons/calendar_link.png new file mode 100644 index 0000000..6b106b9 Binary files /dev/null and b/admin/images/icons/calendar_link.png differ diff --git a/admin/images/icons/calendar_view_day.png b/admin/images/icons/calendar_view_day.png new file mode 100644 index 0000000..9740f76 Binary files /dev/null and b/admin/images/icons/calendar_view_day.png differ diff --git a/admin/images/icons/calendar_view_month.png b/admin/images/icons/calendar_view_month.png new file mode 100644 index 0000000..6cff76c Binary files /dev/null and b/admin/images/icons/calendar_view_month.png differ diff --git a/admin/images/icons/calendar_view_week.png b/admin/images/icons/calendar_view_week.png new file mode 100644 index 0000000..8fe695f Binary files /dev/null and b/admin/images/icons/calendar_view_week.png differ diff --git a/admin/images/icons/camera.png b/admin/images/icons/camera.png new file mode 100644 index 0000000..8536d1a Binary files /dev/null and b/admin/images/icons/camera.png differ diff --git a/admin/images/icons/camera_add.png b/admin/images/icons/camera_add.png new file mode 100644 index 0000000..08b5da9 Binary files /dev/null and b/admin/images/icons/camera_add.png differ diff --git a/admin/images/icons/camera_delete.png b/admin/images/icons/camera_delete.png new file mode 100644 index 0000000..3846d74 Binary files /dev/null and b/admin/images/icons/camera_delete.png differ diff --git a/admin/images/icons/camera_edit.png b/admin/images/icons/camera_edit.png new file mode 100644 index 0000000..b5015b1 Binary files /dev/null and b/admin/images/icons/camera_edit.png differ diff --git a/admin/images/icons/camera_error.png b/admin/images/icons/camera_error.png new file mode 100644 index 0000000..3c1bc95 Binary files /dev/null and b/admin/images/icons/camera_error.png differ diff --git a/admin/images/icons/camera_go.png b/admin/images/icons/camera_go.png new file mode 100644 index 0000000..94ce2b2 Binary files /dev/null and b/admin/images/icons/camera_go.png differ diff --git a/admin/images/icons/camera_link.png b/admin/images/icons/camera_link.png new file mode 100644 index 0000000..d2ac9f9 Binary files /dev/null and b/admin/images/icons/camera_link.png differ diff --git a/admin/images/icons/camera_small.png b/admin/images/icons/camera_small.png new file mode 100644 index 0000000..454b0b0 Binary files /dev/null and b/admin/images/icons/camera_small.png differ diff --git a/admin/images/icons/cancel.png b/admin/images/icons/cancel.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/admin/images/icons/cancel.png differ diff --git a/admin/images/icons/car.png b/admin/images/icons/car.png new file mode 100644 index 0000000..4f3a770 Binary files /dev/null and b/admin/images/icons/car.png differ diff --git a/admin/images/icons/car_add.png b/admin/images/icons/car_add.png new file mode 100644 index 0000000..1215a51 Binary files /dev/null and b/admin/images/icons/car_add.png differ diff --git a/admin/images/icons/car_delete.png b/admin/images/icons/car_delete.png new file mode 100644 index 0000000..2803b56 Binary files /dev/null and b/admin/images/icons/car_delete.png differ diff --git a/admin/images/icons/cart.png b/admin/images/icons/cart.png new file mode 100644 index 0000000..1baf7b9 Binary files /dev/null and b/admin/images/icons/cart.png differ diff --git a/admin/images/icons/cart_add.png b/admin/images/icons/cart_add.png new file mode 100644 index 0000000..45c2900 Binary files /dev/null and b/admin/images/icons/cart_add.png differ diff --git a/admin/images/icons/cart_delete.png b/admin/images/icons/cart_delete.png new file mode 100644 index 0000000..ac5bce5 Binary files /dev/null and b/admin/images/icons/cart_delete.png differ diff --git a/admin/images/icons/cart_edit.png b/admin/images/icons/cart_edit.png new file mode 100644 index 0000000..b94ff88 Binary files /dev/null and b/admin/images/icons/cart_edit.png differ diff --git a/admin/images/icons/cart_error.png b/admin/images/icons/cart_error.png new file mode 100644 index 0000000..144c835 Binary files /dev/null and b/admin/images/icons/cart_error.png differ diff --git a/admin/images/icons/cart_go.png b/admin/images/icons/cart_go.png new file mode 100644 index 0000000..20ee058 Binary files /dev/null and b/admin/images/icons/cart_go.png differ diff --git a/admin/images/icons/cart_put.png b/admin/images/icons/cart_put.png new file mode 100644 index 0000000..3aec353 Binary files /dev/null and b/admin/images/icons/cart_put.png differ diff --git a/admin/images/icons/cart_remove.png b/admin/images/icons/cart_remove.png new file mode 100644 index 0000000..360217b Binary files /dev/null and b/admin/images/icons/cart_remove.png differ diff --git a/admin/images/icons/cd.png b/admin/images/icons/cd.png new file mode 100644 index 0000000..ef43223 Binary files /dev/null and b/admin/images/icons/cd.png differ diff --git a/admin/images/icons/cd_add.png b/admin/images/icons/cd_add.png new file mode 100644 index 0000000..b0254ef Binary files /dev/null and b/admin/images/icons/cd_add.png differ diff --git a/admin/images/icons/cd_burn.png b/admin/images/icons/cd_burn.png new file mode 100644 index 0000000..157cb0b Binary files /dev/null and b/admin/images/icons/cd_burn.png differ diff --git a/admin/images/icons/cd_delete.png b/admin/images/icons/cd_delete.png new file mode 100644 index 0000000..7d7b3d5 Binary files /dev/null and b/admin/images/icons/cd_delete.png differ diff --git a/admin/images/icons/cd_edit.png b/admin/images/icons/cd_edit.png new file mode 100644 index 0000000..b0dc194 Binary files /dev/null and b/admin/images/icons/cd_edit.png differ diff --git a/admin/images/icons/cd_eject.png b/admin/images/icons/cd_eject.png new file mode 100644 index 0000000..762932f Binary files /dev/null and b/admin/images/icons/cd_eject.png differ diff --git a/admin/images/icons/cd_go.png b/admin/images/icons/cd_go.png new file mode 100644 index 0000000..13e0499 Binary files /dev/null and b/admin/images/icons/cd_go.png differ diff --git a/admin/images/icons/chart_bar.png b/admin/images/icons/chart_bar.png new file mode 100644 index 0000000..9051fbc Binary files /dev/null and b/admin/images/icons/chart_bar.png differ diff --git a/admin/images/icons/chart_bar_add.png b/admin/images/icons/chart_bar_add.png new file mode 100644 index 0000000..d283e84 Binary files /dev/null and b/admin/images/icons/chart_bar_add.png differ diff --git a/admin/images/icons/chart_bar_delete.png b/admin/images/icons/chart_bar_delete.png new file mode 100644 index 0000000..259f686 Binary files /dev/null and b/admin/images/icons/chart_bar_delete.png differ diff --git a/admin/images/icons/chart_bar_edit.png b/admin/images/icons/chart_bar_edit.png new file mode 100644 index 0000000..df64d97 Binary files /dev/null and b/admin/images/icons/chart_bar_edit.png differ diff --git a/admin/images/icons/chart_bar_error.png b/admin/images/icons/chart_bar_error.png new file mode 100644 index 0000000..bdacea5 Binary files /dev/null and b/admin/images/icons/chart_bar_error.png differ diff --git a/admin/images/icons/chart_bar_link.png b/admin/images/icons/chart_bar_link.png new file mode 100644 index 0000000..bf18aed Binary files /dev/null and b/admin/images/icons/chart_bar_link.png differ diff --git a/admin/images/icons/chart_curve.png b/admin/images/icons/chart_curve.png new file mode 100644 index 0000000..01e933a Binary files /dev/null and b/admin/images/icons/chart_curve.png differ diff --git a/admin/images/icons/chart_curve_add.png b/admin/images/icons/chart_curve_add.png new file mode 100644 index 0000000..f9e2050 Binary files /dev/null and b/admin/images/icons/chart_curve_add.png differ diff --git a/admin/images/icons/chart_curve_delete.png b/admin/images/icons/chart_curve_delete.png new file mode 100644 index 0000000..b411391 Binary files /dev/null and b/admin/images/icons/chart_curve_delete.png differ diff --git a/admin/images/icons/chart_curve_edit.png b/admin/images/icons/chart_curve_edit.png new file mode 100644 index 0000000..bd07673 Binary files /dev/null and b/admin/images/icons/chart_curve_edit.png differ diff --git a/admin/images/icons/chart_curve_error.png b/admin/images/icons/chart_curve_error.png new file mode 100644 index 0000000..906dd03 Binary files /dev/null and b/admin/images/icons/chart_curve_error.png differ diff --git a/admin/images/icons/chart_curve_go.png b/admin/images/icons/chart_curve_go.png new file mode 100644 index 0000000..ac9eda5 Binary files /dev/null and b/admin/images/icons/chart_curve_go.png differ diff --git a/admin/images/icons/chart_curve_link.png b/admin/images/icons/chart_curve_link.png new file mode 100644 index 0000000..144eafe Binary files /dev/null and b/admin/images/icons/chart_curve_link.png differ diff --git a/admin/images/icons/chart_line.png b/admin/images/icons/chart_line.png new file mode 100644 index 0000000..85020f3 Binary files /dev/null and b/admin/images/icons/chart_line.png differ diff --git a/admin/images/icons/chart_line_add.png b/admin/images/icons/chart_line_add.png new file mode 100644 index 0000000..5571a5e Binary files /dev/null and b/admin/images/icons/chart_line_add.png differ diff --git a/admin/images/icons/chart_line_delete.png b/admin/images/icons/chart_line_delete.png new file mode 100644 index 0000000..5b0aa90 Binary files /dev/null and b/admin/images/icons/chart_line_delete.png differ diff --git a/admin/images/icons/chart_line_edit.png b/admin/images/icons/chart_line_edit.png new file mode 100644 index 0000000..9cf6607 Binary files /dev/null and b/admin/images/icons/chart_line_edit.png differ diff --git a/admin/images/icons/chart_line_error.png b/admin/images/icons/chart_line_error.png new file mode 100644 index 0000000..ff23c03 Binary files /dev/null and b/admin/images/icons/chart_line_error.png differ diff --git a/admin/images/icons/chart_line_link.png b/admin/images/icons/chart_line_link.png new file mode 100644 index 0000000..f3727d2 Binary files /dev/null and b/admin/images/icons/chart_line_link.png differ diff --git a/admin/images/icons/chart_organisation.png b/admin/images/icons/chart_organisation.png new file mode 100644 index 0000000..c32d25c Binary files /dev/null and b/admin/images/icons/chart_organisation.png differ diff --git a/admin/images/icons/chart_organisation_add.png b/admin/images/icons/chart_organisation_add.png new file mode 100644 index 0000000..f0dba4a Binary files /dev/null and b/admin/images/icons/chart_organisation_add.png differ diff --git a/admin/images/icons/chart_organisation_delete.png b/admin/images/icons/chart_organisation_delete.png new file mode 100644 index 0000000..7dc8dca Binary files /dev/null and b/admin/images/icons/chart_organisation_delete.png differ diff --git a/admin/images/icons/chart_pie.png b/admin/images/icons/chart_pie.png new file mode 100644 index 0000000..fe00fa0 Binary files /dev/null and b/admin/images/icons/chart_pie.png differ diff --git a/admin/images/icons/chart_pie_add.png b/admin/images/icons/chart_pie_add.png new file mode 100644 index 0000000..bf0822e Binary files /dev/null and b/admin/images/icons/chart_pie_add.png differ diff --git a/admin/images/icons/chart_pie_delete.png b/admin/images/icons/chart_pie_delete.png new file mode 100644 index 0000000..5ab9efd Binary files /dev/null and b/admin/images/icons/chart_pie_delete.png differ diff --git a/admin/images/icons/chart_pie_edit.png b/admin/images/icons/chart_pie_edit.png new file mode 100644 index 0000000..3debc12 Binary files /dev/null and b/admin/images/icons/chart_pie_edit.png differ diff --git a/admin/images/icons/chart_pie_error.png b/admin/images/icons/chart_pie_error.png new file mode 100644 index 0000000..7344174 Binary files /dev/null and b/admin/images/icons/chart_pie_error.png differ diff --git a/admin/images/icons/chart_pie_link.png b/admin/images/icons/chart_pie_link.png new file mode 100644 index 0000000..c072f8e Binary files /dev/null and b/admin/images/icons/chart_pie_link.png differ diff --git a/admin/images/icons/clock.png b/admin/images/icons/clock.png new file mode 100644 index 0000000..e2672c2 Binary files /dev/null and b/admin/images/icons/clock.png differ diff --git a/admin/images/icons/clock_add.png b/admin/images/icons/clock_add.png new file mode 100644 index 0000000..598b839 Binary files /dev/null and b/admin/images/icons/clock_add.png differ diff --git a/admin/images/icons/clock_delete.png b/admin/images/icons/clock_delete.png new file mode 100644 index 0000000..8bf9efe Binary files /dev/null and b/admin/images/icons/clock_delete.png differ diff --git a/admin/images/icons/clock_edit.png b/admin/images/icons/clock_edit.png new file mode 100644 index 0000000..7d35718 Binary files /dev/null and b/admin/images/icons/clock_edit.png differ diff --git a/admin/images/icons/clock_error.png b/admin/images/icons/clock_error.png new file mode 100644 index 0000000..a7c461b Binary files /dev/null and b/admin/images/icons/clock_error.png differ diff --git a/admin/images/icons/clock_go.png b/admin/images/icons/clock_go.png new file mode 100644 index 0000000..a1a24d3 Binary files /dev/null and b/admin/images/icons/clock_go.png differ diff --git a/admin/images/icons/clock_link.png b/admin/images/icons/clock_link.png new file mode 100644 index 0000000..481cf04 Binary files /dev/null and b/admin/images/icons/clock_link.png differ diff --git a/admin/images/icons/clock_pause.png b/admin/images/icons/clock_pause.png new file mode 100644 index 0000000..ba74725 Binary files /dev/null and b/admin/images/icons/clock_pause.png differ diff --git a/admin/images/icons/clock_play.png b/admin/images/icons/clock_play.png new file mode 100644 index 0000000..fb4ebc8 Binary files /dev/null and b/admin/images/icons/clock_play.png differ diff --git a/admin/images/icons/clock_red.png b/admin/images/icons/clock_red.png new file mode 100644 index 0000000..2842cc3 Binary files /dev/null and b/admin/images/icons/clock_red.png differ diff --git a/admin/images/icons/clock_stop.png b/admin/images/icons/clock_stop.png new file mode 100644 index 0000000..6fe8a6f Binary files /dev/null and b/admin/images/icons/clock_stop.png differ diff --git a/admin/images/icons/cog.png b/admin/images/icons/cog.png new file mode 100644 index 0000000..67de2c6 Binary files /dev/null and b/admin/images/icons/cog.png differ diff --git a/admin/images/icons/cog_add.png b/admin/images/icons/cog_add.png new file mode 100644 index 0000000..04f22ba Binary files /dev/null and b/admin/images/icons/cog_add.png differ diff --git a/admin/images/icons/cog_delete.png b/admin/images/icons/cog_delete.png new file mode 100644 index 0000000..8ce71c4 Binary files /dev/null and b/admin/images/icons/cog_delete.png differ diff --git a/admin/images/icons/cog_edit.png b/admin/images/icons/cog_edit.png new file mode 100644 index 0000000..47b75a4 Binary files /dev/null and b/admin/images/icons/cog_edit.png differ diff --git a/admin/images/icons/cog_error.png b/admin/images/icons/cog_error.png new file mode 100644 index 0000000..4766743 Binary files /dev/null and b/admin/images/icons/cog_error.png differ diff --git a/admin/images/icons/cog_go.png b/admin/images/icons/cog_go.png new file mode 100644 index 0000000..3262767 Binary files /dev/null and b/admin/images/icons/cog_go.png differ diff --git a/admin/images/icons/coins.png b/admin/images/icons/coins.png new file mode 100644 index 0000000..0ca9074 Binary files /dev/null and b/admin/images/icons/coins.png differ diff --git a/admin/images/icons/coins_add.png b/admin/images/icons/coins_add.png new file mode 100644 index 0000000..cdff5d3 Binary files /dev/null and b/admin/images/icons/coins_add.png differ diff --git a/admin/images/icons/coins_delete.png b/admin/images/icons/coins_delete.png new file mode 100644 index 0000000..18e0c0f Binary files /dev/null and b/admin/images/icons/coins_delete.png differ diff --git a/admin/images/icons/color_swatch.png b/admin/images/icons/color_swatch.png new file mode 100644 index 0000000..6e6e852 Binary files /dev/null and b/admin/images/icons/color_swatch.png differ diff --git a/admin/images/icons/color_wheel.png b/admin/images/icons/color_wheel.png new file mode 100644 index 0000000..809fb00 Binary files /dev/null and b/admin/images/icons/color_wheel.png differ diff --git a/admin/images/icons/comment.png b/admin/images/icons/comment.png new file mode 100644 index 0000000..7bc9233 Binary files /dev/null and b/admin/images/icons/comment.png differ diff --git a/admin/images/icons/comment_add.png b/admin/images/icons/comment_add.png new file mode 100644 index 0000000..75e78de Binary files /dev/null and b/admin/images/icons/comment_add.png differ diff --git a/admin/images/icons/comment_delete.png b/admin/images/icons/comment_delete.png new file mode 100644 index 0000000..643fdbe Binary files /dev/null and b/admin/images/icons/comment_delete.png differ diff --git a/admin/images/icons/comment_edit.png b/admin/images/icons/comment_edit.png new file mode 100644 index 0000000..73db110 Binary files /dev/null and b/admin/images/icons/comment_edit.png differ diff --git a/admin/images/icons/comments.png b/admin/images/icons/comments.png new file mode 100644 index 0000000..39433cf Binary files /dev/null and b/admin/images/icons/comments.png differ diff --git a/admin/images/icons/comments_add.png b/admin/images/icons/comments_add.png new file mode 100644 index 0000000..b325634 Binary files /dev/null and b/admin/images/icons/comments_add.png differ diff --git a/admin/images/icons/comments_delete.png b/admin/images/icons/comments_delete.png new file mode 100644 index 0000000..6df7376 Binary files /dev/null and b/admin/images/icons/comments_delete.png differ diff --git a/admin/images/icons/compress.png b/admin/images/icons/compress.png new file mode 100644 index 0000000..8606ff0 Binary files /dev/null and b/admin/images/icons/compress.png differ diff --git a/admin/images/icons/computer.png b/admin/images/icons/computer.png new file mode 100644 index 0000000..9bc37dc Binary files /dev/null and b/admin/images/icons/computer.png differ diff --git a/admin/images/icons/computer_add.png b/admin/images/icons/computer_add.png new file mode 100644 index 0000000..db604ee Binary files /dev/null and b/admin/images/icons/computer_add.png differ diff --git a/admin/images/icons/computer_delete.png b/admin/images/icons/computer_delete.png new file mode 100644 index 0000000..5e9b268 Binary files /dev/null and b/admin/images/icons/computer_delete.png differ diff --git a/admin/images/icons/computer_edit.png b/admin/images/icons/computer_edit.png new file mode 100644 index 0000000..34c72fe Binary files /dev/null and b/admin/images/icons/computer_edit.png differ diff --git a/admin/images/icons/computer_error.png b/admin/images/icons/computer_error.png new file mode 100644 index 0000000..b2c3ed5 Binary files /dev/null and b/admin/images/icons/computer_error.png differ diff --git a/admin/images/icons/computer_go.png b/admin/images/icons/computer_go.png new file mode 100644 index 0000000..0b26144 Binary files /dev/null and b/admin/images/icons/computer_go.png differ diff --git a/admin/images/icons/computer_key.png b/admin/images/icons/computer_key.png new file mode 100644 index 0000000..eca5430 Binary files /dev/null and b/admin/images/icons/computer_key.png differ diff --git a/admin/images/icons/computer_link.png b/admin/images/icons/computer_link.png new file mode 100644 index 0000000..3859db2 Binary files /dev/null and b/admin/images/icons/computer_link.png differ diff --git a/admin/images/icons/connect.png b/admin/images/icons/connect.png new file mode 100644 index 0000000..024138e Binary files /dev/null and b/admin/images/icons/connect.png differ diff --git a/admin/images/icons/contrast.png b/admin/images/icons/contrast.png new file mode 100644 index 0000000..adcc004 Binary files /dev/null and b/admin/images/icons/contrast.png differ diff --git a/admin/images/icons/contrast_decrease.png b/admin/images/icons/contrast_decrease.png new file mode 100644 index 0000000..0155bf5 Binary files /dev/null and b/admin/images/icons/contrast_decrease.png differ diff --git a/admin/images/icons/contrast_high.png b/admin/images/icons/contrast_high.png new file mode 100644 index 0000000..d87c8cb Binary files /dev/null and b/admin/images/icons/contrast_high.png differ diff --git a/admin/images/icons/contrast_increase.png b/admin/images/icons/contrast_increase.png new file mode 100644 index 0000000..a3e7f52 Binary files /dev/null and b/admin/images/icons/contrast_increase.png differ diff --git a/admin/images/icons/contrast_low.png b/admin/images/icons/contrast_low.png new file mode 100644 index 0000000..dc9f4b1 Binary files /dev/null and b/admin/images/icons/contrast_low.png differ diff --git a/admin/images/icons/control_eject.png b/admin/images/icons/control_eject.png new file mode 100644 index 0000000..924d817 Binary files /dev/null and b/admin/images/icons/control_eject.png differ diff --git a/admin/images/icons/control_eject_blue.png b/admin/images/icons/control_eject_blue.png new file mode 100644 index 0000000..2bd4963 Binary files /dev/null and b/admin/images/icons/control_eject_blue.png differ diff --git a/admin/images/icons/control_end.png b/admin/images/icons/control_end.png new file mode 100644 index 0000000..036e04d Binary files /dev/null and b/admin/images/icons/control_end.png differ diff --git a/admin/images/icons/control_end_blue.png b/admin/images/icons/control_end_blue.png new file mode 100644 index 0000000..7207935 Binary files /dev/null and b/admin/images/icons/control_end_blue.png differ diff --git a/admin/images/icons/control_equalizer.png b/admin/images/icons/control_equalizer.png new file mode 100644 index 0000000..4606087 Binary files /dev/null and b/admin/images/icons/control_equalizer.png differ diff --git a/admin/images/icons/control_equalizer_blue.png b/admin/images/icons/control_equalizer_blue.png new file mode 100644 index 0000000..1b2e6a3 Binary files /dev/null and b/admin/images/icons/control_equalizer_blue.png differ diff --git a/admin/images/icons/control_fastforward.png b/admin/images/icons/control_fastforward.png new file mode 100644 index 0000000..31f7fd3 Binary files /dev/null and b/admin/images/icons/control_fastforward.png differ diff --git a/admin/images/icons/control_fastforward_blue.png b/admin/images/icons/control_fastforward_blue.png new file mode 100644 index 0000000..4a2f9d4 Binary files /dev/null and b/admin/images/icons/control_fastforward_blue.png differ diff --git a/admin/images/icons/control_pause.png b/admin/images/icons/control_pause.png new file mode 100644 index 0000000..2d9ce9c Binary files /dev/null and b/admin/images/icons/control_pause.png differ diff --git a/admin/images/icons/control_pause_blue.png b/admin/images/icons/control_pause_blue.png new file mode 100644 index 0000000..ec61099 Binary files /dev/null and b/admin/images/icons/control_pause_blue.png differ diff --git a/admin/images/icons/control_play.png b/admin/images/icons/control_play.png new file mode 100644 index 0000000..0846555 Binary files /dev/null and b/admin/images/icons/control_play.png differ diff --git a/admin/images/icons/control_play_blue.png b/admin/images/icons/control_play_blue.png new file mode 100644 index 0000000..f8c8ec6 Binary files /dev/null and b/admin/images/icons/control_play_blue.png differ diff --git a/admin/images/icons/control_repeat.png b/admin/images/icons/control_repeat.png new file mode 100644 index 0000000..1c4f57a Binary files /dev/null and b/admin/images/icons/control_repeat.png differ diff --git a/admin/images/icons/control_repeat_blue.png b/admin/images/icons/control_repeat_blue.png new file mode 100644 index 0000000..406ec33 Binary files /dev/null and b/admin/images/icons/control_repeat_blue.png differ diff --git a/admin/images/icons/control_rewind.png b/admin/images/icons/control_rewind.png new file mode 100644 index 0000000..c029447 Binary files /dev/null and b/admin/images/icons/control_rewind.png differ diff --git a/admin/images/icons/control_rewind_blue.png b/admin/images/icons/control_rewind_blue.png new file mode 100644 index 0000000..15d1584 Binary files /dev/null and b/admin/images/icons/control_rewind_blue.png differ diff --git a/admin/images/icons/control_start.png b/admin/images/icons/control_start.png new file mode 100644 index 0000000..7dd1c07 Binary files /dev/null and b/admin/images/icons/control_start.png differ diff --git a/admin/images/icons/control_start_blue.png b/admin/images/icons/control_start_blue.png new file mode 100644 index 0000000..6f11fcb Binary files /dev/null and b/admin/images/icons/control_start_blue.png differ diff --git a/admin/images/icons/control_stop.png b/admin/images/icons/control_stop.png new file mode 100644 index 0000000..893bb60 Binary files /dev/null and b/admin/images/icons/control_stop.png differ diff --git a/admin/images/icons/control_stop_blue.png b/admin/images/icons/control_stop_blue.png new file mode 100644 index 0000000..e6f75d2 Binary files /dev/null and b/admin/images/icons/control_stop_blue.png differ diff --git a/admin/images/icons/controller.png b/admin/images/icons/controller.png new file mode 100644 index 0000000..5cf76ed Binary files /dev/null and b/admin/images/icons/controller.png differ diff --git a/admin/images/icons/controller_add.png b/admin/images/icons/controller_add.png new file mode 100644 index 0000000..efecb38 Binary files /dev/null and b/admin/images/icons/controller_add.png differ diff --git a/admin/images/icons/controller_delete.png b/admin/images/icons/controller_delete.png new file mode 100644 index 0000000..3d83bc7 Binary files /dev/null and b/admin/images/icons/controller_delete.png differ diff --git a/admin/images/icons/controller_error.png b/admin/images/icons/controller_error.png new file mode 100644 index 0000000..7f17c0c Binary files /dev/null and b/admin/images/icons/controller_error.png differ diff --git a/admin/images/icons/creditcards.png b/admin/images/icons/creditcards.png new file mode 100644 index 0000000..4eae583 Binary files /dev/null and b/admin/images/icons/creditcards.png differ diff --git a/admin/images/icons/cross.png b/admin/images/icons/cross.png new file mode 100644 index 0000000..1514d51 Binary files /dev/null and b/admin/images/icons/cross.png differ diff --git a/admin/images/icons/css.png b/admin/images/icons/css.png new file mode 100644 index 0000000..23f3101 Binary files /dev/null and b/admin/images/icons/css.png differ diff --git a/admin/images/icons/css_add.png b/admin/images/icons/css_add.png new file mode 100644 index 0000000..e8ea10f Binary files /dev/null and b/admin/images/icons/css_add.png differ diff --git a/admin/images/icons/css_delete.png b/admin/images/icons/css_delete.png new file mode 100644 index 0000000..326aba4 Binary files /dev/null and b/admin/images/icons/css_delete.png differ diff --git a/admin/images/icons/css_go.png b/admin/images/icons/css_go.png new file mode 100644 index 0000000..6cdf38c Binary files /dev/null and b/admin/images/icons/css_go.png differ diff --git a/admin/images/icons/css_valid.png b/admin/images/icons/css_valid.png new file mode 100644 index 0000000..4c72ca5 Binary files /dev/null and b/admin/images/icons/css_valid.png differ diff --git a/admin/images/icons/cup.png b/admin/images/icons/cup.png new file mode 100644 index 0000000..b7bfcd1 Binary files /dev/null and b/admin/images/icons/cup.png differ diff --git a/admin/images/icons/cup_add.png b/admin/images/icons/cup_add.png new file mode 100644 index 0000000..4ecaece Binary files /dev/null and b/admin/images/icons/cup_add.png differ diff --git a/admin/images/icons/cup_delete.png b/admin/images/icons/cup_delete.png new file mode 100644 index 0000000..59a6d9c Binary files /dev/null and b/admin/images/icons/cup_delete.png differ diff --git a/admin/images/icons/cup_edit.png b/admin/images/icons/cup_edit.png new file mode 100644 index 0000000..0b8f1e1 Binary files /dev/null and b/admin/images/icons/cup_edit.png differ diff --git a/admin/images/icons/cup_error.png b/admin/images/icons/cup_error.png new file mode 100644 index 0000000..6879874 Binary files /dev/null and b/admin/images/icons/cup_error.png differ diff --git a/admin/images/icons/cup_go.png b/admin/images/icons/cup_go.png new file mode 100644 index 0000000..9527efb Binary files /dev/null and b/admin/images/icons/cup_go.png differ diff --git a/admin/images/icons/cup_key.png b/admin/images/icons/cup_key.png new file mode 100644 index 0000000..7ae160c Binary files /dev/null and b/admin/images/icons/cup_key.png differ diff --git a/admin/images/icons/cup_link.png b/admin/images/icons/cup_link.png new file mode 100644 index 0000000..41d1ace Binary files /dev/null and b/admin/images/icons/cup_link.png differ diff --git a/admin/images/icons/cursor.png b/admin/images/icons/cursor.png new file mode 100644 index 0000000..532f532 Binary files /dev/null and b/admin/images/icons/cursor.png differ diff --git a/admin/images/icons/cut.png b/admin/images/icons/cut.png new file mode 100644 index 0000000..f215d6f Binary files /dev/null and b/admin/images/icons/cut.png differ diff --git a/admin/images/icons/cut_red.png b/admin/images/icons/cut_red.png new file mode 100644 index 0000000..85bb2f0 Binary files /dev/null and b/admin/images/icons/cut_red.png differ diff --git a/admin/images/icons/database.png b/admin/images/icons/database.png new file mode 100644 index 0000000..3d09261 Binary files /dev/null and b/admin/images/icons/database.png differ diff --git a/admin/images/icons/database_add.png b/admin/images/icons/database_add.png new file mode 100644 index 0000000..802bd6c Binary files /dev/null and b/admin/images/icons/database_add.png differ diff --git a/admin/images/icons/database_connect.png b/admin/images/icons/database_connect.png new file mode 100644 index 0000000..3a11197 Binary files /dev/null and b/admin/images/icons/database_connect.png differ diff --git a/admin/images/icons/database_delete.png b/admin/images/icons/database_delete.png new file mode 100644 index 0000000..cce652e Binary files /dev/null and b/admin/images/icons/database_delete.png differ diff --git a/admin/images/icons/database_edit.png b/admin/images/icons/database_edit.png new file mode 100644 index 0000000..e501b66 Binary files /dev/null and b/admin/images/icons/database_edit.png differ diff --git a/admin/images/icons/database_error.png b/admin/images/icons/database_error.png new file mode 100644 index 0000000..578221a Binary files /dev/null and b/admin/images/icons/database_error.png differ diff --git a/admin/images/icons/database_gear.png b/admin/images/icons/database_gear.png new file mode 100644 index 0000000..7c0ab2b Binary files /dev/null and b/admin/images/icons/database_gear.png differ diff --git a/admin/images/icons/database_go.png b/admin/images/icons/database_go.png new file mode 100644 index 0000000..61a8556 Binary files /dev/null and b/admin/images/icons/database_go.png differ diff --git a/admin/images/icons/database_key.png b/admin/images/icons/database_key.png new file mode 100644 index 0000000..3334147 Binary files /dev/null and b/admin/images/icons/database_key.png differ diff --git a/admin/images/icons/database_lightning.png b/admin/images/icons/database_lightning.png new file mode 100644 index 0000000..d9eefc2 Binary files /dev/null and b/admin/images/icons/database_lightning.png differ diff --git a/admin/images/icons/database_link.png b/admin/images/icons/database_link.png new file mode 100644 index 0000000..4c8204a Binary files /dev/null and b/admin/images/icons/database_link.png differ diff --git a/admin/images/icons/database_refresh.png b/admin/images/icons/database_refresh.png new file mode 100644 index 0000000..ff803be Binary files /dev/null and b/admin/images/icons/database_refresh.png differ diff --git a/admin/images/icons/database_save.png b/admin/images/icons/database_save.png new file mode 100644 index 0000000..44c06dd Binary files /dev/null and b/admin/images/icons/database_save.png differ diff --git a/admin/images/icons/database_table.png b/admin/images/icons/database_table.png new file mode 100644 index 0000000..693709c Binary files /dev/null and b/admin/images/icons/database_table.png differ diff --git a/admin/images/icons/date.png b/admin/images/icons/date.png new file mode 100644 index 0000000..783c833 Binary files /dev/null and b/admin/images/icons/date.png differ diff --git a/admin/images/icons/date_add.png b/admin/images/icons/date_add.png new file mode 100644 index 0000000..6a7ae02 Binary files /dev/null and b/admin/images/icons/date_add.png differ diff --git a/admin/images/icons/date_delete.png b/admin/images/icons/date_delete.png new file mode 100644 index 0000000..969a6b7 Binary files /dev/null and b/admin/images/icons/date_delete.png differ diff --git a/admin/images/icons/date_edit.png b/admin/images/icons/date_edit.png new file mode 100644 index 0000000..e681065 Binary files /dev/null and b/admin/images/icons/date_edit.png differ diff --git a/admin/images/icons/date_error.png b/admin/images/icons/date_error.png new file mode 100644 index 0000000..442cd97 Binary files /dev/null and b/admin/images/icons/date_error.png differ diff --git a/admin/images/icons/date_go.png b/admin/images/icons/date_go.png new file mode 100644 index 0000000..52dd9f3 Binary files /dev/null and b/admin/images/icons/date_go.png differ diff --git a/admin/images/icons/date_link.png b/admin/images/icons/date_link.png new file mode 100644 index 0000000..9f0aada Binary files /dev/null and b/admin/images/icons/date_link.png differ diff --git a/admin/images/icons/date_magnify.png b/admin/images/icons/date_magnify.png new file mode 100644 index 0000000..cd05f19 Binary files /dev/null and b/admin/images/icons/date_magnify.png differ diff --git a/admin/images/icons/date_next.png b/admin/images/icons/date_next.png new file mode 100644 index 0000000..48d740a Binary files /dev/null and b/admin/images/icons/date_next.png differ diff --git a/admin/images/icons/date_previous.png b/admin/images/icons/date_previous.png new file mode 100644 index 0000000..e117a83 Binary files /dev/null and b/admin/images/icons/date_previous.png differ diff --git a/admin/images/icons/delete.png b/admin/images/icons/delete.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/admin/images/icons/delete.png differ diff --git a/admin/images/icons/disconnect.png b/admin/images/icons/disconnect.png new file mode 100644 index 0000000..b335cb1 Binary files /dev/null and b/admin/images/icons/disconnect.png differ diff --git a/admin/images/icons/disk.png b/admin/images/icons/disk.png new file mode 100644 index 0000000..99d532e Binary files /dev/null and b/admin/images/icons/disk.png differ diff --git a/admin/images/icons/disk_multiple.png b/admin/images/icons/disk_multiple.png new file mode 100644 index 0000000..fc5a52f Binary files /dev/null and b/admin/images/icons/disk_multiple.png differ diff --git a/admin/images/icons/door.png b/admin/images/icons/door.png new file mode 100644 index 0000000..369fc46 Binary files /dev/null and b/admin/images/icons/door.png differ diff --git a/admin/images/icons/door_in.png b/admin/images/icons/door_in.png new file mode 100644 index 0000000..41676a0 Binary files /dev/null and b/admin/images/icons/door_in.png differ diff --git a/admin/images/icons/door_open.png b/admin/images/icons/door_open.png new file mode 100644 index 0000000..64bab57 Binary files /dev/null and b/admin/images/icons/door_open.png differ diff --git a/admin/images/icons/door_out.png b/admin/images/icons/door_out.png new file mode 100644 index 0000000..2541d2b Binary files /dev/null and b/admin/images/icons/door_out.png differ diff --git a/admin/images/icons/drink.png b/admin/images/icons/drink.png new file mode 100644 index 0000000..d98359c Binary files /dev/null and b/admin/images/icons/drink.png differ diff --git a/admin/images/icons/drink_empty.png b/admin/images/icons/drink_empty.png new file mode 100644 index 0000000..a40211e Binary files /dev/null and b/admin/images/icons/drink_empty.png differ diff --git a/admin/images/icons/drive.png b/admin/images/icons/drive.png new file mode 100644 index 0000000..37b7c9b Binary files /dev/null and b/admin/images/icons/drive.png differ diff --git a/admin/images/icons/drive_add.png b/admin/images/icons/drive_add.png new file mode 100644 index 0000000..29a35d5 Binary files /dev/null and b/admin/images/icons/drive_add.png differ diff --git a/admin/images/icons/drive_burn.png b/admin/images/icons/drive_burn.png new file mode 100644 index 0000000..80fd79f Binary files /dev/null and b/admin/images/icons/drive_burn.png differ diff --git a/admin/images/icons/drive_cd.png b/admin/images/icons/drive_cd.png new file mode 100644 index 0000000..1850b70 Binary files /dev/null and b/admin/images/icons/drive_cd.png differ diff --git a/admin/images/icons/drive_cd_empty.png b/admin/images/icons/drive_cd_empty.png new file mode 100644 index 0000000..8df38d9 Binary files /dev/null and b/admin/images/icons/drive_cd_empty.png differ diff --git a/admin/images/icons/drive_delete.png b/admin/images/icons/drive_delete.png new file mode 100644 index 0000000..e6eb186 Binary files /dev/null and b/admin/images/icons/drive_delete.png differ diff --git a/admin/images/icons/drive_disk.png b/admin/images/icons/drive_disk.png new file mode 100644 index 0000000..5a51e81 Binary files /dev/null and b/admin/images/icons/drive_disk.png differ diff --git a/admin/images/icons/drive_edit.png b/admin/images/icons/drive_edit.png new file mode 100644 index 0000000..7923fad Binary files /dev/null and b/admin/images/icons/drive_edit.png differ diff --git a/admin/images/icons/drive_error.png b/admin/images/icons/drive_error.png new file mode 100644 index 0000000..309f639 Binary files /dev/null and b/admin/images/icons/drive_error.png differ diff --git a/admin/images/icons/drive_go.png b/admin/images/icons/drive_go.png new file mode 100644 index 0000000..fc53379 Binary files /dev/null and b/admin/images/icons/drive_go.png differ diff --git a/admin/images/icons/drive_key.png b/admin/images/icons/drive_key.png new file mode 100644 index 0000000..d0b3c67 Binary files /dev/null and b/admin/images/icons/drive_key.png differ diff --git a/admin/images/icons/drive_link.png b/admin/images/icons/drive_link.png new file mode 100644 index 0000000..8679c4b Binary files /dev/null and b/admin/images/icons/drive_link.png differ diff --git a/admin/images/icons/drive_magnify.png b/admin/images/icons/drive_magnify.png new file mode 100644 index 0000000..0f0f444 Binary files /dev/null and b/admin/images/icons/drive_magnify.png differ diff --git a/admin/images/icons/drive_network.png b/admin/images/icons/drive_network.png new file mode 100644 index 0000000..63d2d5d Binary files /dev/null and b/admin/images/icons/drive_network.png differ diff --git a/admin/images/icons/drive_rename.png b/admin/images/icons/drive_rename.png new file mode 100644 index 0000000..2a9f38b Binary files /dev/null and b/admin/images/icons/drive_rename.png differ diff --git a/admin/images/icons/drive_user.png b/admin/images/icons/drive_user.png new file mode 100644 index 0000000..0b4751c Binary files /dev/null and b/admin/images/icons/drive_user.png differ diff --git a/admin/images/icons/drive_web.png b/admin/images/icons/drive_web.png new file mode 100644 index 0000000..8850a83 Binary files /dev/null and b/admin/images/icons/drive_web.png differ diff --git a/admin/images/icons/dvd.png b/admin/images/icons/dvd.png new file mode 100644 index 0000000..9d94de5 Binary files /dev/null and b/admin/images/icons/dvd.png differ diff --git a/admin/images/icons/dvd_add.png b/admin/images/icons/dvd_add.png new file mode 100644 index 0000000..517d112 Binary files /dev/null and b/admin/images/icons/dvd_add.png differ diff --git a/admin/images/icons/dvd_delete.png b/admin/images/icons/dvd_delete.png new file mode 100644 index 0000000..87bed22 Binary files /dev/null and b/admin/images/icons/dvd_delete.png differ diff --git a/admin/images/icons/dvd_edit.png b/admin/images/icons/dvd_edit.png new file mode 100644 index 0000000..d6330aa Binary files /dev/null and b/admin/images/icons/dvd_edit.png differ diff --git a/admin/images/icons/dvd_error.png b/admin/images/icons/dvd_error.png new file mode 100644 index 0000000..8f6d4be Binary files /dev/null and b/admin/images/icons/dvd_error.png differ diff --git a/admin/images/icons/dvd_go.png b/admin/images/icons/dvd_go.png new file mode 100644 index 0000000..ef6959f Binary files /dev/null and b/admin/images/icons/dvd_go.png differ diff --git a/admin/images/icons/dvd_key.png b/admin/images/icons/dvd_key.png new file mode 100644 index 0000000..da9307f Binary files /dev/null and b/admin/images/icons/dvd_key.png differ diff --git a/admin/images/icons/dvd_link.png b/admin/images/icons/dvd_link.png new file mode 100644 index 0000000..caad726 Binary files /dev/null and b/admin/images/icons/dvd_link.png differ diff --git a/admin/images/icons/email.png b/admin/images/icons/email.png new file mode 100644 index 0000000..7348aed Binary files /dev/null and b/admin/images/icons/email.png differ diff --git a/admin/images/icons/email_add.png b/admin/images/icons/email_add.png new file mode 100644 index 0000000..6c93368 Binary files /dev/null and b/admin/images/icons/email_add.png differ diff --git a/admin/images/icons/email_attach.png b/admin/images/icons/email_attach.png new file mode 100644 index 0000000..1f99485 Binary files /dev/null and b/admin/images/icons/email_attach.png differ diff --git a/admin/images/icons/email_delete.png b/admin/images/icons/email_delete.png new file mode 100644 index 0000000..a9932b1 Binary files /dev/null and b/admin/images/icons/email_delete.png differ diff --git a/admin/images/icons/email_edit.png b/admin/images/icons/email_edit.png new file mode 100644 index 0000000..244f04a Binary files /dev/null and b/admin/images/icons/email_edit.png differ diff --git a/admin/images/icons/email_error.png b/admin/images/icons/email_error.png new file mode 100644 index 0000000..8bdd330 Binary files /dev/null and b/admin/images/icons/email_error.png differ diff --git a/admin/images/icons/email_go.png b/admin/images/icons/email_go.png new file mode 100644 index 0000000..4a6c5d3 Binary files /dev/null and b/admin/images/icons/email_go.png differ diff --git a/admin/images/icons/email_link.png b/admin/images/icons/email_link.png new file mode 100644 index 0000000..2c49f78 Binary files /dev/null and b/admin/images/icons/email_link.png differ diff --git a/admin/images/icons/email_open.png b/admin/images/icons/email_open.png new file mode 100644 index 0000000..7b6f981 Binary files /dev/null and b/admin/images/icons/email_open.png differ diff --git a/admin/images/icons/email_open_image.png b/admin/images/icons/email_open_image.png new file mode 100644 index 0000000..e588e2f Binary files /dev/null and b/admin/images/icons/email_open_image.png differ diff --git a/admin/images/icons/emoticon_evilgrin.png b/admin/images/icons/emoticon_evilgrin.png new file mode 100644 index 0000000..817bd50 Binary files /dev/null and b/admin/images/icons/emoticon_evilgrin.png differ diff --git a/admin/images/icons/emoticon_grin.png b/admin/images/icons/emoticon_grin.png new file mode 100644 index 0000000..fc60c5e Binary files /dev/null and b/admin/images/icons/emoticon_grin.png differ diff --git a/admin/images/icons/emoticon_happy.png b/admin/images/icons/emoticon_happy.png new file mode 100644 index 0000000..6b7336e Binary files /dev/null and b/admin/images/icons/emoticon_happy.png differ diff --git a/admin/images/icons/emoticon_smile.png b/admin/images/icons/emoticon_smile.png new file mode 100644 index 0000000..ade4318 Binary files /dev/null and b/admin/images/icons/emoticon_smile.png differ diff --git a/admin/images/icons/emoticon_surprised.png b/admin/images/icons/emoticon_surprised.png new file mode 100644 index 0000000..4520cfc Binary files /dev/null and b/admin/images/icons/emoticon_surprised.png differ diff --git a/admin/images/icons/emoticon_tongue.png b/admin/images/icons/emoticon_tongue.png new file mode 100644 index 0000000..ecafd2f Binary files /dev/null and b/admin/images/icons/emoticon_tongue.png differ diff --git a/admin/images/icons/emoticon_unhappy.png b/admin/images/icons/emoticon_unhappy.png new file mode 100644 index 0000000..fd5d030 Binary files /dev/null and b/admin/images/icons/emoticon_unhappy.png differ diff --git a/admin/images/icons/emoticon_waii.png b/admin/images/icons/emoticon_waii.png new file mode 100644 index 0000000..458f936 Binary files /dev/null and b/admin/images/icons/emoticon_waii.png differ diff --git a/admin/images/icons/emoticon_wink.png b/admin/images/icons/emoticon_wink.png new file mode 100644 index 0000000..a631949 Binary files /dev/null and b/admin/images/icons/emoticon_wink.png differ diff --git a/admin/images/icons/error.png b/admin/images/icons/error.png new file mode 100644 index 0000000..628cf2d Binary files /dev/null and b/admin/images/icons/error.png differ diff --git a/admin/images/icons/error_add.png b/admin/images/icons/error_add.png new file mode 100644 index 0000000..4c97484 Binary files /dev/null and b/admin/images/icons/error_add.png differ diff --git a/admin/images/icons/error_delete.png b/admin/images/icons/error_delete.png new file mode 100644 index 0000000..7f78bcc Binary files /dev/null and b/admin/images/icons/error_delete.png differ diff --git a/admin/images/icons/error_go.png b/admin/images/icons/error_go.png new file mode 100644 index 0000000..caa1838 Binary files /dev/null and b/admin/images/icons/error_go.png differ diff --git a/admin/images/icons/exclamation.png b/admin/images/icons/exclamation.png new file mode 100644 index 0000000..c37bd06 Binary files /dev/null and b/admin/images/icons/exclamation.png differ diff --git a/admin/images/icons/eye.png b/admin/images/icons/eye.png new file mode 100644 index 0000000..564a1a9 Binary files /dev/null and b/admin/images/icons/eye.png differ diff --git a/admin/images/icons/feed.png b/admin/images/icons/feed.png new file mode 100644 index 0000000..315c4f4 Binary files /dev/null and b/admin/images/icons/feed.png differ diff --git a/admin/images/icons/feed_add.png b/admin/images/icons/feed_add.png new file mode 100644 index 0000000..e77d46e Binary files /dev/null and b/admin/images/icons/feed_add.png differ diff --git a/admin/images/icons/feed_delete.png b/admin/images/icons/feed_delete.png new file mode 100644 index 0000000..5e332b4 Binary files /dev/null and b/admin/images/icons/feed_delete.png differ diff --git a/admin/images/icons/feed_disk.png b/admin/images/icons/feed_disk.png new file mode 100644 index 0000000..a158c99 Binary files /dev/null and b/admin/images/icons/feed_disk.png differ diff --git a/admin/images/icons/feed_edit.png b/admin/images/icons/feed_edit.png new file mode 100644 index 0000000..f1fde7a Binary files /dev/null and b/admin/images/icons/feed_edit.png differ diff --git a/admin/images/icons/feed_error.png b/admin/images/icons/feed_error.png new file mode 100644 index 0000000..c0a801c Binary files /dev/null and b/admin/images/icons/feed_error.png differ diff --git a/admin/images/icons/feed_go.png b/admin/images/icons/feed_go.png new file mode 100644 index 0000000..f2eed1e Binary files /dev/null and b/admin/images/icons/feed_go.png differ diff --git a/admin/images/icons/feed_key.png b/admin/images/icons/feed_key.png new file mode 100644 index 0000000..156bfa9 Binary files /dev/null and b/admin/images/icons/feed_key.png differ diff --git a/admin/images/icons/feed_link.png b/admin/images/icons/feed_link.png new file mode 100644 index 0000000..c45a534 Binary files /dev/null and b/admin/images/icons/feed_link.png differ diff --git a/admin/images/icons/feed_magnify.png b/admin/images/icons/feed_magnify.png new file mode 100644 index 0000000..3023695 Binary files /dev/null and b/admin/images/icons/feed_magnify.png differ diff --git a/admin/images/icons/female.png b/admin/images/icons/female.png new file mode 100644 index 0000000..f92958e Binary files /dev/null and b/admin/images/icons/female.png differ diff --git a/admin/images/icons/film.png b/admin/images/icons/film.png new file mode 100644 index 0000000..b0ce7bb Binary files /dev/null and b/admin/images/icons/film.png differ diff --git a/admin/images/icons/film_add.png b/admin/images/icons/film_add.png new file mode 100644 index 0000000..40d681f Binary files /dev/null and b/admin/images/icons/film_add.png differ diff --git a/admin/images/icons/film_delete.png b/admin/images/icons/film_delete.png new file mode 100644 index 0000000..23a2508 Binary files /dev/null and b/admin/images/icons/film_delete.png differ diff --git a/admin/images/icons/film_edit.png b/admin/images/icons/film_edit.png new file mode 100644 index 0000000..af66b73 Binary files /dev/null and b/admin/images/icons/film_edit.png differ diff --git a/admin/images/icons/film_error.png b/admin/images/icons/film_error.png new file mode 100644 index 0000000..88f3d69 Binary files /dev/null and b/admin/images/icons/film_error.png differ diff --git a/admin/images/icons/film_go.png b/admin/images/icons/film_go.png new file mode 100644 index 0000000..dd0168e Binary files /dev/null and b/admin/images/icons/film_go.png differ diff --git a/admin/images/icons/film_key.png b/admin/images/icons/film_key.png new file mode 100644 index 0000000..5892162 Binary files /dev/null and b/admin/images/icons/film_key.png differ diff --git a/admin/images/icons/film_link.png b/admin/images/icons/film_link.png new file mode 100644 index 0000000..0f24e86 Binary files /dev/null and b/admin/images/icons/film_link.png differ diff --git a/admin/images/icons/film_save.png b/admin/images/icons/film_save.png new file mode 100644 index 0000000..bc8c0d3 Binary files /dev/null and b/admin/images/icons/film_save.png differ diff --git a/admin/images/icons/find.png b/admin/images/icons/find.png new file mode 100644 index 0000000..1547479 Binary files /dev/null and b/admin/images/icons/find.png differ diff --git a/admin/images/icons/flag_blue.png b/admin/images/icons/flag_blue.png new file mode 100644 index 0000000..003924f Binary files /dev/null and b/admin/images/icons/flag_blue.png differ diff --git a/admin/images/icons/flag_green.png b/admin/images/icons/flag_green.png new file mode 100644 index 0000000..e4bc611 Binary files /dev/null and b/admin/images/icons/flag_green.png differ diff --git a/admin/images/icons/flag_orange.png b/admin/images/icons/flag_orange.png new file mode 100644 index 0000000..e632024 Binary files /dev/null and b/admin/images/icons/flag_orange.png differ diff --git a/admin/images/icons/flag_pink.png b/admin/images/icons/flag_pink.png new file mode 100644 index 0000000..5f15e52 Binary files /dev/null and b/admin/images/icons/flag_pink.png differ diff --git a/admin/images/icons/flag_purple.png b/admin/images/icons/flag_purple.png new file mode 100644 index 0000000..d069866 Binary files /dev/null and b/admin/images/icons/flag_purple.png differ diff --git a/admin/images/icons/flag_red.png b/admin/images/icons/flag_red.png new file mode 100644 index 0000000..e8a602d Binary files /dev/null and b/admin/images/icons/flag_red.png differ diff --git a/admin/images/icons/flag_yellow.png b/admin/images/icons/flag_yellow.png new file mode 100644 index 0000000..14c89a5 Binary files /dev/null and b/admin/images/icons/flag_yellow.png differ diff --git a/admin/images/icons/folder.png b/admin/images/icons/folder.png new file mode 100644 index 0000000..784e8fa Binary files /dev/null and b/admin/images/icons/folder.png differ diff --git a/admin/images/icons/folder_add.png b/admin/images/icons/folder_add.png new file mode 100644 index 0000000..529fe8f Binary files /dev/null and b/admin/images/icons/folder_add.png differ diff --git a/admin/images/icons/folder_bell.png b/admin/images/icons/folder_bell.png new file mode 100644 index 0000000..d04dd7f Binary files /dev/null and b/admin/images/icons/folder_bell.png differ diff --git a/admin/images/icons/folder_brick.png b/admin/images/icons/folder_brick.png new file mode 100644 index 0000000..5dea976 Binary files /dev/null and b/admin/images/icons/folder_brick.png differ diff --git a/admin/images/icons/folder_bug.png b/admin/images/icons/folder_bug.png new file mode 100644 index 0000000..4f791b6 Binary files /dev/null and b/admin/images/icons/folder_bug.png differ diff --git a/admin/images/icons/folder_camera.png b/admin/images/icons/folder_camera.png new file mode 100644 index 0000000..c951941 Binary files /dev/null and b/admin/images/icons/folder_camera.png differ diff --git a/admin/images/icons/folder_database.png b/admin/images/icons/folder_database.png new file mode 100644 index 0000000..5193e2e Binary files /dev/null and b/admin/images/icons/folder_database.png differ diff --git a/admin/images/icons/folder_delete.png b/admin/images/icons/folder_delete.png new file mode 100644 index 0000000..112b016 Binary files /dev/null and b/admin/images/icons/folder_delete.png differ diff --git a/admin/images/icons/folder_edit.png b/admin/images/icons/folder_edit.png new file mode 100644 index 0000000..ad669cc Binary files /dev/null and b/admin/images/icons/folder_edit.png differ diff --git a/admin/images/icons/folder_error.png b/admin/images/icons/folder_error.png new file mode 100644 index 0000000..1af8809 Binary files /dev/null and b/admin/images/icons/folder_error.png differ diff --git a/admin/images/icons/folder_explore.png b/admin/images/icons/folder_explore.png new file mode 100644 index 0000000..0ba9391 Binary files /dev/null and b/admin/images/icons/folder_explore.png differ diff --git a/admin/images/icons/folder_feed.png b/admin/images/icons/folder_feed.png new file mode 100644 index 0000000..d06ee51 Binary files /dev/null and b/admin/images/icons/folder_feed.png differ diff --git a/admin/images/icons/folder_find.png b/admin/images/icons/folder_find.png new file mode 100644 index 0000000..c64e2ee Binary files /dev/null and b/admin/images/icons/folder_find.png differ diff --git a/admin/images/icons/folder_go.png b/admin/images/icons/folder_go.png new file mode 100644 index 0000000..34a736f Binary files /dev/null and b/admin/images/icons/folder_go.png differ diff --git a/admin/images/icons/folder_heart.png b/admin/images/icons/folder_heart.png new file mode 100644 index 0000000..56d7da1 Binary files /dev/null and b/admin/images/icons/folder_heart.png differ diff --git a/admin/images/icons/folder_image.png b/admin/images/icons/folder_image.png new file mode 100644 index 0000000..d5df75b Binary files /dev/null and b/admin/images/icons/folder_image.png differ diff --git a/admin/images/icons/folder_key.png b/admin/images/icons/folder_key.png new file mode 100644 index 0000000..fb9b4c2 Binary files /dev/null and b/admin/images/icons/folder_key.png differ diff --git a/admin/images/icons/folder_lightbulb.png b/admin/images/icons/folder_lightbulb.png new file mode 100644 index 0000000..f367a51 Binary files /dev/null and b/admin/images/icons/folder_lightbulb.png differ diff --git a/admin/images/icons/folder_link.png b/admin/images/icons/folder_link.png new file mode 100644 index 0000000..b9b75f6 Binary files /dev/null and b/admin/images/icons/folder_link.png differ diff --git a/admin/images/icons/folder_magnify.png b/admin/images/icons/folder_magnify.png new file mode 100644 index 0000000..0a3e798 Binary files /dev/null and b/admin/images/icons/folder_magnify.png differ diff --git a/admin/images/icons/folder_page.png b/admin/images/icons/folder_page.png new file mode 100644 index 0000000..1ef6e11 Binary files /dev/null and b/admin/images/icons/folder_page.png differ diff --git a/admin/images/icons/folder_page_white.png b/admin/images/icons/folder_page_white.png new file mode 100644 index 0000000..14d6b61 Binary files /dev/null and b/admin/images/icons/folder_page_white.png differ diff --git a/admin/images/icons/folder_palette.png b/admin/images/icons/folder_palette.png new file mode 100644 index 0000000..ba12fe8 Binary files /dev/null and b/admin/images/icons/folder_palette.png differ diff --git a/admin/images/icons/folder_picture.png b/admin/images/icons/folder_picture.png new file mode 100644 index 0000000..052b336 Binary files /dev/null and b/admin/images/icons/folder_picture.png differ diff --git a/admin/images/icons/folder_star.png b/admin/images/icons/folder_star.png new file mode 100644 index 0000000..448e46f Binary files /dev/null and b/admin/images/icons/folder_star.png differ diff --git a/admin/images/icons/folder_table.png b/admin/images/icons/folder_table.png new file mode 100644 index 0000000..473cee3 Binary files /dev/null and b/admin/images/icons/folder_table.png differ diff --git a/admin/images/icons/folder_user.png b/admin/images/icons/folder_user.png new file mode 100644 index 0000000..f021c3e Binary files /dev/null and b/admin/images/icons/folder_user.png differ diff --git a/admin/images/icons/folder_wrench.png b/admin/images/icons/folder_wrench.png new file mode 100644 index 0000000..ea3404e Binary files /dev/null and b/admin/images/icons/folder_wrench.png differ diff --git a/admin/images/icons/font.png b/admin/images/icons/font.png new file mode 100644 index 0000000..b7960db Binary files /dev/null and b/admin/images/icons/font.png differ diff --git a/admin/images/icons/font_add.png b/admin/images/icons/font_add.png new file mode 100644 index 0000000..b709eba Binary files /dev/null and b/admin/images/icons/font_add.png differ diff --git a/admin/images/icons/font_delete.png b/admin/images/icons/font_delete.png new file mode 100644 index 0000000..1d6124d Binary files /dev/null and b/admin/images/icons/font_delete.png differ diff --git a/admin/images/icons/font_go.png b/admin/images/icons/font_go.png new file mode 100644 index 0000000..75eba80 Binary files /dev/null and b/admin/images/icons/font_go.png differ diff --git a/admin/images/icons/group.png b/admin/images/icons/group.png new file mode 100644 index 0000000..7fb4e1f Binary files /dev/null and b/admin/images/icons/group.png differ diff --git a/admin/images/icons/group_add.png b/admin/images/icons/group_add.png new file mode 100644 index 0000000..06c5350 Binary files /dev/null and b/admin/images/icons/group_add.png differ diff --git a/admin/images/icons/group_delete.png b/admin/images/icons/group_delete.png new file mode 100644 index 0000000..4489ca2 Binary files /dev/null and b/admin/images/icons/group_delete.png differ diff --git a/admin/images/icons/group_edit.png b/admin/images/icons/group_edit.png new file mode 100644 index 0000000..c88b945 Binary files /dev/null and b/admin/images/icons/group_edit.png differ diff --git a/admin/images/icons/group_error.png b/admin/images/icons/group_error.png new file mode 100644 index 0000000..7364a13 Binary files /dev/null and b/admin/images/icons/group_error.png differ diff --git a/admin/images/icons/group_gear.png b/admin/images/icons/group_gear.png new file mode 100644 index 0000000..2544f2e Binary files /dev/null and b/admin/images/icons/group_gear.png differ diff --git a/admin/images/icons/group_go.png b/admin/images/icons/group_go.png new file mode 100644 index 0000000..1f52333 Binary files /dev/null and b/admin/images/icons/group_go.png differ diff --git a/admin/images/icons/group_key.png b/admin/images/icons/group_key.png new file mode 100644 index 0000000..257f111 Binary files /dev/null and b/admin/images/icons/group_key.png differ diff --git a/admin/images/icons/group_link.png b/admin/images/icons/group_link.png new file mode 100644 index 0000000..c77ed88 Binary files /dev/null and b/admin/images/icons/group_link.png differ diff --git a/admin/images/icons/heart.png b/admin/images/icons/heart.png new file mode 100644 index 0000000..d9ee53e Binary files /dev/null and b/admin/images/icons/heart.png differ diff --git a/admin/images/icons/heart_add.png b/admin/images/icons/heart_add.png new file mode 100644 index 0000000..d4195ff Binary files /dev/null and b/admin/images/icons/heart_add.png differ diff --git a/admin/images/icons/heart_delete.png b/admin/images/icons/heart_delete.png new file mode 100644 index 0000000..ce523e3 Binary files /dev/null and b/admin/images/icons/heart_delete.png differ diff --git a/admin/images/icons/help.png b/admin/images/icons/help.png new file mode 100644 index 0000000..5c87017 Binary files /dev/null and b/admin/images/icons/help.png differ diff --git a/admin/images/icons/hourglass.png b/admin/images/icons/hourglass.png new file mode 100644 index 0000000..57b03ce Binary files /dev/null and b/admin/images/icons/hourglass.png differ diff --git a/admin/images/icons/hourglass_add.png b/admin/images/icons/hourglass_add.png new file mode 100644 index 0000000..170dfff Binary files /dev/null and b/admin/images/icons/hourglass_add.png differ diff --git a/admin/images/icons/hourglass_delete.png b/admin/images/icons/hourglass_delete.png new file mode 100644 index 0000000..4b1337b Binary files /dev/null and b/admin/images/icons/hourglass_delete.png differ diff --git a/admin/images/icons/hourglass_go.png b/admin/images/icons/hourglass_go.png new file mode 100644 index 0000000..b2d3a98 Binary files /dev/null and b/admin/images/icons/hourglass_go.png differ diff --git a/admin/images/icons/hourglass_link.png b/admin/images/icons/hourglass_link.png new file mode 100644 index 0000000..ecc59b0 Binary files /dev/null and b/admin/images/icons/hourglass_link.png differ diff --git a/admin/images/icons/house.png b/admin/images/icons/house.png new file mode 100644 index 0000000..fed6221 Binary files /dev/null and b/admin/images/icons/house.png differ diff --git a/admin/images/icons/house_go.png b/admin/images/icons/house_go.png new file mode 100644 index 0000000..5457dbd Binary files /dev/null and b/admin/images/icons/house_go.png differ diff --git a/admin/images/icons/house_link.png b/admin/images/icons/house_link.png new file mode 100644 index 0000000..be2c271 Binary files /dev/null and b/admin/images/icons/house_link.png differ diff --git a/admin/images/icons/html.png b/admin/images/icons/html.png new file mode 100644 index 0000000..55d1072 Binary files /dev/null and b/admin/images/icons/html.png differ diff --git a/admin/images/icons/html_add.png b/admin/images/icons/html_add.png new file mode 100644 index 0000000..f1c08b7 Binary files /dev/null and b/admin/images/icons/html_add.png differ diff --git a/admin/images/icons/html_delete.png b/admin/images/icons/html_delete.png new file mode 100644 index 0000000..1bd2848 Binary files /dev/null and b/admin/images/icons/html_delete.png differ diff --git a/admin/images/icons/html_go.png b/admin/images/icons/html_go.png new file mode 100644 index 0000000..a95cede Binary files /dev/null and b/admin/images/icons/html_go.png differ diff --git a/admin/images/icons/html_valid.png b/admin/images/icons/html_valid.png new file mode 100644 index 0000000..71cec92 Binary files /dev/null and b/admin/images/icons/html_valid.png differ diff --git a/admin/images/icons/image.png b/admin/images/icons/image.png new file mode 100644 index 0000000..fc3c393 Binary files /dev/null and b/admin/images/icons/image.png differ diff --git a/admin/images/icons/image_add.png b/admin/images/icons/image_add.png new file mode 100644 index 0000000..fc5d613 Binary files /dev/null and b/admin/images/icons/image_add.png differ diff --git a/admin/images/icons/image_delete.png b/admin/images/icons/image_delete.png new file mode 100644 index 0000000..c260e1d Binary files /dev/null and b/admin/images/icons/image_delete.png differ diff --git a/admin/images/icons/image_edit.png b/admin/images/icons/image_edit.png new file mode 100644 index 0000000..0aa4cc6 Binary files /dev/null and b/admin/images/icons/image_edit.png differ diff --git a/admin/images/icons/image_link.png b/admin/images/icons/image_link.png new file mode 100644 index 0000000..4bdb354 Binary files /dev/null and b/admin/images/icons/image_link.png differ diff --git a/admin/images/icons/images.png b/admin/images/icons/images.png new file mode 100644 index 0000000..184860d Binary files /dev/null and b/admin/images/icons/images.png differ diff --git a/admin/images/icons/information.png b/admin/images/icons/information.png new file mode 100644 index 0000000..12cd1ae Binary files /dev/null and b/admin/images/icons/information.png differ diff --git a/admin/images/icons/ipod.png b/admin/images/icons/ipod.png new file mode 100644 index 0000000..3f768da Binary files /dev/null and b/admin/images/icons/ipod.png differ diff --git a/admin/images/icons/ipod_cast.png b/admin/images/icons/ipod_cast.png new file mode 100644 index 0000000..6f6d340 Binary files /dev/null and b/admin/images/icons/ipod_cast.png differ diff --git a/admin/images/icons/ipod_cast_add.png b/admin/images/icons/ipod_cast_add.png new file mode 100644 index 0000000..c3257f5 Binary files /dev/null and b/admin/images/icons/ipod_cast_add.png differ diff --git a/admin/images/icons/ipod_cast_delete.png b/admin/images/icons/ipod_cast_delete.png new file mode 100644 index 0000000..377ab69 Binary files /dev/null and b/admin/images/icons/ipod_cast_delete.png differ diff --git a/admin/images/icons/ipod_sound.png b/admin/images/icons/ipod_sound.png new file mode 100644 index 0000000..fef6e8b Binary files /dev/null and b/admin/images/icons/ipod_sound.png differ diff --git a/admin/images/icons/joystick.png b/admin/images/icons/joystick.png new file mode 100644 index 0000000..62168f5 Binary files /dev/null and b/admin/images/icons/joystick.png differ diff --git a/admin/images/icons/joystick_add.png b/admin/images/icons/joystick_add.png new file mode 100644 index 0000000..77e7107 Binary files /dev/null and b/admin/images/icons/joystick_add.png differ diff --git a/admin/images/icons/joystick_delete.png b/admin/images/icons/joystick_delete.png new file mode 100644 index 0000000..5d44b59 Binary files /dev/null and b/admin/images/icons/joystick_delete.png differ diff --git a/admin/images/icons/joystick_error.png b/admin/images/icons/joystick_error.png new file mode 100644 index 0000000..b32149e Binary files /dev/null and b/admin/images/icons/joystick_error.png differ diff --git a/admin/images/icons/key.png b/admin/images/icons/key.png new file mode 100644 index 0000000..4ec1a92 Binary files /dev/null and b/admin/images/icons/key.png differ diff --git a/admin/images/icons/key_add.png b/admin/images/icons/key_add.png new file mode 100644 index 0000000..d407403 Binary files /dev/null and b/admin/images/icons/key_add.png differ diff --git a/admin/images/icons/key_delete.png b/admin/images/icons/key_delete.png new file mode 100644 index 0000000..00dec80 Binary files /dev/null and b/admin/images/icons/key_delete.png differ diff --git a/admin/images/icons/key_go.png b/admin/images/icons/key_go.png new file mode 100644 index 0000000..30b0dc3 Binary files /dev/null and b/admin/images/icons/key_go.png differ diff --git a/admin/images/icons/keyboard.png b/admin/images/icons/keyboard.png new file mode 100644 index 0000000..898d402 Binary files /dev/null and b/admin/images/icons/keyboard.png differ diff --git a/admin/images/icons/keyboard_add.png b/admin/images/icons/keyboard_add.png new file mode 100644 index 0000000..26938dd Binary files /dev/null and b/admin/images/icons/keyboard_add.png differ diff --git a/admin/images/icons/keyboard_delete.png b/admin/images/icons/keyboard_delete.png new file mode 100644 index 0000000..1786ed5 Binary files /dev/null and b/admin/images/icons/keyboard_delete.png differ diff --git a/admin/images/icons/keyboard_magnify.png b/admin/images/icons/keyboard_magnify.png new file mode 100644 index 0000000..928fc17 Binary files /dev/null and b/admin/images/icons/keyboard_magnify.png differ diff --git a/admin/images/icons/layers.png b/admin/images/icons/layers.png new file mode 100644 index 0000000..00818f6 Binary files /dev/null and b/admin/images/icons/layers.png differ diff --git a/admin/images/icons/layout.png b/admin/images/icons/layout.png new file mode 100644 index 0000000..ea086b0 Binary files /dev/null and b/admin/images/icons/layout.png differ diff --git a/admin/images/icons/layout_add.png b/admin/images/icons/layout_add.png new file mode 100644 index 0000000..6203722 Binary files /dev/null and b/admin/images/icons/layout_add.png differ diff --git a/admin/images/icons/layout_content.png b/admin/images/icons/layout_content.png new file mode 100644 index 0000000..b4aaad9 Binary files /dev/null and b/admin/images/icons/layout_content.png differ diff --git a/admin/images/icons/layout_delete.png b/admin/images/icons/layout_delete.png new file mode 100644 index 0000000..4bd45f1 Binary files /dev/null and b/admin/images/icons/layout_delete.png differ diff --git a/admin/images/icons/layout_edit.png b/admin/images/icons/layout_edit.png new file mode 100644 index 0000000..ab3100b Binary files /dev/null and b/admin/images/icons/layout_edit.png differ diff --git a/admin/images/icons/layout_error.png b/admin/images/icons/layout_error.png new file mode 100644 index 0000000..5b5acea Binary files /dev/null and b/admin/images/icons/layout_error.png differ diff --git a/admin/images/icons/layout_header.png b/admin/images/icons/layout_header.png new file mode 100644 index 0000000..c6ea7f2 Binary files /dev/null and b/admin/images/icons/layout_header.png differ diff --git a/admin/images/icons/layout_link.png b/admin/images/icons/layout_link.png new file mode 100644 index 0000000..3445d42 Binary files /dev/null and b/admin/images/icons/layout_link.png differ diff --git a/admin/images/icons/layout_sidebar.png b/admin/images/icons/layout_sidebar.png new file mode 100644 index 0000000..3be27bb Binary files /dev/null and b/admin/images/icons/layout_sidebar.png differ diff --git a/admin/images/icons/lightbulb.png b/admin/images/icons/lightbulb.png new file mode 100644 index 0000000..d22fde8 Binary files /dev/null and b/admin/images/icons/lightbulb.png differ diff --git a/admin/images/icons/lightbulb_add.png b/admin/images/icons/lightbulb_add.png new file mode 100644 index 0000000..0dd848b Binary files /dev/null and b/admin/images/icons/lightbulb_add.png differ diff --git a/admin/images/icons/lightbulb_delete.png b/admin/images/icons/lightbulb_delete.png new file mode 100644 index 0000000..f4781da Binary files /dev/null and b/admin/images/icons/lightbulb_delete.png differ diff --git a/admin/images/icons/lightbulb_off.png b/admin/images/icons/lightbulb_off.png new file mode 100644 index 0000000..e95b8c5 Binary files /dev/null and b/admin/images/icons/lightbulb_off.png differ diff --git a/admin/images/icons/lightning.png b/admin/images/icons/lightning.png new file mode 100644 index 0000000..9680afd Binary files /dev/null and b/admin/images/icons/lightning.png differ diff --git a/admin/images/icons/lightning_add.png b/admin/images/icons/lightning_add.png new file mode 100644 index 0000000..dac3c90 Binary files /dev/null and b/admin/images/icons/lightning_add.png differ diff --git a/admin/images/icons/lightning_delete.png b/admin/images/icons/lightning_delete.png new file mode 100644 index 0000000..dfe2770 Binary files /dev/null and b/admin/images/icons/lightning_delete.png differ diff --git a/admin/images/icons/lightning_go.png b/admin/images/icons/lightning_go.png new file mode 100644 index 0000000..29039e6 Binary files /dev/null and b/admin/images/icons/lightning_go.png differ diff --git a/admin/images/icons/link.png b/admin/images/icons/link.png new file mode 100644 index 0000000..25eacb7 Binary files /dev/null and b/admin/images/icons/link.png differ diff --git a/admin/images/icons/link_add.png b/admin/images/icons/link_add.png new file mode 100644 index 0000000..00be352 Binary files /dev/null and b/admin/images/icons/link_add.png differ diff --git a/admin/images/icons/link_break.png b/admin/images/icons/link_break.png new file mode 100644 index 0000000..5235753 Binary files /dev/null and b/admin/images/icons/link_break.png differ diff --git a/admin/images/icons/link_delete.png b/admin/images/icons/link_delete.png new file mode 100644 index 0000000..f66e297 Binary files /dev/null and b/admin/images/icons/link_delete.png differ diff --git a/admin/images/icons/link_edit.png b/admin/images/icons/link_edit.png new file mode 100644 index 0000000..5b3aed0 Binary files /dev/null and b/admin/images/icons/link_edit.png differ diff --git a/admin/images/icons/link_error.png b/admin/images/icons/link_error.png new file mode 100644 index 0000000..ab694b1 Binary files /dev/null and b/admin/images/icons/link_error.png differ diff --git a/admin/images/icons/link_go.png b/admin/images/icons/link_go.png new file mode 100644 index 0000000..ae8cae8 Binary files /dev/null and b/admin/images/icons/link_go.png differ diff --git a/admin/images/icons/lock.png b/admin/images/icons/lock.png new file mode 100644 index 0000000..2ebc4f6 Binary files /dev/null and b/admin/images/icons/lock.png differ diff --git a/admin/images/icons/lock_add.png b/admin/images/icons/lock_add.png new file mode 100644 index 0000000..a7b566b Binary files /dev/null and b/admin/images/icons/lock_add.png differ diff --git a/admin/images/icons/lock_break.png b/admin/images/icons/lock_break.png new file mode 100644 index 0000000..13578ab Binary files /dev/null and b/admin/images/icons/lock_break.png differ diff --git a/admin/images/icons/lock_delete.png b/admin/images/icons/lock_delete.png new file mode 100644 index 0000000..ecb50a9 Binary files /dev/null and b/admin/images/icons/lock_delete.png differ diff --git a/admin/images/icons/lock_edit.png b/admin/images/icons/lock_edit.png new file mode 100644 index 0000000..116aa5b Binary files /dev/null and b/admin/images/icons/lock_edit.png differ diff --git a/admin/images/icons/lock_go.png b/admin/images/icons/lock_go.png new file mode 100644 index 0000000..8c7c89b Binary files /dev/null and b/admin/images/icons/lock_go.png differ diff --git a/admin/images/icons/lock_open.png b/admin/images/icons/lock_open.png new file mode 100644 index 0000000..a471765 Binary files /dev/null and b/admin/images/icons/lock_open.png differ diff --git a/admin/images/icons/lorry.png b/admin/images/icons/lorry.png new file mode 100644 index 0000000..8f95f5a Binary files /dev/null and b/admin/images/icons/lorry.png differ diff --git a/admin/images/icons/lorry_add.png b/admin/images/icons/lorry_add.png new file mode 100644 index 0000000..a2c5124 Binary files /dev/null and b/admin/images/icons/lorry_add.png differ diff --git a/admin/images/icons/lorry_delete.png b/admin/images/icons/lorry_delete.png new file mode 100644 index 0000000..66217f5 Binary files /dev/null and b/admin/images/icons/lorry_delete.png differ diff --git a/admin/images/icons/lorry_error.png b/admin/images/icons/lorry_error.png new file mode 100644 index 0000000..3619ead Binary files /dev/null and b/admin/images/icons/lorry_error.png differ diff --git a/admin/images/icons/lorry_flatbed.png b/admin/images/icons/lorry_flatbed.png new file mode 100644 index 0000000..8b20f55 Binary files /dev/null and b/admin/images/icons/lorry_flatbed.png differ diff --git a/admin/images/icons/lorry_go.png b/admin/images/icons/lorry_go.png new file mode 100644 index 0000000..1c296a6 Binary files /dev/null and b/admin/images/icons/lorry_go.png differ diff --git a/admin/images/icons/lorry_link.png b/admin/images/icons/lorry_link.png new file mode 100644 index 0000000..5e6663e Binary files /dev/null and b/admin/images/icons/lorry_link.png differ diff --git a/admin/images/icons/magifier_zoom_out.png b/admin/images/icons/magifier_zoom_out.png new file mode 100644 index 0000000..81f2819 Binary files /dev/null and b/admin/images/icons/magifier_zoom_out.png differ diff --git a/admin/images/icons/magnifier.png b/admin/images/icons/magnifier.png new file mode 100644 index 0000000..cf3d97f Binary files /dev/null and b/admin/images/icons/magnifier.png differ diff --git a/admin/images/icons/magnifier_zoom_in.png b/admin/images/icons/magnifier_zoom_in.png new file mode 100644 index 0000000..af4fe07 Binary files /dev/null and b/admin/images/icons/magnifier_zoom_in.png differ diff --git a/admin/images/icons/male.png b/admin/images/icons/male.png new file mode 100644 index 0000000..25d6ea9 Binary files /dev/null and b/admin/images/icons/male.png differ diff --git a/admin/images/icons/map.png b/admin/images/icons/map.png new file mode 100644 index 0000000..f90ef25 Binary files /dev/null and b/admin/images/icons/map.png differ diff --git a/admin/images/icons/map_add.png b/admin/images/icons/map_add.png new file mode 100644 index 0000000..2b72da0 Binary files /dev/null and b/admin/images/icons/map_add.png differ diff --git a/admin/images/icons/map_delete.png b/admin/images/icons/map_delete.png new file mode 100644 index 0000000..e74402f Binary files /dev/null and b/admin/images/icons/map_delete.png differ diff --git a/admin/images/icons/map_edit.png b/admin/images/icons/map_edit.png new file mode 100644 index 0000000..93d4d7e Binary files /dev/null and b/admin/images/icons/map_edit.png differ diff --git a/admin/images/icons/map_go.png b/admin/images/icons/map_go.png new file mode 100644 index 0000000..11eab26 Binary files /dev/null and b/admin/images/icons/map_go.png differ diff --git a/admin/images/icons/map_magnify.png b/admin/images/icons/map_magnify.png new file mode 100644 index 0000000..7184c9d Binary files /dev/null and b/admin/images/icons/map_magnify.png differ diff --git a/admin/images/icons/medal_bronze_1.png b/admin/images/icons/medal_bronze_1.png new file mode 100644 index 0000000..5f8a6d6 Binary files /dev/null and b/admin/images/icons/medal_bronze_1.png differ diff --git a/admin/images/icons/medal_bronze_2.png b/admin/images/icons/medal_bronze_2.png new file mode 100644 index 0000000..623d68c Binary files /dev/null and b/admin/images/icons/medal_bronze_2.png differ diff --git a/admin/images/icons/medal_bronze_3.png b/admin/images/icons/medal_bronze_3.png new file mode 100644 index 0000000..ed3f43e Binary files /dev/null and b/admin/images/icons/medal_bronze_3.png differ diff --git a/admin/images/icons/medal_bronze_add.png b/admin/images/icons/medal_bronze_add.png new file mode 100644 index 0000000..8487b2c Binary files /dev/null and b/admin/images/icons/medal_bronze_add.png differ diff --git a/admin/images/icons/medal_bronze_delete.png b/admin/images/icons/medal_bronze_delete.png new file mode 100644 index 0000000..d32aed7 Binary files /dev/null and b/admin/images/icons/medal_bronze_delete.png differ diff --git a/admin/images/icons/medal_gold_1.png b/admin/images/icons/medal_gold_1.png new file mode 100644 index 0000000..87584dc Binary files /dev/null and b/admin/images/icons/medal_gold_1.png differ diff --git a/admin/images/icons/medal_gold_2.png b/admin/images/icons/medal_gold_2.png new file mode 100644 index 0000000..fa3a15d Binary files /dev/null and b/admin/images/icons/medal_gold_2.png differ diff --git a/admin/images/icons/medal_gold_3.png b/admin/images/icons/medal_gold_3.png new file mode 100644 index 0000000..ef1b08b Binary files /dev/null and b/admin/images/icons/medal_gold_3.png differ diff --git a/admin/images/icons/medal_gold_add.png b/admin/images/icons/medal_gold_add.png new file mode 100644 index 0000000..dcade0d Binary files /dev/null and b/admin/images/icons/medal_gold_add.png differ diff --git a/admin/images/icons/medal_gold_delete.png b/admin/images/icons/medal_gold_delete.png new file mode 100644 index 0000000..84b06d5 Binary files /dev/null and b/admin/images/icons/medal_gold_delete.png differ diff --git a/admin/images/icons/medal_silver_1.png b/admin/images/icons/medal_silver_1.png new file mode 100644 index 0000000..75a64da Binary files /dev/null and b/admin/images/icons/medal_silver_1.png differ diff --git a/admin/images/icons/medal_silver_2.png b/admin/images/icons/medal_silver_2.png new file mode 100644 index 0000000..2e0fe75 Binary files /dev/null and b/admin/images/icons/medal_silver_2.png differ diff --git a/admin/images/icons/medal_silver_3.png b/admin/images/icons/medal_silver_3.png new file mode 100644 index 0000000..e385b54 Binary files /dev/null and b/admin/images/icons/medal_silver_3.png differ diff --git a/admin/images/icons/medal_silver_add.png b/admin/images/icons/medal_silver_add.png new file mode 100644 index 0000000..b0633fa Binary files /dev/null and b/admin/images/icons/medal_silver_add.png differ diff --git a/admin/images/icons/medal_silver_delete.png b/admin/images/icons/medal_silver_delete.png new file mode 100644 index 0000000..06cab46 Binary files /dev/null and b/admin/images/icons/medal_silver_delete.png differ diff --git a/admin/images/icons/money.png b/admin/images/icons/money.png new file mode 100644 index 0000000..42c52d0 Binary files /dev/null and b/admin/images/icons/money.png differ diff --git a/admin/images/icons/money_add.png b/admin/images/icons/money_add.png new file mode 100644 index 0000000..588fa9d Binary files /dev/null and b/admin/images/icons/money_add.png differ diff --git a/admin/images/icons/money_delete.png b/admin/images/icons/money_delete.png new file mode 100644 index 0000000..eae2c52 Binary files /dev/null and b/admin/images/icons/money_delete.png differ diff --git a/admin/images/icons/money_dollar.png b/admin/images/icons/money_dollar.png new file mode 100644 index 0000000..59af163 Binary files /dev/null and b/admin/images/icons/money_dollar.png differ diff --git a/admin/images/icons/money_euro.png b/admin/images/icons/money_euro.png new file mode 100644 index 0000000..b322ba9 Binary files /dev/null and b/admin/images/icons/money_euro.png differ diff --git a/admin/images/icons/money_pound.png b/admin/images/icons/money_pound.png new file mode 100644 index 0000000..b711364 Binary files /dev/null and b/admin/images/icons/money_pound.png differ diff --git a/admin/images/icons/money_yen.png b/admin/images/icons/money_yen.png new file mode 100644 index 0000000..228a677 Binary files /dev/null and b/admin/images/icons/money_yen.png differ diff --git a/admin/images/icons/monitor.png b/admin/images/icons/monitor.png new file mode 100644 index 0000000..d040bd0 Binary files /dev/null and b/admin/images/icons/monitor.png differ diff --git a/admin/images/icons/monitor_add.png b/admin/images/icons/monitor_add.png new file mode 100644 index 0000000..a818066 Binary files /dev/null and b/admin/images/icons/monitor_add.png differ diff --git a/admin/images/icons/monitor_delete.png b/admin/images/icons/monitor_delete.png new file mode 100644 index 0000000..3733256 Binary files /dev/null and b/admin/images/icons/monitor_delete.png differ diff --git a/admin/images/icons/monitor_edit.png b/admin/images/icons/monitor_edit.png new file mode 100644 index 0000000..f772c56 Binary files /dev/null and b/admin/images/icons/monitor_edit.png differ diff --git a/admin/images/icons/monitor_error.png b/admin/images/icons/monitor_error.png new file mode 100644 index 0000000..270c501 Binary files /dev/null and b/admin/images/icons/monitor_error.png differ diff --git a/admin/images/icons/monitor_go.png b/admin/images/icons/monitor_go.png new file mode 100644 index 0000000..8af3eda Binary files /dev/null and b/admin/images/icons/monitor_go.png differ diff --git a/admin/images/icons/monitor_lightning.png b/admin/images/icons/monitor_lightning.png new file mode 100644 index 0000000..06e53a9 Binary files /dev/null and b/admin/images/icons/monitor_lightning.png differ diff --git a/admin/images/icons/monitor_link.png b/admin/images/icons/monitor_link.png new file mode 100644 index 0000000..a014b02 Binary files /dev/null and b/admin/images/icons/monitor_link.png differ diff --git a/admin/images/icons/mouse.png b/admin/images/icons/mouse.png new file mode 100644 index 0000000..63a92fa Binary files /dev/null and b/admin/images/icons/mouse.png differ diff --git a/admin/images/icons/mouse_add.png b/admin/images/icons/mouse_add.png new file mode 100644 index 0000000..65bcab5 Binary files /dev/null and b/admin/images/icons/mouse_add.png differ diff --git a/admin/images/icons/mouse_delete.png b/admin/images/icons/mouse_delete.png new file mode 100644 index 0000000..7286566 Binary files /dev/null and b/admin/images/icons/mouse_delete.png differ diff --git a/admin/images/icons/mouse_error.png b/admin/images/icons/mouse_error.png new file mode 100644 index 0000000..bcc1562 Binary files /dev/null and b/admin/images/icons/mouse_error.png differ diff --git a/admin/images/icons/music.png b/admin/images/icons/music.png new file mode 100644 index 0000000..a8b3ede Binary files /dev/null and b/admin/images/icons/music.png differ diff --git a/admin/images/icons/new.png b/admin/images/icons/new.png new file mode 100644 index 0000000..6a9bf03 Binary files /dev/null and b/admin/images/icons/new.png differ diff --git a/admin/images/icons/newspaper.png b/admin/images/icons/newspaper.png new file mode 100644 index 0000000..6a2ecce Binary files /dev/null and b/admin/images/icons/newspaper.png differ diff --git a/admin/images/icons/newspaper_add.png b/admin/images/icons/newspaper_add.png new file mode 100644 index 0000000..8140e8c Binary files /dev/null and b/admin/images/icons/newspaper_add.png differ diff --git a/admin/images/icons/newspaper_delete.png b/admin/images/icons/newspaper_delete.png new file mode 100644 index 0000000..bde96ce Binary files /dev/null and b/admin/images/icons/newspaper_delete.png differ diff --git a/admin/images/icons/newspaper_go.png b/admin/images/icons/newspaper_go.png new file mode 100644 index 0000000..fd61428 Binary files /dev/null and b/admin/images/icons/newspaper_go.png differ diff --git a/admin/images/icons/newspaper_link.png b/admin/images/icons/newspaper_link.png new file mode 100644 index 0000000..99e57cb Binary files /dev/null and b/admin/images/icons/newspaper_link.png differ diff --git a/admin/images/icons/note.png b/admin/images/icons/note.png new file mode 100644 index 0000000..244e6ca Binary files /dev/null and b/admin/images/icons/note.png differ diff --git a/admin/images/icons/note_add.png b/admin/images/icons/note_add.png new file mode 100644 index 0000000..abdad91 Binary files /dev/null and b/admin/images/icons/note_add.png differ diff --git a/admin/images/icons/note_delete.png b/admin/images/icons/note_delete.png new file mode 100644 index 0000000..8a1f0ff Binary files /dev/null and b/admin/images/icons/note_delete.png differ diff --git a/admin/images/icons/note_edit.png b/admin/images/icons/note_edit.png new file mode 100644 index 0000000..291bfc7 Binary files /dev/null and b/admin/images/icons/note_edit.png differ diff --git a/admin/images/icons/note_error.png b/admin/images/icons/note_error.png new file mode 100644 index 0000000..896dadf Binary files /dev/null and b/admin/images/icons/note_error.png differ diff --git a/admin/images/icons/note_go.png b/admin/images/icons/note_go.png new file mode 100644 index 0000000..49e54fd Binary files /dev/null and b/admin/images/icons/note_go.png differ diff --git a/admin/images/icons/overlays.png b/admin/images/icons/overlays.png new file mode 100644 index 0000000..ab3100b Binary files /dev/null and b/admin/images/icons/overlays.png differ diff --git a/admin/images/icons/package.png b/admin/images/icons/package.png new file mode 100644 index 0000000..da3c2a2 Binary files /dev/null and b/admin/images/icons/package.png differ diff --git a/admin/images/icons/package_add.png b/admin/images/icons/package_add.png new file mode 100644 index 0000000..9c8a9da Binary files /dev/null and b/admin/images/icons/package_add.png differ diff --git a/admin/images/icons/package_delete.png b/admin/images/icons/package_delete.png new file mode 100644 index 0000000..86f7fbc Binary files /dev/null and b/admin/images/icons/package_delete.png differ diff --git a/admin/images/icons/package_go.png b/admin/images/icons/package_go.png new file mode 100644 index 0000000..aace63a Binary files /dev/null and b/admin/images/icons/package_go.png differ diff --git a/admin/images/icons/package_green.png b/admin/images/icons/package_green.png new file mode 100644 index 0000000..25b28bb Binary files /dev/null and b/admin/images/icons/package_green.png differ diff --git a/admin/images/icons/package_link.png b/admin/images/icons/package_link.png new file mode 100644 index 0000000..48e7ab5 Binary files /dev/null and b/admin/images/icons/package_link.png differ diff --git a/admin/images/icons/page.png b/admin/images/icons/page.png new file mode 100644 index 0000000..03ddd79 Binary files /dev/null and b/admin/images/icons/page.png differ diff --git a/admin/images/icons/page_add.png b/admin/images/icons/page_add.png new file mode 100644 index 0000000..d5bfa07 Binary files /dev/null and b/admin/images/icons/page_add.png differ diff --git a/admin/images/icons/page_attach.png b/admin/images/icons/page_attach.png new file mode 100644 index 0000000..89ee2da Binary files /dev/null and b/admin/images/icons/page_attach.png differ diff --git a/admin/images/icons/page_code.png b/admin/images/icons/page_code.png new file mode 100644 index 0000000..f7ea904 Binary files /dev/null and b/admin/images/icons/page_code.png differ diff --git a/admin/images/icons/page_copy.png b/admin/images/icons/page_copy.png new file mode 100644 index 0000000..195dc6d Binary files /dev/null and b/admin/images/icons/page_copy.png differ diff --git a/admin/images/icons/page_delete.png b/admin/images/icons/page_delete.png new file mode 100644 index 0000000..3141467 Binary files /dev/null and b/admin/images/icons/page_delete.png differ diff --git a/admin/images/icons/page_edit.png b/admin/images/icons/page_edit.png new file mode 100644 index 0000000..046811e Binary files /dev/null and b/admin/images/icons/page_edit.png differ diff --git a/admin/images/icons/page_error.png b/admin/images/icons/page_error.png new file mode 100644 index 0000000..f07f449 Binary files /dev/null and b/admin/images/icons/page_error.png differ diff --git a/admin/images/icons/page_excel.png b/admin/images/icons/page_excel.png new file mode 100644 index 0000000..eb6158e Binary files /dev/null and b/admin/images/icons/page_excel.png differ diff --git a/admin/images/icons/page_find.png b/admin/images/icons/page_find.png new file mode 100644 index 0000000..2f19388 Binary files /dev/null and b/admin/images/icons/page_find.png differ diff --git a/admin/images/icons/page_gear.png b/admin/images/icons/page_gear.png new file mode 100644 index 0000000..8e83281 Binary files /dev/null and b/admin/images/icons/page_gear.png differ diff --git a/admin/images/icons/page_go.png b/admin/images/icons/page_go.png new file mode 100644 index 0000000..80fe1ed Binary files /dev/null and b/admin/images/icons/page_go.png differ diff --git a/admin/images/icons/page_green.png b/admin/images/icons/page_green.png new file mode 100644 index 0000000..de8e003 Binary files /dev/null and b/admin/images/icons/page_green.png differ diff --git a/admin/images/icons/page_key.png b/admin/images/icons/page_key.png new file mode 100644 index 0000000..d6626cb Binary files /dev/null and b/admin/images/icons/page_key.png differ diff --git a/admin/images/icons/page_lightning.png b/admin/images/icons/page_lightning.png new file mode 100644 index 0000000..7e56870 Binary files /dev/null and b/admin/images/icons/page_lightning.png differ diff --git a/admin/images/icons/page_link.png b/admin/images/icons/page_link.png new file mode 100644 index 0000000..312eab0 Binary files /dev/null and b/admin/images/icons/page_link.png differ diff --git a/admin/images/icons/page_paintbrush.png b/admin/images/icons/page_paintbrush.png new file mode 100644 index 0000000..246a2f0 Binary files /dev/null and b/admin/images/icons/page_paintbrush.png differ diff --git a/admin/images/icons/page_paste.png b/admin/images/icons/page_paste.png new file mode 100644 index 0000000..968f073 Binary files /dev/null and b/admin/images/icons/page_paste.png differ diff --git a/admin/images/icons/page_red.png b/admin/images/icons/page_red.png new file mode 100644 index 0000000..0b18247 Binary files /dev/null and b/admin/images/icons/page_red.png differ diff --git a/admin/images/icons/page_refresh.png b/admin/images/icons/page_refresh.png new file mode 100644 index 0000000..cf347c7 Binary files /dev/null and b/admin/images/icons/page_refresh.png differ diff --git a/admin/images/icons/page_save.png b/admin/images/icons/page_save.png new file mode 100644 index 0000000..caea546 Binary files /dev/null and b/admin/images/icons/page_save.png differ diff --git a/admin/images/icons/page_white.png b/admin/images/icons/page_white.png new file mode 100644 index 0000000..8b8b1ca Binary files /dev/null and b/admin/images/icons/page_white.png differ diff --git a/admin/images/icons/page_white_acrobat.png b/admin/images/icons/page_white_acrobat.png new file mode 100644 index 0000000..8f8095e Binary files /dev/null and b/admin/images/icons/page_white_acrobat.png differ diff --git a/admin/images/icons/page_white_actionscript.png b/admin/images/icons/page_white_actionscript.png new file mode 100644 index 0000000..159b240 Binary files /dev/null and b/admin/images/icons/page_white_actionscript.png differ diff --git a/admin/images/icons/page_white_add.png b/admin/images/icons/page_white_add.png new file mode 100644 index 0000000..aa23dde Binary files /dev/null and b/admin/images/icons/page_white_add.png differ diff --git a/admin/images/icons/page_white_c.png b/admin/images/icons/page_white_c.png new file mode 100644 index 0000000..34a05cc Binary files /dev/null and b/admin/images/icons/page_white_c.png differ diff --git a/admin/images/icons/page_white_camera.png b/admin/images/icons/page_white_camera.png new file mode 100644 index 0000000..f501a59 Binary files /dev/null and b/admin/images/icons/page_white_camera.png differ diff --git a/admin/images/icons/page_white_cd.png b/admin/images/icons/page_white_cd.png new file mode 100644 index 0000000..848bdaf Binary files /dev/null and b/admin/images/icons/page_white_cd.png differ diff --git a/admin/images/icons/page_white_code.png b/admin/images/icons/page_white_code.png new file mode 100644 index 0000000..0c76bd1 Binary files /dev/null and b/admin/images/icons/page_white_code.png differ diff --git a/admin/images/icons/page_white_code_red.png b/admin/images/icons/page_white_code_red.png new file mode 100644 index 0000000..87a6914 Binary files /dev/null and b/admin/images/icons/page_white_code_red.png differ diff --git a/admin/images/icons/page_white_coldfusion.png b/admin/images/icons/page_white_coldfusion.png new file mode 100644 index 0000000..c66011f Binary files /dev/null and b/admin/images/icons/page_white_coldfusion.png differ diff --git a/admin/images/icons/page_white_compressed.png b/admin/images/icons/page_white_compressed.png new file mode 100644 index 0000000..2b6b100 Binary files /dev/null and b/admin/images/icons/page_white_compressed.png differ diff --git a/admin/images/icons/page_white_copy.png b/admin/images/icons/page_white_copy.png new file mode 100644 index 0000000..a9f31a2 Binary files /dev/null and b/admin/images/icons/page_white_copy.png differ diff --git a/admin/images/icons/page_white_cplusplus.png b/admin/images/icons/page_white_cplusplus.png new file mode 100644 index 0000000..a87cf84 Binary files /dev/null and b/admin/images/icons/page_white_cplusplus.png differ diff --git a/admin/images/icons/page_white_csharp.png b/admin/images/icons/page_white_csharp.png new file mode 100644 index 0000000..ffb8fc9 Binary files /dev/null and b/admin/images/icons/page_white_csharp.png differ diff --git a/admin/images/icons/page_white_cup.png b/admin/images/icons/page_white_cup.png new file mode 100644 index 0000000..0a7d6f4 Binary files /dev/null and b/admin/images/icons/page_white_cup.png differ diff --git a/admin/images/icons/page_white_database.png b/admin/images/icons/page_white_database.png new file mode 100644 index 0000000..bddba1f Binary files /dev/null and b/admin/images/icons/page_white_database.png differ diff --git a/admin/images/icons/page_white_delete.png b/admin/images/icons/page_white_delete.png new file mode 100644 index 0000000..af1ecaf Binary files /dev/null and b/admin/images/icons/page_white_delete.png differ diff --git a/admin/images/icons/page_white_dvd.png b/admin/images/icons/page_white_dvd.png new file mode 100644 index 0000000..4cc537a Binary files /dev/null and b/admin/images/icons/page_white_dvd.png differ diff --git a/admin/images/icons/page_white_edit.png b/admin/images/icons/page_white_edit.png new file mode 100644 index 0000000..b93e776 Binary files /dev/null and b/admin/images/icons/page_white_edit.png differ diff --git a/admin/images/icons/page_white_error.png b/admin/images/icons/page_white_error.png new file mode 100644 index 0000000..9fc5a0a Binary files /dev/null and b/admin/images/icons/page_white_error.png differ diff --git a/admin/images/icons/page_white_excel.png b/admin/images/icons/page_white_excel.png new file mode 100644 index 0000000..b977d7e Binary files /dev/null and b/admin/images/icons/page_white_excel.png differ diff --git a/admin/images/icons/page_white_find.png b/admin/images/icons/page_white_find.png new file mode 100644 index 0000000..5818436 Binary files /dev/null and b/admin/images/icons/page_white_find.png differ diff --git a/admin/images/icons/page_white_flash.png b/admin/images/icons/page_white_flash.png new file mode 100644 index 0000000..5769120 Binary files /dev/null and b/admin/images/icons/page_white_flash.png differ diff --git a/admin/images/icons/page_white_freehand.png b/admin/images/icons/page_white_freehand.png new file mode 100644 index 0000000..8d719df Binary files /dev/null and b/admin/images/icons/page_white_freehand.png differ diff --git a/admin/images/icons/page_white_gear.png b/admin/images/icons/page_white_gear.png new file mode 100644 index 0000000..106f5aa Binary files /dev/null and b/admin/images/icons/page_white_gear.png differ diff --git a/admin/images/icons/page_white_get.png b/admin/images/icons/page_white_get.png new file mode 100644 index 0000000..e4a1ecb Binary files /dev/null and b/admin/images/icons/page_white_get.png differ diff --git a/admin/images/icons/page_white_go.png b/admin/images/icons/page_white_go.png new file mode 100644 index 0000000..7e62a92 Binary files /dev/null and b/admin/images/icons/page_white_go.png differ diff --git a/admin/images/icons/page_white_h.png b/admin/images/icons/page_white_h.png new file mode 100644 index 0000000..e902abb Binary files /dev/null and b/admin/images/icons/page_white_h.png differ diff --git a/admin/images/icons/page_white_horizontal.png b/admin/images/icons/page_white_horizontal.png new file mode 100644 index 0000000..1d2d0a4 Binary files /dev/null and b/admin/images/icons/page_white_horizontal.png differ diff --git a/admin/images/icons/page_white_key.png b/admin/images/icons/page_white_key.png new file mode 100644 index 0000000..d616484 Binary files /dev/null and b/admin/images/icons/page_white_key.png differ diff --git a/admin/images/icons/page_white_lightning.png b/admin/images/icons/page_white_lightning.png new file mode 100644 index 0000000..7215d1e Binary files /dev/null and b/admin/images/icons/page_white_lightning.png differ diff --git a/admin/images/icons/page_white_link.png b/admin/images/icons/page_white_link.png new file mode 100644 index 0000000..bf7bd1c Binary files /dev/null and b/admin/images/icons/page_white_link.png differ diff --git a/admin/images/icons/page_white_magnify.png b/admin/images/icons/page_white_magnify.png new file mode 100644 index 0000000..f6b74cc Binary files /dev/null and b/admin/images/icons/page_white_magnify.png differ diff --git a/admin/images/icons/page_white_medal.png b/admin/images/icons/page_white_medal.png new file mode 100644 index 0000000..d3fffb6 Binary files /dev/null and b/admin/images/icons/page_white_medal.png differ diff --git a/admin/images/icons/page_white_office.png b/admin/images/icons/page_white_office.png new file mode 100644 index 0000000..a65bcb3 Binary files /dev/null and b/admin/images/icons/page_white_office.png differ diff --git a/admin/images/icons/page_white_paint.png b/admin/images/icons/page_white_paint.png new file mode 100644 index 0000000..23a37b8 Binary files /dev/null and b/admin/images/icons/page_white_paint.png differ diff --git a/admin/images/icons/page_white_paintbrush.png b/admin/images/icons/page_white_paintbrush.png new file mode 100644 index 0000000..f907e44 Binary files /dev/null and b/admin/images/icons/page_white_paintbrush.png differ diff --git a/admin/images/icons/page_white_paste.png b/admin/images/icons/page_white_paste.png new file mode 100644 index 0000000..5b2cbb3 Binary files /dev/null and b/admin/images/icons/page_white_paste.png differ diff --git a/admin/images/icons/page_white_php.png b/admin/images/icons/page_white_php.png new file mode 100644 index 0000000..7868a25 Binary files /dev/null and b/admin/images/icons/page_white_php.png differ diff --git a/admin/images/icons/page_white_picture.png b/admin/images/icons/page_white_picture.png new file mode 100644 index 0000000..134b669 Binary files /dev/null and b/admin/images/icons/page_white_picture.png differ diff --git a/admin/images/icons/page_white_powerpoint.png b/admin/images/icons/page_white_powerpoint.png new file mode 100644 index 0000000..c4eff03 Binary files /dev/null and b/admin/images/icons/page_white_powerpoint.png differ diff --git a/admin/images/icons/page_white_put.png b/admin/images/icons/page_white_put.png new file mode 100644 index 0000000..884ffd6 Binary files /dev/null and b/admin/images/icons/page_white_put.png differ diff --git a/admin/images/icons/page_white_ruby.png b/admin/images/icons/page_white_ruby.png new file mode 100644 index 0000000..f59b7c4 Binary files /dev/null and b/admin/images/icons/page_white_ruby.png differ diff --git a/admin/images/icons/page_white_stack.png b/admin/images/icons/page_white_stack.png new file mode 100644 index 0000000..44084ad Binary files /dev/null and b/admin/images/icons/page_white_stack.png differ diff --git a/admin/images/icons/page_white_star.png b/admin/images/icons/page_white_star.png new file mode 100644 index 0000000..3a1441c Binary files /dev/null and b/admin/images/icons/page_white_star.png differ diff --git a/admin/images/icons/page_white_swoosh.png b/admin/images/icons/page_white_swoosh.png new file mode 100644 index 0000000..e770829 Binary files /dev/null and b/admin/images/icons/page_white_swoosh.png differ diff --git a/admin/images/icons/page_white_text.png b/admin/images/icons/page_white_text.png new file mode 100644 index 0000000..813f712 Binary files /dev/null and b/admin/images/icons/page_white_text.png differ diff --git a/admin/images/icons/page_white_text_width.png b/admin/images/icons/page_white_text_width.png new file mode 100644 index 0000000..d9cf132 Binary files /dev/null and b/admin/images/icons/page_white_text_width.png differ diff --git a/admin/images/icons/page_white_tux.png b/admin/images/icons/page_white_tux.png new file mode 100644 index 0000000..52699bf Binary files /dev/null and b/admin/images/icons/page_white_tux.png differ diff --git a/admin/images/icons/page_white_vector.png b/admin/images/icons/page_white_vector.png new file mode 100644 index 0000000..4a05955 Binary files /dev/null and b/admin/images/icons/page_white_vector.png differ diff --git a/admin/images/icons/page_white_visualstudio.png b/admin/images/icons/page_white_visualstudio.png new file mode 100644 index 0000000..a0a433d Binary files /dev/null and b/admin/images/icons/page_white_visualstudio.png differ diff --git a/admin/images/icons/page_white_width.png b/admin/images/icons/page_white_width.png new file mode 100644 index 0000000..1eb8809 Binary files /dev/null and b/admin/images/icons/page_white_width.png differ diff --git a/admin/images/icons/page_white_word.png b/admin/images/icons/page_white_word.png new file mode 100644 index 0000000..ae8ecbf Binary files /dev/null and b/admin/images/icons/page_white_word.png differ diff --git a/admin/images/icons/page_white_world.png b/admin/images/icons/page_white_world.png new file mode 100644 index 0000000..6ed2490 Binary files /dev/null and b/admin/images/icons/page_white_world.png differ diff --git a/admin/images/icons/page_white_wrench.png b/admin/images/icons/page_white_wrench.png new file mode 100644 index 0000000..fecadd0 Binary files /dev/null and b/admin/images/icons/page_white_wrench.png differ diff --git a/admin/images/icons/page_white_zip.png b/admin/images/icons/page_white_zip.png new file mode 100644 index 0000000..fd4bbcc Binary files /dev/null and b/admin/images/icons/page_white_zip.png differ diff --git a/admin/images/icons/page_word.png b/admin/images/icons/page_word.png new file mode 100644 index 0000000..834cdfa Binary files /dev/null and b/admin/images/icons/page_word.png differ diff --git a/admin/images/icons/page_world.png b/admin/images/icons/page_world.png new file mode 100644 index 0000000..b8895dd Binary files /dev/null and b/admin/images/icons/page_world.png differ diff --git a/admin/images/icons/paintbrush.png b/admin/images/icons/paintbrush.png new file mode 100644 index 0000000..a3ecf87 Binary files /dev/null and b/admin/images/icons/paintbrush.png differ diff --git a/admin/images/icons/paintcan.png b/admin/images/icons/paintcan.png new file mode 100644 index 0000000..f82a886 Binary files /dev/null and b/admin/images/icons/paintcan.png differ diff --git a/admin/images/icons/palette.png b/admin/images/icons/palette.png new file mode 100644 index 0000000..73c5b3f Binary files /dev/null and b/admin/images/icons/palette.png differ diff --git a/admin/images/icons/paste_plain.png b/admin/images/icons/paste_plain.png new file mode 100644 index 0000000..c0490eb Binary files /dev/null and b/admin/images/icons/paste_plain.png differ diff --git a/admin/images/icons/paste_word.png b/admin/images/icons/paste_word.png new file mode 100644 index 0000000..f6b87f8 Binary files /dev/null and b/admin/images/icons/paste_word.png differ diff --git a/admin/images/icons/pencil.png b/admin/images/icons/pencil.png new file mode 100644 index 0000000..0bfecd5 Binary files /dev/null and b/admin/images/icons/pencil.png differ diff --git a/admin/images/icons/pencil_add.png b/admin/images/icons/pencil_add.png new file mode 100644 index 0000000..902bbe6 Binary files /dev/null and b/admin/images/icons/pencil_add.png differ diff --git a/admin/images/icons/pencil_delete.png b/admin/images/icons/pencil_delete.png new file mode 100644 index 0000000..d8944e6 Binary files /dev/null and b/admin/images/icons/pencil_delete.png differ diff --git a/admin/images/icons/pencil_go.png b/admin/images/icons/pencil_go.png new file mode 100644 index 0000000..937bded Binary files /dev/null and b/admin/images/icons/pencil_go.png differ diff --git a/admin/images/icons/phone.png b/admin/images/icons/phone.png new file mode 100644 index 0000000..c39f162 Binary files /dev/null and b/admin/images/icons/phone.png differ diff --git a/admin/images/icons/phone_add.png b/admin/images/icons/phone_add.png new file mode 100644 index 0000000..d3555e0 Binary files /dev/null and b/admin/images/icons/phone_add.png differ diff --git a/admin/images/icons/phone_delete.png b/admin/images/icons/phone_delete.png new file mode 100644 index 0000000..bbe4f8a Binary files /dev/null and b/admin/images/icons/phone_delete.png differ diff --git a/admin/images/icons/phone_sound.png b/admin/images/icons/phone_sound.png new file mode 100644 index 0000000..7fdf1c5 Binary files /dev/null and b/admin/images/icons/phone_sound.png differ diff --git a/admin/images/icons/photo.png b/admin/images/icons/photo.png new file mode 100644 index 0000000..6c2aaaa Binary files /dev/null and b/admin/images/icons/photo.png differ diff --git a/admin/images/icons/photo_add.png b/admin/images/icons/photo_add.png new file mode 100644 index 0000000..63cc355 Binary files /dev/null and b/admin/images/icons/photo_add.png differ diff --git a/admin/images/icons/photo_delete.png b/admin/images/icons/photo_delete.png new file mode 100644 index 0000000..18b67df Binary files /dev/null and b/admin/images/icons/photo_delete.png differ diff --git a/admin/images/icons/photo_link.png b/admin/images/icons/photo_link.png new file mode 100644 index 0000000..e6bb35f Binary files /dev/null and b/admin/images/icons/photo_link.png differ diff --git a/admin/images/icons/photos.png b/admin/images/icons/photos.png new file mode 100644 index 0000000..8836fe6 Binary files /dev/null and b/admin/images/icons/photos.png differ diff --git a/admin/images/icons/picture.png b/admin/images/icons/picture.png new file mode 100644 index 0000000..4a158fe Binary files /dev/null and b/admin/images/icons/picture.png differ diff --git a/admin/images/icons/picture_add.png b/admin/images/icons/picture_add.png new file mode 100644 index 0000000..d6d3f85 Binary files /dev/null and b/admin/images/icons/picture_add.png differ diff --git a/admin/images/icons/picture_delete.png b/admin/images/icons/picture_delete.png new file mode 100644 index 0000000..cca9f53 Binary files /dev/null and b/admin/images/icons/picture_delete.png differ diff --git a/admin/images/icons/picture_edit.png b/admin/images/icons/picture_edit.png new file mode 100644 index 0000000..9a70c34 Binary files /dev/null and b/admin/images/icons/picture_edit.png differ diff --git a/admin/images/icons/picture_empty.png b/admin/images/icons/picture_empty.png new file mode 100644 index 0000000..abd2b9b Binary files /dev/null and b/admin/images/icons/picture_empty.png differ diff --git a/admin/images/icons/picture_error.png b/admin/images/icons/picture_error.png new file mode 100644 index 0000000..d41d90d Binary files /dev/null and b/admin/images/icons/picture_error.png differ diff --git a/admin/images/icons/picture_go.png b/admin/images/icons/picture_go.png new file mode 100644 index 0000000..27c63c5 Binary files /dev/null and b/admin/images/icons/picture_go.png differ diff --git a/admin/images/icons/picture_key.png b/admin/images/icons/picture_key.png new file mode 100644 index 0000000..667086c Binary files /dev/null and b/admin/images/icons/picture_key.png differ diff --git a/admin/images/icons/picture_link.png b/admin/images/icons/picture_link.png new file mode 100644 index 0000000..42dca74 Binary files /dev/null and b/admin/images/icons/picture_link.png differ diff --git a/admin/images/icons/picture_save.png b/admin/images/icons/picture_save.png new file mode 100644 index 0000000..777fb5d Binary files /dev/null and b/admin/images/icons/picture_save.png differ diff --git a/admin/images/icons/pictures.png b/admin/images/icons/pictures.png new file mode 100644 index 0000000..d9591c1 Binary files /dev/null and b/admin/images/icons/pictures.png differ diff --git a/admin/images/icons/pilcrow.png b/admin/images/icons/pilcrow.png new file mode 100644 index 0000000..95704fb Binary files /dev/null and b/admin/images/icons/pilcrow.png differ diff --git a/admin/images/icons/pill.png b/admin/images/icons/pill.png new file mode 100644 index 0000000..f2bdef6 Binary files /dev/null and b/admin/images/icons/pill.png differ diff --git a/admin/images/icons/pill_add.png b/admin/images/icons/pill_add.png new file mode 100644 index 0000000..ac9c2df Binary files /dev/null and b/admin/images/icons/pill_add.png differ diff --git a/admin/images/icons/pill_delete.png b/admin/images/icons/pill_delete.png new file mode 100644 index 0000000..c61592e Binary files /dev/null and b/admin/images/icons/pill_delete.png differ diff --git a/admin/images/icons/pill_go.png b/admin/images/icons/pill_go.png new file mode 100644 index 0000000..e5c07d4 Binary files /dev/null and b/admin/images/icons/pill_go.png differ diff --git a/admin/images/icons/plugin.png b/admin/images/icons/plugin.png new file mode 100644 index 0000000..6187b15 Binary files /dev/null and b/admin/images/icons/plugin.png differ diff --git a/admin/images/icons/plugin_add.png b/admin/images/icons/plugin_add.png new file mode 100644 index 0000000..ae43690 Binary files /dev/null and b/admin/images/icons/plugin_add.png differ diff --git a/admin/images/icons/plugin_delete.png b/admin/images/icons/plugin_delete.png new file mode 100644 index 0000000..d9c3376 Binary files /dev/null and b/admin/images/icons/plugin_delete.png differ diff --git a/admin/images/icons/plugin_disabled.png b/admin/images/icons/plugin_disabled.png new file mode 100644 index 0000000..f4f6be5 Binary files /dev/null and b/admin/images/icons/plugin_disabled.png differ diff --git a/admin/images/icons/plugin_edit.png b/admin/images/icons/plugin_edit.png new file mode 100644 index 0000000..b6cb0ec Binary files /dev/null and b/admin/images/icons/plugin_edit.png differ diff --git a/admin/images/icons/plugin_error.png b/admin/images/icons/plugin_error.png new file mode 100644 index 0000000..cff65d7 Binary files /dev/null and b/admin/images/icons/plugin_error.png differ diff --git a/admin/images/icons/plugin_go.png b/admin/images/icons/plugin_go.png new file mode 100644 index 0000000..41da991 Binary files /dev/null and b/admin/images/icons/plugin_go.png differ diff --git a/admin/images/icons/plugin_link.png b/admin/images/icons/plugin_link.png new file mode 100644 index 0000000..445c188 Binary files /dev/null and b/admin/images/icons/plugin_link.png differ diff --git a/admin/images/icons/printer.png b/admin/images/icons/printer.png new file mode 100644 index 0000000..a350d18 Binary files /dev/null and b/admin/images/icons/printer.png differ diff --git a/admin/images/icons/printer_add.png b/admin/images/icons/printer_add.png new file mode 100644 index 0000000..d228d05 Binary files /dev/null and b/admin/images/icons/printer_add.png differ diff --git a/admin/images/icons/printer_delete.png b/admin/images/icons/printer_delete.png new file mode 100644 index 0000000..1d8605f Binary files /dev/null and b/admin/images/icons/printer_delete.png differ diff --git a/admin/images/icons/printer_empty.png b/admin/images/icons/printer_empty.png new file mode 100644 index 0000000..94e8c16 Binary files /dev/null and b/admin/images/icons/printer_empty.png differ diff --git a/admin/images/icons/printer_error.png b/admin/images/icons/printer_error.png new file mode 100644 index 0000000..279ebb0 Binary files /dev/null and b/admin/images/icons/printer_error.png differ diff --git a/admin/images/icons/rainbow.png b/admin/images/icons/rainbow.png new file mode 100644 index 0000000..5ede989 Binary files /dev/null and b/admin/images/icons/rainbow.png differ diff --git a/admin/images/icons/report.png b/admin/images/icons/report.png new file mode 100644 index 0000000..779ad58 Binary files /dev/null and b/admin/images/icons/report.png differ diff --git a/admin/images/icons/report_add.png b/admin/images/icons/report_add.png new file mode 100644 index 0000000..d5eac9b Binary files /dev/null and b/admin/images/icons/report_add.png differ diff --git a/admin/images/icons/report_delete.png b/admin/images/icons/report_delete.png new file mode 100644 index 0000000..dcce0b6 Binary files /dev/null and b/admin/images/icons/report_delete.png differ diff --git a/admin/images/icons/report_disk.png b/admin/images/icons/report_disk.png new file mode 100644 index 0000000..1c856cd Binary files /dev/null and b/admin/images/icons/report_disk.png differ diff --git a/admin/images/icons/report_edit.png b/admin/images/icons/report_edit.png new file mode 100644 index 0000000..c61a6d8 Binary files /dev/null and b/admin/images/icons/report_edit.png differ diff --git a/admin/images/icons/report_go.png b/admin/images/icons/report_go.png new file mode 100644 index 0000000..f35a979 Binary files /dev/null and b/admin/images/icons/report_go.png differ diff --git a/admin/images/icons/report_key.png b/admin/images/icons/report_key.png new file mode 100644 index 0000000..90b758e Binary files /dev/null and b/admin/images/icons/report_key.png differ diff --git a/admin/images/icons/report_link.png b/admin/images/icons/report_link.png new file mode 100644 index 0000000..23f2611 Binary files /dev/null and b/admin/images/icons/report_link.png differ diff --git a/admin/images/icons/report_magnify.png b/admin/images/icons/report_magnify.png new file mode 100644 index 0000000..aeaa889 Binary files /dev/null and b/admin/images/icons/report_magnify.png differ diff --git a/admin/images/icons/report_picture.png b/admin/images/icons/report_picture.png new file mode 100644 index 0000000..3a9a7e5 Binary files /dev/null and b/admin/images/icons/report_picture.png differ diff --git a/admin/images/icons/report_user.png b/admin/images/icons/report_user.png new file mode 100644 index 0000000..7766edd Binary files /dev/null and b/admin/images/icons/report_user.png differ diff --git a/admin/images/icons/report_word.png b/admin/images/icons/report_word.png new file mode 100644 index 0000000..9951342 Binary files /dev/null and b/admin/images/icons/report_word.png differ diff --git a/admin/images/icons/resultset_first.png b/admin/images/icons/resultset_first.png new file mode 100644 index 0000000..b03eaf8 Binary files /dev/null and b/admin/images/icons/resultset_first.png differ diff --git a/admin/images/icons/resultset_last.png b/admin/images/icons/resultset_last.png new file mode 100644 index 0000000..8ec8947 Binary files /dev/null and b/admin/images/icons/resultset_last.png differ diff --git a/admin/images/icons/resultset_next.png b/admin/images/icons/resultset_next.png new file mode 100644 index 0000000..e252606 Binary files /dev/null and b/admin/images/icons/resultset_next.png differ diff --git a/admin/images/icons/resultset_previous.png b/admin/images/icons/resultset_previous.png new file mode 100644 index 0000000..18f9cc1 Binary files /dev/null and b/admin/images/icons/resultset_previous.png differ diff --git a/admin/images/icons/rosette.png b/admin/images/icons/rosette.png new file mode 100644 index 0000000..f233bc7 Binary files /dev/null and b/admin/images/icons/rosette.png differ diff --git a/admin/images/icons/rss.png b/admin/images/icons/rss.png new file mode 100644 index 0000000..1dc6ff3 Binary files /dev/null and b/admin/images/icons/rss.png differ diff --git a/admin/images/icons/rss_add.png b/admin/images/icons/rss_add.png new file mode 100644 index 0000000..b590beb Binary files /dev/null and b/admin/images/icons/rss_add.png differ diff --git a/admin/images/icons/rss_delete.png b/admin/images/icons/rss_delete.png new file mode 100644 index 0000000..9deb738 Binary files /dev/null and b/admin/images/icons/rss_delete.png differ diff --git a/admin/images/icons/rss_go.png b/admin/images/icons/rss_go.png new file mode 100644 index 0000000..43a86bf Binary files /dev/null and b/admin/images/icons/rss_go.png differ diff --git a/admin/images/icons/rss_valid.png b/admin/images/icons/rss_valid.png new file mode 100644 index 0000000..a6d0b0e Binary files /dev/null and b/admin/images/icons/rss_valid.png differ diff --git a/admin/images/icons/ruby.png b/admin/images/icons/ruby.png new file mode 100644 index 0000000..f763a16 Binary files /dev/null and b/admin/images/icons/ruby.png differ diff --git a/admin/images/icons/ruby_add.png b/admin/images/icons/ruby_add.png new file mode 100644 index 0000000..a2cd648 Binary files /dev/null and b/admin/images/icons/ruby_add.png differ diff --git a/admin/images/icons/ruby_delete.png b/admin/images/icons/ruby_delete.png new file mode 100644 index 0000000..3002263 Binary files /dev/null and b/admin/images/icons/ruby_delete.png differ diff --git a/admin/images/icons/ruby_gear.png b/admin/images/icons/ruby_gear.png new file mode 100644 index 0000000..4a10590 Binary files /dev/null and b/admin/images/icons/ruby_gear.png differ diff --git a/admin/images/icons/ruby_get.png b/admin/images/icons/ruby_get.png new file mode 100644 index 0000000..f5203c7 Binary files /dev/null and b/admin/images/icons/ruby_get.png differ diff --git a/admin/images/icons/ruby_go.png b/admin/images/icons/ruby_go.png new file mode 100644 index 0000000..d8d276e Binary files /dev/null and b/admin/images/icons/ruby_go.png differ diff --git a/admin/images/icons/ruby_key.png b/admin/images/icons/ruby_key.png new file mode 100644 index 0000000..451cfeb Binary files /dev/null and b/admin/images/icons/ruby_key.png differ diff --git a/admin/images/icons/ruby_link.png b/admin/images/icons/ruby_link.png new file mode 100644 index 0000000..bf4be52 Binary files /dev/null and b/admin/images/icons/ruby_link.png differ diff --git a/admin/images/icons/ruby_put.png b/admin/images/icons/ruby_put.png new file mode 100644 index 0000000..e026323 Binary files /dev/null and b/admin/images/icons/ruby_put.png differ diff --git a/admin/images/icons/script.png b/admin/images/icons/script.png new file mode 100644 index 0000000..0f9ed4d Binary files /dev/null and b/admin/images/icons/script.png differ diff --git a/admin/images/icons/script_add.png b/admin/images/icons/script_add.png new file mode 100644 index 0000000..d650552 Binary files /dev/null and b/admin/images/icons/script_add.png differ diff --git a/admin/images/icons/script_code.png b/admin/images/icons/script_code.png new file mode 100644 index 0000000..63fe6ce Binary files /dev/null and b/admin/images/icons/script_code.png differ diff --git a/admin/images/icons/script_code_red.png b/admin/images/icons/script_code_red.png new file mode 100644 index 0000000..8fcf0f0 Binary files /dev/null and b/admin/images/icons/script_code_red.png differ diff --git a/admin/images/icons/script_delete.png b/admin/images/icons/script_delete.png new file mode 100644 index 0000000..e6500ce Binary files /dev/null and b/admin/images/icons/script_delete.png differ diff --git a/admin/images/icons/script_edit.png b/admin/images/icons/script_edit.png new file mode 100644 index 0000000..b4d31ce Binary files /dev/null and b/admin/images/icons/script_edit.png differ diff --git a/admin/images/icons/script_error.png b/admin/images/icons/script_error.png new file mode 100644 index 0000000..0491954 Binary files /dev/null and b/admin/images/icons/script_error.png differ diff --git a/admin/images/icons/script_gear.png b/admin/images/icons/script_gear.png new file mode 100644 index 0000000..56fcf84 Binary files /dev/null and b/admin/images/icons/script_gear.png differ diff --git a/admin/images/icons/script_go.png b/admin/images/icons/script_go.png new file mode 100644 index 0000000..8e154e2 Binary files /dev/null and b/admin/images/icons/script_go.png differ diff --git a/admin/images/icons/script_key.png b/admin/images/icons/script_key.png new file mode 100644 index 0000000..49bb24d Binary files /dev/null and b/admin/images/icons/script_key.png differ diff --git a/admin/images/icons/script_lightning.png b/admin/images/icons/script_lightning.png new file mode 100644 index 0000000..b3fa18c Binary files /dev/null and b/admin/images/icons/script_lightning.png differ diff --git a/admin/images/icons/script_link.png b/admin/images/icons/script_link.png new file mode 100644 index 0000000..bdeb985 Binary files /dev/null and b/admin/images/icons/script_link.png differ diff --git a/admin/images/icons/script_palette.png b/admin/images/icons/script_palette.png new file mode 100644 index 0000000..6d46962 Binary files /dev/null and b/admin/images/icons/script_palette.png differ diff --git a/admin/images/icons/script_save.png b/admin/images/icons/script_save.png new file mode 100644 index 0000000..36216d8 Binary files /dev/null and b/admin/images/icons/script_save.png differ diff --git a/admin/images/icons/server.png b/admin/images/icons/server.png new file mode 100644 index 0000000..720a237 Binary files /dev/null and b/admin/images/icons/server.png differ diff --git a/admin/images/icons/server_add.png b/admin/images/icons/server_add.png new file mode 100644 index 0000000..3f10a3a Binary files /dev/null and b/admin/images/icons/server_add.png differ diff --git a/admin/images/icons/server_chart.png b/admin/images/icons/server_chart.png new file mode 100644 index 0000000..1128d3f Binary files /dev/null and b/admin/images/icons/server_chart.png differ diff --git a/admin/images/icons/server_compressed.png b/admin/images/icons/server_compressed.png new file mode 100644 index 0000000..bf49fad Binary files /dev/null and b/admin/images/icons/server_compressed.png differ diff --git a/admin/images/icons/server_connect.png b/admin/images/icons/server_connect.png new file mode 100644 index 0000000..49b2691 Binary files /dev/null and b/admin/images/icons/server_connect.png differ diff --git a/admin/images/icons/server_database.png b/admin/images/icons/server_database.png new file mode 100644 index 0000000..b24e826 Binary files /dev/null and b/admin/images/icons/server_database.png differ diff --git a/admin/images/icons/server_delete.png b/admin/images/icons/server_delete.png new file mode 100644 index 0000000..61e740f Binary files /dev/null and b/admin/images/icons/server_delete.png differ diff --git a/admin/images/icons/server_edit.png b/admin/images/icons/server_edit.png new file mode 100644 index 0000000..dc76253 Binary files /dev/null and b/admin/images/icons/server_edit.png differ diff --git a/admin/images/icons/server_error.png b/admin/images/icons/server_error.png new file mode 100644 index 0000000..f640256 Binary files /dev/null and b/admin/images/icons/server_error.png differ diff --git a/admin/images/icons/server_go.png b/admin/images/icons/server_go.png new file mode 100644 index 0000000..540c8e2 Binary files /dev/null and b/admin/images/icons/server_go.png differ diff --git a/admin/images/icons/server_key.png b/admin/images/icons/server_key.png new file mode 100644 index 0000000..ecd5174 Binary files /dev/null and b/admin/images/icons/server_key.png differ diff --git a/admin/images/icons/server_lightning.png b/admin/images/icons/server_lightning.png new file mode 100644 index 0000000..b0f4e46 Binary files /dev/null and b/admin/images/icons/server_lightning.png differ diff --git a/admin/images/icons/server_link.png b/admin/images/icons/server_link.png new file mode 100644 index 0000000..e8821df Binary files /dev/null and b/admin/images/icons/server_link.png differ diff --git a/admin/images/icons/server_uncompressed.png b/admin/images/icons/server_uncompressed.png new file mode 100644 index 0000000..86e8325 Binary files /dev/null and b/admin/images/icons/server_uncompressed.png differ diff --git a/admin/images/icons/shading.png b/admin/images/icons/shading.png new file mode 100644 index 0000000..09275f9 Binary files /dev/null and b/admin/images/icons/shading.png differ diff --git a/admin/images/icons/shape_align_bottom.png b/admin/images/icons/shape_align_bottom.png new file mode 100644 index 0000000..55d2694 Binary files /dev/null and b/admin/images/icons/shape_align_bottom.png differ diff --git a/admin/images/icons/shape_align_center.png b/admin/images/icons/shape_align_center.png new file mode 100644 index 0000000..efe9a98 Binary files /dev/null and b/admin/images/icons/shape_align_center.png differ diff --git a/admin/images/icons/shape_align_left.png b/admin/images/icons/shape_align_left.png new file mode 100644 index 0000000..aaedc41 Binary files /dev/null and b/admin/images/icons/shape_align_left.png differ diff --git a/admin/images/icons/shape_align_middle.png b/admin/images/icons/shape_align_middle.png new file mode 100644 index 0000000..d350dd8 Binary files /dev/null and b/admin/images/icons/shape_align_middle.png differ diff --git a/admin/images/icons/shape_align_right.png b/admin/images/icons/shape_align_right.png new file mode 100644 index 0000000..ff556b6 Binary files /dev/null and b/admin/images/icons/shape_align_right.png differ diff --git a/admin/images/icons/shape_align_top.png b/admin/images/icons/shape_align_top.png new file mode 100644 index 0000000..1181b43 Binary files /dev/null and b/admin/images/icons/shape_align_top.png differ diff --git a/admin/images/icons/shape_flip_horizontal.png b/admin/images/icons/shape_flip_horizontal.png new file mode 100644 index 0000000..8667c81 Binary files /dev/null and b/admin/images/icons/shape_flip_horizontal.png differ diff --git a/admin/images/icons/shape_flip_vertical.png b/admin/images/icons/shape_flip_vertical.png new file mode 100644 index 0000000..0bd66d1 Binary files /dev/null and b/admin/images/icons/shape_flip_vertical.png differ diff --git a/admin/images/icons/shape_group.png b/admin/images/icons/shape_group.png new file mode 100644 index 0000000..bb2ff51 Binary files /dev/null and b/admin/images/icons/shape_group.png differ diff --git a/admin/images/icons/shape_handles.png b/admin/images/icons/shape_handles.png new file mode 100644 index 0000000..ce27fe3 Binary files /dev/null and b/admin/images/icons/shape_handles.png differ diff --git a/admin/images/icons/shape_move_back.png b/admin/images/icons/shape_move_back.png new file mode 100644 index 0000000..a216ffd Binary files /dev/null and b/admin/images/icons/shape_move_back.png differ diff --git a/admin/images/icons/shape_move_backwards.png b/admin/images/icons/shape_move_backwards.png new file mode 100644 index 0000000..ee3f9b2 Binary files /dev/null and b/admin/images/icons/shape_move_backwards.png differ diff --git a/admin/images/icons/shape_move_forwards.png b/admin/images/icons/shape_move_forwards.png new file mode 100644 index 0000000..cfe4493 Binary files /dev/null and b/admin/images/icons/shape_move_forwards.png differ diff --git a/admin/images/icons/shape_move_front.png b/admin/images/icons/shape_move_front.png new file mode 100644 index 0000000..b4a4e3b Binary files /dev/null and b/admin/images/icons/shape_move_front.png differ diff --git a/admin/images/icons/shape_rotate_anticlockwise.png b/admin/images/icons/shape_rotate_anticlockwise.png new file mode 100644 index 0000000..07a3020 Binary files /dev/null and b/admin/images/icons/shape_rotate_anticlockwise.png differ diff --git a/admin/images/icons/shape_rotate_clockwise.png b/admin/images/icons/shape_rotate_clockwise.png new file mode 100644 index 0000000..b99db7d Binary files /dev/null and b/admin/images/icons/shape_rotate_clockwise.png differ diff --git a/admin/images/icons/shape_square.png b/admin/images/icons/shape_square.png new file mode 100644 index 0000000..33af046 Binary files /dev/null and b/admin/images/icons/shape_square.png differ diff --git a/admin/images/icons/shape_square_add.png b/admin/images/icons/shape_square_add.png new file mode 100644 index 0000000..31edfce Binary files /dev/null and b/admin/images/icons/shape_square_add.png differ diff --git a/admin/images/icons/shape_square_delete.png b/admin/images/icons/shape_square_delete.png new file mode 100644 index 0000000..ede912d Binary files /dev/null and b/admin/images/icons/shape_square_delete.png differ diff --git a/admin/images/icons/shape_square_edit.png b/admin/images/icons/shape_square_edit.png new file mode 100644 index 0000000..d28dc6b Binary files /dev/null and b/admin/images/icons/shape_square_edit.png differ diff --git a/admin/images/icons/shape_square_error.png b/admin/images/icons/shape_square_error.png new file mode 100644 index 0000000..0d0dcfa Binary files /dev/null and b/admin/images/icons/shape_square_error.png differ diff --git a/admin/images/icons/shape_square_go.png b/admin/images/icons/shape_square_go.png new file mode 100644 index 0000000..5a2ad90 Binary files /dev/null and b/admin/images/icons/shape_square_go.png differ diff --git a/admin/images/icons/shape_square_key.png b/admin/images/icons/shape_square_key.png new file mode 100644 index 0000000..c34b982 Binary files /dev/null and b/admin/images/icons/shape_square_key.png differ diff --git a/admin/images/icons/shape_square_link.png b/admin/images/icons/shape_square_link.png new file mode 100644 index 0000000..b885fcc Binary files /dev/null and b/admin/images/icons/shape_square_link.png differ diff --git a/admin/images/icons/shape_ungroup.png b/admin/images/icons/shape_ungroup.png new file mode 100644 index 0000000..3a6f369 Binary files /dev/null and b/admin/images/icons/shape_ungroup.png differ diff --git a/admin/images/icons/shield.png b/admin/images/icons/shield.png new file mode 100644 index 0000000..3cb4e25 Binary files /dev/null and b/admin/images/icons/shield.png differ diff --git a/admin/images/icons/shield_add.png b/admin/images/icons/shield_add.png new file mode 100644 index 0000000..e20a1b4 Binary files /dev/null and b/admin/images/icons/shield_add.png differ diff --git a/admin/images/icons/shield_delete.png b/admin/images/icons/shield_delete.png new file mode 100644 index 0000000..22823a7 Binary files /dev/null and b/admin/images/icons/shield_delete.png differ diff --git a/admin/images/icons/shield_go.png b/admin/images/icons/shield_go.png new file mode 100644 index 0000000..e9bd852 Binary files /dev/null and b/admin/images/icons/shield_go.png differ diff --git a/admin/images/icons/sitemap.png b/admin/images/icons/sitemap.png new file mode 100644 index 0000000..ca779f3 Binary files /dev/null and b/admin/images/icons/sitemap.png differ diff --git a/admin/images/icons/sitemap_color.png b/admin/images/icons/sitemap_color.png new file mode 100644 index 0000000..c64582b Binary files /dev/null and b/admin/images/icons/sitemap_color.png differ diff --git a/admin/images/icons/sound.png b/admin/images/icons/sound.png new file mode 100644 index 0000000..6056d23 Binary files /dev/null and b/admin/images/icons/sound.png differ diff --git a/admin/images/icons/sound_add.png b/admin/images/icons/sound_add.png new file mode 100644 index 0000000..965c503 Binary files /dev/null and b/admin/images/icons/sound_add.png differ diff --git a/admin/images/icons/sound_delete.png b/admin/images/icons/sound_delete.png new file mode 100644 index 0000000..ab9577a Binary files /dev/null and b/admin/images/icons/sound_delete.png differ diff --git a/admin/images/icons/sound_low.png b/admin/images/icons/sound_low.png new file mode 100644 index 0000000..4d91863 Binary files /dev/null and b/admin/images/icons/sound_low.png differ diff --git a/admin/images/icons/sound_mute.png b/admin/images/icons/sound_mute.png new file mode 100644 index 0000000..b652d2a Binary files /dev/null and b/admin/images/icons/sound_mute.png differ diff --git a/admin/images/icons/sound_none.png b/admin/images/icons/sound_none.png new file mode 100644 index 0000000..b497ebd Binary files /dev/null and b/admin/images/icons/sound_none.png differ diff --git a/admin/images/icons/spellcheck.png b/admin/images/icons/spellcheck.png new file mode 100644 index 0000000..ebc632d Binary files /dev/null and b/admin/images/icons/spellcheck.png differ diff --git a/admin/images/icons/sport_8ball.png b/admin/images/icons/sport_8ball.png new file mode 100644 index 0000000..4f627b7 Binary files /dev/null and b/admin/images/icons/sport_8ball.png differ diff --git a/admin/images/icons/sport_basketball.png b/admin/images/icons/sport_basketball.png new file mode 100644 index 0000000..f7a000b Binary files /dev/null and b/admin/images/icons/sport_basketball.png differ diff --git a/admin/images/icons/sport_football.png b/admin/images/icons/sport_football.png new file mode 100644 index 0000000..199f0f7 Binary files /dev/null and b/admin/images/icons/sport_football.png differ diff --git a/admin/images/icons/sport_golf.png b/admin/images/icons/sport_golf.png new file mode 100644 index 0000000..e21fa44 Binary files /dev/null and b/admin/images/icons/sport_golf.png differ diff --git a/admin/images/icons/sport_raquet.png b/admin/images/icons/sport_raquet.png new file mode 100644 index 0000000..f5e0f0c Binary files /dev/null and b/admin/images/icons/sport_raquet.png differ diff --git a/admin/images/icons/sport_shuttlecock.png b/admin/images/icons/sport_shuttlecock.png new file mode 100644 index 0000000..917287f Binary files /dev/null and b/admin/images/icons/sport_shuttlecock.png differ diff --git a/admin/images/icons/sport_soccer.png b/admin/images/icons/sport_soccer.png new file mode 100644 index 0000000..3eb1828 Binary files /dev/null and b/admin/images/icons/sport_soccer.png differ diff --git a/admin/images/icons/sport_tennis.png b/admin/images/icons/sport_tennis.png new file mode 100644 index 0000000..e88a6ef Binary files /dev/null and b/admin/images/icons/sport_tennis.png differ diff --git a/admin/images/icons/star.png b/admin/images/icons/star.png new file mode 100644 index 0000000..b88c857 Binary files /dev/null and b/admin/images/icons/star.png differ diff --git a/admin/images/icons/status_away.png b/admin/images/icons/status_away.png new file mode 100644 index 0000000..70bcbcc Binary files /dev/null and b/admin/images/icons/status_away.png differ diff --git a/admin/images/icons/status_busy.png b/admin/images/icons/status_busy.png new file mode 100644 index 0000000..987c806 Binary files /dev/null and b/admin/images/icons/status_busy.png differ diff --git a/admin/images/icons/status_offline.png b/admin/images/icons/status_offline.png new file mode 100644 index 0000000..a88261a Binary files /dev/null and b/admin/images/icons/status_offline.png differ diff --git a/admin/images/icons/status_online.png b/admin/images/icons/status_online.png new file mode 100644 index 0000000..947bd4b Binary files /dev/null and b/admin/images/icons/status_online.png differ diff --git a/admin/images/icons/stop.png b/admin/images/icons/stop.png new file mode 100644 index 0000000..0cfd585 Binary files /dev/null and b/admin/images/icons/stop.png differ diff --git a/admin/images/icons/style.png b/admin/images/icons/style.png new file mode 100644 index 0000000..81e41de Binary files /dev/null and b/admin/images/icons/style.png differ diff --git a/admin/images/icons/style_add.png b/admin/images/icons/style_add.png new file mode 100644 index 0000000..e0369c6 Binary files /dev/null and b/admin/images/icons/style_add.png differ diff --git a/admin/images/icons/style_delete.png b/admin/images/icons/style_delete.png new file mode 100644 index 0000000..640f187 Binary files /dev/null and b/admin/images/icons/style_delete.png differ diff --git a/admin/images/icons/style_edit.png b/admin/images/icons/style_edit.png new file mode 100644 index 0000000..25bb5b6 Binary files /dev/null and b/admin/images/icons/style_edit.png differ diff --git a/admin/images/icons/style_go.png b/admin/images/icons/style_go.png new file mode 100644 index 0000000..25d6181 Binary files /dev/null and b/admin/images/icons/style_go.png differ diff --git a/admin/images/icons/sum.png b/admin/images/icons/sum.png new file mode 100644 index 0000000..fd7b32e Binary files /dev/null and b/admin/images/icons/sum.png differ diff --git a/admin/images/icons/tab.png b/admin/images/icons/tab.png new file mode 100644 index 0000000..3d8207f Binary files /dev/null and b/admin/images/icons/tab.png differ diff --git a/admin/images/icons/tab_add.png b/admin/images/icons/tab_add.png new file mode 100644 index 0000000..d3b9936 Binary files /dev/null and b/admin/images/icons/tab_add.png differ diff --git a/admin/images/icons/tab_delete.png b/admin/images/icons/tab_delete.png new file mode 100644 index 0000000..100da2f Binary files /dev/null and b/admin/images/icons/tab_delete.png differ diff --git a/admin/images/icons/tab_edit.png b/admin/images/icons/tab_edit.png new file mode 100644 index 0000000..4c09c0f Binary files /dev/null and b/admin/images/icons/tab_edit.png differ diff --git a/admin/images/icons/tab_go.png b/admin/images/icons/tab_go.png new file mode 100644 index 0000000..844ce04 Binary files /dev/null and b/admin/images/icons/tab_go.png differ diff --git a/admin/images/icons/table.png b/admin/images/icons/table.png new file mode 100644 index 0000000..abcd936 Binary files /dev/null and b/admin/images/icons/table.png differ diff --git a/admin/images/icons/table_add.png b/admin/images/icons/table_add.png new file mode 100644 index 0000000..2a3e5c4 Binary files /dev/null and b/admin/images/icons/table_add.png differ diff --git a/admin/images/icons/table_delete.png b/admin/images/icons/table_delete.png new file mode 100644 index 0000000..b85916d Binary files /dev/null and b/admin/images/icons/table_delete.png differ diff --git a/admin/images/icons/table_edit.png b/admin/images/icons/table_edit.png new file mode 100644 index 0000000..bfcb024 Binary files /dev/null and b/admin/images/icons/table_edit.png differ diff --git a/admin/images/icons/table_error.png b/admin/images/icons/table_error.png new file mode 100644 index 0000000..589e92b Binary files /dev/null and b/admin/images/icons/table_error.png differ diff --git a/admin/images/icons/table_gear.png b/admin/images/icons/table_gear.png new file mode 100644 index 0000000..cfc2702 Binary files /dev/null and b/admin/images/icons/table_gear.png differ diff --git a/admin/images/icons/table_go.png b/admin/images/icons/table_go.png new file mode 100644 index 0000000..0528dfa Binary files /dev/null and b/admin/images/icons/table_go.png differ diff --git a/admin/images/icons/table_key.png b/admin/images/icons/table_key.png new file mode 100644 index 0000000..34e23e2 Binary files /dev/null and b/admin/images/icons/table_key.png differ diff --git a/admin/images/icons/table_lightning.png b/admin/images/icons/table_lightning.png new file mode 100644 index 0000000..612612b Binary files /dev/null and b/admin/images/icons/table_lightning.png differ diff --git a/admin/images/icons/table_link.png b/admin/images/icons/table_link.png new file mode 100644 index 0000000..decac8a Binary files /dev/null and b/admin/images/icons/table_link.png differ diff --git a/admin/images/icons/table_multiple.png b/admin/images/icons/table_multiple.png new file mode 100644 index 0000000..d76448e Binary files /dev/null and b/admin/images/icons/table_multiple.png differ diff --git a/admin/images/icons/table_refresh.png b/admin/images/icons/table_refresh.png new file mode 100644 index 0000000..ab92010 Binary files /dev/null and b/admin/images/icons/table_refresh.png differ diff --git a/admin/images/icons/table_relationship.png b/admin/images/icons/table_relationship.png new file mode 100644 index 0000000..28b8505 Binary files /dev/null and b/admin/images/icons/table_relationship.png differ diff --git a/admin/images/icons/table_row_delete.png b/admin/images/icons/table_row_delete.png new file mode 100644 index 0000000..54c6969 Binary files /dev/null and b/admin/images/icons/table_row_delete.png differ diff --git a/admin/images/icons/table_row_insert.png b/admin/images/icons/table_row_insert.png new file mode 100644 index 0000000..ff5925e Binary files /dev/null and b/admin/images/icons/table_row_insert.png differ diff --git a/admin/images/icons/table_save.png b/admin/images/icons/table_save.png new file mode 100644 index 0000000..25b74d1 Binary files /dev/null and b/admin/images/icons/table_save.png differ diff --git a/admin/images/icons/table_sort.png b/admin/images/icons/table_sort.png new file mode 100644 index 0000000..ed6785a Binary files /dev/null and b/admin/images/icons/table_sort.png differ diff --git a/admin/images/icons/tag.png b/admin/images/icons/tag.png new file mode 100644 index 0000000..e093032 Binary files /dev/null and b/admin/images/icons/tag.png differ diff --git a/admin/images/icons/tag_blue.png b/admin/images/icons/tag_blue.png new file mode 100644 index 0000000..9757fc6 Binary files /dev/null and b/admin/images/icons/tag_blue.png differ diff --git a/admin/images/icons/tag_blue_add.png b/admin/images/icons/tag_blue_add.png new file mode 100644 index 0000000..f135248 Binary files /dev/null and b/admin/images/icons/tag_blue_add.png differ diff --git a/admin/images/icons/tag_blue_delete.png b/admin/images/icons/tag_blue_delete.png new file mode 100644 index 0000000..9fbae67 Binary files /dev/null and b/admin/images/icons/tag_blue_delete.png differ diff --git a/admin/images/icons/tag_blue_edit.png b/admin/images/icons/tag_blue_edit.png new file mode 100644 index 0000000..2a9f626 Binary files /dev/null and b/admin/images/icons/tag_blue_edit.png differ diff --git a/admin/images/icons/tag_green.png b/admin/images/icons/tag_green.png new file mode 100644 index 0000000..83ec984 Binary files /dev/null and b/admin/images/icons/tag_green.png differ diff --git a/admin/images/icons/tag_orange.png b/admin/images/icons/tag_orange.png new file mode 100644 index 0000000..454a59f Binary files /dev/null and b/admin/images/icons/tag_orange.png differ diff --git a/admin/images/icons/tag_pink.png b/admin/images/icons/tag_pink.png new file mode 100644 index 0000000..76e2296 Binary files /dev/null and b/admin/images/icons/tag_pink.png differ diff --git a/admin/images/icons/tag_purple.png b/admin/images/icons/tag_purple.png new file mode 100644 index 0000000..ebaf0e8 Binary files /dev/null and b/admin/images/icons/tag_purple.png differ diff --git a/admin/images/icons/tag_red.png b/admin/images/icons/tag_red.png new file mode 100644 index 0000000..6ebb37d Binary files /dev/null and b/admin/images/icons/tag_red.png differ diff --git a/admin/images/icons/tag_yellow.png b/admin/images/icons/tag_yellow.png new file mode 100644 index 0000000..83d1292 Binary files /dev/null and b/admin/images/icons/tag_yellow.png differ diff --git a/admin/images/icons/telephone.png b/admin/images/icons/telephone.png new file mode 100644 index 0000000..cecc436 Binary files /dev/null and b/admin/images/icons/telephone.png differ diff --git a/admin/images/icons/telephone_add.png b/admin/images/icons/telephone_add.png new file mode 100644 index 0000000..5591cfc Binary files /dev/null and b/admin/images/icons/telephone_add.png differ diff --git a/admin/images/icons/telephone_delete.png b/admin/images/icons/telephone_delete.png new file mode 100644 index 0000000..0013268 Binary files /dev/null and b/admin/images/icons/telephone_delete.png differ diff --git a/admin/images/icons/telephone_edit.png b/admin/images/icons/telephone_edit.png new file mode 100644 index 0000000..bcf6d7e Binary files /dev/null and b/admin/images/icons/telephone_edit.png differ diff --git a/admin/images/icons/telephone_error.png b/admin/images/icons/telephone_error.png new file mode 100644 index 0000000..d3ec3a1 Binary files /dev/null and b/admin/images/icons/telephone_error.png differ diff --git a/admin/images/icons/telephone_go.png b/admin/images/icons/telephone_go.png new file mode 100644 index 0000000..395c8fb Binary files /dev/null and b/admin/images/icons/telephone_go.png differ diff --git a/admin/images/icons/telephone_key.png b/admin/images/icons/telephone_key.png new file mode 100644 index 0000000..cef5dec Binary files /dev/null and b/admin/images/icons/telephone_key.png differ diff --git a/admin/images/icons/telephone_link.png b/admin/images/icons/telephone_link.png new file mode 100644 index 0000000..ef1ee5d Binary files /dev/null and b/admin/images/icons/telephone_link.png differ diff --git a/admin/images/icons/television.png b/admin/images/icons/television.png new file mode 100644 index 0000000..1738a4f Binary files /dev/null and b/admin/images/icons/television.png differ diff --git a/admin/images/icons/television_add.png b/admin/images/icons/television_add.png new file mode 100644 index 0000000..2baaad9 Binary files /dev/null and b/admin/images/icons/television_add.png differ diff --git a/admin/images/icons/television_delete.png b/admin/images/icons/television_delete.png new file mode 100644 index 0000000..b9a5860 Binary files /dev/null and b/admin/images/icons/television_delete.png differ diff --git a/admin/images/icons/text_align_center.png b/admin/images/icons/text_align_center.png new file mode 100644 index 0000000..57beb38 Binary files /dev/null and b/admin/images/icons/text_align_center.png differ diff --git a/admin/images/icons/text_align_justify.png b/admin/images/icons/text_align_justify.png new file mode 100644 index 0000000..2fbdd69 Binary files /dev/null and b/admin/images/icons/text_align_justify.png differ diff --git a/admin/images/icons/text_align_left.png b/admin/images/icons/text_align_left.png new file mode 100644 index 0000000..6c8fcc1 Binary files /dev/null and b/admin/images/icons/text_align_left.png differ diff --git a/admin/images/icons/text_align_right.png b/admin/images/icons/text_align_right.png new file mode 100644 index 0000000..a150257 Binary files /dev/null and b/admin/images/icons/text_align_right.png differ diff --git a/admin/images/icons/text_allcaps.png b/admin/images/icons/text_allcaps.png new file mode 100644 index 0000000..280fd44 Binary files /dev/null and b/admin/images/icons/text_allcaps.png differ diff --git a/admin/images/icons/text_bold.png b/admin/images/icons/text_bold.png new file mode 100644 index 0000000..889ae80 Binary files /dev/null and b/admin/images/icons/text_bold.png differ diff --git a/admin/images/icons/text_columns.png b/admin/images/icons/text_columns.png new file mode 100644 index 0000000..97b2e03 Binary files /dev/null and b/admin/images/icons/text_columns.png differ diff --git a/admin/images/icons/text_dropcaps.png b/admin/images/icons/text_dropcaps.png new file mode 100644 index 0000000..dd65786 Binary files /dev/null and b/admin/images/icons/text_dropcaps.png differ diff --git a/admin/images/icons/text_heading_1.png b/admin/images/icons/text_heading_1.png new file mode 100644 index 0000000..9c122e9 Binary files /dev/null and b/admin/images/icons/text_heading_1.png differ diff --git a/admin/images/icons/text_heading_2.png b/admin/images/icons/text_heading_2.png new file mode 100644 index 0000000..fbd8765 Binary files /dev/null and b/admin/images/icons/text_heading_2.png differ diff --git a/admin/images/icons/text_heading_3.png b/admin/images/icons/text_heading_3.png new file mode 100644 index 0000000..c7836cf Binary files /dev/null and b/admin/images/icons/text_heading_3.png differ diff --git a/admin/images/icons/text_heading_4.png b/admin/images/icons/text_heading_4.png new file mode 100644 index 0000000..4e929ea Binary files /dev/null and b/admin/images/icons/text_heading_4.png differ diff --git a/admin/images/icons/text_heading_5.png b/admin/images/icons/text_heading_5.png new file mode 100644 index 0000000..30cabeb Binary files /dev/null and b/admin/images/icons/text_heading_5.png differ diff --git a/admin/images/icons/text_heading_6.png b/admin/images/icons/text_heading_6.png new file mode 100644 index 0000000..058170a Binary files /dev/null and b/admin/images/icons/text_heading_6.png differ diff --git a/admin/images/icons/text_horizontalrule.png b/admin/images/icons/text_horizontalrule.png new file mode 100644 index 0000000..8dd1da1 Binary files /dev/null and b/admin/images/icons/text_horizontalrule.png differ diff --git a/admin/images/icons/text_indent.png b/admin/images/icons/text_indent.png new file mode 100644 index 0000000..9364532 Binary files /dev/null and b/admin/images/icons/text_indent.png differ diff --git a/admin/images/icons/text_indent_remove.png b/admin/images/icons/text_indent_remove.png new file mode 100644 index 0000000..1651b07 Binary files /dev/null and b/admin/images/icons/text_indent_remove.png differ diff --git a/admin/images/icons/text_italic.png b/admin/images/icons/text_italic.png new file mode 100644 index 0000000..8482ac8 Binary files /dev/null and b/admin/images/icons/text_italic.png differ diff --git a/admin/images/icons/text_kerning.png b/admin/images/icons/text_kerning.png new file mode 100644 index 0000000..377def6 Binary files /dev/null and b/admin/images/icons/text_kerning.png differ diff --git a/admin/images/icons/text_letter_omega.png b/admin/images/icons/text_letter_omega.png new file mode 100644 index 0000000..5075ec6 Binary files /dev/null and b/admin/images/icons/text_letter_omega.png differ diff --git a/admin/images/icons/text_letterspacing.png b/admin/images/icons/text_letterspacing.png new file mode 100644 index 0000000..41390f5 Binary files /dev/null and b/admin/images/icons/text_letterspacing.png differ diff --git a/admin/images/icons/text_linespacing.png b/admin/images/icons/text_linespacing.png new file mode 100644 index 0000000..1a91cbd Binary files /dev/null and b/admin/images/icons/text_linespacing.png differ diff --git a/admin/images/icons/text_list_bullets.png b/admin/images/icons/text_list_bullets.png new file mode 100644 index 0000000..4a8672b Binary files /dev/null and b/admin/images/icons/text_list_bullets.png differ diff --git a/admin/images/icons/text_list_numbers.png b/admin/images/icons/text_list_numbers.png new file mode 100644 index 0000000..33b0b8d Binary files /dev/null and b/admin/images/icons/text_list_numbers.png differ diff --git a/admin/images/icons/text_lowercase.png b/admin/images/icons/text_lowercase.png new file mode 100644 index 0000000..382a102 Binary files /dev/null and b/admin/images/icons/text_lowercase.png differ diff --git a/admin/images/icons/text_padding_bottom.png b/admin/images/icons/text_padding_bottom.png new file mode 100644 index 0000000..4880c43 Binary files /dev/null and b/admin/images/icons/text_padding_bottom.png differ diff --git a/admin/images/icons/text_padding_left.png b/admin/images/icons/text_padding_left.png new file mode 100644 index 0000000..b55482e Binary files /dev/null and b/admin/images/icons/text_padding_left.png differ diff --git a/admin/images/icons/text_padding_right.png b/admin/images/icons/text_padding_right.png new file mode 100644 index 0000000..106edae Binary files /dev/null and b/admin/images/icons/text_padding_right.png differ diff --git a/admin/images/icons/text_padding_top.png b/admin/images/icons/text_padding_top.png new file mode 100644 index 0000000..c5c45b2 Binary files /dev/null and b/admin/images/icons/text_padding_top.png differ diff --git a/admin/images/icons/text_replace.png b/admin/images/icons/text_replace.png new file mode 100644 index 0000000..877f82f Binary files /dev/null and b/admin/images/icons/text_replace.png differ diff --git a/admin/images/icons/text_signature.png b/admin/images/icons/text_signature.png new file mode 100644 index 0000000..c72fd80 Binary files /dev/null and b/admin/images/icons/text_signature.png differ diff --git a/admin/images/icons/text_smallcaps.png b/admin/images/icons/text_smallcaps.png new file mode 100644 index 0000000..5b98a6e Binary files /dev/null and b/admin/images/icons/text_smallcaps.png differ diff --git a/admin/images/icons/text_strikethrough.png b/admin/images/icons/text_strikethrough.png new file mode 100644 index 0000000..612058a Binary files /dev/null and b/admin/images/icons/text_strikethrough.png differ diff --git a/admin/images/icons/text_subscript.png b/admin/images/icons/text_subscript.png new file mode 100644 index 0000000..1a2b010 Binary files /dev/null and b/admin/images/icons/text_subscript.png differ diff --git a/admin/images/icons/text_superscript.png b/admin/images/icons/text_superscript.png new file mode 100644 index 0000000..2fb2a7c Binary files /dev/null and b/admin/images/icons/text_superscript.png differ diff --git a/admin/images/icons/text_underline.png b/admin/images/icons/text_underline.png new file mode 100644 index 0000000..90d0df2 Binary files /dev/null and b/admin/images/icons/text_underline.png differ diff --git a/admin/images/icons/text_uppercase.png b/admin/images/icons/text_uppercase.png new file mode 100644 index 0000000..8dcc2db Binary files /dev/null and b/admin/images/icons/text_uppercase.png differ diff --git a/admin/images/icons/textfield.png b/admin/images/icons/textfield.png new file mode 100644 index 0000000..d37e730 Binary files /dev/null and b/admin/images/icons/textfield.png differ diff --git a/admin/images/icons/textfield_add.png b/admin/images/icons/textfield_add.png new file mode 100644 index 0000000..204de72 Binary files /dev/null and b/admin/images/icons/textfield_add.png differ diff --git a/admin/images/icons/textfield_delete.png b/admin/images/icons/textfield_delete.png new file mode 100644 index 0000000..c7bd58b Binary files /dev/null and b/admin/images/icons/textfield_delete.png differ diff --git a/admin/images/icons/textfield_key.png b/admin/images/icons/textfield_key.png new file mode 100644 index 0000000..a9d5e4f Binary files /dev/null and b/admin/images/icons/textfield_key.png differ diff --git a/admin/images/icons/textfield_rename.png b/admin/images/icons/textfield_rename.png new file mode 100644 index 0000000..4e3688e Binary files /dev/null and b/admin/images/icons/textfield_rename.png differ diff --git a/admin/images/icons/thumb_down.png b/admin/images/icons/thumb_down.png new file mode 100644 index 0000000..3c832d4 Binary files /dev/null and b/admin/images/icons/thumb_down.png differ diff --git a/admin/images/icons/thumb_up.png b/admin/images/icons/thumb_up.png new file mode 100644 index 0000000..2bd16cc Binary files /dev/null and b/admin/images/icons/thumb_up.png differ diff --git a/admin/images/icons/tick.png b/admin/images/icons/tick.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/admin/images/icons/tick.png differ diff --git a/admin/images/icons/time.png b/admin/images/icons/time.png new file mode 100644 index 0000000..911da3f Binary files /dev/null and b/admin/images/icons/time.png differ diff --git a/admin/images/icons/time_add.png b/admin/images/icons/time_add.png new file mode 100644 index 0000000..dcc45cb Binary files /dev/null and b/admin/images/icons/time_add.png differ diff --git a/admin/images/icons/time_delete.png b/admin/images/icons/time_delete.png new file mode 100644 index 0000000..5bf8313 Binary files /dev/null and b/admin/images/icons/time_delete.png differ diff --git a/admin/images/icons/time_go.png b/admin/images/icons/time_go.png new file mode 100644 index 0000000..d451ee0 Binary files /dev/null and b/admin/images/icons/time_go.png differ diff --git a/admin/images/icons/timeline_marker.png b/admin/images/icons/timeline_marker.png new file mode 100644 index 0000000..a3fbddf Binary files /dev/null and b/admin/images/icons/timeline_marker.png differ diff --git a/admin/images/icons/transmit.png b/admin/images/icons/transmit.png new file mode 100644 index 0000000..f54bf73 Binary files /dev/null and b/admin/images/icons/transmit.png differ diff --git a/admin/images/icons/transmit_add.png b/admin/images/icons/transmit_add.png new file mode 100644 index 0000000..b7fd4e6 Binary files /dev/null and b/admin/images/icons/transmit_add.png differ diff --git a/admin/images/icons/transmit_blue.png b/admin/images/icons/transmit_blue.png new file mode 100644 index 0000000..7b1142f Binary files /dev/null and b/admin/images/icons/transmit_blue.png differ diff --git a/admin/images/icons/transmit_delete.png b/admin/images/icons/transmit_delete.png new file mode 100644 index 0000000..3d72be2 Binary files /dev/null and b/admin/images/icons/transmit_delete.png differ diff --git a/admin/images/icons/transmit_edit.png b/admin/images/icons/transmit_edit.png new file mode 100644 index 0000000..eb9a3dd Binary files /dev/null and b/admin/images/icons/transmit_edit.png differ diff --git a/admin/images/icons/transmit_error.png b/admin/images/icons/transmit_error.png new file mode 100644 index 0000000..fd1d449 Binary files /dev/null and b/admin/images/icons/transmit_error.png differ diff --git a/admin/images/icons/transmit_go.png b/admin/images/icons/transmit_go.png new file mode 100644 index 0000000..10137e5 Binary files /dev/null and b/admin/images/icons/transmit_go.png differ diff --git a/admin/images/icons/tux.png b/admin/images/icons/tux.png new file mode 100644 index 0000000..bbefe2e Binary files /dev/null and b/admin/images/icons/tux.png differ diff --git a/admin/images/icons/user.png b/admin/images/icons/user.png new file mode 100644 index 0000000..79f35cc Binary files /dev/null and b/admin/images/icons/user.png differ diff --git a/admin/images/icons/user_add.png b/admin/images/icons/user_add.png new file mode 100644 index 0000000..deae99b Binary files /dev/null and b/admin/images/icons/user_add.png differ diff --git a/admin/images/icons/user_comment.png b/admin/images/icons/user_comment.png new file mode 100644 index 0000000..e54ebeb Binary files /dev/null and b/admin/images/icons/user_comment.png differ diff --git a/admin/images/icons/user_delete.png b/admin/images/icons/user_delete.png new file mode 100644 index 0000000..acbb563 Binary files /dev/null and b/admin/images/icons/user_delete.png differ diff --git a/admin/images/icons/user_edit.png b/admin/images/icons/user_edit.png new file mode 100644 index 0000000..c1974cd Binary files /dev/null and b/admin/images/icons/user_edit.png differ diff --git a/admin/images/icons/user_female.png b/admin/images/icons/user_female.png new file mode 100644 index 0000000..7c71de0 Binary files /dev/null and b/admin/images/icons/user_female.png differ diff --git a/admin/images/icons/user_go.png b/admin/images/icons/user_go.png new file mode 100644 index 0000000..0468cf0 Binary files /dev/null and b/admin/images/icons/user_go.png differ diff --git a/admin/images/icons/user_gray.png b/admin/images/icons/user_gray.png new file mode 100644 index 0000000..8fd539e Binary files /dev/null and b/admin/images/icons/user_gray.png differ diff --git a/admin/images/icons/user_green.png b/admin/images/icons/user_green.png new file mode 100644 index 0000000..30383c2 Binary files /dev/null and b/admin/images/icons/user_green.png differ diff --git a/admin/images/icons/user_orange.png b/admin/images/icons/user_orange.png new file mode 100644 index 0000000..b818127 Binary files /dev/null and b/admin/images/icons/user_orange.png differ diff --git a/admin/images/icons/user_red.png b/admin/images/icons/user_red.png new file mode 100644 index 0000000..c6f66e8 Binary files /dev/null and b/admin/images/icons/user_red.png differ diff --git a/admin/images/icons/user_suit.png b/admin/images/icons/user_suit.png new file mode 100644 index 0000000..b3454e1 Binary files /dev/null and b/admin/images/icons/user_suit.png differ diff --git a/admin/images/icons/vcard.png b/admin/images/icons/vcard.png new file mode 100644 index 0000000..c02f315 Binary files /dev/null and b/admin/images/icons/vcard.png differ diff --git a/admin/images/icons/vcard_add.png b/admin/images/icons/vcard_add.png new file mode 100644 index 0000000..2a68453 Binary files /dev/null and b/admin/images/icons/vcard_add.png differ diff --git a/admin/images/icons/vcard_delete.png b/admin/images/icons/vcard_delete.png new file mode 100644 index 0000000..b194b97 Binary files /dev/null and b/admin/images/icons/vcard_delete.png differ diff --git a/admin/images/icons/vcard_edit.png b/admin/images/icons/vcard_edit.png new file mode 100644 index 0000000..ab0f6e7 Binary files /dev/null and b/admin/images/icons/vcard_edit.png differ diff --git a/admin/images/icons/vector.png b/admin/images/icons/vector.png new file mode 100644 index 0000000..a1291c2 Binary files /dev/null and b/admin/images/icons/vector.png differ diff --git a/admin/images/icons/vector_add.png b/admin/images/icons/vector_add.png new file mode 100644 index 0000000..988770f Binary files /dev/null and b/admin/images/icons/vector_add.png differ diff --git a/admin/images/icons/vector_delete.png b/admin/images/icons/vector_delete.png new file mode 100644 index 0000000..ca139e0 Binary files /dev/null and b/admin/images/icons/vector_delete.png differ diff --git a/admin/images/icons/wand.png b/admin/images/icons/wand.png new file mode 100644 index 0000000..44ccbf8 Binary files /dev/null and b/admin/images/icons/wand.png differ diff --git a/admin/images/icons/weather_clouds.png b/admin/images/icons/weather_clouds.png new file mode 100644 index 0000000..3f73eaa Binary files /dev/null and b/admin/images/icons/weather_clouds.png differ diff --git a/admin/images/icons/weather_cloudy.png b/admin/images/icons/weather_cloudy.png new file mode 100644 index 0000000..5856e1d Binary files /dev/null and b/admin/images/icons/weather_cloudy.png differ diff --git a/admin/images/icons/weather_lightning.png b/admin/images/icons/weather_lightning.png new file mode 100644 index 0000000..1d42b36 Binary files /dev/null and b/admin/images/icons/weather_lightning.png differ diff --git a/admin/images/icons/weather_rain.png b/admin/images/icons/weather_rain.png new file mode 100644 index 0000000..cb3d54d Binary files /dev/null and b/admin/images/icons/weather_rain.png differ diff --git a/admin/images/icons/weather_snow.png b/admin/images/icons/weather_snow.png new file mode 100644 index 0000000..45bbdf1 Binary files /dev/null and b/admin/images/icons/weather_snow.png differ diff --git a/admin/images/icons/weather_sun.png b/admin/images/icons/weather_sun.png new file mode 100644 index 0000000..0156c26 Binary files /dev/null and b/admin/images/icons/weather_sun.png differ diff --git a/admin/images/icons/webcam.png b/admin/images/icons/webcam.png new file mode 100644 index 0000000..af71c30 Binary files /dev/null and b/admin/images/icons/webcam.png differ diff --git a/admin/images/icons/webcam_add.png b/admin/images/icons/webcam_add.png new file mode 100644 index 0000000..f02fcfa Binary files /dev/null and b/admin/images/icons/webcam_add.png differ diff --git a/admin/images/icons/webcam_delete.png b/admin/images/icons/webcam_delete.png new file mode 100644 index 0000000..bd6277f Binary files /dev/null and b/admin/images/icons/webcam_delete.png differ diff --git a/admin/images/icons/webcam_error.png b/admin/images/icons/webcam_error.png new file mode 100644 index 0000000..2faa706 Binary files /dev/null and b/admin/images/icons/webcam_error.png differ diff --git a/admin/images/icons/world.png b/admin/images/icons/world.png new file mode 100644 index 0000000..68f21d3 Binary files /dev/null and b/admin/images/icons/world.png differ diff --git a/admin/images/icons/world_add.png b/admin/images/icons/world_add.png new file mode 100644 index 0000000..6d0d7f7 Binary files /dev/null and b/admin/images/icons/world_add.png differ diff --git a/admin/images/icons/world_delete.png b/admin/images/icons/world_delete.png new file mode 100644 index 0000000..ffcd115 Binary files /dev/null and b/admin/images/icons/world_delete.png differ diff --git a/admin/images/icons/world_edit.png b/admin/images/icons/world_edit.png new file mode 100644 index 0000000..00794d4 Binary files /dev/null and b/admin/images/icons/world_edit.png differ diff --git a/admin/images/icons/world_go.png b/admin/images/icons/world_go.png new file mode 100644 index 0000000..aee9c97 Binary files /dev/null and b/admin/images/icons/world_go.png differ diff --git a/admin/images/icons/world_link.png b/admin/images/icons/world_link.png new file mode 100644 index 0000000..b8edc12 Binary files /dev/null and b/admin/images/icons/world_link.png differ diff --git a/admin/images/icons/wrench.png b/admin/images/icons/wrench.png new file mode 100644 index 0000000..5c8213f Binary files /dev/null and b/admin/images/icons/wrench.png differ diff --git a/admin/images/icons/wrench_orange.png b/admin/images/icons/wrench_orange.png new file mode 100644 index 0000000..565a933 Binary files /dev/null and b/admin/images/icons/wrench_orange.png differ diff --git a/admin/images/icons/xhtml.png b/admin/images/icons/xhtml.png new file mode 100644 index 0000000..da5dbf2 Binary files /dev/null and b/admin/images/icons/xhtml.png differ diff --git a/admin/images/icons/xhtml_add.png b/admin/images/icons/xhtml_add.png new file mode 100644 index 0000000..bbaf784 Binary files /dev/null and b/admin/images/icons/xhtml_add.png differ diff --git a/admin/images/icons/xhtml_delete.png b/admin/images/icons/xhtml_delete.png new file mode 100644 index 0000000..157b520 Binary files /dev/null and b/admin/images/icons/xhtml_delete.png differ diff --git a/admin/images/icons/xhtml_go.png b/admin/images/icons/xhtml_go.png new file mode 100644 index 0000000..43cf814 Binary files /dev/null and b/admin/images/icons/xhtml_go.png differ diff --git a/admin/images/icons/xhtml_valid.png b/admin/images/icons/xhtml_valid.png new file mode 100644 index 0000000..d2e1cfb Binary files /dev/null and b/admin/images/icons/xhtml_valid.png differ diff --git a/admin/images/icons/zoom.png b/admin/images/icons/zoom.png new file mode 100644 index 0000000..908612e Binary files /dev/null and b/admin/images/icons/zoom.png differ diff --git a/admin/images/icons/zoom_in.png b/admin/images/icons/zoom_in.png new file mode 100644 index 0000000..cdf0a52 Binary files /dev/null and b/admin/images/icons/zoom_in.png differ diff --git a/admin/images/icons/zoom_out.png b/admin/images/icons/zoom_out.png new file mode 100644 index 0000000..07bf98a Binary files /dev/null and b/admin/images/icons/zoom_out.png differ diff --git a/admin/images/spinner.gif b/admin/images/spinner.gif new file mode 100644 index 0000000..86dbe65 Binary files /dev/null and b/admin/images/spinner.gif differ diff --git a/admin/images/up.gif b/admin/images/up.gif new file mode 100644 index 0000000..c5ef548 Binary files /dev/null and b/admin/images/up.gif differ diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..a1dc852 --- /dev/null +++ b/admin/index.php @@ -0,0 +1,108 @@ + + * @package BeCast Webengine core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: index.php 100 2010-02-20 14:42:30Z genuineparts $ +*/ +ERROR_REPORTING(E_ALL ^E_NOTICE); +$basepath=""; +$nav_include="../"; +require_once dirname(dirname(__FILE__)).'/core/init_core.inc.php'; +$session->page_begin("Admincenter", True); +define("in_BL_ADMIN",TRUE); + +function size_format($num, $prec = 2) +{ + if ($num >= 1024000){ + return number_format($num / 1048576, $prec) . ' MB'; + }elseif ($num >= 1000){ + return sprintf("%.{$prec}f KB", $num / 1024); + }else{ + return $num . ' bytes'; + } +} + +if(isset($session->userdata['uid']) && $session->userdata['uid']!=0 && ($session->userdata["admin_cp"] && $session->userdata["is_admin"])){ + require_once dirname(dirname(__FILE__)).'/inc/admin.class.php'; + require_once dirname(dirname(__FILE__)).'/inc/panel.class.php'; + $admin=new admin(); + $panel=new panel(); + $panel->menu_item("page_home",$lang->_('BACKTOPAGE'),"house"); + $panel->menu_item("admin_home",$lang->_('ADMININDEX'),"layout"); + $admin->create_admin_nav(); + $panel->menu_item("group_only",$lang->_('NAVIGATION')); + $panel->menu_item("navigation",$lang->_('NAVIGATIONADMIN'),"table_multiple"); + $panel->menu_item("group_only",$lang->_('USERADMIN')); + $panel->menu_item("adduser",$lang->_('ADDUSER'),"user_add"); + $panel->menu_item("editusers",$lang->_('EDITUSER'),"user_edit"); + $panel->menu_item("banips",$lang->_('IPBAN'),"disconnect"); + $panel->menu_item("group_only",$lang->_('GROUPADMIN')); + $panel->menu_item("addgroup",$lang->_('ADDGROUP'),"group_add"); + $panel->menu_item("editgroup",$lang->_('EDITGROUP'),"group_edit"); + $panel->menu_item("group_only",$lang->_('CONFIG')); + $panel->menu_item("config",$lang->_('CONFIG'),"wrench"); + $panel->menu_item("module",$lang->_('MODULES'),"bricks"); + $panel->menu_item("versions",$lang->_('VERSION'),"shield_go"); + if(isset($_GET["panel"])){ + $admin->get_panel($_GET["panel"]); + }else{ + $panel->content=$lang->_('STARTTEXT'); + $panel->title=$lang->_('ADMINMENU'); + $panel->content.=' + + '; + + + $total_rows = 0; + $total_data = 0; + $total_index = 0; + + // Table sizes + $result = $db->query("SHOW TABLE STATUS"); + while ($row = $db->fetch_array($result)) + { + $total_rows += $row['Rows']; + $total_data += $row['Data_length']; + $total_index += $row['Index_length']; + $rows = number_format($row['Rows']); + $data = size_format($row['Data_length']); + $index = size_format($row['Index_length']); + $total = size_format($row['Data_length'] + $row['Index_length']); + $panel->content.=''; + } + + + // Total + $rows = number_format($total_rows); + $data = size_format($total_data); + $index = size_format($total_index); + $total = size_format($total_data + $total_index); + $panel->content.='
'.$lang->_('DATABASE').'
'.$lang->_('TABLE').''.$lang->_('ROWCOUNT').''.$lang->_('INDEXSIZE').''.$lang->_('DATASIZE').''.$lang->_('SUMSIZE').'
'.$row["Name"].''.$rows.''.$index.''.$data.''.$total.'
Gesamt'.$rows.''.$index.''.$data.''.$total.'
'; + $panel->parse_page(); + } + +}else{ + return $error->http_error("404"); +} +?> + diff --git a/admin/module.apnl.php b/admin/module.apnl.php new file mode 100644 index 0000000..95b13b4 --- /dev/null +++ b/admin/module.apnl.php @@ -0,0 +1,307 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: module.apnl.php 64 2009-07-24 22:07:55Z genuineparts $ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} + +/** +* fetch Userdata +* +*/ +$session->page_begin("Module", True); + + +class module_panel extends admin_module{ + + /** + * Main Output of the panel + * + */ + function output(){ + global $module,$config,$db,$panel,$userinfo,$root,$core; + + /** + * If action and module are set either Install or Deinstall the module + * + */ + if((isset($_GET["action"]) && $_GET["action"]!="") && (isset($_GET["module"]) && $_GET["module"]!="")){ + + if($_GET["action"]=="install"){ + $this->install($_GET["module"]); + }elseif($_GET["action"]=="uninstall"){ + $this->uninstall($_GET["module"]); + } + + /** + * Else create the Module-Panel + * + */ + }else{ + + $panel->title="Modulverwaltung"; + $panel->content.="

Installierte Module


+ + + + + + + + "; + if(!empty($core->mod_)){ + foreach($core->mod_ as $mod){ + If($mod["depends"]!=""){ + + $depends=""; + $dependands=unserialize($mod["depends"]); + foreach($dependands as $dep){ + if(!$deps){ + $deps=''.$dep.''; + }else{ + $deps.=', '.$dep.''; + } + } + $depends.='
hängt ab von: '.$deps; + } + $panel->content.=" + + + + + + "; + unset($deps); + unset($depends); + unset($mod); + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
ModulVersionAutorHomepageAktion
".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Deinstallieren
Keine Module verfügbar.

"; + + $panel->content.="

Nicht Installierte Module


"; + $panel->content.=" + + + + + + + "; + + $modules=$this->avaiable_modules(); + if(is_array($modules)){ + foreach($modules as $mod){ + If($mod["depends"]!=""){ + + $depends=""; + $dependands=explode(",",$mod["depends"]); + foreach($dependands as $dep){ + if(!$deps){ + $deps=''.$dep.''; + }else{ + $deps.=', '.$dep.''; + } + } + $depends.='
hängt ab von: '.$deps; + } + $panel->content.=" + + + + + + "; + unset($deps); + unset($depends); + unset($mod); + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
ModulVersionAutorHomepageAktion
".$mod["name"].$depends."".$mod["version"]."".$mod["author"]."".$mod["url"]."Installieren
Keine Module verfügbar.
"; + } + } + + /** + * Lists all installable Modules + * + * @return string|array + */ + function avaiable_modules() { + global $module,$config,$db,$panel,$userinfo,$root,$core; + $install_mods = array(); + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + + if ($dir = @opendir($root."/modules")){ + while ($file = readdir($dir)){ + if (is_dir($root."/modules/".$file) && is_file($root."/modules/".$file."/".$file.".module.php")){ + if (empty($core->mod_[$file])) + { + include_once($root."/modules/".$file."/".$file.".module.php"); + $class="module_".$file; + $imod=new $class(); + $install_mods[$file]=$imod->get_info(); + $install_mods[$file]["file"]=$file; + } + } + } + return $install_mods; + } + } + + /** + * Installs a Module + * + * @param Modul + */ + function install($module) { + global $config,$core,$db,$panel,$userinfo,$root; + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + if(file_exists($root."/modules/".$module."/".$module.".module.php")){ + include_once($root."/modules/".$module."/".$module.".module.php"); + $class="module_".$module; + $install=new $class(); + $info=$install->get_info(); + If($info["depends"]!=""){ + $dependands=explode(",",$info["depends"]); + foreach($dependands as $dep){ + If(empty($core->mod_[$dep])){ + $inst_result="Die Abhängigkeit zu dem Modul ".$dep." ist nicht erfüllt"; + } + } + } + if(!$inst_result){ + $inst_result=$install->install(); + } + + if($inst_result===True){ + if($info["depends"]!=""){ + $dependands=serialize(explode(",",$info["depends"])); + } + $db->query("INSERT INTO `" . $config["prefix"] . "role_values` (`name`,`text`, `type`) VALUES ('".$info['file']."_admin','".$info['name']." - Administration','yesno')"); + $db->query("INSERT INTO `" . $config["prefix"] . "module` (`file`,`name`,`version`,`author`,`depends`, `url`) VALUES ('".$info['file']."','".$info['name']."','".$info['version']."','".$info['author']."','".$dependands."','".$info['url']."')"); + $panel->admin_message("Modul installiert!","Das Modul wurde erfolgreich installiert.",True,"module",3); + }else{ + $install->uninstall(); + $panel->admin_message("Fehler!","Das Modul konnte nicht installiert werden. Der Fehler war: ".$inst_result,True,"module",3); + } + + } + } + + /** + * Uninstalls a Module + * + * @param Modul + */ + function uninstall($module) { + global $config,$db,$panel,$userinfo,$root; + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + if(file_exists($root."/modules/".$module."/".$module.".module.php")){ + include_once($root."/modules/".$module."/".$module.".module.php"); + $class="module_".$module; + $uninstall=new $class(); + $info=$uninstall->get_info(); + $deps=$this->depencys($info["file"]); + if(is_array($deps)){ + $dmod=implode(",",$deps); + $uninst_result='
Die folgenden Module sind von dem Modul '.$info["name"].' abhängig: '.$dmod; + }else{ + $uninst_result=$uninstall->uninstall(); + } + if($uninst_result===True){ + $result=$db->query("SELECT `id` FROM `" . $config["prefix"] . "role_values` WHERE `name`='".$info["file"]."_admin'"); + $id=$db->fetch_array($result); + $db->query("DELETE FROM `" . $config["prefix"] . "roleset` WHERE `role_value_id`='".$id['id']."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "role_values` WHERE `id`='".$id['id']."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "module` WHERE `file`='".$info["file"]."'"); + $panel->admin_message("Modul deinstalliert!","Das Modul wurde erfolgreich deinstalliert.",True,"module",3); + }else{ + $panel->admin_message("Fehler!","Das Modul konnte nicht deinstalliert werden. Der Fehler war: ".$uninst_result,True,"module",5); + } + } + } + + /** + * Gets the dependance of a Module + * + * @param Modul + * @return array|false + */ + function depencys($module) { + global $config,$db,$core, $panel,$userinfo,$root; + $deps=FALSE; + foreach($core->mod_ as $mod){ + $depend=unserialize($mod["depends"]); + if(is_array($depend)){ + if(in_array($module,$depend)){ + $deps[]=$mod['name']; + } + } + } + return $deps; + } + + /** + * Metaheader output + * + */ + function meta() { + global $module,$config,$panel,$userinfo,$root; + $meta=""; + return $meta; + + } + +} +?> diff --git a/admin/navigation.apnl.php b/admin/navigation.apnl.php new file mode 100644 index 0000000..4bd0d2b --- /dev/null +++ b/admin/navigation.apnl.php @@ -0,0 +1,359 @@ + + * @package BeCast WebEngine core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$addnav["right"]=FALSE; +$session->page_begin("Sort", True); + + +class navigation_panel extends admin_module{ + + function output(){ + global $module,$config,$db,$panel,$cache,$log,$plugin,$mainmodule,$asmodule; + if(isset($_POST['left']) && !empty($_POST['left'])){ + $order_array = explode('&', $_POST['left']); + foreach($order_array as $position=>$id) { + $id=str_replace('left[]=','',$id); + if($id=='nugget'){ + $db->query("INSERT INTO `" . $config["prefix"] . "navigation` (name,side,sort) VALUES ('HTML-Block','l','".$position."')"); + }elseif(!intval($id)){ + $db->query("INSERT INTO `" . $config["prefix"] . "navigation` (name,side,sort,file) VALUES ('".$db->escape($id)."','l','".$position."','".$db->escape($id)."')"); + }else{ + $db->query("UPDATE `" . $config["prefix"] . "navigation` set side='l',sort='".$position."' WHERE id='".$id."'"); + } + } + $cache->update_sidebars(); + } + if(isset($_POST['right']) && !empty($_POST['right'])){ + var_dump($_POST); + $order_array = explode('&', $_POST['right']); + foreach($order_array as $position=>$id) { + $id=str_replace('right[]=','',$id); + if($id=='nugget'){ + $db->query("INSERT INTO `" . $config["prefix"] . "navigation` (name,side,sort) VALUES ('HTML-Block','r','".$position."')"); + }elseif(!intval($id)){ + $db->query("INSERT INTO `" . $config["prefix"] . "navigation` (name,side,sort,file) VALUES ('".$db->escape($id)."','r','".$position."','".$db->escape($id)."')"); + }else{ + $db->query("UPDATE `" . $config["prefix"] . "navigation` set side='r',sort='".$position."' WHERE id='".$id."'"); + } + } + $cache->update_sidebars(); + } + if(isset($_POST['main']) && !empty($_POST['main'])){ + $order_array = explode('&', $_POST['main']); + foreach($order_array as $position=>$id) { + $id=str_replace('main[]=','',$id); + if($id=='nugget'){ + $db->query("INSERT INTO `" . $config["prefix"] . "navigation` (name,side,sort) VALUES ('HTML-Block','m','".$position."')"); + }elseif(!intval($id)){ + $db->query("INSERT INTO `" . $config["prefix"] . "navigation` (name,side,sort,file) VALUES ('".$db->escape($id)."','m','".$position."','frontpage_".$db->escape($id)."')"); + }else{ + $db->query("UPDATE `" . $config["prefix"] . "navigation` set side='m',sort='".$position."' WHERE id='".$id."'"); + } + } + $cache->update_sidebars(); + } + if(isset($_POST['delete'])){ + $id=str_replace('id_','',$_POST['delete']); + $db->query("DELETE FROM `" . $config["prefix"] . "navigation` WHERE id='".$id."'"); + $cache->update_sidebars(); + } + if(isset($_GET['editprop']) && $_GET['editprop']!=''){ + if(isset($_POST['send']) && !empty($_POST['name']) && !empty($_POST['id'])){ + $db->query("UPDATE `" . $config["prefix"] . "navigation` set name='".$db->escape($_POST["name"])."',content='".$db->escape(str_replace("&","&",$_POST["content"]))."' WHERE id='".intval($_POST["id"])."'"); + $cache->update_sidebars(); + $panel->admin_message('Daten übernommen!','Die Daten wurden erfolgreich übernommen.',True,'navigation',3); + }else{ + $panel->title='Navigationsverwaltung'; + $panel->form(array('action'=>$config['path'].'/admin/index.php?panel=navigation&editprop='.$_GET['editprop'])); + $result=$db->query('SELECT * FROM `' . $config['prefix'] . 'navigation` WHERE id=\''.intval($_GET['editprop']).'\''); + $data = $db->fetch_array($result); + $panel->content.='

Titel:

'; + $panel->field(array('name'=>'name','typ'=>'text','value'=>$data['name'])); + if($data['file']==''){ + $panel->content.='

Inhalt:

'; + $panel->textarea(array('name'=>'content','value'=>$data['content'],'rows'=>20,'cols'=>60)); + }else{ + $panel->content.='
Dieses Modul wird von einer Navigationsdatei bereitgestellt.'; + } + $panel->content.='
'; + $panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1')); + $panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['editprop'])); + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + } + }elseif(isset($_GET['editmain']) && $_GET['editmain']!=''){ + if(isset($_POST['send']) && !empty($_POST['name']) && !empty($_POST['id'])){ + $db->query("UPDATE `" . $config["prefix"] . "navigation` SET `name`='".$db->escape($_POST["name"])."',`valid`='".$db->escape($_POST["valid"])."',`content`='".$db->escape(str_replace("&","&",$_POST["content"]))."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); + $cache->update_sidebars(); + $panel->admin_message('Daten übernommen!','Die Daten wurden erfolgreich übernommen.',True,'navigation',3); + }else{ + $panel->title='Navigationsverwaltung'; + $panel->form(array('action'=>$config['path'].'/admin/index.php?panel=navigation&editmain='.$_GET['editmain'])); + $result=$db->query('SELECT * FROM `' . $config['prefix'] . 'navigation` WHERE id=\''.intval($_GET['editmain']).'\''); + $data = $db->fetch_array($result); + $panel->content.='

Titel:

'; + $panel->field(array('name'=>'name','typ'=>'text','value'=>$data['name'])); + $panel->content.='

Gütigkeitsbereich:

'; + $panel->select(array('Überall'=>'E','Startseite'=>'F'),$data['valid'],'valid'); + if($data['file']==''){ + $panel->content.='

Inhalt:

'; + $panel->textarea(array('name'=>'content','value'=>$data['content'],'rows'=>20,'cols'=>60)); + }else{ + $panel->content.='
Dieses Modul wird von einer Datei bereitgestellt.'; + } + $panel->content.='
'; + $panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1')); + $panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['editmain'])); + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + } + + }else{ + $left=''; + $right=''; + $main=''; + $asmodule=''; + $mainmodule=''; + $lresult=$db->query("SELECT * FROM `" . $config['prefix'] . "navigation` WHERE side='l' ORDER by sort"); + while ($row = $db->fetch_array($lresult)){ + $left.='
'.$row["name"].'
'; + } + $rresult=$db->query("SELECT * FROM `" . $config['prefix'] . "navigation` WHERE side='r' ORDER by sort"); + while ($row = $db->fetch_array($rresult)){ + $right.='
'.$row["name"].'
'; + } + $mresult=$db->query("SELECT * FROM `" . $config['prefix'] . "navigation` WHERE side='m' ORDER by sort"); + while ($row = $db->fetch_array($mresult)){ + if($row['name']=='maincontent'){ + $main.='
Seitencontent
'; + }else{ + $main.='
'.$row["name"].'
'; + } + } + $av_module=$this->avaiable_modules(); + if(is_array($av_module)){ + foreach($av_module as $module){ + $asmodule.='
'.$module.'
'; + } + } + $plugin->run_hook('navigation_mainmodule',array($mainmodule)); + $plugin->run_hook('navigation_leftmodule',array($left)); + $plugin->run_hook('navigation_rightmodule',array($right)); + $panel->title='Navigationsverwaltung'; + $panel->content='Hier kann man die Sortierung von Modulen verändern oder sie anders auf der Seite anordnen.

+ + +
+
+

Links

+ '.$left.' +
+ +
+

Hauptseite

+ '.$main.' +
+ + +
+
+

Verfügbare Module

+
HTML-Block
+ '.$asmodule.' +
+
+

Verfügbare Hauptseitenmodule

+
HTML-Block
+ '.$mainmodule.' +
+
+ +
+ '; + $panel->foot=''; + + } + } + + function avaiable_modules() { + global $config,$db,$panel,$userinfo,$admin,$root,$firephp; + $install_mods=array(); + $nav=array(); + $result=$db->query("SELECT * FROM `" . $config['prefix'] . "navigation`"); + while ($row = $db->fetch_array($result)){ + if($row['file']!=''){ + $filename='nav_'.$row['file'].'.php'; + $nav[$filename]=TRUE; + } + } + $root = $_SERVER['DOCUMENT_ROOT'] . $config['path']; + if ($dir = @opendir($root.'/nav_modules')){ + while ($file = readdir($dir)){ + if (is_file($root.'/nav_modules/'.$file) && strstr($file, 'nav_') && strstr($file, '.php')){ + if (empty($nav[$file])) + { + $install_mods[] = str_replace('.php', '', $file); + } + } + } + return $install_mods; + } + } + + function meta() { + global $module,$config,$db,$panel,$userinfo,$admin,$root; + $meta=' + + + + + '; + return $meta; + + } + + +} +?> diff --git a/admin/versions.apnl.php b/admin/versions.apnl.php new file mode 100644 index 0000000..7fcb8f1 --- /dev/null +++ b/admin/versions.apnl.php @@ -0,0 +1,494 @@ + + * @package BeFramed core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$addnav["right"]=FALSE; +$session->page_begin("Version", True); + +$subnav_item="Verwaltung » Systemstatus"; + +class versions_panel extends admin_module{ + + function output(){ + global $module,$config,$db,$panel,$admin,$module,$root,$core; + $files=$this->listdir($root.'/modules'); + foreach($files as $file){ + $file_object = array( + 'name' => substr($file,strlen($root.'/modules/')), + 'size' => $this->byteConvert(filesize($file)), + 'time' => date("d.m.Y, H:i:s", filemtime($file))); + $dir_objects[] = $file_object; + } + + $url="http://www.astat.org/versions.php"; + $file = @fopen($url,"r"); + if($file != false){ + $data = @fread($file,"4048"); + $xml=new xml(); + $out = $xml->parse($data, NULL); + $i=0; + $max=count($out["mod"]); + while($i<=$max){ + $versions[$i]["name"]=$out["mod"][$i]; + $versions[$i]["ver"]=$out["ver"][$i]; + $i++; + } + $vers=$core->ver_major.".".$core->ver_minor.".".$core->ver_rev; + $panel->title="Moduleversionen"; + $panel->content.=" + + + + + "; + if($out["relase"]["version"]>$vers){ + $panel->content.=""; + }else{ + + foreach($module as $mod){ + $panel->content.=" + + "; + foreach($versions as $v){ + if($v["name"]==$mod["name"]){ + if($mod["ver"]<$v["ver"]){ + $panel->content.=""; + }elseif($mod["ver"]==$v["ver"]){ + $panel->content.=""; + }else{ + $panel->content.=""; + } + } + } + $panel->content.=""; + + } + foreach($core->mod_ as $mod){ + $panel->content.=" + + "; + foreach($versions as $v){ + if($v["name"]==$mod["name"]){ + if($mod["version"]<$v["ver"]){ + $panel->content.=""; + }elseif($mod["version"]==$v["ver"]){ + $panel->content.=""; + }else{ + $panel->content.=""; + } + } + } + $panel->content.=""; + } + } + $panel->content.="
ModulVersionUpdate
Diese Version ist nicht mehr aktuell.
Besuche die Projektseite für ein Update
".$mod["name"]."".$mod["ver"]."Neue Version verfügbar!AktuellModified file?
".$mod["name"]."".$mod["version"]."Neue Version verfügbar!AktuellModified file?

"; + $panel->parse_page(); + }else{ + $panel->title="Moduleversionen"; + $panel->content.="Die Versionprüfung ist fehlgeschlagen."; + $panel->content.=" + + + + "; + + + foreach($module as $mod){ + $panel->content.=" + + "; + $panel->content.=""; + } + $panel->content.="
ModulVersion
".$mod["name"]."".$mod["ver"]."

"; + $panel->parse_page(); + } + $panel->title="Datei Infos"; + $panel->content.=" + + + + + "; + foreach($dir_objects as $files){ + $panel->content.=" + + + + "; + } + + $panel->content.="
DateiGrößezuletzt Geändert
".$files["name"]."".$files["size"]."".$files["time"]."
"; + } + + function byteConvert( $bytes ) { + + if ($bytes<=0) + return '0 Byte'; + + $convention=1000; //[1000->10^x|1024->2^x] + $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB'); + $e=floor(log($bytes,$convention)); + return round($bytes/pow($convention,$e),2).' '.$s[$e]; + } + + function listdir($start_dir='.') { + + $files = array(); + if (is_dir($start_dir)) { + $fh = opendir($start_dir); + while (($file = readdir($fh)) !== false) { + # loop through the files, skipping . and .., and recursing if necessary + if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue; + $filepath = $start_dir . '/' . $file; + if ( is_dir($filepath) ) + $files = array_merge($files, $this->listdir($filepath)); + else + array_push($files, $filepath); + } + closedir($fh); + } else { + # false if the function was called with an invalid non-directory argument + $files = false; + } + return $files; + } + +} + +class Xml { + + /** + * Xml parser container. + * + * @var resource parser + */ + var $parser; + + /** + * Parse result. + * + * @var array pOut + */ + var $pOut = array(); + + /** + * Contain the overlap tag temporarily . + * + * @var array track + */ + var $track = array(); + + /** + * Current tag level. + * + * @var string tmpLevel + */ + var $tmpLevel = ''; + + /** + * Attribut of current tag. + * + * @var array tmpAttrLevel + */ + var $tmpAttrLevel = array(); + + /** + * Write result. + * + * @var string wOut + */ + var $wOut = ''; + + + + + /** + * parse + * Set the parser Xml and theses options. + * Xml file could be a string, a file, or curl. + * When the source is loaded, we run the parse. + * After, we clean all the memory and variables, + * and return the result in an array. + * + * @access public + * @param src string Source + * @param typeof string Source type : NULL, FILE, CURL. + * @param encoding string Encoding type. + * @return array + */ + function parse ( $src, $typeof = 'FILE', $encoding = 'UTF-8' ) { + + // ini; + // (re)set array; + $this->pOut = array(); + $this->parser = xml_parser_create(); + + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $encoding); + + xml_set_object($this->parser, $this); + xml_set_element_handler($this->parser, 'startHandler', 'endHandler'); + xml_set_character_data_handler($this->parser, 'contentHandler'); + + if(empty($src)) + trigger_error('Source could not be empty.', E_USER_ERROR); + + // format source; + if($typeof == NULL) + $data = $src; + elseif($typeof == 'FILE') { + $fop = fopen($src, 'r'); + $data = null; + while(!feof($fop)) + $data .= fread($fop, 1024); + fclose($fop); + } + elseif($typeof == 'CURL') { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $src); + curl_setopt($curl, CURLOPT_HEADER, 0); + $data = curl_exec($curl); + curl_close($curl); + } + else + return trigger_error('Xml parser need data.', E_USER_ERROR); + + // parse $data; + $parse = xml_parse($this->parser, $data); + if(!$parse) + return trigger_error('XML Error : %s at line %d.', E_USER_ERROR, + array(xml_error_string(xml_get_error_code($this->parser)), + xml_get_current_line_number($this->parser))); + + // destroy parser; + xml_parser_free($this->parser); + + // unset extra vars; + unset($data, + $this->track, + $this->tmpLevel); + + // remove global tag and return the result; + return $this->pOut[0][key($this->pOut[0])]; + } + + + + /** + * startHandler + * Manage the open tag, and these attributs by callback. + * The purpose is to create a pointer : {{int ptr}}. + * If the pointer exists, we have a multi-tag situation. + * Tag name is stocked like : '' + * Attributs is stocked like : '-ATTR' + * Return true but built $this->pOut. + * + * @access private + * @param parser resource Parser resource. + * @param tag string Tag name. + * @param attr array Attribut. + * @return bool + */ + function startHandler ( $parser, $tag, $attr ) { + + // built $this->track; + $this->track[] = $tag; + // place pointer to the end; + end($this->track); + // temp level; + $this->tmpLevel = key($this->track); + + // built attrLevel into $this->tmpAttrLevel + if(isset($this->tmpAttrLevel[$this->tmpLevel]['attrLevel'])) + $this->tmpAttrLevel[$this->tmpLevel]['attrLevel']++; + + // built $this->pOut; + if(!isset($this->pOut[key($this->track)][$tag])) { + $this->pOut[key($this->track)][$tag] = '{{'.key($this->track).'}}'; + + if(!isset($this->tmpAttrLevel[$this->tmpLevel]['attrLevel'])) + $this->tmpAttrLevel[$this->tmpLevel]['attrLevel'] = 0; + } + + // built attributs; + if(!empty($attr)) { + + $this->tmpAttrLevel[$this->tmpLevel][] = $this->tmpAttrLevel[$this->tmpLevel]['attrLevel']; + end($this->tmpAttrLevel[$this->tmpLevel]); + + // it's the first attribut; + if(!isset($this->pOut[key($this->track)][$tag.'-ATTR'])) + $this->pOut[key($this->track)][$tag.'-ATTR'] = $attr; + + // or it's not the first; + else { + // so it's the second; + if(!prev($this->tmpAttrLevel[$this->tmpLevel])) { + $this->pOut[key($this->track)][$tag.'-ATTR'] = array( + current($this->tmpAttrLevel[$this->tmpLevel]) => $this->pOut[key($this->track)][$tag.'-ATTR'], + next($this->tmpAttrLevel[$this->tmpLevel]) => $attr + ); + } + // or one other; + else + $this->pOut[key($this->track)][$tag.'-ATTR'][$this->tmpAttrLevel[$this->tmpLevel]['attrLevel']] = $attr; + } + } + + return true; + } + + + + /** + * contentHandler + * Detect the pointer, or the multi-tag by callback. + * If we have a pointer, the method replaces this pointer by the content. + * Else we have a multi-tag, the method add a element to this array. + * Return true but built $this->pOut. + * + * @access private + * @param parser resource Parser resource. + * @param contentHandler string Tag content. + * @return bool + */ + function contentHandler ( $parser, $contentHandler ) { + + // remove all spaces; + if(!preg_match('#^\\\\s*$#', $contentHandler)) { + + // $contentHandler is a string; + if(is_string($this->pOut[key($this->track)][current($this->track)])) { + + // then $contentHandler is a pointer : {{int ptr}} case 1; + if(preg_match('#{{([0-9]+)}}#', $this->pOut[key($this->track)][current($this->track)])) + $this->pOut[key($this->track)][current($this->track)] = $contentHandler; + + // or then $contentHandler is a multi-tag content case 2; + else { + $this->pOut[key($this->track)][current($this->track)] = array( + 0 => $this->pOut[key($this->track)][current($this->track)], + 1 => $contentHandler + ); + } + } + // or $contentHandler is an array; + else { + + // then $contentHandler is the multi-tag array case 1; + if(isset($this->pOut[key($this->track)][current($this->track)][0])) + $this->pOut[key($this->track)][current($this->track)][] = $contentHandler; + + // or then $contentHandler is a node-tag case 2; + else + $this->pOut[key($this->track)][current($this->track)] = array( + 0 => $this->pOut[key($this->track)][current($this->track)], + 1 => $contentHandler + ); + } + + } + + return true; + } + + + + /** + * endHandler + * Detect the last pointer by callback. + * Move the last tags block up. + * And reset some temp variables. + * Return true but built $this->pOut. + * + * @access private + * @param parser resource Parser resource. + * @param tag string Tag name. + * @return bool + */ + function endHandler ( $parser, $tag ) { + + // if level--; + if(key($this->track) == $this->tmpLevel-1) { + // search up tag; + // use array_keys if an empty tag exists (taking the last tag); + + // if it's a normal framaset; + $keyBack = array_keys($this->pOut[key($this->track)], '{{'.key($this->track).'}}'); + $count = count($keyBack); + + if($count != 0) { + $keyBack = $keyBack[$count-1]; + // move this level up; + $this->pOut[key($this->track)][$keyBack] = $this->pOut[key($this->track)+1]; + } + + // if we have a multi-tag framaset ($count == 0); + else { + // if place is set; + if(isset($this->pOut[key($this->track)][current($this->track)][0])) { + + // if it's a string, we built an array; + if(is_string($this->pOut[key($this->track)][current($this->track)])) + $this->pOut[key($this->track)][current($this->track)] = array( + 0 => $this->pOut[key($this->track)][current($this->track)], + 1 => $this->pOut[key($this->track)+1] + ); + + // else add an index into the array; + else + $this->pOut[key($this->track)][current($this->track)][] = $this->pOut[key($this->track)+1]; + } + // else set the place; + else + $this->pOut[key($this->track)][current($this->track)] = array( + 0 => $this->pOut[key($this->track)][current($this->track)], + 1 => $this->pOut[key($this->track)+1] + ); + } + + // kick $this->pOut level out; + array_pop($this->pOut); + end($this->pOut); + } + + // re-temp level; + $this->tmpLevel = key($this->track); + + while(isset($this->tmpAttrLevel[$this->tmpLevel+1])) + array_pop($this->tmpAttrLevel); + + // kick $this->track level out; + array_pop($this->track); + end($this->track); + + return true; + } +} + +?> diff --git a/ajax.php b/ajax.php new file mode 100644 index 0000000..60df1b2 --- /dev/null +++ b/ajax.php @@ -0,0 +1,25 @@ +get_ajax_module($_POST["task"],$_POST["sub"]); +}else{ + $ajax->get_ajax_module($_GET["task"],$_GET["sub"]); +} +?> diff --git a/class_templates/admin_module.template.php b/class_templates/admin_module.template.php new file mode 100644 index 0000000..501f539 --- /dev/null +++ b/class_templates/admin_module.template.php @@ -0,0 +1,40 @@ + diff --git a/class_templates/ajax_module.template.php b/class_templates/ajax_module.template.php new file mode 100644 index 0000000..9c7c824 --- /dev/null +++ b/class_templates/ajax_module.template.php @@ -0,0 +1,53 @@ +tpl= new Smarty(); + $this->tpl->setCompileDir($root . '/core/template/templates_c'); + $this->tpl->setCacheDir($root . '/core/template/cache'); + $this->tpl->setConfigDir($root . '/core/template/config'); + If($config["caching"]==1){ + $this->tpl->setCaching(Smarty::CACHING_LIFETIME_SAVED); + } + $this->tpl->assign("path",$config["path"]."/"); + } + + function __destruct() { + } + + function meta() { + } + +} +?> diff --git a/class_templates/page_module.template.php b/class_templates/page_module.template.php new file mode 100644 index 0000000..6d6538a --- /dev/null +++ b/class_templates/page_module.template.php @@ -0,0 +1,63 @@ +tpl= new Smarty(); + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + $this->tpl->setCompileDir($root . '/core/template/templates_c'); + $this->tpl->setCacheDir($root . '/core/template/cache'); + $this->tpl->setConfigDir($root . '/core/template/config'); + If($config["caching"]==1){ + $this->tpl->setCaching(Smarty::CACHING_LIFETIME_SAVED); + } + $this->tpl->assign("path",$config["path"]."/"); + } + + function __destruct() { + } + + function meta() { + } + function footer() { + } + +} +?> diff --git a/core/database/mysql.class.php b/core/database/mysql.class.php new file mode 100644 index 0000000..6c4299d --- /dev/null +++ b/core/database/mysql.class.php @@ -0,0 +1,190 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: mysql.class.php 104 2010-02-20 19:16:12Z genuineparts $ +*/ + +$module["db"]["name"]="Database Class (mysql)"; +$module["db"]["ver"]="1.0.1"; +class db { + var $host=""; + var $user="root"; + var $password=""; + var $db="becast"; + var $encoding; + var $logging; + var $abfragen=0; + var $exception; + private $conid=FALSE; + public const ASSOC = 1; + public const NUM = 2; + public const BOTH = 3; + + function __construct($host,$user,$password,$db,$encoding="utf8",$logging=false,$exception=false) { + global $log,$config; + $this->host=$host; + $this->user=$user; + $this->password=$password; + $this->db=$db; + $this->logging=$logging; + $this->exception=$exception; + + if($this->logging==FALSE && DEBUG!=FALSE){ + $this->logger=new logger("file",dirname(dirname(dirname(__FILE__))).'/logs/mysql_debug.log',5); + }elseif($this->logging){ + $this->logger=new logger("file",dirname(dirname(dirname(__FILE__))).'/logs/mysql.log'); + } + + $this->encoding=$encoding; + $this->conid; + + if($this->logging) + $this->logger->write("mySQL Klasse instanziert", 5); + if(!$this->conid){ + if($this->logging) + $this->logger->write("Connection zu mySQL Server besteht nicht.", 5,__LINE__,__FILE__); + $this->conid=$this->connect($this->host,$this->user,$this->password,$this->db,$this->encoding); + }else{ + if($this->logging) + $this->logger->write("Connection zu mySQL Server besteht. ID ".$this->conid, 5,__LINE__,__FILE__); + } + if($this->encoding) + $this->query("SET NAMES '".$this->encoding."'"); + } + + function __destruct() { + $this->disconnect(); + } + + function connect($host, $user, $password, $db, $encoding){ + $conn = @mysql_connect($host, $user, $password); + if($this->logging) + $this->logger->write("Connect to Mysql Server", 5,__LINE__,__FILE__); + + if(!$conn){ + if($this->exception){ + throw new Exception('mySQLi Connect failed'); + }else{ + trigger_error("mySQL Connect failed",E_USER_ERROR); + + if($this->logging) + $this->logger->write("Connect Failed ". $this->error(), 5,__LINE__,__FILE__); + die(); + } + }else{ + if($this->logging) + $this->logger->write("Selecting Database ".$db, 5,__LINE__,__FILE__); + } + + $conn2 = @mysql_select_db($db,$conn); + if($this->logging) + $this->logger->write("Connect to Mysql Server", 5,__LINE__,__FILE__); + + if(!$conn2){ + include('templates/general_error.tpl'); + + if($this->logging) + $this->logger->write("Select failed ". $this->error(), 5,__LINE__,__FILE__); + die(); + }else{ + if($this->logging) + $this->logger->write("Database ".$db." selected", 5,__LINE__,__FILE__); + } + + return $conn; + } + + + function disconnect(){ + if($this->logging) + $this->logger->write("Closing Mysql Connection.", 5,__LINE__,__FILE__); + + @mysql_close($this->conid); + } + + function query($query){ + global $abfragen; + + if($this->logging) + $this->logger->write($query." ". $this->conid, 5,__LINE__,__FILE__); + + $this->abfragen++; + $res = mysql_query($query, $this->conid); + return $res; + } + + function querys(){ + return $this->abfragen; + } + + function num_rows($result){ + $rows = mysql_num_rows($result); + return $rows; + } + + function fetch_row($result){ + $row = mysql_fetch_row($result); + return $row; + } + + function fetch_array($result){ + $row = array(); + $row = mysql_fetch_array($result, MYSQL_ASSOC); + return $row; + } + + function escape($string){ + $return = mysql_real_escape_string($string); + return $return; + } + + function escape_binary($string){ + return "X'".$this->escape(bin2hex($string))."'"; + } + + function fetch_object($result){ + $row = mysql_fetch_object($result); + return $row; + } + + function error(){ + $error = mysql_error($this->conid); + return $error; + } + + function errno(){ + $errno = mysql_errno($this->conid); + return $errno ; + } + + function free_result($result){ + mysql_free_result($result); + } + + function last_id(){ + $id = mysql_insert_id($this->conid); + return $id; + } +} +?> diff --git a/core/database/mysqli.class.php b/core/database/mysqli.class.php new file mode 100644 index 0000000..c72d787 --- /dev/null +++ b/core/database/mysqli.class.php @@ -0,0 +1,181 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: mysqli.class.php 126 2010-02-21 21:07:52Z genuineparts $ +*/ + +$module["db"]["name"]="Database Class (mysqli)"; +$module["db"]["ver"]="1.0.1"; +class db { + var $mysqli; + var $host=""; + var $user="root"; + var $password=""; + var $db="astat"; + var $encoding; + var $logger; + var $logging; + var $abfragen=0; + var $exception; + public const ASSOC = 1; + public const NUM = 2; + public const BOTH = 3; + + function __construct($host,$user,$password,$db,$encoding="utf8",$logging=false,$exception=false) { + global $log,$config,$root,$logger; + $this->mysqli; + $this->host=$host; + $this->user=$user; + $this->password=$password; + $this->db=$db; + $this->logging=$logging; + $this->exception=$exception; + if($this->logging!=FALSE || DEBUG!=FALSE){ + $this->logger=new logger("file",dirname(dirname(dirname(__FILE__))).'/logs/mysql_debug.log',5); + } + $this->encoding=$encoding; + + if($this->logging) + $this->logger->write("mySQLi Klasse instanziert", 5,__LINE__,__FILE__); + + if(!is_object($this->mysqli)){ + if($this->logging) + $this->logger->write("Connection zu mySQL Server besteht nicht.", 5,__LINE__,__FILE__); + + $this->connect($this->host,$this->user,$this->password,$this->db); + }else{ + if($this->logging) + $this->logger->write("Connection zu mySQL Server besteht.", 5,__LINE__,__FILE__); + } + if($this->encoding) + $this->mysqli->set_charset($this->encoding); + } + + function __destruct() { + $this->disconnect(); + } + + function connect($host, $user, $password, $db){ + $this->mysqli=@new mysqli($host, $user, $password,$db); + if($this->logging) + $this->logger->write("Connect to Mysql Server", 5,__LINE__,__FILE__); + + if (mysqli_connect_errno()) { + if($this->exception){ + throw new Exception('mySQLi Connect failed'); + }else{ + if($this->logging) + $this->logger->write("Connect Failed ". mysqli_connect_error(), 2,__LINE__,__FILE__); + + trigger_error("mySQLi Connect failed",E_USER_ERROR); + die(); + } + } + } + + + function disconnect(){ + if($this->logging) + $this->logger->write("Closing Mysqli Connection.", 5,__LINE__,__FILE__); + + $this->mysqli->close(); + } + + function query($query){ + global $abfragen; + + if($this->logging) + $this->logger->write($query, 5); + + $this->abfragen++; + + $res = $this->mysqli->query($query); + if($this->mysqli->error && $this->logging){ + $this->logger->write("SQL ERROR: ".$this->mysqli->error,2); + } + return $res; + } + + function querys(){ + return $this->abfragen; + } + + function num_rows($result){ + $rows = $result->num_rows; + return $rows; + } + + function fetch_row($result){ + $row = $result->fetch_row(); + return $row; + } + + function fetch_array($result){ + + $row = array(); + $row = $result->fetch_array(MYSQLI_ASSOC); + return $row; + } + + function fetch_array_num($result){ + + $row = array(); + $row = $result->fetch_array(MYSQLI_NUM ); + return $row; + } + + function escape($string){ + $return = $this->mysqli->real_escape_string($string); + return $return; + } + + function escape_binary($string){ + return "X'".$this->escape(bin2hex($string))."'"; + } + + function fetch_object($result){ + $row = $result->fetch_object(); + return $row; + } + + function error(){ + $error = $this->mysqli->error; + return $error; + } + + function errno(){ + $errno = $this->mysqli->errno; + return $errno ; + } + + function free_result($result){ + $result->free_result(); + } + + function last_id(){ + $id = $this->mysqli->insert_id; + return $id; + } +} +?> diff --git a/core/index.html b/core/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/core/index.html @@ -0,0 +1 @@ + diff --git a/core/init_core.inc.php b/core/init_core.inc.php new file mode 100644 index 0000000..9fe7cfb --- /dev/null +++ b/core/init_core.inc.php @@ -0,0 +1,262 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: init_core.inc.php 148 2012-03-27 19:48:30Z genuineparts $ +*/ + +define('in_astat', true); + +function getTime() { + $timer = explode( ' ', microtime() ); + $timer = $timer[1] + $timer[0]; + return $timer; +} + +$start = getTime(); +/** +* Configuration +*/ +require dirname(dirname(__FILE__)).'/inc/config.inc.php'; + +/** +* Smarty +*/ +require $basepath.'template/libs/Smarty.class.php'; +use Smarty\Smarty; + +/** +* Database +*/ +require $basepath.'database/'.$config['db_class'].'.class.php'; + +/** +* Functions +*/ +include dirname(dirname(__FILE__)).'/inc/functions.class.php'; + +/** +* Logger +*/ +require dirname(dirname(__FILE__)).'/inc/logger.class.php'; + +/** +* Logger +*/ +require dirname(dirname(__FILE__)).'/inc/datacache.class.php'; + +/** +* Cache +*/ +require dirname(dirname(__FILE__)).'/inc/cache.class.php'; + +/** +* Errors +*/ +include dirname(dirname(__FILE__)).'/inc/error.class.php'; + +/** +* Plugins +*/ +include dirname(dirname(__FILE__)).'/inc/plugin.class.php'; + +/** +* Mail +*/ +include dirname(dirname(__FILE__)).'/inc/mail.class.php'; + +/** + * Captcha + */ +include dirname(dirname(__FILE__)).'/inc/captcha.class.php'; +$plugin=new plugins(); + +$db= new db($config['host'], $config['user'], $config['pass'], $config['db'],'utf8', true); + +/** +* Select $config vars form Database +* +*/ +$result = $db->query("SELECT `name`, `value` FROM " . $config['prefix'] . "config"); +while ($row = $db->fetch_array($result)){ + $config[$row['name']] = $row['value']; +} + +/** +* Set LC Lang for Dates +*/ +if($config['LCLANG']){ + setlocale(LC_ALL,$config['LCLANG']); +} + +/** +* Start Datacache +* +*/ +$cache=new datacache(); + +/** +* Start Datacache +* +*/ +$ccache=new cache(); + +/** +* Look if we have a path Variable and try to autoset if not. +* +*/ +if(!isset($config['path'])){ + $path = explode('/', $_SERVER['SCRIPT_NAME']); + $last = array_pop($path); + $path = str_replace('/' . $last, '', $_SERVER['SCRIPT_NAME']); + $config['path'] = $path; + $db->query("INSERT INTO " . $config['prefix'] . "config (`name`, `value`, `title`, `description`, `option`, `category`) VALUES +( 'path', '".$path."', 'Pfad', 'Der Pfad auf ihrem Webserver z.b. /cms', 'text', 1)"); +}else{ + $path=$config['path']; +} + +/** +* Start Logger +* +*/ +$log=new logger($config['logtype'],dirname(dirname(__FILE__)).'/logs/'.$config['logfile'],$config['loglevel']); +$tpl = new Smarty(); +$error = new errorhandler(); +$functions = new functions(); +$root = $_SERVER['DOCUMENT_ROOT'] . $config['path']; + +/** +* Start Language +* +*/ +require dirname(dirname(__FILE__)).'/inc/lang.class.php'; +$lang=new lang(); + + +/** +* Check if we have a Theme variable and the Theme exists +* @TODO Theme Management +* +*/ +if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/themes/'.$config['theme'])){ + $tpl->setTemplateDir($root . '/themes/'.$config['theme']); +}else{ + + /** + * Fallback + */ + $tpl->setTemplateDir($root . '/themes/default'); +} +$tpl->setCompileDir($root . '/core/template/templates_c'); +$tpl->setCacheDir($root . '/core/template/cache'); +$tpl->setConfigDir($root . '/core/template/config'); +$tpl->loadFilter(\Smarty\Smarty::FILTER_OUTPUT,'trimwhitespace'); +$tpl->registerFilter("output", "lang"); +//var_dump($tpl -> getAutoloadFilters()); +/** +* Well... This should vanish with Thememanagement +* +*/ +$addnav['right'] = TRUE; +$addnav['left'] = TRUE; + + +/** +* Start Sessions +* +*/ +require dirname(dirname(__FILE__)).'/inc/sessions.class.php'; +$session=new session(); + + +/** +* Initiate Core Class +* +*/ +require dirname(dirname(__FILE__)).'/inc/core.class.php'; +$core=new core($db, $log, $tpl); + +if(defined('INSTALLED')){ + if(is_dir(dirname(dirname(__FILE__)).'/install')){ + return $core->message($lang->_('DELINSTALLDIR'), $lang->_('DELINSTALLDIRTEXT'),FALSE); + } +}else{ + header("Location: install/install.php"); +} + +$captcha = new captcha(); + +/** +* OpenID +*/ +if($config['use_openid']==1){ + include dirname(dirname(__FILE__)).'/inc/SimpleOpenID.class.php'; +} +/** +* Get all *.plugin.php files from the Modules and register the Pluginhooks +* +*/ +$core->load_modules(); +foreach($core->mod_ as $key=>$val){ + if(file_exists($root.'/modules/'.$val['file'].'/' . $val['file'] . '.plugins.php')){ + include_once $root.'/modules/'.$val['file'].'/' . $val['file']. '.plugins.php'; + $class='plugins_'.$val['file']; + if(class_exists($class)){ + $imod=new $class(); + if(is_callable(array($imod,'register_plugins'))){ + $imod->register_plugins($plugin); + } + } + } +} + +$plugin->run_hook('init_core'); + + +function lang($code, \Smarty\Template $template) { + $source = $code; + return preg_replace_callback ('/##(.+?)##/', 'langstr', $source); +} + +function langstr($treffer) +{ + global $lang; + return $lang->_($treffer[1]); +} + +/** +* This loads *.class.php files from the /core/modules dir. +* Its useful but "undocumented". +* +*/ +$moduledir = dirname(dirname(__FILE__)).'/core/modules'; +$modules = opendir($moduledir); +while ($mods = readdir($modules)) { + if (preg_match('/^.*?\.class.php$/', $mods)) { + require_once($moduledir.'/'.$mods); + } + } +@closedir($modules); + +?> diff --git a/core/modules/textparser.class.php b/core/modules/textparser.class.php new file mode 100644 index 0000000..1600107 --- /dev/null +++ b/core/modules/textparser.class.php @@ -0,0 +1,229 @@ +BBCodesDefault) OR !isset($this->BBCodesExtra)) + { + trigger_error("Es fehlen wichtige Variablen! Bitte kontrollieren Sie die Klasse."); + } + $this->addDefaultBBCodes(); + } + + private function addDefaultBBCodes() + { + $this->BBCodesDefault = array("b" => array("/\[b\](.*)\[\/b\]/isU" => "$1"), + "i" => array("/\[i\](.*)\[\/i\]/isU" => "$1"), + "u" => array("/\[u\](.*)\[\/u\]/isU" => "$1"), + "hr" => array("/\[hr\]/isU" => "
"), + "br" => array("/\[br\]/isU" => "
"), + "url" => array("/\[url\=(.*)\](.*)\[\/url\]/isU" => "$2"), + "youtube" => array("/\[youtube\](.*)\[\/youtube\]/isU" => ""), + "img" => array("/\[img\](.*)\[\/img\]/isU" => "\"\"")); + } + + public function addExtraBBCode($name, $bbCodePattern, $htmlCodePattern) + { + if(!isset($this->BBCodesExtra[$name])) + { + $this->BBCodesExtra[$name] = array($bbCodePattern => $htmlCodePattern); + } + else + { + trigger_error("BBCodename existiert bereits"); + } + } + + private function parseExtraCode() + { + if(!is_array($this->BBCodesExtra)) return $this->rawText; + + foreach($this->BBCodesExtra as $BBCode => $array) + { + foreach($array as $BBCodePattern => $htmlPattern) + { + $this->rawText = preg_replace($BBCodePattern, $htmlPattern, $this->rawText); + } + } + return $this->rawText; + } + + private function iniParse($rawText) + { + $this->rawText = $rawText; + foreach($this->BBCodesDefault as $BBCode => $array) + { + if(stripos($this->rawText, "[".$BBCode."]") !== FALSE && stripos($this->rawText, "[/".$BBCode."]") !== FALSE) + { + return true; + } + continue; + } + if(is_array($this->BBCodesExtra)) + { + foreach($this->BBCodesExtra as $BBCode => $array) + { + if(stripos($this->rawText, "[".$BBCode."]") !== FALSE && stripos($this->rawText, "[/".$BBCode."]") !== FALSE) + { + return true; + } + continue; + } + } + + return false; + } + + private function parseCode() + { + if($this->rawText == "") + { + trigger_error("Diese Funktion muss erst durch iniParse() initialisert werden!"); + } + + foreach($this->BBCodesDefault as $BBCode => $array) + { + foreach($array as $search => $html) + { + $this->rawText = preg_replace($search, $html, $this->rawText); + } + } + + return $this->rawText; + } + + public function parse($rawText) + { + //$this->rawText = htmlentities($rawText); + if(!$this->iniParse($rawText)) return $this->rawText; + $this->parseCode(); + $this->parseExtraCode(); + return $this->rawText; + } +}*/ + +class textparser { + + function __construct($parse_smilies=true) { + global $config, $db; + if($config['smilies_table']!=NULL && $config['smilies_table'] != ""){ + $this->parse_smilies=$parse_smilies; + if($this->parse_smilies){ + $result=$db->query('SELECT * FROM `' . $config['smilies_table']. '`'); + while($row=$db->fetch_array($result)){ + $find=preg_quote($row['find']); + $this->smilies[$find]=''.$row['name'].''; + } + } + } + } + + function parseParameters ($stringParameter) { + $arrayParameter = array (); + + if (is_string ($stringParameter) === TRUE && empty ($stringParameter) === FALSE){ + if (preg_match_all ('°(^|\w+)\=(\"?)([^\"]*?)\2(?: |$)°', $stringParameter, $arrayMatches, PREG_SET_ORDER) > 0){ + foreach ($arrayMatches AS $integerMatchCount => $arrayMatch){ + if (empty ($arrayMatch[1]) === TRUE){ + $stringKey = '__INIT__'; + }else{ + $stringKey = strtolower ($arrayMatch[1]); + } + $arrayParameter[$stringKey] = $arrayMatch[3]; + $arrayParameter[$integerMatchCount] = &$arrayParameter[$stringKey]; + } + unset ($arrayMatch); + } + } + + return $arrayParameter; + } + + function parse($mixedInfo) { + $stringCode = ''; + $arrayParameter = array (); + $booleanMixedInfoIsArray = FALSE; + + if (is_array ($mixedInfo) === TRUE && count ($mixedInfo) == 4){ + $stringText = $mixedInfo[3]; + $stringCode = strtolower ($mixedInfo[1]); + $arrayParameter = $this->parseParameters ($mixedInfo[2]); + $booleanMixedInfoIsArray = TRUE; + }elseif (is_string ($mixedInfo) === TRUE){ + $stringText = $mixedInfo; + $stringText = preg_replace ('°\[(br|hr)]°is','[\1][/\1]',$stringText); + }else{ + return ''; + } + + if ($stringCode != 'noparse'){ + $stringText = preg_replace_callback ('°\[(\w+)((?:\s|=)[^]]*)?]((?:[^[]|\[(?!/?\1((?:\s|=)[^]]*)?])|(?R))*)\[/\1]°',array($this,'parse'),$stringText); + } + + if ($booleanMixedInfoIsArray === TRUE){ + switch ($stringCode){ + case 'b': + case 'i': + case 'u': + { + $stringText = '<'.$mixedInfo[1].'>'.$stringText.''; + break; + } + + case 'br': + case 'hr': + { + $stringText = '<'.$mixedInfo[1].' />'; + break; + } + + case 'url': + { + if (count ($arrayParameter) == 0 || array_key_exists ('__INIT__',$arrayParameter) === FALSE){ + $stringText = ''.$stringText.''; + }else{ + $stringTitle = ''; + + if (array_key_exists ('title',$arrayParameter) === TRUE){ + $stringTitle = ' title="'.$arrayParameter['title'].'"'; + } + $stringText = ''.$stringText.''; + + unset ($stringTitle); + } + + break; + } + + case 'color': + { + $stringText = ''.$stringText.''; + break; + } + + default: + { + $stringText = $mixedInfo[0]; + + break; + } + + } + } + if($this->parse_smilies){ + foreach($this->smilies as $find=>$replace){ + $stringText = @preg_replace('#'.$find.'#s', $replace, $stringText); + } + } + return $stringText; + } + +} +?> diff --git a/core/template/libs/Smarty.class.php b/core/template/libs/Smarty.class.php new file mode 100644 index 0000000..813f978 --- /dev/null +++ b/core/template/libs/Smarty.class.php @@ -0,0 +1,45 @@ +testInstall(); // +///////////////////////////////////////////////////////////////////// + +$module["template"]["name"]="Smarty Template Engine"; +$module["template"]["ver"]="5.5.1"; + +define('__SMARTY_DIR', __DIR__ . '/../src/'); + +// Global function declarations +require_once(__SMARTY_DIR . "/functions.php"); + +spl_autoload_register(function ($class) { + // Class prefix + $prefix = 'Smarty\\'; + + // Does the class use the namespace prefix? + $len = strlen($prefix); + if (strncmp($prefix, $class, $len) !== 0) { + // If not, move to the next registered autoloader + return; + } + + // Hack off the prefix part + $relative_class = substr($class, $len); + + // Build a path to the include file + $file = __SMARTY_DIR . str_replace('\\', '/', $relative_class) . '.php'; + + // If the file exists, require it + if (file_exists($file)) { + require_once($file); + } +}); diff --git a/core/template/src/BlockHandler/Base.php b/core/template/src/BlockHandler/Base.php new file mode 100644 index 0000000..e194f67 --- /dev/null +++ b/core/template/src/BlockHandler/Base.php @@ -0,0 +1,19 @@ +cacheable; + } +} \ No newline at end of file diff --git a/core/template/src/BlockHandler/BlockHandlerInterface.php b/core/template/src/BlockHandler/BlockHandlerInterface.php new file mode 100644 index 0000000..9aa744e --- /dev/null +++ b/core/template/src/BlockHandler/BlockHandlerInterface.php @@ -0,0 +1,10 @@ +callback = $callback; + $this->cacheable = $cacheable; + } + + public function handle($params, $content, Template $template, &$repeat) { + return \call_user_func_array($this->callback, [$params, $content, &$template, &$repeat]); + } +} \ No newline at end of file diff --git a/core/template/src/BlockHandler/TextFormat.php b/core/template/src/BlockHandler/TextFormat.php new file mode 100644 index 0000000..b4fa5ac --- /dev/null +++ b/core/template/src/BlockHandler/TextFormat.php @@ -0,0 +1,110 @@ + + * @throws \Smarty\Exception + */ +class TextFormat implements BlockHandlerInterface { + + public function handle($params, $content, Template $template, &$repeat) { + if (is_null($content)) { + return; + } + $style = null; + $indent = 0; + $indent_first = 0; + $indent_char = ' '; + $wrap = 80; + $wrap_char = "\n"; + $wrap_cut = false; + $assign = null; + foreach ($params as $_key => $_val) { + switch ($_key) { + case 'style': + case 'indent_char': + case 'wrap_char': + case 'assign': + $$_key = (string)$_val; + break; + case 'indent': + case 'indent_first': + case 'wrap': + $$_key = (int)$_val; + break; + case 'wrap_cut': + $$_key = (bool)$_val; + break; + default: + trigger_error("textformat: unknown attribute '{$_key}'"); + } + } + if ($style === 'email') { + $wrap = 72; + } + // split into paragraphs + $_paragraphs = preg_split('![\r\n]{2}!', $content); + foreach ($_paragraphs as &$_paragraph) { + if (!$_paragraph) { + continue; + } + // convert mult. spaces & special chars to single space + $_paragraph = + preg_replace( + array( + '!\s+!' . Smarty::$_UTF8_MODIFIER, + '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER + ), + array( + ' ', + '' + ), + $_paragraph + ); + // indent first line + if ($indent_first > 0) { + $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; + } + // wordwrap sentences + $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); + // indent lines + if ($indent > 0) { + $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph); + } + } + $_output = implode($wrap_char . $wrap_char, $_paragraphs); + if ($assign) { + $template->assign($assign, $_output); + } else { + return $_output; + } + } + + public function isCacheable(): bool { + return true; + } +} \ No newline at end of file diff --git a/core/template/src/Cacheresource/Base.php b/core/template/src/Cacheresource/Base.php new file mode 100644 index 0000000..41c4f6b --- /dev/null +++ b/core/template/src/Cacheresource/Base.php @@ -0,0 +1,156 @@ +hasLock($smarty, $cached)) { + $hadLock = true; + if (microtime(true) - $start > $smarty->locking_timeout) { + // abort waiting for lock release + return false; + } + sleep(1); + } + return $hadLock; + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty + * @param Cached $cached + * + * @return bool + */ + public function hasLock(Smarty $smarty, Cached $cached) + { + // check if lock exists + return false; + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty + * @param Cached $cached + * + * @return bool + */ + public function acquireLock(Smarty $smarty, Cached $cached) + { + // create lock + return true; + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty + * @param Cached $cached + * + * @return bool + */ + public function releaseLock(Smarty $smarty, Cached $cached) + { + // release lock + return true; + } +} diff --git a/core/template/src/Cacheresource/Custom.php b/core/template/src/Cacheresource/Custom.php new file mode 100644 index 0000000..f9eb858 --- /dev/null +++ b/core/template/src/Cacheresource/Custom.php @@ -0,0 +1,303 @@ +cache_id) ? preg_replace('![^\w\|]+!', '_', $cached->cache_id) : null; + $_compile_id = isset($cached->compile_id) ? preg_replace('![^\w]+!', '_', $cached->compile_id) : null; + $path = $cached->getSource()->uid . $_cache_id . $_compile_id; + $cached->filepath = sha1($path); + if ($_template->getSmarty()->cache_locking) { + $cached->lock_id = sha1('lock.' . $path); + } + $this->populateTimestamp($cached); + } + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param \Smarty\Template\Cached $cached + * + * @return void + */ + public function populateTimestamp(\Smarty\Template\Cached $cached) + { + $mtime = + $this->fetchTimestamp($cached->filepath, $cached->getSource()->name, $cached->cache_id, $cached->compile_id); + if ($mtime !== null) { + $cached->timestamp = $mtime; + $cached->exists = !!$cached->timestamp; + return; + } + $timestamp = null; + $this->fetch( + $cached->filepath, + $cached->getSource()->name, + $cached->cache_id, + $cached->compile_id, + $cached->content, + $timestamp + ); + $cached->timestamp = isset($timestamp) ? $timestamp : false; + $cached->exists = !!$cached->timestamp; + } + + /** + * Read the cached template and process the header + * + * @param Template $_smarty_tpl do not change variable name, is used by compiled template + * @param Cached|null $cached cached object + * @param boolean $update flag if called because cache update + * + * @return boolean true or false if the cached content does not exist + */ + public function process( + Template $_smarty_tpl, + ?\Smarty\Template\Cached $cached = null, + $update = false + ) { + if (!$cached) { + $cached = $_smarty_tpl->getCached(); + } + $content = $cached->content ? $cached->content : null; + $timestamp = $cached->timestamp ? $cached->timestamp : null; + if ($content === null || !$timestamp) { + $this->fetch( + $_smarty_tpl->getCached()->filepath, + $_smarty_tpl->getSource()->name, + $_smarty_tpl->cache_id, + $_smarty_tpl->compile_id, + $content, + $timestamp + ); + } + if (isset($content)) { + eval('?>' . $content); + $cached->content = null; + return true; + } + return false; + } + + /** + * Write the rendered template output to cache + * + * @param Template $_template template object + * @param string $content content to cache + * + * @return boolean success + */ + public function storeCachedContent(Template $_template, $content) + { + return $this->save( + $_template->getCached()->filepath, + $_template->getSource()->name, + $_template->cache_id, + $_template->compile_id, + $_template->cache_lifetime, + $content + ); + } + + /** + * Read cached template from cache + * + * @param Template $_template template object + * + * @return string|boolean content + */ + public function retrieveCachedContent(Template $_template) + { + $content = $_template->getCached()->content ?: null; + if ($content === null) { + $timestamp = null; + $this->fetch( + $_template->getCached()->filepath, + $_template->getSource()->name, + $_template->cache_id, + $_template->compile_id, + $content, + $timestamp + ); + } + if (isset($content)) { + return $content; + } + return false; + } + + /** + * Empty cache + * + * @param \Smarty\Smarty $smarty Smarty object + * @param null $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clearAll(\Smarty\Smarty $smarty, $exp_time = null) + { + return $this->delete(null, null, null, $exp_time); + } + + /** + * Empty cache for a specific template + * + * @param \Smarty\Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return int number of cache files deleted + * @throws \Smarty\Exception + */ + public function clear(\Smarty\Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + $cache_name = null; + if (isset($resource_name)) { + $source = \Smarty\Template\Source::load(null, $smarty, $resource_name); + if ($source->exists) { + $cache_name = $source->name; + } else { + return 0; + } + } + return $this->delete($cache_name, $cache_id, $compile_id, $exp_time); + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return boolean true or false if cache is locked + */ + public function hasLock(\Smarty\Smarty $smarty, \Smarty\Template\Cached $cached) + { + $id = $cached->lock_id; + $name = $cached->getSource()->name . '.lock'; + $mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id); + if ($mtime === null) { + $this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime); + } + return $mtime && ($t = time()) - $mtime < $smarty->locking_timeout; + } + + /** + * Lock cache for this template + * + * @param \Smarty\Smarty $smarty Smarty object + * @param \Smarty\Template\Cached $cached cached object + * + * @return bool|void + */ + public function acquireLock(\Smarty\Smarty $smarty, \Smarty\Template\Cached $cached) + { + $cached->is_locked = true; + $id = $cached->lock_id; + $name = $cached->getSource()->name . '.lock'; + $this->save($id, $name, $cached->cache_id, $cached->compile_id, $smarty->locking_timeout, ''); + } + + /** + * Unlock cache for this template + * + * @param \Smarty\Smarty $smarty Smarty object + * @param \Smarty\Template\Cached $cached cached object + * + * @return bool|void + */ + public function releaseLock(\Smarty\Smarty $smarty, \Smarty\Template\Cached $cached) + { + $cached->is_locked = false; + $name = $cached->getSource()->name . '.lock'; + $this->delete($name, $cached->cache_id, $cached->compile_id, null); + } +} diff --git a/core/template/src/Cacheresource/File.php b/core/template/src/Cacheresource/File.php new file mode 100644 index 0000000..4b4198e --- /dev/null +++ b/core/template/src/Cacheresource/File.php @@ -0,0 +1,338 @@ +getSource(); + $smarty = $_template->getSmarty(); + $_compile_dir_sep = $smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^'; + $_filepath = $source->uid; + $cached->filepath = $smarty->getCacheDir(); + if (isset($_template->cache_id)) { + $cached->filepath .= preg_replace( + array( + '![^\w|]+!', + '![|]+!' + ), + array( + '_', + $_compile_dir_sep + ), + $_template->cache_id + ) . $_compile_dir_sep; + } + if (isset($_template->compile_id)) { + $cached->filepath .= preg_replace('![^\w]+!', '_', $_template->compile_id) . $_compile_dir_sep; + } + // if use_sub_dirs, break file into directories + if ($smarty->use_sub_dirs) { + $cached->filepath .= $_filepath[ 0 ] . $_filepath[ 1 ] . DIRECTORY_SEPARATOR . $_filepath[ 2 ] . + $_filepath[ 3 ] . + DIRECTORY_SEPARATOR . + $_filepath[ 4 ] . $_filepath[ 5 ] . DIRECTORY_SEPARATOR; + } + $cached->filepath .= $_filepath . '_' . $source->getBasename(); + + if ($smarty->cache_locking) { + $cached->lock_id = $cached->filepath . '.lock'; + } + $cached->filepath .= '.php'; + $cached->timestamp = $cached->exists = is_file($cached->filepath); + if ($cached->exists) { + $cached->timestamp = filemtime($cached->filepath); + } + } + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param Cached $cached cached object + * + * @return void + */ + public function populateTimestamp(Cached $cached) + { + $cached->timestamp = $cached->exists = is_file($cached->filepath); + if ($cached->exists) { + $cached->timestamp = filemtime($cached->filepath); + } + } + + /** + * Read the cached template and process its header + * + * @param Template $_smarty_tpl do not change variable name, is used by compiled template + * @param Cached|null $cached cached object + * @param bool $update flag if called because cache update + * + * @return boolean true or false if the cached content does not exist + */ + public function process( + Template $_smarty_tpl, + ?Cached $cached = null, + $update = false + ) { + $_smarty_tpl->getCached()->setValid(false); + if ($update && defined('HHVM_VERSION')) { + eval('?>' . file_get_contents($_smarty_tpl->getCached()->filepath)); + return true; + } else { + return @include $_smarty_tpl->getCached()->filepath; + } + } + + /** + * Write the rendered template output to cache + * + * @param Template $_template template object + * @param string $content content to cache + * + * @return bool success + * @throws \Smarty\Exception + */ + public function storeCachedContent(Template $_template, $content) + { + if ($_template->getSmarty()->writeFile($_template->getCached()->filepath, $content) === true) { + if (function_exists('opcache_invalidate') + && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api'))) < 1 + ) { + opcache_invalidate($_template->getCached()->filepath, true); + } elseif (function_exists('apc_compile_file')) { + apc_compile_file($_template->getCached()->filepath); + } + $cached = $_template->getCached(); + $cached->timestamp = $cached->exists = is_file($cached->filepath); + if ($cached->exists) { + $cached->timestamp = filemtime($cached->filepath); + return true; + } + } + return false; + } + + /** + * Read cached template from cache + * + * @param Template $_template template object + * + * @return string content + */ + public function retrieveCachedContent(Template $_template) + { + if (is_file($_template->getCached()->filepath)) { + return file_get_contents($_template->getCached()->filepath); + } + return false; + } + + /** + * Empty cache + * + * @param Smarty $smarty + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clearAll(Smarty $smarty, $exp_time = null) + { + return $this->clear($smarty, null, null, null, $exp_time); + } + + /** + * Empty cache for a specific template + * + * @param Smarty $smarty + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time (number of seconds, not timestamp) + * + * @return integer number of cache files deleted + */ + public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null; + $_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null; + $_dir_sep = $smarty->use_sub_dirs ? '/' : '^'; + $_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0; + $_dir = $smarty->getCacheDir(); + if ($_dir === '/') { //We should never want to delete this! + return 0; + } + $_dir_length = strlen($_dir); + if (isset($_cache_id)) { + $_cache_id_parts = explode('|', $_cache_id); + $_cache_id_parts_count = count($_cache_id_parts); + if ($smarty->use_sub_dirs) { + foreach ($_cache_id_parts as $id_part) { + $_dir .= $id_part . '/'; + } + } + } + if (isset($resource_name)) { + $_save_stat = $smarty->caching; + $smarty->caching = \Smarty\Smarty::CACHING_LIFETIME_CURRENT; + $tpl = $smarty->doCreateTemplate($resource_name); + $smarty->caching = $_save_stat; + // remove from template cache + if ($tpl->getSource()->exists) { + $_resourcename_parts = basename(str_replace('^', '/', $tpl->getCached()->filepath)); + } else { + return 0; + } + } + $_count = 0; + $_time = time(); + if (file_exists($_dir)) { + $_cacheDirs = new RecursiveDirectoryIterator($_dir); + $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST); + foreach ($_cache as $_file) { + if (substr(basename($_file->getPathname()), 0, 1) === '.') { + continue; + } + $_filepath = (string)$_file; + // directory ? + if ($_file->isDir()) { + if (!$_cache->isDot()) { + // delete folder if empty + @rmdir($_file->getPathname()); + } + } else { + // delete only php files + if (substr($_filepath, -4) !== '.php') { + continue; + } + $_parts = explode($_dir_sep, str_replace('\\', '/', substr($_filepath, $_dir_length))); + $_parts_count = count($_parts); + // check name + if (isset($resource_name)) { + if ($_parts[ $_parts_count - 1 ] !== $_resourcename_parts) { + continue; + } + } + // check compile id + if (isset($_compile_id) && (!isset($_parts[ $_parts_count - 2 - $_compile_id_offset ]) + || $_parts[ $_parts_count - 2 - $_compile_id_offset ] !== $_compile_id) + ) { + continue; + } + // check cache id + if (isset($_cache_id)) { + // count of cache id parts + $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : + $_parts_count - 1 - $_compile_id_offset; + if ($_parts_count < $_cache_id_parts_count) { + continue; + } + for ($i = 0; $i < $_cache_id_parts_count; $i++) { + if ($_parts[ $i ] !== $_cache_id_parts[ $i ]) { + continue 2; + } + } + } + if (is_file($_filepath)) { + // expired ? + if (isset($exp_time)) { + if ($exp_time < 0) { + preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_filepath), $match); + if ($_time < (filemtime($_filepath) + $match[ 1 ])) { + continue; + } + } else { + if ($_time - filemtime($_filepath) < $exp_time) { + continue; + } + } + } + $_count += @unlink($_filepath) ? 1 : 0; + if (function_exists('opcache_invalidate') + && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1) + ) { + opcache_invalidate($_filepath, true); + } elseif (function_exists('apc_delete_file')) { + apc_delete_file($_filepath); + } + } + } + } + } + return $_count; + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return boolean true or false if cache is locked + */ + public function hasLock(Smarty $smarty, Cached $cached) + { + clearstatcache(true, $cached->lock_id ?? ''); + if (null !== $cached->lock_id && is_file($cached->lock_id)) { + $t = filemtime($cached->lock_id); + return $t && (time() - $t < $smarty->locking_timeout); + } else { + return false; + } + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return void + */ + public function acquireLock(Smarty $smarty, Cached $cached) + { + $cached->is_locked = true; + touch($cached->lock_id); + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return void + */ + public function releaseLock(Smarty $smarty, Cached $cached) + { + $cached->is_locked = false; + @unlink($cached->lock_id); + } +} diff --git a/core/template/src/Cacheresource/KeyValueStore.php b/core/template/src/Cacheresource/KeyValueStore.php new file mode 100644 index 0000000..1953bb2 --- /dev/null +++ b/core/template/src/Cacheresource/KeyValueStore.php @@ -0,0 +1,541 @@ +filepath = $_template->getSource()->uid . '#' . $this->sanitize($cached->getSource()->resource) . '#' . + $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->compile_id); + $this->populateTimestamp($cached); + } + + /** + * populate Cached Object with timestamp and exists from Resource + * + * @param Cached $cached cached object + * + * @return void + */ + public function populateTimestamp(Cached $cached) + { + if (!$this->fetch( + $cached->filepath, + $cached->getSource()->name, + $cached->cache_id, + $cached->compile_id, + $content, + $timestamp, + $cached->getSource()->uid + ) + ) { + return; + } + $cached->content = $content; + $cached->timestamp = (int)$timestamp; + $cached->exists = !!$cached->timestamp; + } + + /** + * Read the cached template and process the header + * + * @param Template $_smarty_tpl do not change variable name, is used by compiled template + * @param Cached|null $cached cached object + * @param boolean $update flag if called because cache update + * + * @return boolean true or false if the cached content does not exist + */ + public function process( + Template $_smarty_tpl, + ?Cached $cached = null, + $update = false + ) { + if (!$cached) { + $cached = $_smarty_tpl->getCached(); + } + $content = $cached->content ?: null; + $timestamp = $cached->timestamp ?: null; + if ($content === null || !$timestamp) { + if (!$this->fetch( + $_smarty_tpl->getCached()->filepath, + $_smarty_tpl->getSource()->name, + $_smarty_tpl->cache_id, + $_smarty_tpl->compile_id, + $content, + $timestamp, + $_smarty_tpl->getSource()->uid + ) + ) { + return false; + } + } + if (isset($content)) { + eval('?>' . $content); + return true; + } + return false; + } + + /** + * Write the rendered template output to cache + * + * @param Template $_template template object + * @param string $content content to cache + * + * @return boolean success + */ + public function storeCachedContent(Template $_template, $content) + { + $this->addMetaTimestamp($content); + return $this->write(array($_template->getCached()->filepath => $content), $_template->cache_lifetime); + } + + /** + * Read cached template from cache + * + * @param Template $_template template object + * + * @return string|false content + */ + public function retrieveCachedContent(Template $_template) + { + $content = $_template->getCached()->content ?: null; + $timestamp = null; + if ($content === null) { + if (!$this->fetch( + $_template->getCached()->filepath, + $_template->getSource()->name, + $_template->cache_id, + $_template->compile_id, + $content, + $timestamp, + $_template->getSource()->uid + ) + ) { + return false; + } + } + if (isset($content)) { + return $content; + } + return false; + } + + /** + * Empty cache + * {@internal the $exp_time argument is ignored altogether }} + * + * @param Smarty $smarty Smarty object + * @param integer $exp_time expiration time [being ignored] + * + * @return integer number of cache files deleted [always -1] + * @uses purge() to clear the whole store + * @uses invalidate() to mark everything outdated if purge() is inapplicable + */ + public function clearAll(Smarty $smarty, $exp_time = null) + { + if (!$this->purge()) { + $this->invalidate(null); + } + return -1; + } + + /** + * Empty cache for a specific template + * {@internal the $exp_time argument is ignored altogether}} + * + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time [being ignored] + * + * @return int number of cache files deleted [always -1] + * @throws \Smarty\Exception + * @uses buildCachedFilepath() to generate the CacheID + * @uses invalidate() to mark CacheIDs parent chain as outdated + * @uses delete() to remove CacheID from cache + */ + public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) + { + $uid = $this->getTemplateUid($smarty, $resource_name); + $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' . + $this->sanitize($compile_id); + $this->delete(array($cid)); + $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid); + return -1; + } + + /** + * Get template's unique ID + * + * @param Smarty $smarty Smarty object + * @param string $resource_name template name + * + * @return string filepath of cache file + * @throws \Smarty\Exception + */ + protected function getTemplateUid(Smarty $smarty, $resource_name) + { + if (isset($resource_name)) { + $source = \Smarty\Template\Source::load(null, $smarty, $resource_name); + if ($source->exists) { + return $source->uid; + } + } + return ''; + } + + /** + * Sanitize CacheID components + * + * @param string $string CacheID component to sanitize + * + * @return string sanitized CacheID component + */ + protected function sanitize($string) + { + $string = trim((string)$string, '|'); + if (!$string) { + return ''; + } + return preg_replace('#[^\w\|]+#S', '_', $string); + } + + /** + * Fetch and prepare a cache object. + * + * @param string $cid CacheID to fetch + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer &$timestamp cached timestamp (epoch) + * @param string $resource_uid resource's uid + * + * @return boolean success + */ + protected function fetch( + $cid, + $resource_name = null, + $cache_id = null, + $compile_id = null, + &$content = null, + &$timestamp = null, + $resource_uid = null + ) { + $t = $this->read(array($cid)); + $content = !empty($t[ $cid ]) ? $t[ $cid ] : null; + $timestamp = null; + if ($content && ($timestamp = $this->getMetaTimestamp($content))) { + $invalidated = + $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid); + if ($invalidated > $timestamp) { + $timestamp = null; + $content = null; + } + } + return !!$content; + } + + /** + * Add current microtime to the beginning of $cache_content + * {@internal the header uses 8 Bytes, the first 4 Bytes are the seconds, the second 4 Bytes are the microseconds}} + * + * @param string &$content the content to be cached + */ + protected function addMetaTimestamp(&$content) + { + $mt = explode(' ', microtime()); + $ts = pack('NN', $mt[ 1 ], (int)($mt[ 0 ] * 100000000)); + $content = $ts . $content; + } + + /** + * Extract the timestamp the $content was cached + * + * @param string &$content the cached content + * + * @return float the microtime the content was cached + */ + protected function getMetaTimestamp(&$content) + { + extract(unpack('N1s/N1m/a*content', $content)); + /** + * @var int $s + * @var int $m + */ + return $s + ($m / 100000000); + } + + /** + * Invalidate CacheID + * + * @param string $cid CacheID + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's uid + * + * @return void + */ + protected function invalidate( + $cid = null, + $resource_name = null, + $cache_id = null, + $compile_id = null, + $resource_uid = null + ) { + $now = microtime(true); + $key = null; + // invalidate everything + if (!$resource_name && !$cache_id && !$compile_id) { + $key = 'IVK#ALL'; + } // invalidate all caches by template + else { + if ($resource_name && !$cache_id && !$compile_id) { + $key = 'IVK#TEMPLATE#' . $resource_uid . '#' . $this->sanitize($resource_name); + } // invalidate all caches by cache group + else { + if (!$resource_name && $cache_id && !$compile_id) { + $key = 'IVK#CACHE#' . $this->sanitize($cache_id); + } // invalidate all caches by compile id + else { + if (!$resource_name && !$cache_id && $compile_id) { + $key = 'IVK#COMPILE#' . $this->sanitize($compile_id); + } // invalidate by combination + else { + $key = 'IVK#CID#' . $cid; + } + } + } + } + $this->write(array($key => $now)); + } + + /** + * Determine the latest timestamp known to the invalidation chain + * + * @param string $cid CacheID to determine latest invalidation timestamp of + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath + * + * @return float the microtime the CacheID was invalidated + */ + protected function getLatestInvalidationTimestamp( + $cid, + $resource_name = null, + $cache_id = null, + $compile_id = null, + $resource_uid = null + ) { + // abort if there are no InvalidationKeys to check + if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) { + return 0; + } + // there are no InValidationKeys + if (!($values = $this->read($_cid))) { + return 0; + } + // make sure we're dealing with floats + $values = array_map('floatval', $values); + return max($values); + } + + /** + * Translate a CacheID into the list of applicable InvalidationKeys. + * Splits 'some|chain|into|an|array' into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... ) + * + * @param string $cid CacheID to translate + * @param string $resource_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $resource_uid source's filepath + * + * @return array list of InvalidationKeys + * @uses $invalidationKeyPrefix to prepend to each InvalidationKey + */ + protected function listInvalidationKeys( + $cid, + $resource_name = null, + $cache_id = null, + $compile_id = null, + $resource_uid = null + ) { + $t = array('IVK#ALL'); + $_name = $_compile = '#'; + if ($resource_name) { + $_name .= $resource_uid . '#' . $this->sanitize($resource_name); + $t[] = 'IVK#TEMPLATE' . $_name; + } + if ($compile_id) { + $_compile .= $this->sanitize($compile_id); + $t[] = 'IVK#COMPILE' . $_compile; + } + $_name .= '#'; + $cid = trim((string)$cache_id, '|'); + if (!$cid) { + return $t; + } + $i = 0; + while (true) { + // determine next delimiter position + $i = strpos($cid, '|', $i); + // add complete CacheID if there are no more delimiters + if ($i === false) { + $t[] = 'IVK#CACHE#' . $cid; + $t[] = 'IVK#CID' . $_name . $cid . $_compile; + $t[] = 'IVK#CID' . $_name . $_compile; + break; + } + $part = substr($cid, 0, $i); + // add slice to list + $t[] = 'IVK#CACHE#' . $part; + $t[] = 'IVK#CID' . $_name . $part . $_compile; + // skip past delimiter position + $i++; + } + return $t; + } + + /** + * Check is cache is locked for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return boolean true or false if cache is locked + */ + public function hasLock(Smarty $smarty, Cached $cached) + { + $key = 'LOCK#' . $cached->filepath; + $data = $this->read(array($key)); + return $data && time() - $data[ $key ] < $smarty->locking_timeout; + } + + /** + * Lock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return bool|void + */ + public function acquireLock(Smarty $smarty, Cached $cached) + { + $cached->is_locked = true; + $key = 'LOCK#' . $cached->filepath; + $this->write(array($key => time()), $smarty->locking_timeout); + } + + /** + * Unlock cache for this template + * + * @param Smarty $smarty Smarty object + * @param Cached $cached cached object + * + * @return void + */ + public function releaseLock(Smarty $smarty, Cached $cached) + { + $cached->is_locked = false; + $key = 'LOCK#' . $cached->filepath; + $this->delete(array($key)); + } + + /** + * Read values for a set of keys from cache + * + * @param array $keys list of keys to fetch + * + * @return array list of values with the given keys used as indexes + */ + abstract protected function read(array $keys); + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + abstract protected function write(array $keys, $expire = null); + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + abstract protected function delete(array $keys); + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + return false; + } +} diff --git a/core/template/src/Compile/Base.php b/core/template/src/Compile/Base.php new file mode 100644 index 0000000..2d5c0c0 --- /dev/null +++ b/core/template/src/Compile/Base.php @@ -0,0 +1,233 @@ +cacheable; + } + + /** + * Converts attributes into parameter array strings + * + * @param array $_attr + * + * @return array + */ + protected function formatParamsArray(array $_attr): array { + $_paramsArray = []; + foreach ($_attr as $_key => $_value) { + $_paramsArray[] = var_export($_key, true) . "=>" . $_value; + } + return $_paramsArray; + } + + /** + * This function checks if the attributes passed are valid + * The attributes passed for the tag to compile are checked against the list of required and + * optional attributes. Required attributes must be present. Optional attributes are check against + * the corresponding list. The keyword '_any' specifies that any attribute will be accepted + * as valid + * + * @param object $compiler compiler object + * @param array $attributes attributes applied to the tag + * + * @return array of mapped attributes for further processing + */ + protected function getAttributes($compiler, $attributes) { + $_indexed_attr = []; + $options = array_fill_keys($this->option_flags, true); + foreach ($attributes as $key => $mixed) { + // shorthand ? + if (!is_array($mixed)) { + // options flag ? + if (isset($options[trim($mixed, '\'"')])) { + $_indexed_attr[trim($mixed, '\'"')] = true; + // shorthand attribute ? + } elseif (isset($this->shorttag_order[$key])) { + $_indexed_attr[$this->shorttag_order[$key]] = $mixed; + } else { + // too many shorthands + $compiler->trigger_template_error('too many shorthand attributes', null, true); + } + // named attribute + } else { + foreach ($mixed as $k => $v) { + // options flag? + if (isset($options[$k])) { + if (is_bool($v)) { + $_indexed_attr[$k] = $v; + } else { + if (is_string($v)) { + $v = trim($v, '\'" '); + } + + // Mapping array for boolean option value + static $optionMap = [1 => true, 0 => false, 'true' => true, 'false' => false]; + + if (isset($optionMap[$v])) { + $_indexed_attr[$k] = $optionMap[$v]; + } else { + $compiler->trigger_template_error( + "illegal value '" . var_export($v, true) . + "' for options flag '{$k}'", + null, + true + ); + } + } + // must be named attribute + } else { + $_indexed_attr[$k] = $v; + } + } + } + } + // check if all required attributes present + foreach ($this->required_attributes as $attr) { + if (!isset($_indexed_attr[$attr])) { + $compiler->trigger_template_error("missing '{$attr}' attribute", null, true); + } + } + // check for not allowed attributes + if ($this->optional_attributes !== ['_any']) { + $allowedAttributes = array_fill_keys( + array_merge( + $this->required_attributes, + $this->optional_attributes, + $this->option_flags + ), + true + ); + foreach ($_indexed_attr as $key => $dummy) { + if (!isset($allowedAttributes[$key]) && $key !== 0) { + $compiler->trigger_template_error("unexpected '{$key}' attribute", null, true); + } + } + } + // default 'false' for all options flags not set + foreach ($this->option_flags as $flag) { + if (!isset($_indexed_attr[$flag])) { + $_indexed_attr[$flag] = false; + } + } + + return $_indexed_attr; + } + + /** + * Push opening tag name on stack + * Optionally additional data can be saved on stack + * + * @param Template $compiler compiler object + * @param string $openTag the opening tag's name + * @param mixed $data optional data saved + */ + protected function openTag(Template $compiler, $openTag, $data = null) { + $compiler->openTag($openTag, $data); + } + + /** + * Pop closing tag + * Raise an error if this stack-top doesn't match with expected opening tags + * + * @param Template $compiler compiler object + * @param array|string $expectedTag the expected opening tag names + * + * @return mixed any type the opening tag's name or saved data + */ + protected function closeTag(Template $compiler, $expectedTag) { + return $compiler->closeTag($expectedTag); + } + + /** + * @param mixed $scope + * @param array $invalidScopes + * + * @return int + * @throws Exception + */ + protected function convertScope($scope): int { + + static $scopes = [ + 'local' => Data::SCOPE_LOCAL, // current scope + 'parent' => Data::SCOPE_PARENT, // parent scope (definition unclear) + 'tpl_root' => Data::SCOPE_TPL_ROOT, // highest template (keep going up until parent is not a template) + 'root' => Data::SCOPE_ROOT, // highest scope (definition unclear) + 'global' => Data::SCOPE_GLOBAL, // smarty object + + 'smarty' => Data::SCOPE_SMARTY, // @deprecated alias of 'global' + ]; + + $_scopeName = trim($scope, '\'"'); + if (is_numeric($_scopeName) && in_array($_scopeName, $scopes)) { + return (int) $_scopeName; + } + + if (isset($scopes[$_scopeName])) { + return $scopes[$_scopeName]; + } + + $err = var_export($_scopeName, true); + throw new Exception("illegal value '{$err}' for \"scope\" attribute"); + } + + /** + * Compiles code for the tag + * + * @param array $args array with attributes from parser + * @param Template $compiler compiler object + * @param array $parameter array with compilation parameter + * + * @return string compiled code as a string + * @throws \Smarty\CompilerException + */ + abstract public function compile($args, Template $compiler, $parameter = array(), $tag = null, $function = null): string; +} diff --git a/core/template/src/Compile/BlockCompiler.php b/core/template/src/Compile/BlockCompiler.php new file mode 100644 index 0000000..e7a8f31 --- /dev/null +++ b/core/template/src/Compile/BlockCompiler.php @@ -0,0 +1,228 @@ +compileOpeningTag($compiler, $args, $tag, $function); + } else { + $output = $this->compileClosingTag($compiler, $tag, $parameter, $function); + } + return $output; + } + + /** + * Compiles code for the {$smarty.block.child} property + * + * @param Template $compiler compiler object + * + * @return string compiled code + * @throws CompilerException + */ + public function compileChild(\Smarty\Compiler\Template $compiler) { + + if (!isset($compiler->_cache['blockNesting'])) { + $compiler->trigger_template_error( + "'{\$smarty.block.child}' used outside {block} tags ", + $compiler->getParser()->lex->taglineno + ); + } + $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]['callsChild'] = true; + $compiler->suppressNocacheProcessing = true; + + $output = "getInheritance()->callChild($_smarty_tpl, $this' . ");\n"; + $output .= "?>\n"; + return $output; + } + + /** + * Compiles code for the {$smarty.block.parent} property + * + * @param Template $compiler compiler object + * + * @return string compiled code + * @throws CompilerException + */ + public function compileParent(\Smarty\Compiler\Template $compiler) { + + if (!isset($compiler->_cache['blockNesting'])) { + $compiler->trigger_template_error( + "'{\$smarty.block.parent}' used outside {block} tags ", + $compiler->getParser()->lex->taglineno + ); + } + $compiler->suppressNocacheProcessing = true; + + $output = "getInheritance()->callParent($_smarty_tpl, $this' . ");\n"; + $output .= "?>\n"; + return $output; + } + + /** + * Returns true if this block is cacheable. + * + * @param Smarty $smarty + * @param $function + * + * @return bool + */ + protected function blockIsCacheable(\Smarty\Smarty $smarty, $function): bool { + return $smarty->getBlockHandler($function)->isCacheable(); + } + + /** + * Returns the code used for the isset check + * + * @param string $tag tag name + * @param string $function base tag or method name + * + * @return string + */ + protected function getIsCallableCode($tag, $function): string { + return "\$_smarty_tpl->getSmarty()->getBlockHandler(" . var_export($function, true) . ")"; + } + + /** + * Returns the full code used to call the callback + * + * @param string $tag tag name + * @param string $function base tag or method name + * + * @return string + */ + protected function getFullCallbackCode($tag, $function): string { + return "\$_smarty_tpl->getSmarty()->getBlockHandler(" . var_export($function, true) . ")->handle"; + } + + /** + * @param Template $compiler + * @param array $args + * @param string|null $tag + * @param string|null $function + * + * @return string + */ + private function compileOpeningTag(Template $compiler, array $args, ?string $tag, ?string $function): string { + + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + $this->nesting++; + unset($_attr['nocache']); + $_params = 'array(' . implode(',', $this->formatParamsArray($_attr)) . ')'; + + if (!$this->blockIsCacheable($compiler->getSmarty(), $function)) { + $compiler->tag_nocache = true; + } + + if ($compiler->tag_nocache) { + // push a {nocache} tag onto the stack to prevent caching of this block + $this->openTag($compiler, 'nocache'); + } + + $this->openTag($compiler, $tag, [$_params, $compiler->tag_nocache]); + + // compile code + $output = "getIsCallableCode($tag, $function) .") {\nthrow new \\Smarty\\Exception('block tag \'{$tag}\' not callable or registered');\n}\n +echo " . $this->getFullCallbackCode($tag, $function) . "({$_params}, null, \$_smarty_tpl, \$_block_repeat); +while (\$_block_repeat) { + ob_start(); +?>"; + + return $output; + } + + /** + * @param Template $compiler + * @param string $tag + * @param array $parameter + * @param string|null $function + * + * @return string + * @throws CompilerException + * @throws Exception + */ + private function compileClosingTag(Template $compiler, string $tag, array $parameter, ?string $function): string { + + // closing tag of block plugin, restore nocache + $base_tag = substr($tag, 0, -5); + [$_params, $nocache_pushed] = $this->closeTag($compiler, $base_tag); + + // compile code + if (!isset($parameter['modifier_list'])) { + $mod_pre = $mod_post = $mod_content = ''; + $mod_content2 = 'ob_get_clean()'; + } else { + $mod_content2 = "\$_block_content{$this->nesting}"; + $mod_content = "\$_block_content{$this->nesting} = ob_get_clean();\n"; + $mod_pre = "ob_start();\n"; + $mod_post = 'echo ' . $compiler->compileModifier($parameter['modifier_list'], 'ob_get_clean()') + . ";\n"; + } + $output = "getFullCallbackCode($base_tag, $function); + $output .= "echo {$callback}({$_params}, {$mod_content2}, \$_smarty_tpl, \$_block_repeat);\n"; + $output .= "{$mod_post}}\n?>"; + + if ($nocache_pushed) { + // pop the pushed virtual nocache tag + $this->closeTag($compiler, 'nocache'); + $compiler->tag_nocache = true; + } + + return $output; + } + +} diff --git a/core/template/src/Compile/CompilerInterface.php b/core/template/src/Compile/CompilerInterface.php new file mode 100644 index 0000000..5f2cc7c --- /dev/null +++ b/core/template/src/Compile/CompilerInterface.php @@ -0,0 +1,26 @@ +getSmarty()->getRuntime('DefaultPluginHandler')->hasPlugin(" . + var_export($function, true) . ", 'block')"; + } + + /** + * @inheritDoc + */ + protected function getFullCallbackCode($tag, $function): string { + return "\$_smarty_tpl->getSmarty()->getRuntime('DefaultPluginHandler')->getCallback(" . + var_export($function, true) . ", 'block')"; + } + + /** + * @inheritDoc + */ + protected function blockIsCacheable(\Smarty\Smarty $smarty, $function): bool { + return true; + } + +} \ No newline at end of file diff --git a/core/template/src/Compile/DefaultHandlerFunctionCallCompiler.php b/core/template/src/Compile/DefaultHandlerFunctionCallCompiler.php new file mode 100644 index 0000000..e6d1138 --- /dev/null +++ b/core/template/src/Compile/DefaultHandlerFunctionCallCompiler.php @@ -0,0 +1,47 @@ +getAttributes($compiler, $args); + unset($_attr['nocache']); + + $_paramsArray = $this->formatParamsArray($_attr); + $_params = 'array(' . implode(',', $_paramsArray) . ')'; + + $output = "\$_smarty_tpl->getSmarty()->getRuntime('DefaultPluginHandler')->getCallback(" . var_export($function, true) . + ",'function')($_params, \$_smarty_tpl)"; + + if (!empty($parameter['modifierlist'])) { + $output = $compiler->compileModifier($parameter['modifierlist'], $output); + } + return "\n"; + } +} \ No newline at end of file diff --git a/core/template/src/Compile/FunctionCallCompiler.php b/core/template/src/Compile/FunctionCallCompiler.php new file mode 100644 index 0000000..107dd98 --- /dev/null +++ b/core/template/src/Compile/FunctionCallCompiler.php @@ -0,0 +1,79 @@ +getAttributes($compiler, $args); + unset($_attr['nocache']); + + $_paramsArray = $this->formatParamsArray($_attr); + $_params = 'array(' . implode(',', $_paramsArray) . ')'; + + + if ($functionHandler = $compiler->getSmarty()->getFunctionHandler($function)) { + + // not cacheable? + $compiler->tag_nocache = $compiler->tag_nocache || !$functionHandler->isCacheable(); + $output = "\$_smarty_tpl->getSmarty()->getFunctionHandler(" . var_export($function, true) . ")"; + $output .= "->handle($_params, \$_smarty_tpl)"; + } else { + $compiler->trigger_template_error("unknown function '{$function}'", null, true); + } + + if (!empty($parameter['modifierlist'])) { + $output = $compiler->compileModifier($parameter['modifierlist'], $output); + } + + return $output; + } +} diff --git a/core/template/src/Compile/Modifier/BCPluginWrapper.php b/core/template/src/Compile/Modifier/BCPluginWrapper.php new file mode 100644 index 0000000..0147651 --- /dev/null +++ b/core/template/src/Compile/Modifier/BCPluginWrapper.php @@ -0,0 +1,19 @@ +callback = $callback; + } + + /** + * @inheritDoc + */ + public function compile($params, \Smarty\Compiler\Template $compiler) { + return call_user_func($this->callback, $params, $compiler); + } +} \ No newline at end of file diff --git a/core/template/src/Compile/Modifier/Base.php b/core/template/src/Compile/Modifier/Base.php new file mode 100644 index 0000000..2ae5722 --- /dev/null +++ b/core/template/src/Compile/Modifier/Base.php @@ -0,0 +1,49 @@ +literal_compiler_param($params, 1, 'html'); + $char_set = $this->literal_compiler_param($params, 2, \Smarty\Smarty::$_CHARSET); + $double_encode = $this->literal_compiler_param($params, 3, true); + if (!$char_set) { + $char_set = \Smarty\Smarty::$_CHARSET; + } + switch ($esc_type) { + case 'html': + case 'force': + // in case of auto-escaping, and without the 'force' option, no double-escaping + if ($compiler->getSmarty()->escape_html && $esc_type != 'force') + return $params[0]; + // otherwise, escape the variable + return 'htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . + var_export($double_encode, true) . ')'; + // no break + case 'htmlall': + $compiler->setRawOutput(true); + return 'htmlentities(mb_convert_encoding((string)' . $params[ 0 ] . ', \'UTF-8\', ' . + var_export($char_set, true) . '), ENT_QUOTES, \'UTF-8\', ' . + var_export($double_encode, true) . ')'; + // no break + case 'url': + $compiler->setRawOutput(true); + return 'rawurlencode((string)' . $params[ 0 ] . ')'; + case 'urlpathinfo': + $compiler->setRawOutput(true); + return 'str_replace("%2F", "/", rawurlencode((string)' . $params[ 0 ] . '))'; + case 'quotes': + $compiler->setRawOutput(true); + // escape unescaped single quotes + return 'preg_replace("%(?setRawOutput(true); + // escape quotes and backslashes, newlines, etc. + // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements + return 'strtr((string)' . + $params[ 0 ] . + ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", + "\\n" => "\\\n", " "<\/", " Smarty Compiler: ' . $this->message . ' <-- '; + } + + /** + * @param int $line + */ + public function setLine($line) { + $this->line = $line; + } + + /** + * The template source snippet relating to the error + * + * @type string|null + */ + public $source = null; + + /** + * The raw text of the error message + * + * @type string|null + */ + public $desc = null; + + /** + * The resource identifier or template name + * + * @type string|null + */ + public $template = null; +} diff --git a/core/template/src/Data.php b/core/template/src/Data.php new file mode 100644 index 0000000..6ae823d --- /dev/null +++ b/core/template/src/Data.php @@ -0,0 +1,521 @@ +smarty = $smarty; + if (is_object($_parent)) { + // when object set up back pointer + $this->parent = $_parent; + } elseif (is_array($_parent)) { + // set up variable values + foreach ($_parent as $_key => $_val) { + $this->assign($_key, $_val); + } + } elseif ($_parent !== null) { + throw new Exception('Wrong type for template variables'); + } + } + + /** + * assigns a Smarty variable + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached + * @param int $scope one of self::SCOPE_* constants + * + * @return Data current Data (or Smarty or \Smarty\Template) instance for + * chaining + */ + public function assign($tpl_var, $value = null, $nocache = false, $scope = null) + { + if (is_array($tpl_var)) { + foreach ($tpl_var as $_key => $_val) { + $this->assign($_key, $_val, $nocache, $scope); + } + return $this; + } + switch ($scope ?? $this->getDefaultScope()) { + case self::SCOPE_GLOBAL: + case self::SCOPE_SMARTY: + $this->getSmarty()->assign($tpl_var, $value); + break; + case self::SCOPE_TPL_ROOT: + $ptr = $this; + while (isset($ptr->parent) && ($ptr->parent instanceof Template)) { + $ptr = $ptr->parent; + } + $ptr->assign($tpl_var, $value); + break; + case self::SCOPE_ROOT: + $ptr = $this; + while (isset($ptr->parent) && !($ptr->parent instanceof Smarty)) { + $ptr = $ptr->parent; + } + $ptr->assign($tpl_var, $value); + break; + case self::SCOPE_PARENT: + if ($this->parent) { + $this->parent->assign($tpl_var, $value); + } else { + // assign local as fallback + $this->assign($tpl_var, $value); + } + break; + case self::SCOPE_LOCAL: + default: + if (isset($this->tpl_vars[$tpl_var])) { + $this->tpl_vars[$tpl_var]->setValue($value); + if ($nocache) { + $this->tpl_vars[$tpl_var]->setNocache(true); + } + } else { + $this->tpl_vars[$tpl_var] = new Variable($value, $nocache); + } + } + + return $this; + } + + /** + * appends values to template variables + * + * @param array|string $tpl_var the template variable name(s) + * @param mixed $value the value to append + * @param bool $merge flag if array elements shall be merged + * @param bool $nocache if true any output of this variable will + * be not cached + * + * @return Data + * @api Smarty::append() + */ + public function append($tpl_var, $value = null, $merge = false, $nocache = false) + { + if (is_array($tpl_var)) { + foreach ($tpl_var as $_key => $_val) { + $this->append($_key, $_val, $merge, $nocache); + } + } else { + + $newValue = $this->getValue($tpl_var) ?? []; + if (!is_array($newValue)) { + $newValue = (array) $newValue; + } + + if ($merge && is_array($value)) { + foreach ($value as $_mkey => $_mval) { + $newValue[$_mkey] = $_mval; + } + } else { + $newValue[] = $value; + } + + $this->assign($tpl_var, $newValue, $nocache); + } + return $this; + } + + /** + * assigns a global Smarty variable + * + * @param string $varName the global variable name + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached + * + * @return Data + * @deprecated since 5.0 + */ + public function assignGlobal($varName, $value = null, $nocache = false) + { + trigger_error(__METHOD__ . " is deprecated. Use \\Smarty\\Smarty::assign() to assign a variable " . + " at the Smarty level.", E_USER_DEPRECATED); + return $this->getSmarty()->assign($varName, $value, $nocache); + } + + /** + * Returns a single or all template variables + * + * @param string $varName variable name or null + * @param bool $searchParents include parent templates? + * + * @return mixed variable value or or array of variables + * @api Smarty::getTemplateVars() + * + */ + public function getTemplateVars($varName = null, $searchParents = true) + { + if (isset($varName)) { + return $this->getValue($varName, $searchParents); + } + + return array_merge( + $this->parent && $searchParents ? $this->parent->getTemplateVars() : [], + array_map(function(Variable $var) { return $var->getValue(); }, $this->tpl_vars) + ); + } + + /** + * Wrapper for ::getVariable() + * + * @deprecated since 5.0 + * + * @param $varName + * @param $searchParents + * @param $errorEnable + * + * @return void + */ + public function _getVariable($varName, $searchParents = true, $errorEnable = true) { + trigger_error('Using ::_getVariable() to is deprecated and will be ' . + 'removed in a future release. Use getVariable() instead.', E_USER_DEPRECATED); + return $this->getVariable($varName, $searchParents, $errorEnable); + } + + /** + * Gets the object of a Smarty variable + * + * @param string $varName the name of the Smarty variable + * @param bool $searchParents search also in parent data + * @param bool $errorEnable + * + * @return Variable + */ + public function getVariable($varName, $searchParents = true, $errorEnable = true) { + if (isset($this->tpl_vars[$varName])) { + return $this->tpl_vars[$varName]; + } + + if ($searchParents && $this->parent) { + return $this->parent->getVariable($varName, $searchParents, $errorEnable); + } + + if ($errorEnable && $this->getSmarty()->error_unassigned) { + // force a notice + $x = $$varName; + } + return new UndefinedVariable(); + } + + /** + * Directly sets a complete Variable object in the variable with the given name. + * @param $varName + * @param Variable $variableObject + * + * @return void + */ + public function setVariable($varName, Variable $variableObject) { + $this->tpl_vars[$varName] = $variableObject; + } + + /** + * Indicates if given variable has been set. + * @param $varName + * + * @return bool + */ + public function hasVariable($varName): bool { + return !($this->getVariable($varName, true, false) instanceof UndefinedVariable); + } + + /** + * Returns the value of the Smarty\Variable given by $varName, or null if the variable does not exist. + * + * @param $varName + * @param bool $searchParents + * + * @return mixed|null + */ + public function getValue($varName, $searchParents = true) { + $variable = $this->getVariable($varName, $searchParents); + return isset($variable) ? $variable->getValue() : null; + } + + /** + * load config variables into template object + * + * @param array $new_config_vars + */ + public function assignConfigVars($new_config_vars, array $sections = []) { + + // copy global config vars + foreach ($new_config_vars['vars'] as $variable => $value) { + if ($this->getSmarty()->config_overwrite || !isset($this->config_vars[$variable])) { + $this->config_vars[$variable] = $value; + } else { + $this->config_vars[$variable] = array_merge((array)$this->config_vars[$variable], (array)$value); + } + } + + foreach ($sections as $tpl_section) { + if (isset($new_config_vars['sections'][$tpl_section])) { + foreach ($new_config_vars['sections'][$tpl_section]['vars'] as $variable => $value) { + if ($this->getSmarty()->config_overwrite || !isset($this->config_vars[$variable])) { + $this->config_vars[$variable] = $value; + } else { + $this->config_vars[$variable] = array_merge((array)$this->config_vars[$variable], (array)$value); + } + } + } + } + } + + /** + * Get Smarty object + * + * @return Smarty + */ + public function getSmarty() + { + return $this->smarty; + } + + /** + * clear the given assigned template variable(s). + * + * @param string|array $tpl_var the template variable(s) to clear + * + * @return Data + * + * @api Smarty::clearAssign() + */ + public function clearAssign($tpl_var) + { + if (is_array($tpl_var)) { + foreach ($tpl_var as $curr_var) { + unset($this->tpl_vars[ $curr_var ]); + } + } else { + unset($this->tpl_vars[ $tpl_var ]); + } + return $this; + } + + /** + * clear all the assigned template variables. + * + * @return Data + * + * @api Smarty::clearAllAssign() + */ + public function clearAllAssign() + { + $this->tpl_vars = array(); + return $this; + } + + /** + * clear a single or all config variables + * + * @param string|null $name variable name or null + * + * @return Data + * + * @api Smarty::clearConfig() + */ + public function clearConfig($name = null) + { + if (isset($name)) { + unset($this->config_vars[ $name ]); + } else { + $this->config_vars = array(); + } + return $this; + } + + /** + * Gets a config variable value + * + * @param string $varName the name of the config variable + * + * @return mixed the value of the config variable + * @throws Exception + */ + public function getConfigVariable($varName) + { + + if (isset($this->config_vars[$varName])) { + return $this->config_vars[$varName]; + } + + $returnValue = $this->parent ? $this->parent->getConfigVariable($varName) : null; + + if ($returnValue === null && $this->getSmarty()->error_unassigned) { + throw new Exception("Undefined variable $varName"); + } + + return $returnValue; + } + + public function hasConfigVariable($varName): bool { + try { + return $this->getConfigVariable($varName) !== null; + } catch (Exception $e) { + return false; + } + } + + /** + * Returns a single or all config variables + * + * @param string $varname variable name or null + * + * @return mixed variable value or or array of variables + * @throws Exception + * + * @api Smarty::getConfigVars() + */ + public function getConfigVars($varname = null) + { + if (isset($varname)) { + return $this->getConfigVariable($varname); + } + + return array_merge($this->parent ? $this->parent->getConfigVars() : [], $this->config_vars); + } + + /** + * load a config file, optionally load just selected sections + * + * @param string $config_file filename + * @param mixed $sections array of section names, single + * section or null + + * @returns $this + * @throws \Exception + * + * @api Smarty::configLoad() + */ + public function configLoad($config_file, $sections = null) + { + $template = $this->getSmarty()->doCreateTemplate($config_file, null, null, $this, null, null, true); + $template->caching = Smarty::CACHING_OFF; + $template->assign('sections', (array) $sections ?? []); + // trigger a call to $this->assignConfigVars + $template->fetch(); + return $this; + } + + /** + * Sets the default scope for new variables assigned in this template. + * @param int $scope + * + * @return void + */ + protected function setDefaultScope(int $scope) { + $this->defaultScope = $scope; + } + + /** + * Returns the default scope for new variables assigned in this template. + * @return int + */ + public function getDefaultScope(): int { + return $this->defaultScope; + } + + /** + * @return Data|Smarty|null + */ + public function getParent() { + return $this->parent; + } + + /** + * @param Data|Smarty|null $parent + */ + public function setParent($parent): void { + $this->parent = $parent; + } + + public function pushStack(): void { + $stackList = []; + foreach ($this->tpl_vars as $name => $variable) { + $stackList[$name] = clone $variable; // variables are stored in Variable objects + } + $this->_var_stack[] = $this->tpl_vars; + $this->tpl_vars = $stackList; + + $this->_config_stack[] = $this->config_vars; + } + + public function popStack(): void { + $this->tpl_vars = array_pop($this->_var_stack); + $this->config_vars = array_pop($this->_config_stack); + } +} diff --git a/core/template/src/Debug.php b/core/template/src/Debug.php new file mode 100644 index 0000000..ab1a887 --- /dev/null +++ b/core/template/src/Debug.php @@ -0,0 +1,370 @@ +_isSubTpl()) { + $this->index++; + $this->offset++; + $this->template_data[ $this->index ] = null; + } + $key = $this->get_key($template); + $this->template_data[ $this->index ][ $key ][ 'start_template_time' ] = microtime(true); + } + + /** + * End logging of cache time + * + * @param Template $template cached template + */ + public function end_template(Template $template) + { + $key = $this->get_key($template); + $this->template_data[ $this->index ][ $key ][ 'total_time' ] += + microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_template_time' ]; + } + + /** + * Start logging of compile time + * + * @param Template $template + */ + public function start_compile(Template $template) + { + static $_is_stringy = array('string' => true, 'eval' => true); + if (!empty($template->getCompiler()->trace_uid)) { + $key = $template->getCompiler()->trace_uid; + if (!isset($this->template_data[ $this->index ][ $key ])) { + $this->saveTemplateData($_is_stringy, $template, $key); + } + } else { + if (isset($this->ignore_uid[ $template->getSource()->uid ])) { + return; + } + $key = $this->get_key($template); + } + $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true); + } + + /** + * End logging of compile time + * + * @param Template $template + */ + public function end_compile(Template $template) + { + if (!empty($template->getCompiler()->trace_uid)) { + $key = $template->getCompiler()->trace_uid; + } else { + if (isset($this->ignore_uid[ $template->getSource()->uid ])) { + return; + } + $key = $this->get_key($template); + } + $this->template_data[ $this->index ][ $key ][ 'compile_time' ] += + microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ]; + } + + /** + * Start logging of render time + * + * @param Template $template + */ + public function start_render(Template $template) + { + $key = $this->get_key($template); + $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true); + } + + /** + * End logging of compile time + * + * @param Template $template + */ + public function end_render(Template $template) + { + $key = $this->get_key($template); + $this->template_data[ $this->index ][ $key ][ 'render_time' ] += + microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ]; + } + + /** + * Start logging of cache time + * + * @param Template $template cached template + */ + public function start_cache(Template $template) + { + $key = $this->get_key($template); + $this->template_data[ $this->index ][ $key ][ 'start_time' ] = microtime(true); + } + + /** + * End logging of cache time + * + * @param Template $template cached template + */ + public function end_cache(Template $template) + { + $key = $this->get_key($template); + $this->template_data[ $this->index ][ $key ][ 'cache_time' ] += + microtime(true) - $this->template_data[ $this->index ][ $key ][ 'start_time' ]; + } + + /** + * Register template object + * + * @param Template $template cached template + */ + public function register_template(Template $template) + { + } + + /** + * Register data object + * + * @param Data $data data object + */ + public static function register_data(Data $data) + { + } + + /** + * Opens a window for the Smarty Debugging Console and display the data + * + * @param Template|Smarty $obj object to debug + * @param bool $full + * + * @throws \Exception + * @throws Exception + */ + public function display_debug($obj, bool $full = false) + { + if (!$full) { + $this->offset++; + $savedIndex = $this->index; + $this->index = 9999; + } + $smarty = $obj->getSmarty(); + // create fresh instance of smarty for displaying the debug console + // to avoid problems if the application did overload the Smarty class + $debObj = new Smarty(); + // copy the working dirs from application + $debObj->setCompileDir($smarty->getCompileDir()); + $debObj->compile_check = Smarty::COMPILECHECK_ON; + $debObj->security_policy = null; + $debObj->debugging = false; + $debObj->debugging_ctrl = 'NONE'; + $debObj->error_reporting = E_ALL & ~E_NOTICE; + $debObj->debug_tpl = $smarty->debug_tpl ?? 'file:' . __DIR__ . '/debug.tpl'; + $debObj->registered_resources = array(); + $debObj->escape_html = true; + $debObj->caching = Smarty::CACHING_OFF; + // prepare information of assigned variables + $ptr = $this->get_debug_vars($obj); + $_assigned_vars = $ptr->tpl_vars; + ksort($_assigned_vars); + $_config_vars = $ptr->config_vars; + ksort($_config_vars); + $debugging = $smarty->debugging; + $templateName = $obj->getSource()->type . ':' . $obj->getSource()->name; + $displayMode = $debugging === 2 || !$full; + $offset = $this->offset * 50; + $_template = $debObj->doCreateTemplate($debObj->debug_tpl); + if ($obj instanceof Template) { + $_template->assign('template_name', $templateName); + } elseif ($obj instanceof Smarty || $full) { + $_template->assign('template_data', $this->template_data[$this->index]); + } else { + $_template->assign('template_data', null); + } + $_template->assign('assigned_vars', $_assigned_vars); + $_template->assign('config_vars', $_config_vars); + $_template->assign('execution_time', microtime(true) - $smarty->start_time); + $_template->assign('targetWindow', $displayMode ? md5("$offset$templateName") : '__Smarty__'); + $_template->assign('offset', $offset); + echo $_template->fetch(); + if (isset($full)) { + $this->index--; + } + if (!$full) { + $this->index = $savedIndex; + } + } + + /** + * Recursively gets variables from all template/data scopes + * + * @param \Smarty\Data $obj object to debug + * + * @return \StdClass + */ + private function get_debug_vars($obj) + { + $config_vars = array(); + foreach ($obj->config_vars as $key => $var) { + $config_vars[$key]['value'] = $var; + $config_vars[$key]['scope'] = get_class($obj) . ':' . spl_object_id($obj); + } + $tpl_vars = array(); + foreach ($obj->tpl_vars as $key => $var) { + foreach ($var as $varkey => $varvalue) { + if ($varkey === 'value') { + $tpl_vars[ $key ][ $varkey ] = $varvalue; + } else { + if ($varkey === 'nocache') { + if ($varvalue === true) { + $tpl_vars[ $key ][ $varkey ] = $varvalue; + } + } else { + if ($varkey !== 'scope' || $varvalue !== 0) { + $tpl_vars[ $key ][ 'attributes' ][ $varkey ] = $varvalue; + } + } + } + } + $tpl_vars[$key]['scope'] = get_class($obj) . ':' . spl_object_id($obj); + } + if (isset($obj->parent)) { + $parent = $this->get_debug_vars($obj->parent); + foreach ($parent->tpl_vars as $name => $pvar) { + if (isset($tpl_vars[ $name ]) && $tpl_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) { + $tpl_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ]; + } + } + $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars); + foreach ($parent->config_vars as $name => $pvar) { + if (isset($config_vars[ $name ]) && $config_vars[ $name ][ 'value' ] === $pvar[ 'value' ]) { + $config_vars[ $name ][ 'scope' ] = $pvar[ 'scope' ]; + } + } + $config_vars = array_merge($parent->config_vars, $config_vars); + } + return (object)array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars); + } + + /** + * Return key into $template_data for template + * + * @param Template $template template object + * + * @return string key into $template_data + */ + private function get_key(Template $template) + { + static $_is_stringy = array('string' => true, 'eval' => true); + + $key = $template->getSource()->uid; + if (isset($this->template_data[ $this->index ][ $key ])) { + return $key; + } else { + $this->saveTemplateData($_is_stringy, $template, $key); + $this->template_data[ $this->index ][ $key ][ 'total_time' ] = 0; + return $key; + } + } + + /** + * Ignore template + * + * @param Template $template + */ + public function ignore(Template $template) + { + $this->ignore_uid[$template->getSource()->uid] = true; + } + + /** + * handle 'URL' debugging mode + * + * @param Smarty $smarty + */ + public function debugUrl(Smarty $smarty) + { + if (isset($_SERVER[ 'QUERY_STRING' ])) { + $_query_string = $_SERVER[ 'QUERY_STRING' ]; + } else { + $_query_string = ''; + } + if (false !== strpos($_query_string, $smarty->smarty_debug_id)) { + if (false !== strpos($_query_string, $smarty->smarty_debug_id . '=on')) { + // enable debugging for this browser session + setcookie('SMARTY_DEBUG', true); + $smarty->debugging = true; + } elseif (false !== strpos($_query_string, $smarty->smarty_debug_id . '=off')) { + // disable debugging for this browser session + setcookie('SMARTY_DEBUG', false); + $smarty->debugging = false; + } else { + // enable debugging for this page + $smarty->debugging = true; + } + } else { + if (isset($_COOKIE[ 'SMARTY_DEBUG' ])) { + $smarty->debugging = true; + } + } + } + + /** + * @param array $_is_stringy + * @param Template $template + * @param string $key + * + * @return void + */ + private function saveTemplateData(array $_is_stringy, Template $template, string $key): void { + if (isset($_is_stringy[$template->getSource()->type])) { + $this->template_data[$this->index][$key]['name'] = + '\'' . substr($template->getSource()->name, 0, 25) . '...\''; + } else { + $this->template_data[$this->index][$key]['name'] = $template->getSource()->getResourceName(); + } + $this->template_data[$this->index][$key]['compile_time'] = 0; + $this->template_data[$this->index][$key]['render_time'] = 0; + $this->template_data[$this->index][$key]['cache_time'] = 0; + } +} diff --git a/core/template/src/ErrorHandler.php b/core/template/src/ErrorHandler.php new file mode 100644 index 0000000..05b1cb3 --- /dev/null +++ b/core/template/src/ErrorHandler.php @@ -0,0 +1,97 @@ +propName} where propName is undefined. + * @var bool + */ + public $allowUndefinedProperties = true; + + /** + * Allows {$foo.bar} where bar is unset and {$foo.bar1.bar2} where either bar1 or bar2 is unset. + * @var bool + */ + public $allowUndefinedArrayKeys = true; + + /** + * Allows {$foo->bar} where bar is not an object (e.g. null or false). + * @var bool + */ + public $allowDereferencingNonObjects = true; + + private $previousErrorHandler = null; + + /** + * Enable error handler to intercept errors + */ + public function activate() { + /* + Error muting is done because some people implemented custom error_handlers using + https://php.net/set_error_handler and for some reason did not understand the following paragraph: + + It is important to remember that the standard PHP error handler is completely bypassed for the + error types specified by error_types unless the callback function returns FALSE. + error_reporting() settings will have no effect and your error handler will be called regardless - + however you are still able to read the current value of error_reporting and act appropriately. + Of particular note is that this value will be 0 if the statement that caused the error was + prepended by the @ error-control operator. + */ + $this->previousErrorHandler = set_error_handler([$this, 'handleError']); + } + + /** + * Disable error handler + */ + public function deactivate() { + restore_error_handler(); + $this->previousErrorHandler = null; + } + + /** + * Error Handler to mute expected messages + * + * @link https://php.net/set_error_handler + * + * @param integer $errno Error level + * @param $errstr + * @param $errfile + * @param $errline + * @param $errcontext + * + * @return bool + */ + public function handleError($errno, $errstr, $errfile, $errline, $errcontext = []) + { + if ($this->allowUndefinedProperties && preg_match( + '/^(Undefined property)/', + $errstr + )) { + return; // suppresses this error + } + + if ($this->allowUndefinedArrayKeys && preg_match( + '/^(Undefined index|Undefined array key|Trying to access array offset on)/', + $errstr + )) { + return; // suppresses this error + } + + if ($this->allowDereferencingNonObjects && preg_match( + '/^Attempt to read property ".+?" on/', + $errstr + )) { + return; // suppresses this error + } + + // pass all other errors through to the previous error handler or to the default PHP error handler + return $this->previousErrorHandler ? + call_user_func($this->previousErrorHandler, $errno, $errstr, $errfile, $errline, $errcontext) : false; + } +} diff --git a/core/template/src/Exception.php b/core/template/src/Exception.php new file mode 100644 index 0000000..0f75f56 --- /dev/null +++ b/core/template/src/Exception.php @@ -0,0 +1,16 @@ + Smarty: ' . $this->message . ' <-- '; + } +} diff --git a/core/template/src/Extension/BCPluginsAdapter.php b/core/template/src/Extension/BCPluginsAdapter.php new file mode 100644 index 0000000..77b47f8 --- /dev/null +++ b/core/template/src/Extension/BCPluginsAdapter.php @@ -0,0 +1,229 @@ +smarty = $smarty; + } + + private function findPlugin($type, $name): ?array { + if (null !== $plugin = $this->smarty->getRegisteredPlugin($type, $name)) { + return $plugin; + } + + return null; + } + + public function getTagCompiler(string $tag): ?\Smarty\Compile\CompilerInterface { + + $plugin = $this->findPlugin(\Smarty\Smarty::PLUGIN_COMPILER, $tag); + if ($plugin === null) { + return null; + } + + if (is_callable($plugin[0])) { + $callback = $plugin[0]; + $cacheable = (bool) $plugin[1] ?? true; + return new TagPluginWrapper($callback, $cacheable); + } elseif (class_exists($plugin[0])) { + $compiler = new $plugin[0]; + if ($compiler instanceof CompilerInterface) { + return $compiler; + } + } + + return null; + } + + public function getFunctionHandler(string $functionName): ?\Smarty\FunctionHandler\FunctionHandlerInterface { + $plugin = $this->findPlugin(\Smarty\Smarty::PLUGIN_FUNCTION, $functionName); + if ($plugin === null) { + return null; + } + $callback = $plugin[0]; + $cacheable = (bool) $plugin[1] ?? true; + + return new FunctionPluginWrapper($callback, $cacheable); + + } + + public function getBlockHandler(string $blockTagName): ?\Smarty\BlockHandler\BlockHandlerInterface { + $plugin = $this->findPlugin(\Smarty\Smarty::PLUGIN_BLOCK, $blockTagName); + if ($plugin === null) { + return null; + } + $callback = $plugin[0]; + $cacheable = (bool) $plugin[1] ?? true; + + return new BlockPluginWrapper($callback, $cacheable); + } + + public function getModifierCallback(string $modifierName) { + + $plugin = $this->findPlugin(\Smarty\Smarty::PLUGIN_MODIFIER, $modifierName); + if ($plugin === null) { + return null; + } + return $plugin[0]; + } + + public function getModifierCompiler(string $modifier): ?\Smarty\Compile\Modifier\ModifierCompilerInterface { + $plugin = $this->findPlugin(\Smarty\Smarty::PLUGIN_MODIFIERCOMPILER, $modifier); + if ($plugin === null) { + return null; + } + $callback = $plugin[0]; + + return new ModifierCompilerPluginWrapper($callback); + } + + /** + * @var array + */ + private $preFilters = []; + + public function getPreFilters(): array { + return $this->preFilters; + } + + public function addPreFilter(\Smarty\Filter\FilterInterface $filter) { + $this->preFilters[] = $filter; + } + + public function addCallableAsPreFilter(callable $callable, ?string $name = null) { + if ($name === null) { + $this->preFilters[] = new FilterPluginWrapper($callable); + } else { + $this->preFilters[$name] = new FilterPluginWrapper($callable); + } + } + + public function removePrefilter(string $name) { + unset($this->preFilters[$name]); + } + + /** + * @var array + */ + private $postFilters = []; + + public function getPostFilters(): array { + return $this->postFilters; + } + + public function addPostFilter(\Smarty\Filter\FilterInterface $filter) { + $this->postFilters[] = $filter; + } + + public function addCallableAsPostFilter(callable $callable, ?string $name = null) { + if ($name === null) { + $this->postFilters[] = new FilterPluginWrapper($callable); + } else { + $this->postFilters[$name] = new FilterPluginWrapper($callable); + } + } + + public function removePostFilter(string $name) { + unset($this->postFilters[$name]); + } + + + /** + * @var array + */ + private $outputFilters = []; + + public function getOutputFilters(): array { + return $this->outputFilters; + } + + public function addOutputFilter(\Smarty\Filter\FilterInterface $filter) { + $this->outputFilters[] = $filter; + } + + public function addCallableAsOutputFilter(callable $callable, ?string $name = null) { + if ($name === null) { + $this->outputFilters[] = new FilterPluginWrapper($callable); + } else { + $this->outputFilters[$name] = new FilterPluginWrapper($callable); + } + } + + public function removeOutputFilter(string $name) { + unset($this->outputFilters[$name]); + } + + public function loadPluginsFromDir(string $path) { + foreach([ + 'function', + 'modifier', + 'block', + 'compiler', + 'prefilter', + 'postfilter', + 'outputfilter', + 'modifiercompiler', + ] as $type) { + foreach (glob($path . $type . '.?*.php') as $filename) { + $pluginName = $this->getPluginNameFromFilename($filename); + if ($pluginName !== null) { + require_once $filename; + $functionOrClassName = 'smarty_' . $type . '_' . $pluginName; + if (function_exists($functionOrClassName) || class_exists($functionOrClassName)) { + $this->smarty->registerPlugin($type, $pluginName, $functionOrClassName, true, []); + } + } + } + } + + $type = 'resource'; + foreach (glob($path . $type . '.?*.php') as $filename) { + $pluginName = $this->getPluginNameFromFilename($filename); + if ($pluginName !== null) { + require_once $filename; + if (class_exists($className = 'smarty_' . $type . '_' . $pluginName)) { + $this->smarty->registerResource($pluginName, new $className()); + } + } + } + + $type = 'cacheresource'; + foreach (glob($path . $type . '.?*.php') as $filename) { + $pluginName = $this->getPluginNameFromFilename($filename); + if ($pluginName !== null) { + require_once $filename; + if (class_exists($className = 'smarty_' . $type . '_' . $pluginName)) { + $this->smarty->registerCacheResource($pluginName, new $className()); + } + } + } + + } + + /** + * @param $filename + * + * @return string|null + */ + private function getPluginNameFromFilename($filename) { + if (!preg_match('/.*\.([a-z_A-Z0-9]+)\.php$/',$filename,$matches)) { + return null; + } + return $matches[1]; + } + +} diff --git a/core/template/src/Extension/Base.php b/core/template/src/Extension/Base.php new file mode 100644 index 0000000..b37b6ac --- /dev/null +++ b/core/template/src/Extension/Base.php @@ -0,0 +1,41 @@ +callback = $callback; + $this->modifierName = $modifierName; + } + + public function handle(...$params) { + try { + return ($this->callback)(...$params); + } catch (\ArgumentCountError $e) { + throw new Exception("Invalid number of arguments to modifier " . $this->modifierName); + } + } + +} \ No newline at end of file diff --git a/core/template/src/Extension/CoreExtension.php b/core/template/src/Extension/CoreExtension.php new file mode 100644 index 0000000..a7c658d --- /dev/null +++ b/core/template/src/Extension/CoreExtension.php @@ -0,0 +1,49 @@ +modifiers[$modifier])) { + return $this->modifiers[$modifier]; + } + + switch ($modifier) { + case 'cat': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\CatModifierCompiler(); break; + case 'count_characters': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\CountCharactersModifierCompiler(); break; + case 'count_paragraphs': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\CountParagraphsModifierCompiler(); break; + case 'count_sentences': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\CountSentencesModifierCompiler(); break; + case 'count_words': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\CountWordsModifierCompiler(); break; + case 'default': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\DefaultModifierCompiler(); break; + case 'empty': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\EmptyModifierCompiler(); break; + case 'escape': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\EscapeModifierCompiler(); break; + case 'from_charset': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\FromCharsetModifierCompiler(); break; + case 'indent': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\IndentModifierCompiler(); break; + case 'is_array': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\IsArrayModifierCompiler(); break; + case 'isset': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\IssetModifierCompiler(); break; + case 'json_encode': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\JsonEncodeModifierCompiler(); break; + case 'lower': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\LowerModifierCompiler(); break; + case 'nl2br': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\Nl2brModifierCompiler(); break; + case 'noprint': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\NoPrintModifierCompiler(); break; + case 'raw': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\RawModifierCompiler(); break; + case 'round': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\RoundModifierCompiler(); break; + case 'str_repeat': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\StrRepeatModifierCompiler(); break; + case 'string_format': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\StringFormatModifierCompiler(); break; + case 'strip': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\StripModifierCompiler(); break; + case 'strip_tags': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\StripTagsModifierCompiler(); break; + case 'strlen': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\StrlenModifierCompiler(); break; + case 'substr': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\SubstrModifierCompiler(); break; + case 'to_charset': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\ToCharsetModifierCompiler(); break; + case 'unescape': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\UnescapeModifierCompiler(); break; + case 'upper': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\UpperModifierCompiler(); break; + case 'wordwrap': $this->modifiers[$modifier] = new \Smarty\Compile\Modifier\WordWrapModifierCompiler(); break; + } + + return $this->modifiers[$modifier] ?? null; + } + + public function getModifierCallback(string $modifierName) { + switch ($modifierName) { + case 'capitalize': return [$this, 'smarty_modifier_capitalize']; + case 'count': return [$this, 'smarty_modifier_count']; + case 'date_format': return [$this, 'smarty_modifier_date_format']; + case 'debug_print_var': return [$this, 'smarty_modifier_debug_print_var']; + case 'escape': return [$this, 'smarty_modifier_escape']; + case 'explode': return [$this, 'smarty_modifier_explode']; + case 'implode': return [$this, 'smarty_modifier_implode']; + case 'in_array': return [$this, 'smarty_modifier_in_array']; + case 'join': return [$this, 'smarty_modifier_join']; + case 'mb_wordwrap': return [$this, 'smarty_modifier_mb_wordwrap']; + case 'number_format': return [$this, 'smarty_modifier_number_format']; + case 'regex_replace': return [$this, 'smarty_modifier_regex_replace']; + case 'replace': return [$this, 'smarty_modifier_replace']; + case 'spacify': return [$this, 'smarty_modifier_spacify']; + case 'split': return [$this, 'smarty_modifier_split']; + case 'truncate': return [$this, 'smarty_modifier_truncate']; + } + return null; + } + + public function getFunctionHandler(string $functionName): ?\Smarty\FunctionHandler\FunctionHandlerInterface { + + if (isset($this->functionHandlers[$functionName])) { + return $this->functionHandlers[$functionName]; + } + + switch ($functionName) { + case 'count': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\Count(); break; + case 'counter': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\Counter(); break; + case 'cycle': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\Cycle(); break; + case 'fetch': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\Fetch(); break; + case 'html_checkboxes': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlCheckboxes(); break; + case 'html_image': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlImage(); break; + case 'html_options': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlOptions(); break; + case 'html_radios': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlRadios(); break; + case 'html_select_date': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlSelectDate(); break; + case 'html_select_time': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlSelectTime(); break; + case 'html_table': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\HtmlTable(); break; + case 'mailto': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\Mailto(); break; + case 'math': $this->functionHandlers[$functionName] = new \Smarty\FunctionHandler\Math(); break; + } + + return $this->functionHandlers[$functionName] ?? null; + } + + public function getBlockHandler(string $blockTagName): ?\Smarty\BlockHandler\BlockHandlerInterface { + + switch ($blockTagName) { + case 'textformat': $this->blockHandlers[$blockTagName] = new \Smarty\BlockHandler\TextFormat(); break; + } + + return $this->blockHandlers[$blockTagName] ?? null; + } + + /** + * Smarty spacify modifier plugin + * Type: modifier + * Name: spacify + * Purpose: add spaces between characters in a string + * + * @author Monte Ohrt + * + * @param string $string input string + * @param string $spacify_char string to insert between characters. + * + * @return string + */ + public function smarty_modifier_spacify($string, $spacify_char = ' ') + { + // well… what about charsets besides latin and UTF-8? + return implode($spacify_char, preg_split('//' . \Smarty\Smarty::$_UTF8_MODIFIER, $string, -1, PREG_SPLIT_NO_EMPTY)); + } + + /** + * Smarty capitalize modifier plugin + * Type: modifier + * Name: capitalize + * Purpose: capitalize words in the string + * {@internal {$string|capitalize:true:true} is the fastest option for MBString enabled systems }} + * + * @param string $string string to capitalize + * @param boolean $uc_digits also capitalize "x123" to "X123" + * @param boolean $lc_rest capitalize first letters, lowercase all following letters "aAa" to "Aaa" + * + * @return string capitalized string + * @author Monte Ohrt + * @author Rodney Rehm + */ + public function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false) + { + $string = (string) $string; + + if ($lc_rest) { + // uppercase (including hyphenated words) + $upper_string = mb_convert_case($string, MB_CASE_TITLE, \Smarty\Smarty::$_CHARSET); + } else { + // uppercase word breaks + $upper_string = preg_replace_callback( + "!(^|[^\p{L}'])([\p{Ll}])!S" . \Smarty\Smarty::$_UTF8_MODIFIER, + function ($matches) { + return stripslashes($matches[1]) . + mb_convert_case(stripslashes($matches[2]), MB_CASE_UPPER, \Smarty\Smarty::$_CHARSET); + }, + $string + ); + } + // check uc_digits case + if (!$uc_digits) { + if (preg_match_all( + "!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . \Smarty\Smarty::$_UTF8_MODIFIER, + $string, + $matches, + PREG_OFFSET_CAPTURE + ) + ) { + foreach ($matches[ 1 ] as $match) { + $upper_string = + substr_replace( + $upper_string, + mb_strtolower($match[ 0 ], \Smarty\Smarty::$_CHARSET), + $match[ 1 ], + strlen($match[ 0 ]) + ); + } + } + } + $upper_string = + preg_replace_callback( + "!((^|\s)['\"])(\w)!" . \Smarty\Smarty::$_UTF8_MODIFIER, + function ($matches) { + return stripslashes( + $matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), + MB_CASE_UPPER, + \Smarty\Smarty::$_CHARSET + ); + }, + $upper_string + ); + return $upper_string; + } + + /** + * Smarty count modifier plugin + * Type: modifier + * Name: count + * Purpose: counts all elements in an array or in a Countable object + * Input: + * - Countable|array: array or object to count + * - mode: int defaults to 0 for normal count mode, if set to 1 counts recursive + * + * @param mixed $arrayOrObject input array/object + * @param int $mode count mode + * + * @return int + */ + public function smarty_modifier_count($arrayOrObject, $mode = 0) { + /* + * @see https://www.php.net/count + * > Prior to PHP 8.0.0, if the parameter was neither an array nor an object that implements the Countable interface, + * > 1 would be returned, unless value was null, in which case 0 would be returned. + */ + + if ($arrayOrObject instanceof \Countable || is_array($arrayOrObject)) { + return count($arrayOrObject, (int) $mode); + } elseif ($arrayOrObject === null) { + return 0; + } + return 1; + } + + /** + * Smarty date_format modifier plugin + * Type: modifier + * Name: date_format + * Purpose: format datestamps via strftime + * Input: + * - string: input date string + * - format: strftime format for output + * - default_date: default date if $string is empty + * + * @author Monte Ohrt + * + * @param string $string input date string + * @param string $format strftime format for output + * @param string $default_date default date if $string is empty + * @param string $formatter either 'strftime' or 'auto' + * + * @return string |void + * @uses smarty_make_timestamp() + */ + public function smarty_modifier_date_format($string, $format = null, $default_date = '', $formatter = 'auto') + { + if ($format === null) { + $format = \Smarty\Smarty::$_DATE_FORMAT; + } + + if (!empty($string) && $string !== '0000-00-00' && $string !== '0000-00-00 00:00:00') { + $timestamp = smarty_make_timestamp($string); + } elseif (!empty($default_date)) { + $timestamp = smarty_make_timestamp($default_date); + } else { + return; + } + if ($formatter === 'strftime' || ($formatter === 'auto' && strpos($format, '%') !== false)) { + if (\Smarty\Smarty::$_IS_WINDOWS) { + $_win_from = array( + '%D', + '%h', + '%n', + '%r', + '%R', + '%t', + '%T' + ); + $_win_to = array( + '%m/%d/%y', + '%b', + "\n", + '%I:%M:%S %p', + '%H:%M', + "\t", + '%H:%M:%S' + ); + if (strpos($format, '%e') !== false) { + $_win_from[] = '%e'; + $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); + } + if (strpos($format, '%l') !== false) { + $_win_from[] = '%l'; + $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); + } + $format = str_replace($_win_from, $_win_to, $format); + } + // @ to suppress deprecation errors when running in PHP8.1 or higher. + return @strftime($format, $timestamp); + } else { + return date($format, $timestamp); + } + } + + /** + * Smarty debug_print_var modifier plugin + * Type: modifier + * Name: debug_print_var + * Purpose: formats variable contents for display in the console + * + * @author Monte Ohrt + * + * @param array|object $var variable to be formatted + * @param int $max maximum recursion depth if $var is an array or object + * @param int $length maximum string length if $var is a string + * @param int $depth actual recursion depth + * @param array $objects processed objects in actual depth to prevent recursive object processing + * + * @return string + */ + public function smarty_modifier_debug_print_var($var, $max = 10, $length = 40, $depth = 0, $objects = array()) + { + $_replace = array("\n" => '\n', "\r" => '\r', "\t" => '\t'); + switch (gettype($var)) { + case 'array': + $results = 'Array (' . count($var) . ')'; + if ($depth === $max) { + break; + } + foreach ($var as $curr_key => $curr_val) { + $results .= '
' . str_repeat(' ', $depth * 2) . '' . strtr($curr_key, $_replace) . + ' => ' . + $this->smarty_modifier_debug_print_var($curr_val, $max, $length, ++$depth, $objects); + $depth--; + } + break; + case 'object': + $object_vars = get_object_vars($var); + $results = '' . get_class($var) . ' Object (' . count($object_vars) . ')'; + if (in_array($var, $objects)) { + $results .= ' called recursive'; + break; + } + if ($depth === $max) { + break; + } + $objects[] = $var; + foreach ($object_vars as $curr_key => $curr_val) { + $results .= '
' . str_repeat(' ', $depth * 2) . ' ->' . strtr($curr_key, $_replace) . + ' = ' . $this->smarty_modifier_debug_print_var($curr_val, $max, $length, ++$depth, $objects); + $depth--; + } + break; + case 'boolean': + case 'NULL': + case 'resource': + if (true === $var) { + $results = 'true'; + } elseif (false === $var) { + $results = 'false'; + } elseif (null === $var) { + $results = 'null'; + } else { + $results = htmlspecialchars((string)$var); + } + $results = '' . $results . ''; + break; + case 'integer': + case 'float': + $results = htmlspecialchars((string)$var); + break; + case 'string': + $results = strtr($var, $_replace); + if (mb_strlen($var, \Smarty\Smarty::$_CHARSET) > $length) { + $results = mb_substr($var, 0, $length - 3, \Smarty\Smarty::$_CHARSET) . '...'; + } + $results = htmlspecialchars('"' . $results . '"', ENT_QUOTES, \Smarty\Smarty::$_CHARSET); + break; + case 'unknown type': + default: + $results = strtr((string)$var, $_replace); + if (mb_strlen($results, \Smarty\Smarty::$_CHARSET) > $length) { + $results = mb_substr($results, 0, $length - 3, \Smarty\Smarty::$_CHARSET) . '...'; + } + $results = htmlspecialchars($results, ENT_QUOTES, \Smarty\Smarty::$_CHARSET); + } + return $results; + } + + /** + * Smarty escape modifier plugin + * Type: modifier + * Name: escape + * Purpose: escape string for output + * + * @author Monte Ohrt + * + * @param string $string input string + * @param string $esc_type escape type + * @param string $char_set character set, used for htmlspecialchars() or htmlentities() + * @param boolean $double_encode encode already encoded entitites again, used for htmlspecialchars() or htmlentities() + * + * @return string escaped input string + */ + public function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true) + { + if (!$char_set) { + $char_set = \Smarty\Smarty::$_CHARSET; + } + + $string = (string)$string; + + switch ($esc_type) { + case 'html': + return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode); + // no break + case 'htmlall': + $string = mb_convert_encoding($string, 'UTF-8', $char_set); + return htmlentities($string, ENT_QUOTES, 'UTF-8', $double_encode); + // no break + case 'url': + return rawurlencode($string); + case 'urlpathinfo': + return str_replace('%2F', '/', rawurlencode($string)); + case 'quotes': + // escape unescaped single quotes + return preg_replace("%(?mb_to_unicode($string, \Smarty\Smarty::$_CHARSET) as $unicode) { + $return .= '&#x' . strtoupper(dechex($unicode)) . ';'; + } + return $return; + case 'decentity': + $return = ''; + foreach ($this->mb_to_unicode($string, \Smarty\Smarty::$_CHARSET) as $unicode) { + $return .= '&#' . $unicode . ';'; + } + return $return; + case 'javascript': + // escape quotes and backslashes, newlines, etc. + return strtr( + $string, + array( + '\\' => '\\\\', + "'" => "\\'", + '"' => '\\"', + "\r" => '\\r', + "\n" => '\\n', + ' '<\/', + // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements + '#is', + $source, + $matches, + PREG_OFFSET_CAPTURE | PREG_SET_ORDER + ) + ) { + foreach ($matches as $match) { + $store[] = $match[ 0 ][ 0 ]; + $_length = strlen($match[ 0 ][ 0 ]); + $replace = '@!@SMARTY:' . $_store . ':SMARTY@!@'; + $source = substr_replace($source, $replace, $match[ 0 ][ 1 ] - $_offset, $_length); + $_offset += $_length - strlen($replace); + $_store++; + } + } + // Strip all HTML-Comments + // yes, even the ones in '; + } elseif ($encode === 'javascript_charcode') { + for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { + $ord[] = ord($string[$x]); + } + return ''; + } elseif ($encode === 'hex') { + preg_match('!^(.*)(\?.*)$!', $address, $match); + if (!empty($match[2])) { + trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.", E_USER_WARNING); + return; + } + $address_encode = ''; + for ($x = 0, $_length = strlen($address); $x < $_length; $x++) { + if (preg_match('!\w!' . \Smarty\Smarty::$_UTF8_MODIFIER, $address[$x])) { + $address_encode .= '%' . bin2hex($address[$x]); + } else { + $address_encode .= $address[$x]; + } + } + $text_encode = ''; + for ($x = 0, $_length = strlen($text); $x < $_length; $x++) { + $text_encode .= '&#x' . bin2hex($text[$x]) . ';'; + } + $mailto = "mailto:"; + return '' . $text_encode . ''; + } else { + // no encoding + return $string; + } + } +} diff --git a/core/template/src/FunctionHandler/Math.php b/core/template/src/FunctionHandler/Math.php new file mode 100644 index 0000000..23ef925 --- /dev/null +++ b/core/template/src/FunctionHandler/Math.php @@ -0,0 +1,140 @@ + + * + * @param array $params parameters + * @param Template $template template object + * + * @return string|null + */ +class Math extends Base { + + public function handle($params, Template $template) { + static $_allowed_funcs = + [ + 'int' => true, + 'abs' => true, + 'ceil' => true, + 'acos' => true, + 'acosh' => true, + 'cos' => true, + 'cosh' => true, + 'deg2rad' => true, + 'rad2deg' => true, + 'exp' => true, + 'floor' => true, + 'log' => true, + 'log10' => true, + 'max' => true, + 'min' => true, + 'pi' => true, + 'pow' => true, + 'rand' => true, + 'round' => true, + 'asin' => true, + 'asinh' => true, + 'sin' => true, + 'sinh' => true, + 'sqrt' => true, + 'srand' => true, + 'atan' => true, + 'atanh' => true, + 'tan' => true, + 'tanh' => true + ]; + + // be sure equation parameter is present + if (empty($params['equation'])) { + trigger_error("math: missing equation parameter", E_USER_WARNING); + return; + } + $equation = $params['equation']; + + // Remove whitespaces + $equation = preg_replace('/\s+/', '', $equation); + + // Adapted from https://www.php.net/manual/en/function.eval.php#107377 + $number = '-?(?:\d+(?:[,.]\d+)?|pi|Ď€)'; // What is a number + $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; + $operators = '[,+\/*\^%-]'; // Allowed math operators + $regexp = '/^((' . $number . '|' . $functionsOrVars . '|(' . $functionsOrVars . '\s*\((?1)*\)|\((?1)*\)))(?:' . $operators . '(?1))?)+$/'; + + if (!preg_match($regexp, $equation)) { + trigger_error("math: illegal characters", E_USER_WARNING); + return; + } + + // make sure parenthesis are balanced + if (substr_count($equation, '(') !== substr_count($equation, ')')) { + trigger_error("math: unbalanced parenthesis", E_USER_WARNING); + return; + } + + // disallow backticks + if (strpos($equation, '`') !== false) { + trigger_error("math: backtick character not allowed in equation", E_USER_WARNING); + return; + } + + // also disallow dollar signs + if (strpos($equation, '$') !== false) { + trigger_error("math: dollar signs not allowed in equation", E_USER_WARNING); + return; + } + foreach ($params as $key => $val) { + if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') { + // make sure value is not empty + if (strlen($val) === 0) { + trigger_error("math: parameter '{$key}' is empty", E_USER_WARNING); + return; + } + if (!is_numeric($val)) { + trigger_error("math: parameter '{$key}' is not numeric", E_USER_WARNING); + return; + } + } + } + // match all vars in equation, make sure all are passed + preg_match_all('!(?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)!', $equation, $match); + foreach ($match[1] as $curr_var) { + if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) { + trigger_error( + "math: function call '{$curr_var}' not allowed, or missing parameter '{$curr_var}'", + E_USER_WARNING + ); + return; + } + } + foreach ($params as $key => $val) { + if ($key !== 'equation' && $key !== 'format' && $key !== 'assign') { + $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); + } + } + $smarty_math_result = null; + eval("\$smarty_math_result = " . $equation . ";"); + + if (empty($params['format'])) { + if (empty($params['assign'])) { + return $smarty_math_result; + } else { + $template->assign($params['assign'], $smarty_math_result); + } + } else { + if (empty($params['assign'])) { + printf($params['format'], $smarty_math_result); + } else { + $template->assign($params['assign'], sprintf($params['format'], $smarty_math_result)); + } + } + } +} diff --git a/core/template/src/Lexer/ConfigfileLexer.php b/core/template/src/Lexer/ConfigfileLexer.php new file mode 100644 index 0000000..d592c82 --- /dev/null +++ b/core/template/src/Lexer/ConfigfileLexer.php @@ -0,0 +1,707 @@ + 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', 6 => 'TRIPPLE'); + + /** + * storage for assembled token patterns + * + * @var string + */ + private $yy_global_pattern1 = null; + private $yy_global_pattern2 = null; + private $yy_global_pattern3 = null; + private $yy_global_pattern4 = null; + private $yy_global_pattern5 = null; + private $yy_global_pattern6 = null; + + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + ); + + /** + * constructor + * + * @param string $data template source + * @param \Smarty\Compiler\Configfile $compiler + */ + public function __construct($data, \Smarty\Compiler\Configfile $compiler) + { + $this->data = $data . "\n"; //now all lines are \n-terminated + $this->dataLength = strlen($data); + $this->counter = 0; + if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) { + $this->counter += strlen($match[0]); + } + $this->line = 1; + $this->compiler = $compiler; + $this->smarty = $compiler->smarty; + $this->configBooleanize = $this->smarty->config_booleanize; + } + + public function replace ($input) { + return $input; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + + + private $_yy_state = 1; + private $_yy_stack = array(); + + public function yylex() + { + return $this->{'yylex' . $this->_yy_state}(); + } + + public function yypushstate($state) + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + array_push($this->_yy_stack, $this->_yy_state); + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + public function yypopstate() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + $this->_yy_state = array_pop($this->_yy_stack); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + + } + + public function yybegin($state) + { + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + + + + public function yylex1() + { + if (!isset($this->yy_global_pattern1)) { + $this->yy_global_pattern1 = $this->replace("/\G(#|;)|\G(\\[)|\G(\\])|\G(=)|\G([ \t\r]+)|\G(\n)|\G([0-9]*[a-zA-Z_]\\w*)|\G([\S\s])/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern1,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state START'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r1_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const START = 1; + public function yy_r1_1() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_COMMENTSTART; + $this->yypushstate(self::COMMENT); + } + public function yy_r1_2() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_OPENB; + $this->yypushstate(self::SECTION); + } + public function yy_r1_3() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_CLOSEB; + } + public function yy_r1_4() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_EQUAL; + $this->yypushstate(self::VALUE); + } + public function yy_r1_5() + { + + return false; + } + public function yy_r1_6() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NEWLINE; + } + public function yy_r1_7() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_ID; + } + public function yy_r1_8() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_OTHER; + } + + + + public function yylex2() + { + if (!isset($this->yy_global_pattern2)) { + $this->yy_global_pattern2 = $this->replace("/\G([ \t\r]+)|\G(\\d+\\.\\d+(?=[ \t\r]*[\n#;]))|\G(\\d+(?=[ \t\r]*[\n#;]))|\G(\"\"\")|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#;]))|\G(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#;]))|\G([a-zA-Z]+(?=[ \t\r]*[\n#;]))|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern2,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state VALUE'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r2_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const VALUE = 2; + public function yy_r2_1() + { + + return false; + } + public function yy_r2_2() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_FLOAT; + $this->yypopstate(); + } + public function yy_r2_3() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_INT; + $this->yypopstate(); + } + public function yy_r2_4() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_TRIPPLE_QUOTES; + $this->yypushstate(self::TRIPPLE); + } + public function yy_r2_5() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_SINGLE_QUOTED_STRING; + $this->yypopstate(); + } + public function yy_r2_6() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_DOUBLE_QUOTED_STRING; + $this->yypopstate(); + } + public function yy_r2_7() + { + + if (!$this->configBooleanize || !in_array(strtolower($this->value), array('true', 'false', 'on', 'off', 'yes', 'no')) ) { + $this->yypopstate(); + $this->yypushstate(self::NAKED_STRING_VALUE); + return true; //reprocess in new state + } else { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_BOOL; + $this->yypopstate(); + } + } + public function yy_r2_8() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + $this->yypopstate(); + } + public function yy_r2_9() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + $this->value = ''; + $this->yypopstate(); + } + + + + public function yylex3() + { + if (!isset($this->yy_global_pattern3)) { + $this->yy_global_pattern3 = $this->replace("/\G([^\n]+?(?=[ \t\r]*\n))/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern3,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state NAKED_STRING_VALUE'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r3_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const NAKED_STRING_VALUE = 3; + public function yy_r3_1() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + $this->yypopstate(); + } + + + + public function yylex4() + { + if (!isset($this->yy_global_pattern4)) { + $this->yy_global_pattern4 = $this->replace("/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern4,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state COMMENT'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r4_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const COMMENT = 4; + public function yy_r4_1() + { + + return false; + } + public function yy_r4_2() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + } + public function yy_r4_3() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NEWLINE; + $this->yypopstate(); + } + + + + public function yylex5() + { + if (!isset($this->yy_global_pattern5)) { + $this->yy_global_pattern5 = $this->replace("/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern5,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state SECTION'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r5_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const SECTION = 5; + public function yy_r5_1() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_DOT; + } + public function yy_r5_2() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_SECTION; + $this->yypopstate(); + } + + + public function yylex6() + { + if (!isset($this->yy_global_pattern6)) { + $this->yy_global_pattern6 = $this->replace("/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern6,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TRIPPLE'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r6_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const TRIPPLE = 6; + public function yy_r6_1() + { + + $this->token = \Smarty\Parser\ConfigfileParser::TPC_TRIPPLE_QUOTES_END; + $this->yypopstate(); + $this->yypushstate(self::START); + } + public function yy_r6_2() + { + + $to = strlen($this->data); + preg_match("/\"\"\"[ \t\r]*[\n#;]/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_config_file_error ('missing or misspelled literal closing tag'); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\ConfigfileParser::TPC_TRIPPLE_TEXT; + } + + +} diff --git a/core/template/src/Lexer/ConfigfileLexer.plex b/core/template/src/Lexer/ConfigfileLexer.plex new file mode 100644 index 0000000..a895050 --- /dev/null +++ b/core/template/src/Lexer/ConfigfileLexer.plex @@ -0,0 +1,321 @@ + 'START', 2 => 'VALUE', 3 => 'NAKED_STRING_VALUE', 4 => 'COMMENT', 5 => 'SECTION', 6 => 'TRIPPLE'); + + /** + * storage for assembled token patterns + * + * @var string + */ + private $yy_global_pattern1 = null; + private $yy_global_pattern2 = null; + private $yy_global_pattern3 = null; + private $yy_global_pattern4 = null; + private $yy_global_pattern5 = null; + private $yy_global_pattern6 = null; + + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + ); + + /** + * constructor + * + * @param string $data template source + * @param \Smarty\Compiler\Configfile $compiler + */ + public function __construct($data, \Smarty\Compiler\Configfile $compiler) + { + $this->data = $data . "\n"; //now all lines are \n-terminated + $this->dataLength = strlen($data); + $this->counter = 0; + if (preg_match('/^\xEF\xBB\xBF/', $this->data, $match)) { + $this->counter += strlen($match[0]); + } + $this->line = 1; + $this->compiler = $compiler; + $this->smarty = $compiler->smarty; + $this->configBooleanize = $this->smarty->config_booleanize; + } + + public function replace ($input) { + return $input; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + +/*!lex2php +%input $this->data +%counter $this->counter +%token $this->token +%value $this->value +%line $this->line +commentstart = /#|;/ +openB = /\[/ +closeB = /\]/ +section = /.*?(?=[\.=\[\]\r\n])/ +equal = /=/ +whitespace = /[ \t\r]+/ +dot = /\./ +id = /[0-9]*[a-zA-Z_]\w*/ +newline = /\n/ +single_quoted_string = /'[^'\\]*(?:\\.[^'\\]*)*'(?=[ \t\r]*[\n#;])/ +double_quoted_string = /"[^"\\]*(?:\\.[^"\\]*)*"(?=[ \t\r]*[\n#;])/ +tripple_quotes = /"""/ +tripple_quotes_end = /"""(?=[ \t\r]*[\n#;])/ +text = /[\S\s]/ +float = /\d+\.\d+(?=[ \t\r]*[\n#;])/ +int = /\d+(?=[ \t\r]*[\n#;])/ +maybe_bool = /[a-zA-Z]+(?=[ \t\r]*[\n#;])/ +naked_string = /[^\n]+?(?=[ \t\r]*\n)/ +*/ + +/*!lex2php +%statename START + +commentstart { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_COMMENTSTART; + $this->yypushstate(self::COMMENT); +} +openB { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_OPENB; + $this->yypushstate(self::SECTION); +} +closeB { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_CLOSEB; +} +equal { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_EQUAL; + $this->yypushstate(self::VALUE); +} +whitespace { + return false; +} +newline { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NEWLINE; +} +id { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_ID; +} +text { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_OTHER; +} + +*/ + +/*!lex2php +%statename VALUE + +whitespace { + return false; +} +float { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_FLOAT; + $this->yypopstate(); +} +int { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_INT; + $this->yypopstate(); +} +tripple_quotes { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_TRIPPLE_QUOTES; + $this->yypushstate(self::TRIPPLE); +} +single_quoted_string { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_SINGLE_QUOTED_STRING; + $this->yypopstate(); +} +double_quoted_string { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_DOUBLE_QUOTED_STRING; + $this->yypopstate(); +} +maybe_bool { + if (!$this->configBooleanize || !in_array(strtolower($this->value), array('true', 'false', 'on', 'off', 'yes', 'no')) ) { + $this->yypopstate(); + $this->yypushstate(self::NAKED_STRING_VALUE); + return true; //reprocess in new state + } else { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_BOOL; + $this->yypopstate(); + } +} +naked_string { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + $this->yypopstate(); +} +newline { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + $this->value = ''; + $this->yypopstate(); +} + +*/ + +/*!lex2php +%statename NAKED_STRING_VALUE + +naked_string { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; + $this->yypopstate(); +} + +*/ + +/*!lex2php +%statename COMMENT + +whitespace { + return false; +} +naked_string { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NAKED_STRING; +} +newline { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_NEWLINE; + $this->yypopstate(); +} + +*/ + +/*!lex2php +%statename SECTION + +dot { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_DOT; +} +section { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_SECTION; + $this->yypopstate(); +} + +*/ +/*!lex2php +%statename TRIPPLE + +tripple_quotes_end { + $this->token = \Smarty\Parser\ConfigfileParser::TPC_TRIPPLE_QUOTES_END; + $this->yypopstate(); + $this->yypushstate(self::START); +} +text { + $to = strlen($this->data); + preg_match("/\"\"\"[ \t\r]*[\n#;]/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_config_file_error ('missing or misspelled literal closing tag'); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\ConfigfileParser::TPC_TRIPPLE_TEXT; +} +*/ + +} diff --git a/core/template/src/Lexer/TemplateLexer.php b/core/template/src/Lexer/TemplateLexer.php new file mode 100644 index 0000000..2e7f330 --- /dev/null +++ b/core/template/src/Lexer/TemplateLexer.php @@ -0,0 +1,1083 @@ + + */ +class TemplateLexer +{ + /** + * Source + * + * @var string + */ + public $data; + + /** + * Source length + * + * @var int + */ + public $dataLength = null; + + /** + * byte counter + * + * @var int + */ + public $counter; + + /** + * token number + * + * @var int + */ + public $token; + + /** + * token value + * + * @var string + */ + public $value; + + /** + * current line + * + * @var int + */ + public $line; + + /** + * tag start line + * + * @var + */ + public $taglineno; + + /** + * state number + * + * @var int + */ + public $state = 1; + + /** + * Smarty object + * + * @var Smarty + */ + public $smarty = null; + + /** + * compiler object + * + * @var \Smarty\Compiler\Template + */ + public $compiler = null; + + /** + * trace file + * + * @var resource + */ + public $yyTraceFILE; + + /** + * trace prompt + * + * @var string + */ + public $yyTracePrompt; + + /** + * XML flag true while processing xml + * + * @var bool + */ + public $is_xml = false; + + /** + * state names + * + * @var array + */ + public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',); + + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + 'NOT' => '(!,not)', + 'OPENP' => '(', + 'CLOSEP' => ')', + 'OPENB' => '[', + 'CLOSEB' => ']', + 'PTR' => '->', + 'APTR' => '=>', + 'EQUAL' => '=', + 'NUMBER' => 'number', + 'UNIMATH' => '+" , "-', + 'MATH' => '*" , "/" , "%', + 'INCDEC' => '++" , "--', + 'SPACE' => ' ', + 'DOLLAR' => '$', + 'SEMICOLON' => ';', + 'COLON' => ':', + 'DOUBLECOLON' => '::', + 'AT' => '@', + 'HATCH' => '#', + 'QUOTE' => '"', + 'BACKTICK' => '`', + 'VERT' => '"|" modifier', + 'DOT' => '.', + 'COMMA' => '","', + 'QMARK' => '"?"', + 'ID' => 'id, name', + 'TEXT' => 'text', + 'LDELSLASH' => '{/..} closing tag', + 'LDEL' => '{...} Smarty tag', + 'COMMENT' => 'comment', + 'AS' => 'as', + 'TO' => 'to', + 'LOGOP' => '"<", "==" ... logical operator', + 'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition', + 'SCOND' => '"is even" ... if condition', + ); + + /** + * literal tag nesting level + * + * @var int + */ + private $literal_cnt = 0; + + /** + * preg token pattern for state TEXT + * + * @var string + */ + private $yy_global_pattern1 = null; + + /** + * preg token pattern for state TAG + * + * @var string + */ + private $yy_global_pattern2 = null; + + /** + * preg token pattern for state TAGBODY + * + * @var string + */ + private $yy_global_pattern3 = null; + + /** + * preg token pattern for state LITERAL + * + * @var string + */ + private $yy_global_pattern4 = null; + + /** + * preg token pattern for state DOUBLEQUOTEDSTRING + * + * @var null + */ + private $yy_global_pattern5 = null; + + /** + * preg token pattern for text + * + * @var null + */ + private $yy_global_text = null; + + /** + * preg token pattern for literal + * + * @var null + */ + private $yy_global_literal = null; + + /** + * constructor + * + * @param string $source template source + * @param \Smarty\Compiler\Template $compiler + */ + public function __construct($source, \Smarty\Compiler\Template $compiler) + { + $this->data = $source; + $this->dataLength = strlen($this->data); + $this->counter = 0; + if (preg_match('/^\xEF\xBB\xBF/i', $this->data, $match)) { + $this->counter += strlen($match[0]); + } + $this->line = 1; + $this->smarty = $compiler->getTemplate()->getSmarty(); + $this->compiler = $compiler; + $this->compiler->initDelimiterPreg(); + $this->smarty_token_names['LDEL'] = $this->smarty->getLeftDelimiter(); + $this->smarty_token_names['RDEL'] = $this->smarty->getRightDelimiter(); + } + + /** + * open lexer/parser trace file + * + */ + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + /** + * replace placeholders with runtime preg code + * + * @param string $preg + * + * @return string + */ + public function replace($preg) + { + return $this->compiler->replaceDelimiter($preg); + } + + /** + * check if current value is an autoliteral left delimiter + * + * @return bool + */ + public function isAutoLiteral() + { + return $this->smarty->getAutoLiteral() && isset($this->value[ $this->compiler->getLdelLength() ]) ? + strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false; + } + + + private $_yy_state = 1; + private $_yy_stack = array(); + + public function yylex() + { + return $this->{'yylex' . $this->_yy_state}(); + } + + public function yypushstate($state) + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + array_push($this->_yy_stack, $this->_yy_state); + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + public function yypopstate() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + $this->_yy_state = array_pop($this->_yy_stack); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + + } + + public function yybegin($state) + { + $this->_yy_state = $state; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); + } + } + + + + public function yylex1() + { + if (!isset($this->yy_global_pattern1)) { + $this->yy_global_pattern1 = $this->replace("/\G([{][}])|\G((SMARTYldel)SMARTYal[*])|\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\S\s])/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern1,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TEXT'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r1_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const TEXT = 1; + public function yy_r1_1() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r1_2() + { + + $to = $this->dataLength; + preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1] + strlen($match[0][0]); + } else { + $this->compiler->trigger_template_error ("missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + return false; + } + public function yy_r1_4() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r1_6() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LITERALSTART; + $this->yypushstate(self::LITERAL); + } + public function yy_r1_8() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LITERALEND; + $this->yypushstate(self::LITERAL); + } + public function yy_r1_10() + { + + $this->yypushstate(self::TAG); + return true; + } + public function yy_r1_12() + { + + if (!isset($this->yy_global_text)) { + $this->yy_global_text = $this->replace('/(SMARTYldel)SMARTYal/isS'); + } + $to = $this->dataLength; + preg_match($this->yy_global_text, $this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + + + public function yylex2() + { + if (!isset($this->yy_global_pattern2)) { + $this->yy_global_pattern2 = $this->replace("/\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\s+)|\G((SMARTYldel)SMARTYalfor\\s+)|\G((SMARTYldel)SMARTYalforeach(?![^\s]))|\G((SMARTYldel)SMARTYalsetfilter\\s+)|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$]smarty\\.block\\.(child|parent)\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/][0-9]*[a-zA-Z_]\\w*\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal)/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern2,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TAG'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r2_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const TAG = 2; + public function yy_r2_1() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDELIF; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + public function yy_r2_4() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDELFOR; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + public function yy_r2_6() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDELFOREACH; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + public function yy_r2_8() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDELSETFILTER; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + public function yy_r2_10() + { + + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_SIMPLETAG; + $this->taglineno = $this->line; + } + public function yy_r2_13() + { + + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } + public function yy_r2_16() + { + + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_CLOSETAG; + $this->taglineno = $this->line; + } + public function yy_r2_18() + { + + if ($this->_yy_stack[count($this->_yy_stack)-1] === self::TEXT) { + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_SIMPELOUTPUT; + $this->taglineno = $this->line; + } else { + $this->value = $this->smarty->getLeftDelimiter(); + $this->token = \Smarty\Parser\TemplateParser::TP_LDEL; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + } + public function yy_r2_21() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDELSLASH; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + public function yy_r2_23() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDEL; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + + + public function yylex3() + { + if (!isset($this->yy_global_pattern3)) { + $this->yy_global_pattern3 = $this->replace("/\G(\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+(not\\s+)?in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even|div)\\s+by\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G([!]\\s*|not\\s+)|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G(array\\s*[(]\\s*)|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|][@]?)|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern3,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TAGBODY'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r3_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const TAGBODY = 3; + public function yy_r3_1() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_RDEL; + $this->yypopstate(); + } + public function yy_r3_2() + { + + $this->yypushstate(self::TAG); + return true; + } + public function yy_r3_4() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_QUOTE; + $this->yypushstate(self::DOUBLEQUOTEDSTRING); + $this->compiler->enterDoubleQuote(); + } + public function yy_r3_5() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_SINGLEQUOTESTRING; + } + public function yy_r3_6() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_DOLLARID; + } + public function yy_r3_7() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_DOLLAR; + } + public function yy_r3_8() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_ISIN; + } + public function yy_r3_10() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_AS; + } + public function yy_r3_11() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TO; + } + public function yy_r3_12() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_STEP; + } + public function yy_r3_13() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_INSTANCEOF; + } + public function yy_r3_14() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LOGOP; + } + public function yy_r3_16() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_SLOGOP; + } + public function yy_r3_18() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TLOGOP; + } + public function yy_r3_21() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_SINGLECOND; + } + public function yy_r3_24() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_NOT; + } + public function yy_r3_25() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TYPECAST; + } + public function yy_r3_29() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_OPENP; + } + public function yy_r3_30() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_CLOSEP; + } + public function yy_r3_31() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_OPENB; + } + public function yy_r3_32() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_CLOSEB; + } + public function yy_r3_33() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_PTR; + } + public function yy_r3_34() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_APTR; + } + public function yy_r3_35() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_EQUAL; + } + public function yy_r3_36() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_INCDEC; + } + public function yy_r3_38() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_UNIMATH; + } + public function yy_r3_40() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_MATH; + } + public function yy_r3_42() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_AT; + } + public function yy_r3_43() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_ARRAYOPEN; + } + public function yy_r3_44() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_HATCH; + } + public function yy_r3_45() + { + + // resolve conflicts with shorttag and right_delimiter starting with '=' + if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) === $this->smarty->getRightDelimiter()) { + preg_match('/\s+/',$this->value,$match); + $this->value = $match[0]; + $this->token = \Smarty\Parser\TemplateParser::TP_SPACE; + } else { + $this->token = \Smarty\Parser\TemplateParser::TP_ATTR; + } + } + public function yy_r3_46() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_NAMESPACE; + } + public function yy_r3_49() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_ID; + } + public function yy_r3_50() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_INTEGER; + } + public function yy_r3_51() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_BACKTICK; + $this->yypopstate(); + } + public function yy_r3_52() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_VERT; + } + public function yy_r3_53() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_DOT; + } + public function yy_r3_54() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_COMMA; + } + public function yy_r3_55() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_SEMICOLON; + } + public function yy_r3_56() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_DOUBLECOLON; + } + public function yy_r3_57() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_COLON; + } + public function yy_r3_58() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_QMARK; + } + public function yy_r3_59() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_HEX; + } + public function yy_r3_60() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_SPACE; + } + public function yy_r3_61() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + + + + public function yylex4() + { + if (!isset($this->yy_global_pattern4)) { + $this->yy_global_pattern4 = $this->replace("/\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G([\S\s])/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern4,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state LITERAL'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r4_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const LITERAL = 4; + public function yy_r4_1() + { + + $this->literal_cnt++; + $this->token = \Smarty\Parser\TemplateParser::TP_LITERAL; + } + public function yy_r4_3() + { + + if ($this->literal_cnt) { + $this->literal_cnt--; + $this->token = \Smarty\Parser\TemplateParser::TP_LITERAL; + } else { + $this->token = \Smarty\Parser\TemplateParser::TP_LITERALEND; + $this->yypopstate(); + } + } + public function yy_r4_5() + { + + if (!isset($this->yy_global_literal)) { + $this->yy_global_literal = $this->replace('/(SMARTYldel)SMARTYal[\/]?literalSMARTYrdel/isS'); + } + $to = $this->dataLength; + preg_match($this->yy_global_literal, $this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\TemplateParser::TP_LITERAL; + } + + + public function yylex5() + { + if (!isset($this->yy_global_pattern5)) { + $this->yy_global_pattern5 = $this->replace("/\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=((SMARTYldel)SMARTYal|\\$|`\\$|\"SMARTYliteral)))|\G([\S\s])/isS"); + } + if (!isset($this->dataLength)) { + $this->dataLength = strlen($this->data); + } + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + + do { + if (preg_match($this->yy_global_pattern5,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); + } else { + $yymatches = array_filter($yymatches); + } + if (empty($yymatches)) { + throw new Exception('Error: lexing failed because a rule matched' . + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state DOUBLEQUOTEDSTRING'); + } + next($yymatches); // skip global match + $this->token = key($yymatches); // token number + $this->value = current($yymatches); // token value + $r = $this->{'yy_r5_' . $this->token}(); + if ($r === null) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + // accept this token + return true; + } elseif ($r === true) { + // we have changed state + // process this token in the new state + return $this->yylex(); + } elseif ($r === false) { + $this->counter += strlen($this->value); + $this->line += substr_count($this->value, "\n"); + if ($this->counter >= $this->dataLength) { + return false; // end of input + } + // skip this token + continue; + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); + } + break; + } while (true); + + } // end function + + + const DOUBLEQUOTEDSTRING = 5; + public function yy_r5_1() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r5_3() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r5_5() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r5_7() + { + + $this->yypushstate(self::TAG); + return true; + } + public function yy_r5_9() + { + + $this->yypushstate(self::TAG); + return true; + } + public function yy_r5_11() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_LDEL; + $this->taglineno = $this->line; + $this->yypushstate(self::TAGBODY); + } + public function yy_r5_13() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_QUOTE; + $this->yypopstate(); + } + public function yy_r5_14() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_BACKTICK; + $this->value = substr($this->value,0,-1); + $this->yypushstate(self::TAGBODY); + $this->taglineno = $this->line; + } + public function yy_r5_15() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_DOLLARID; + } + public function yy_r5_16() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r5_17() + { + + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + public function yy_r5_22() + { + + $to = $this->dataLength; + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + + } + + \ No newline at end of file diff --git a/core/template/src/Lexer/TemplateLexer.plex b/core/template/src/Lexer/TemplateLexer.plex new file mode 100644 index 0000000..282a99c --- /dev/null +++ b/core/template/src/Lexer/TemplateLexer.plex @@ -0,0 +1,677 @@ + + */ +class TemplateLexer +{ + /** + * Source + * + * @var string + */ + public $data; + + /** + * Source length + * + * @var int + */ + public $dataLength = null; + + /** + * byte counter + * + * @var int + */ + public $counter; + + /** + * token number + * + * @var int + */ + public $token; + + /** + * token value + * + * @var string + */ + public $value; + + /** + * current line + * + * @var int + */ + public $line; + + /** + * tag start line + * + * @var + */ + public $taglineno; + + /** + * state number + * + * @var int + */ + public $state = 1; + + /** + * Smarty object + * + * @var Smarty + */ + public $smarty = null; + + /** + * compiler object + * + * @var \Smarty\Compiler\Template + */ + public $compiler = null; + + /** + * trace file + * + * @var resource + */ + public $yyTraceFILE; + + /** + * trace prompt + * + * @var string + */ + public $yyTracePrompt; + + /** + * XML flag true while processing xml + * + * @var bool + */ + public $is_xml = false; + + /** + * state names + * + * @var array + */ + public $state_name = array(1 => 'TEXT', 2 => 'TAG', 3 => 'TAGBODY', 4 => 'LITERAL', 5 => 'DOUBLEQUOTEDSTRING',); + + /** + * token names + * + * @var array + */ + public $smarty_token_names = array( // Text for parser error messages + 'NOT' => '(!,not)', + 'OPENP' => '(', + 'CLOSEP' => ')', + 'OPENB' => '[', + 'CLOSEB' => ']', + 'PTR' => '->', + 'APTR' => '=>', + 'EQUAL' => '=', + 'NUMBER' => 'number', + 'UNIMATH' => '+" , "-', + 'MATH' => '*" , "/" , "%', + 'INCDEC' => '++" , "--', + 'SPACE' => ' ', + 'DOLLAR' => '$', + 'SEMICOLON' => ';', + 'COLON' => ':', + 'DOUBLECOLON' => '::', + 'AT' => '@', + 'HATCH' => '#', + 'QUOTE' => '"', + 'BACKTICK' => '`', + 'VERT' => '"|" modifier', + 'DOT' => '.', + 'COMMA' => '","', + 'QMARK' => '"?"', + 'ID' => 'id, name', + 'TEXT' => 'text', + 'LDELSLASH' => '{/..} closing tag', + 'LDEL' => '{...} Smarty tag', + 'COMMENT' => 'comment', + 'AS' => 'as', + 'TO' => 'to', + 'LOGOP' => '"<", "==" ... logical operator', + 'TLOGOP' => '"lt", "eq" ... logical operator; "is div by" ... if condition', + 'SCOND' => '"is even" ... if condition', + ); + + /** + * literal tag nesting level + * + * @var int + */ + private $literal_cnt = 0; + + /** + * preg token pattern for state TEXT + * + * @var string + */ + private $yy_global_pattern1 = null; + + /** + * preg token pattern for state TAG + * + * @var string + */ + private $yy_global_pattern2 = null; + + /** + * preg token pattern for state TAGBODY + * + * @var string + */ + private $yy_global_pattern3 = null; + + /** + * preg token pattern for state LITERAL + * + * @var string + */ + private $yy_global_pattern4 = null; + + /** + * preg token pattern for state DOUBLEQUOTEDSTRING + * + * @var null + */ + private $yy_global_pattern5 = null; + + /** + * preg token pattern for text + * + * @var null + */ + private $yy_global_text = null; + + /** + * preg token pattern for literal + * + * @var null + */ + private $yy_global_literal = null; + + /** + * constructor + * + * @param string $source template source + * @param \Smarty\Compiler\Template $compiler + */ + public function __construct($source, \Smarty\Compiler\Template $compiler) + { + $this->data = $source; + $this->dataLength = strlen($this->data); + $this->counter = 0; + if (preg_match('/^\xEF\xBB\xBF/i', $this->data, $match)) { + $this->counter += strlen($match[0]); + } + $this->line = 1; + $this->smarty = $compiler->getTemplate()->getSmarty(); + $this->compiler = $compiler; + $this->compiler->initDelimiterPreg(); + $this->smarty_token_names['LDEL'] = $this->smarty->getLeftDelimiter(); + $this->smarty_token_names['RDEL'] = $this->smarty->getRightDelimiter(); + } + + /** + * open lexer/parser trace file + * + */ + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + /** + * replace placeholders with runtime preg code + * + * @param string $preg + * + * @return string + */ + public function replace($preg) + { + return $this->compiler->replaceDelimiter($preg); + } + + /** + * check if current value is an autoliteral left delimiter + * + * @return bool + */ + public function isAutoLiteral() + { + return $this->smarty->getAutoLiteral() && isset($this->value[ $this->compiler->getLdelLength() ]) ? + strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false; + } + + /*!lex2php + %input $this->data + %counter $this->counter + %token $this->token + %value $this->value + %line $this->line + userliteral = ~(SMARTYldel)SMARTYautoliteral\s+SMARTYliteral~ + char = ~[\S\s]~ + textdoublequoted = ~([^"\\]*?)((?:\\.[^"\\]*?)*?)(?=((SMARTYldel)SMARTYal|\$|`\$|"SMARTYliteral))~ + namespace = ~([0-9]*[a-zA-Z_]\w*)?(\\[0-9]*[a-zA-Z_]\w*)+~ + emptyjava = ~[{][}]~ + slash = ~[/]~ + ldel = ~(SMARTYldel)SMARTYal~ + rdel = ~\s*SMARTYrdel~ + nocacherdel = ~(\s+nocache)?\s*SMARTYrdel~ + smartyblockchildparent = ~[\$]smarty\.block\.(child|parent)~ + integer = ~\d+~ + hex = ~0[xX][0-9a-fA-F]+~ + math = ~\s*([*]{1,2}|[%/^&]|[<>]{2})\s*~ + comment = ~(SMARTYldel)SMARTYal[*]~ + incdec = ~([+]|[-]){2}~ + unimath = ~\s*([+]|[-])\s*~ + openP = ~\s*[(]\s*~ + closeP = ~\s*[)]~ + openB = ~\[\s*~ + closeB = ~\s*\]~ + dollar = ~[$]~ + dot = ~[.]~ + comma = ~\s*[,]\s*~ + doublecolon = ~[:]{2}~ + colon = ~\s*[:]\s*~ + at = ~[@]~ + hatch = ~[#]~ + semicolon = ~\s*[;]\s*~ + equal = ~\s*[=]\s*~ + space = ~\s+~ + ptr = ~\s*[-][>]\s*~ + aptr = ~\s*[=][>]\s*~ + singlequotestring = ~'[^'\\]*(?:\\.[^'\\]*)*'~ + backtick = ~[`]~ + vert = ~[|][@]?~ + qmark = ~\s*[?]\s*~ + constant = ~[_]+[A-Z0-9][0-9A-Z_]*|[A-Z][0-9A-Z_]*(?![0-9A-Z_]*[a-z])~ + attr = ~\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\s*[=]\s*~ + id = ~[0-9]*[a-zA-Z_]\w*~ + literal = ~literal~ + strip = ~strip~ + lop = ~\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\s*~ + slop = ~\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\s+~ + tlop = ~\s+is\s+(not\s+)?(odd|even|div)\s+by\s+~ + scond = ~\s+is\s+(not\s+)?(odd|even)~ + isin = ~\s+is\s+(not\s+)?in\s+~ + as = ~\s+as\s+~ + to = ~\s+to\s+~ + step = ~\s+step\s+~ + if = ~(if|elseif|else if|while)\s+~ + for = ~for\s+~ + array = ~array~ + foreach = ~foreach(?![^\s])~ + setfilter = ~setfilter\s+~ + instanceof = ~\s+instanceof\s+~ + not = ~[!]\s*|not\s+~ + typecast = ~[(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\s*~ + double_quote = ~["]~ + */ + /*!lex2php + %statename TEXT + emptyjava { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + comment { + $to = $this->dataLength; + preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1] + strlen($match[0][0]); + } else { + $this->compiler->trigger_template_error ("missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + return false; + } + userliteral { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + ldel literal rdel { + $this->token = \Smarty\Parser\TemplateParser::TP_LITERALSTART; + $this->yypushstate(self::LITERAL); + } + ldel slash literal rdel { + $this->token = \Smarty\Parser\TemplateParser::TP_LITERALEND; + $this->yypushstate(self::LITERAL); + } + ldel { + $this->yypushstate(self::TAG); + return true; + } + char { + if (!isset($this->yy_global_text)) { + $this->yy_global_text = $this->replace('/(SMARTYldel)SMARTYal/isS'); + } + $to = $this->dataLength; + preg_match($this->yy_global_text, $this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + */ + /*!lex2php + %statename TAG + ldel if { + $this->token = \Smarty\Parser\TemplateParser::TP_LDELIF; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + ldel for { + $this->token = \Smarty\Parser\TemplateParser::TP_LDELFOR; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + ldel foreach { + $this->token = \Smarty\Parser\TemplateParser::TP_LDELFOREACH; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + ldel setfilter { + $this->token = \Smarty\Parser\TemplateParser::TP_LDELSETFILTER; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + ldel id nocacherdel { + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_SIMPLETAG; + $this->taglineno = $this->line; + } + ldel smartyblockchildparent rdel { + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } + ldel slash id rdel { + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_CLOSETAG; + $this->taglineno = $this->line; + } + ldel dollar id nocacherdel { + if ($this->_yy_stack[count($this->_yy_stack)-1] === self::TEXT) { + $this->yypopstate(); + $this->token = \Smarty\Parser\TemplateParser::TP_SIMPELOUTPUT; + $this->taglineno = $this->line; + } else { + $this->value = $this->smarty->getLeftDelimiter(); + $this->token = \Smarty\Parser\TemplateParser::TP_LDEL; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + } + ldel slash { + $this->token = \Smarty\Parser\TemplateParser::TP_LDELSLASH; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + ldel { + $this->token = \Smarty\Parser\TemplateParser::TP_LDEL; + $this->yybegin(self::TAGBODY); + $this->taglineno = $this->line; + } + */ + /*!lex2php + %statename TAGBODY + rdel { + $this->token = \Smarty\Parser\TemplateParser::TP_RDEL; + $this->yypopstate(); + } + ldel { + $this->yypushstate(self::TAG); + return true; + } + double_quote { + $this->token = \Smarty\Parser\TemplateParser::TP_QUOTE; + $this->yypushstate(self::DOUBLEQUOTEDSTRING); + $this->compiler->enterDoubleQuote(); + } + singlequotestring { + $this->token = \Smarty\Parser\TemplateParser::TP_SINGLEQUOTESTRING; + } + dollar id { + $this->token = \Smarty\Parser\TemplateParser::TP_DOLLARID; + } + dollar { + $this->token = \Smarty\Parser\TemplateParser::TP_DOLLAR; + } + isin { + $this->token = \Smarty\Parser\TemplateParser::TP_ISIN; + } + as { + $this->token = \Smarty\Parser\TemplateParser::TP_AS; + } + to { + $this->token = \Smarty\Parser\TemplateParser::TP_TO; + } + step { + $this->token = \Smarty\Parser\TemplateParser::TP_STEP; + } + instanceof { + $this->token = \Smarty\Parser\TemplateParser::TP_INSTANCEOF; + } + lop { + $this->token = \Smarty\Parser\TemplateParser::TP_LOGOP; + } + slop { + $this->token = \Smarty\Parser\TemplateParser::TP_SLOGOP; + } + tlop { + $this->token = \Smarty\Parser\TemplateParser::TP_TLOGOP; + } + scond { + $this->token = \Smarty\Parser\TemplateParser::TP_SINGLECOND; + } + not{ + $this->token = \Smarty\Parser\TemplateParser::TP_NOT; + } + typecast { + $this->token = \Smarty\Parser\TemplateParser::TP_TYPECAST; + } + openP { + $this->token = \Smarty\Parser\TemplateParser::TP_OPENP; + } + closeP { + $this->token = \Smarty\Parser\TemplateParser::TP_CLOSEP; + } + openB { + $this->token = \Smarty\Parser\TemplateParser::TP_OPENB; + } + closeB { + $this->token = \Smarty\Parser\TemplateParser::TP_CLOSEB; + } + ptr { + $this->token = \Smarty\Parser\TemplateParser::TP_PTR; + } + aptr { + $this->token = \Smarty\Parser\TemplateParser::TP_APTR; + } + equal { + $this->token = \Smarty\Parser\TemplateParser::TP_EQUAL; + } + incdec { + $this->token = \Smarty\Parser\TemplateParser::TP_INCDEC; + } + unimath { + $this->token = \Smarty\Parser\TemplateParser::TP_UNIMATH; + } + math { + $this->token = \Smarty\Parser\TemplateParser::TP_MATH; + } + at { + $this->token = \Smarty\Parser\TemplateParser::TP_AT; + } + array openP { + $this->token = \Smarty\Parser\TemplateParser::TP_ARRAYOPEN; + } + hatch { + $this->token = \Smarty\Parser\TemplateParser::TP_HATCH; + } + attr { + // resolve conflicts with shorttag and right_delimiter starting with '=' + if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) === $this->smarty->getRightDelimiter()) { + preg_match('/\s+/',$this->value,$match); + $this->value = $match[0]; + $this->token = \Smarty\Parser\TemplateParser::TP_SPACE; + } else { + $this->token = \Smarty\Parser\TemplateParser::TP_ATTR; + } + } + namespace { + $this->token = \Smarty\Parser\TemplateParser::TP_NAMESPACE; + } + id { + $this->token = \Smarty\Parser\TemplateParser::TP_ID; + } + integer { + $this->token = \Smarty\Parser\TemplateParser::TP_INTEGER; + } + backtick { + $this->token = \Smarty\Parser\TemplateParser::TP_BACKTICK; + $this->yypopstate(); + } + vert { + $this->token = \Smarty\Parser\TemplateParser::TP_VERT; + } + dot { + $this->token = \Smarty\Parser\TemplateParser::TP_DOT; + } + comma { + $this->token = \Smarty\Parser\TemplateParser::TP_COMMA; + } + semicolon { + $this->token = \Smarty\Parser\TemplateParser::TP_SEMICOLON; + } + doublecolon { + $this->token = \Smarty\Parser\TemplateParser::TP_DOUBLECOLON; + } + colon { + $this->token = \Smarty\Parser\TemplateParser::TP_COLON; + } + qmark { + $this->token = \Smarty\Parser\TemplateParser::TP_QMARK; + } + hex { + $this->token = \Smarty\Parser\TemplateParser::TP_HEX; + } + space { + $this->token = \Smarty\Parser\TemplateParser::TP_SPACE; + } + char { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + */ + + /*!lex2php + %statename LITERAL + ldel literal rdel { + $this->literal_cnt++; + $this->token = \Smarty\Parser\TemplateParser::TP_LITERAL; + } + ldel slash literal rdel { + if ($this->literal_cnt) { + $this->literal_cnt--; + $this->token = \Smarty\Parser\TemplateParser::TP_LITERAL; + } else { + $this->token = \Smarty\Parser\TemplateParser::TP_LITERALEND; + $this->yypopstate(); + } + } + char { + if (!isset($this->yy_global_literal)) { + $this->yy_global_literal = $this->replace('/(SMARTYldel)SMARTYal[\/]?literalSMARTYrdel/isS'); + } + $to = $this->dataLength; + preg_match($this->yy_global_literal, $this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\TemplateParser::TP_LITERAL; + } + */ + /*!lex2php + %statename DOUBLEQUOTEDSTRING + userliteral { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + ldel literal rdel { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + ldel slash literal rdel { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + ldel slash { + $this->yypushstate(self::TAG); + return true; + } + ldel id { + $this->yypushstate(self::TAG); + return true; + } + ldel { + $this->token = \Smarty\Parser\TemplateParser::TP_LDEL; + $this->taglineno = $this->line; + $this->yypushstate(self::TAGBODY); + } + double_quote { + $this->token = \Smarty\Parser\TemplateParser::TP_QUOTE; + $this->yypopstate(); + } + backtick dollar { + $this->token = \Smarty\Parser\TemplateParser::TP_BACKTICK; + $this->value = substr($this->value,0,-1); + $this->yypushstate(self::TAGBODY); + $this->taglineno = $this->line; + } + dollar id { + $this->token = \Smarty\Parser\TemplateParser::TP_DOLLARID; + } + dollar { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + textdoublequoted { + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + char { + $to = $this->dataLength; + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = \Smarty\Parser\TemplateParser::TP_TEXT; + } + */ + } + + \ No newline at end of file diff --git a/core/template/src/ParseTree/Base.php b/core/template/src/ParseTree/Base.php new file mode 100644 index 0000000..e1140c1 --- /dev/null +++ b/core/template/src/ParseTree/Base.php @@ -0,0 +1,45 @@ +data = $data; + } + + /** + * Return buffer content in parentheses + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string content + */ + public function to_smarty_php(\Smarty\Parser\TemplateParser $parser) + { + return sprintf('(%s)', $this->data); + } +} diff --git a/core/template/src/ParseTree/Dq.php b/core/template/src/ParseTree/Dq.php new file mode 100644 index 0000000..b5fca3b --- /dev/null +++ b/core/template/src/ParseTree/Dq.php @@ -0,0 +1,97 @@ +subtrees[] = $subtree; + if ($subtree instanceof Tag) { + $parser->block_nesting_level = $parser->compiler->getTagStackCount(); + } + } + + /** + * Append buffer to subtree + * + * @param \Smarty\Parser\TemplateParser $parser + * @param Base $subtree parse tree buffer + */ + public function append_subtree(\Smarty\Parser\TemplateParser $parser, Base $subtree) + { + $last_subtree = count($this->subtrees) - 1; + if ($last_subtree >= 0 && $this->subtrees[ $last_subtree ] instanceof Tag + && $this->subtrees[ $last_subtree ]->saved_block_nesting < $parser->block_nesting_level + ) { + if ($subtree instanceof Code) { + $this->subtrees[ $last_subtree ]->data = + $parser->compiler->appendCode( + (string) $this->subtrees[ $last_subtree ]->data, + 'data . ';?>' + ); + } elseif ($subtree instanceof DqContent) { + $this->subtrees[ $last_subtree ]->data = + $parser->compiler->appendCode( + (string) $this->subtrees[ $last_subtree ]->data, + 'data . '";?>' + ); + } else { + $this->subtrees[ $last_subtree ]->data = + $parser->compiler->appendCode((string) $this->subtrees[ $last_subtree ]->data, (string) $subtree->data); + } + } else { + $this->subtrees[] = $subtree; + } + if ($subtree instanceof Tag) { + $parser->block_nesting_level = $parser->compiler->getTagStackCount(); + } + } + + /** + * Merge subtree buffer content together + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string compiled template code + */ + public function to_smarty_php(\Smarty\Parser\TemplateParser $parser) + { + $code = ''; + foreach ($this->subtrees as $subtree) { + if ($code !== '') { + $code .= '.'; + } + if ($subtree instanceof Tag) { + $more_php = $subtree->assign_to_var($parser); + } else { + $more_php = $subtree->to_smarty_php($parser); + } + $code .= $more_php; + if (!$subtree instanceof DqContent) { + $parser->compiler->has_variable_string = true; + } + } + return $code; + } +} diff --git a/core/template/src/ParseTree/DqContent.php b/core/template/src/ParseTree/DqContent.php new file mode 100644 index 0000000..f0a4b06 --- /dev/null +++ b/core/template/src/ParseTree/DqContent.php @@ -0,0 +1,44 @@ +data = $data; + } + + /** + * Return content as double-quoted string + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string doubled quoted string + */ + public function to_smarty_php(\Smarty\Parser\TemplateParser $parser) + { + return '"' . $this->data . '"'; + } +} diff --git a/core/template/src/ParseTree/Tag.php b/core/template/src/ParseTree/Tag.php new file mode 100644 index 0000000..05237f2 --- /dev/null +++ b/core/template/src/ParseTree/Tag.php @@ -0,0 +1,70 @@ +data = $data; + $this->saved_block_nesting = $parser->block_nesting_level; + } + + /** + * Return buffer content + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string content + */ + public function to_smarty_php(\Smarty\Parser\TemplateParser $parser) + { + return $this->data; + } + + /** + * Return complied code that loads the evaluated output of buffer content into a temporary variable + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string template code + */ + public function assign_to_var(\Smarty\Parser\TemplateParser $parser) + { + $var = $parser->compiler->getNewPrefixVariable(); + $tmp = $parser->compiler->appendCode('', (string) $this->data); + $tmp = $parser->compiler->appendCode($tmp, ""); + $parser->compiler->appendPrefixCode($tmp); + return $var; + } +} diff --git a/core/template/src/ParseTree/Template.php b/core/template/src/ParseTree/Template.php new file mode 100644 index 0000000..ce802a0 --- /dev/null +++ b/core/template/src/ParseTree/Template.php @@ -0,0 +1,172 @@ +subtrees)) { + $this->subtrees = array_merge($this->subtrees, $subtree->subtrees); + } else { + if ($subtree->data !== '') { + $this->subtrees[] = $subtree; + } + } + } + + /** + * Append array to subtree + * + * @param \Smarty\Parser\TemplateParser $parser + * @param Base[] $array + */ + public function append_array(\Smarty\Parser\TemplateParser $parser, $array = array()) + { + if (!empty($array)) { + $this->subtrees = array_merge($this->subtrees, (array)$array); + } + } + + /** + * Prepend array to subtree + * + * @param \Smarty\Parser\TemplateParser $parser + * @param Base[] $array + */ + public function prepend_array(\Smarty\Parser\TemplateParser $parser, $array = array()) + { + if (!empty($array)) { + $this->subtrees = array_merge((array)$array, $this->subtrees); + } + } + + /** + * Sanitize and merge subtree buffers together + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string template code content + */ + public function to_smarty_php(\Smarty\Parser\TemplateParser $parser) + { + $code = ''; + + foreach ($this->getChunkedSubtrees() as $chunk) { + $text = ''; + switch ($chunk['mode']) { + case 'textstripped': + foreach ($chunk['subtrees'] as $subtree) { + $text .= $subtree->to_smarty_php($parser); + } + $code .= preg_replace( + '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', + "\n", + $parser->compiler->processText($text) + ); + break; + case 'text': + foreach ($chunk['subtrees'] as $subtree) { + $text .= $subtree->to_smarty_php($parser); + } + $code .= preg_replace( + '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', + "\n", + $text + ); + break; + case 'tag': + foreach ($chunk['subtrees'] as $subtree) { + $text = $parser->compiler->appendCode($text, (string) $subtree->to_smarty_php($parser)); + } + $code .= $text; + break; + default: + foreach ($chunk['subtrees'] as $subtree) { + $text = $subtree->to_smarty_php($parser); + } + $code .= $text; + + } + } + return $code; + } + + private function getChunkedSubtrees() { + $chunks = array(); + $currentMode = null; + $currentChunk = array(); + for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) { + + if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, array('textstripped', 'text', 'tag'))) { + continue; + } + + if ($this->subtrees[ $key ] instanceof Text + && $this->subtrees[ $key ]->isToBeStripped()) { + $newMode = 'textstripped'; + } elseif ($this->subtrees[ $key ] instanceof Text) { + $newMode = 'text'; + } elseif ($this->subtrees[ $key ] instanceof Tag) { + $newMode = 'tag'; + } else { + $newMode = 'other'; + } + + if ($newMode == $currentMode) { + $currentChunk[] = $this->subtrees[ $key ]; + } else { + $chunks[] = array( + 'mode' => $currentMode, + 'subtrees' => $currentChunk + ); + $currentMode = $newMode; + $currentChunk = array($this->subtrees[ $key ]); + } + } + if ($currentMode && $currentChunk) { + $chunks[] = array( + 'mode' => $currentMode, + 'subtrees' => $currentChunk + ); + } + return $chunks; + } +} diff --git a/core/template/src/ParseTree/Text.php b/core/template/src/ParseTree/Text.php new file mode 100644 index 0000000..e613140 --- /dev/null +++ b/core/template/src/ParseTree/Text.php @@ -0,0 +1,59 @@ +data = $data; + $this->toBeStripped = $toBeStripped; + } + + /** + * Wether this section should be stripped on output to smarty php + * @return bool + */ + public function isToBeStripped() { + return $this->toBeStripped; + } + + /** + * Return buffer content + * + * @param \Smarty\Parser\TemplateParser $parser + * + * @return string text + */ + public function to_smarty_php(\Smarty\Parser\TemplateParser $parser) + { + return $this->data; + } +} diff --git a/core/template/src/Parser/ConfigfileParser.php b/core/template/src/Parser/ConfigfileParser.php new file mode 100644 index 0000000..7997a09 --- /dev/null +++ b/core/template/src/Parser/ConfigfileParser.php @@ -0,0 +1,972 @@ + '\\', + '\'' => '\''); + + /** + * constructor + * + * @param Lexer $lex + * @param Configfile $compiler + */ + public function __construct(Lexer $lex, Configfile $compiler) + { + $this->lex = $lex; + $this->smarty = $compiler->getSmarty(); + $this->compiler = $compiler; + $this->configOverwrite = $this->smarty->config_overwrite; + $this->configReadHidden = $this->smarty->config_read_hidden; + } + + /** + * parse optional boolean keywords + * + * @param string $str + * + * @return bool + */ + private function parse_bool($str) + { + $str = strtolower($str); + if (in_array($str, array('on', 'yes', 'true'))) { + $res = true; + } else { + $res = false; + } + return $res; + } + + /** + * parse single quoted string + * remove outer quotes + * unescape inner quotes + * + * @param string $qstr + * + * @return string + */ + private static function parse_single_quoted_string($qstr) + { + $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes + + $ss = preg_split('/(\\\\.)/', $escaped_string, - 1, PREG_SPLIT_DELIM_CAPTURE); + + $str = ''; + foreach ($ss as $s) { + if (strlen($s) === 2 && $s[0] === '\\') { + if (isset(self::$escapes_single[$s[1]])) { + $s = self::$escapes_single[$s[1]]; + } + } + $str .= $s; + } + return $str; + } + + /** + * parse double quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_double_quoted_string($qstr) + { + $inner_str = substr($qstr, 1, strlen($qstr) - 2); + return stripcslashes($inner_str); + } + + /** + * parse triple quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_tripple_double_quoted_string($qstr) + { + return stripcslashes($qstr); + } + + /** + * set a config variable in target array + * + * @param array $var + * @param array $target_array + */ + private function set_var(array $var, array &$target_array) + { + $key = $var['key']; + $value = $var['value']; + + if ($this->configOverwrite || !isset($target_array['vars'][$key])) { + $target_array['vars'][$key] = $value; + } else { + settype($target_array['vars'][$key], 'array'); + $target_array['vars'][$key][] = $value; + } + } + + /** + * add config variable to global vars + * + * @param array $vars + */ + private function add_global_vars(array $vars) + { + if (!isset($this->compiler->config_data['vars'])) { + $this->compiler->config_data['vars'] = array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data); + } + } + + /** + * add config variable to section + * + * @param string $section_name + * @param array $vars + */ + private function add_section_vars($section_name, array $vars) + { + if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) { + $this->compiler->config_data['sections'][$section_name]['vars'] = array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data['sections'][$section_name]); + } + } + + const TPC_OPENB = 1; + const TPC_SECTION = 2; + const TPC_CLOSEB = 3; + const TPC_DOT = 4; + const TPC_ID = 5; + const TPC_EQUAL = 6; + const TPC_FLOAT = 7; + const TPC_INT = 8; + const TPC_BOOL = 9; + const TPC_SINGLE_QUOTED_STRING = 10; + const TPC_DOUBLE_QUOTED_STRING = 11; + const TPC_TRIPPLE_QUOTES = 12; + const TPC_TRIPPLE_TEXT = 13; + const TPC_TRIPPLE_QUOTES_END = 14; + const TPC_NAKED_STRING = 15; + const TPC_OTHER = 16; + const TPC_NEWLINE = 17; + const TPC_COMMENTSTART = 18; + const YY_NO_ACTION = 60; + const YY_ACCEPT_ACTION = 59; + const YY_ERROR_ACTION = 58; + + const YY_SZ_ACTTAB = 39; +public static $yy_action = array( + 24, 25, 26, 27, 28, 12, 15, 23, 31, 32, + 59, 8, 9, 3, 21, 22, 33, 13, 33, 13, + 14, 10, 18, 16, 30, 11, 17, 20, 34, 7, + 5, 1, 2, 29, 4, 19, 52, 35, 6, + ); + public static $yy_lookahead = array( + 7, 8, 9, 10, 11, 12, 5, 27, 15, 16, + 20, 21, 25, 23, 25, 26, 17, 18, 17, 18, + 2, 25, 4, 13, 14, 1, 15, 24, 17, 22, + 3, 23, 23, 14, 6, 2, 28, 17, 3, +); + const YY_SHIFT_USE_DFLT = -8; + const YY_SHIFT_MAX = 19; + public static $yy_shift_ofst = array( + -8, 1, 1, 1, -7, -1, -1, 24, -8, -8, + -8, 18, 10, 11, 27, 28, 19, 20, 33, 35, +); + const YY_REDUCE_USE_DFLT = -21; + const YY_REDUCE_MAX = 10; + public static $yy_reduce_ofst = array( + -10, -11, -11, -11, -20, -13, -4, 3, 7, 8, + 9, +); + public static $yyExpectedTokens = array( + array(), + array(5, 17, 18, ), + array(5, 17, 18, ), + array(5, 17, 18, ), + array(7, 8, 9, 10, 11, 12, 15, 16, ), + array(17, 18, ), + array(17, 18, ), + array(1, ), + array(), + array(), + array(), + array(2, 4, ), + array(13, 14, ), + array(15, 17, ), + array(3, ), + array(6, ), + array(14, ), + array(17, ), + array(2, ), + array(3, ), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), +); + public static $yy_default = array( + 44, 40, 41, 37, 58, 58, 58, 36, 39, 44, + 44, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 38, 42, 43, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, +); + const YYNOCODE = 29; + const YYSTACKDEPTH = 100; + const YYNSTATE = 36; + const YYNRULE = 22; + const YYERRORSYMBOL = 19; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + public static $yyFallback = array( + ); + public function Trace($TraceFILE, $zTracePrompt) + { + if (!$TraceFILE) { + $zTracePrompt = 0; + } elseif (!$zTracePrompt) { + $TraceFILE = 0; + } + $this->yyTraceFILE = $TraceFILE; + $this->yyTracePrompt = $zTracePrompt; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + public $yyTraceFILE; + public $yyTracePrompt; + public $yyidx; /* Index of top element in stack */ + public $yyerrcnt; /* Shifts left before out of the error */ + public $yystack = array(); /* The parser's stack */ + + public $yyTokenName = array( + '$', 'OPENB', 'SECTION', 'CLOSEB', + 'DOT', 'ID', 'EQUAL', 'FLOAT', + 'INT', 'BOOL', 'SINGLE_QUOTED_STRING', 'DOUBLE_QUOTED_STRING', + 'TRIPPLE_QUOTES', 'TRIPPLE_TEXT', 'TRIPPLE_QUOTES_END', 'NAKED_STRING', + 'OTHER', 'NEWLINE', 'COMMENTSTART', 'error', + 'start', 'global_vars', 'sections', 'var_list', + 'section', 'newline', 'var', 'value', + ); + + public static $yyRuleName = array( + 'start ::= global_vars sections', + 'global_vars ::= var_list', + 'sections ::= sections section', + 'sections ::=', + 'section ::= OPENB SECTION CLOSEB newline var_list', + 'section ::= OPENB DOT SECTION CLOSEB newline var_list', + 'var_list ::= var_list newline', + 'var_list ::= var_list var', + 'var_list ::=', + 'var ::= ID EQUAL value', + 'value ::= FLOAT', + 'value ::= INT', + 'value ::= BOOL', + 'value ::= SINGLE_QUOTED_STRING', + 'value ::= DOUBLE_QUOTED_STRING', + 'value ::= TRIPPLE_QUOTES TRIPPLE_TEXT TRIPPLE_QUOTES_END', + 'value ::= TRIPPLE_QUOTES TRIPPLE_QUOTES_END', + 'value ::= NAKED_STRING', + 'value ::= OTHER', + 'newline ::= NEWLINE', + 'newline ::= COMMENTSTART NEWLINE', + 'newline ::= COMMENTSTART NAKED_STRING NEWLINE', + ); + + public function tokenName($tokenType) + { + if ($tokenType === 0) { + return 'End of Input'; + } + if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { + return $this->yyTokenName[$tokenType]; + } else { + return 'Unknown'; + } + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: break; /* If no destructor action specified: do nothing */ + } + } + + public function yy_pop_parser_stack() + { + if (empty($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if ($this->yyTraceFILE && $this->yyidx >= 0) { + fwrite($this->yyTraceFILE, + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . + "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx--; + + return $yymajor; + } + + public function __destruct() + { + while ($this->yystack !== Array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + public function yy_get_expected_tokens($token) + { + static $res3 = array(); + static $res4 = array(); + $state = $this->yystack[$this->yyidx]->stateno; + $expected = self::$yyExpectedTokens[$state]; + if (isset($res3[$state][$token])) { + if ($res3[$state][$token]) { + return $expected; + } + } else { + if ($res3[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { + return $expected; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ === 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return array_unique($expected); + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; + $nextstate = $this->yy_find_reduce_action( + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno][0]); + if (isset(self::$yyExpectedTokens[$nextstate])) { + $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); + if (isset($res4[$nextstate][$token])) { + if ($res4[$nextstate][$token]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } else { + if ($res4[$nextstate][$token] = in_array($token, self::$yyExpectedTokens[$nextstate], true)) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return array_unique($expected); + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return $expected; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + + public function yy_is_expected_token($token) + { + static $res = array(); + static $res2 = array(); + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[$this->yyidx]->stateno; + if (isset($res[$state][$token])) { + if ($res[$state][$token]) { + return true; + } + } else { + if ($res[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { + return true; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ === 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; + $nextstate = $this->yy_find_reduce_action( + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno][0]); + if (isset($res2[$nextstate][$token])) { + if ($res2[$nextstate][$token]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } else { + if ($res2[$nextstate][$token] = (isset(self::$yyExpectedTokens[$nextstate]) && in_array($token, self::$yyExpectedTokens[$nextstate], true))) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_find_shift_action($iLookAhead) + { + $stateno = $this->yystack[$this->yyidx]->stateno; + + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ + if (!isset(self::$yy_shift_ofst[$stateno])) { + // no shift actions + return self::$yy_default[$stateno]; + } + $i = self::$yy_shift_ofst[$stateno]; + if ($i === self::YY_SHIFT_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead === self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || + self::$yy_lookahead[$i] != $iLookAhead) { + if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) + && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { + if ($this->yyTraceFILE) { + fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'FALLBACK ' . + $this->yyTokenName[$iLookAhead] . ' => ' . + $this->yyTokenName[$iFallback] . "\n"); + } + + return $this->yy_find_shift_action($iFallback); + } + + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_find_reduce_action($stateno, $iLookAhead) + { + /* $stateno = $this->yystack[$this->yyidx]->stateno; */ + + if (!isset(self::$yy_reduce_ofst[$stateno])) { + return self::$yy_default[$stateno]; + } + $i = self::$yy_reduce_ofst[$stateno]; + if ($i === self::YY_REDUCE_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead === self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || + self::$yy_lookahead[$i] != $iLookAhead) { + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx--; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } +// line 245 "src/Parser/ConfigfileParser.y" + + $this->internalError = true; + $this->compiler->trigger_config_file_error('Stack overflow in configfile parser'); + + return; + } + $yytos = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + $this->yystack[] = $yytos; + if ($this->yyTraceFILE && $this->yyidx > 0) { + fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, + $yyNewState); + fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i++) { + fprintf($this->yyTraceFILE, " %s", + $this->yyTokenName[$this->yystack[$i]->major]); + } + fwrite($this->yyTraceFILE,"\n"); + } + } + + public static $yyRuleInfo = array( + array( 0 => 20, 1 => 2 ), + array( 0 => 21, 1 => 1 ), + array( 0 => 22, 1 => 2 ), + array( 0 => 22, 1 => 0 ), + array( 0 => 24, 1 => 5 ), + array( 0 => 24, 1 => 6 ), + array( 0 => 23, 1 => 2 ), + array( 0 => 23, 1 => 2 ), + array( 0 => 23, 1 => 0 ), + array( 0 => 26, 1 => 3 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 27, 1 => 3 ), + array( 0 => 27, 1 => 2 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 27, 1 => 1 ), + array( 0 => 25, 1 => 1 ), + array( 0 => 25, 1 => 2 ), + array( 0 => 25, 1 => 3 ), + ); + + public static $yyReduceMap = array( + 0 => 0, + 2 => 0, + 3 => 0, + 19 => 0, + 20 => 0, + 21 => 0, + 1 => 1, + 4 => 4, + 5 => 5, + 6 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 10 => 10, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, + 16 => 16, + 17 => 17, + 18 => 17, + ); +// line 251 "src/Parser/ConfigfileParser.y" + public function yy_r0(){ + $this->_retvalue = null; + } +// line 256 "src/Parser/ConfigfileParser.y" + public function yy_r1(){ + $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = null; + } +// line 270 "src/Parser/ConfigfileParser.y" + public function yy_r4(){ + $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = null; + } +// line 275 "src/Parser/ConfigfileParser.y" + public function yy_r5(){ + if ($this->configReadHidden) { + $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); + } + $this->_retvalue = null; + } +// line 283 "src/Parser/ConfigfileParser.y" + public function yy_r6(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 287 "src/Parser/ConfigfileParser.y" + public function yy_r7(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, array($this->yystack[$this->yyidx + 0]->minor)); + } +// line 291 "src/Parser/ConfigfileParser.y" + public function yy_r8(){ + $this->_retvalue = array(); + } +// line 297 "src/Parser/ConfigfileParser.y" + public function yy_r9(){ + $this->_retvalue = array('key' => $this->yystack[$this->yyidx + -2]->minor, 'value' => $this->yystack[$this->yyidx + 0]->minor); + } +// line 302 "src/Parser/ConfigfileParser.y" + public function yy_r10(){ + $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor; + } +// line 306 "src/Parser/ConfigfileParser.y" + public function yy_r11(){ + $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor; + } +// line 310 "src/Parser/ConfigfileParser.y" + public function yy_r12(){ + $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor); + } +// line 314 "src/Parser/ConfigfileParser.y" + public function yy_r13(){ + $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor); + } +// line 318 "src/Parser/ConfigfileParser.y" + public function yy_r14(){ + $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor); + } +// line 322 "src/Parser/ConfigfileParser.y" + public function yy_r15(){ + $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + -1]->minor); + } +// line 326 "src/Parser/ConfigfileParser.y" + public function yy_r16(){ + $this->_retvalue = ''; + } +// line 330 "src/Parser/ConfigfileParser.y" + public function yy_r17(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } + + private $_retvalue; + + public function yy_reduce($yyruleno) + { + if ($this->yyTraceFILE && $yyruleno >= 0 + && $yyruleno < count(self::$yyRuleName)) { + fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", + $this->yyTracePrompt, $yyruleno, + self::$yyRuleName[$yyruleno]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (isset(self::$yyReduceMap[$yyruleno])) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[$yyruleno][0]; + $yysize = self::$yyRuleInfo[$yyruleno][1]; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i--) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!$this->yyTraceFILE && $yysize) { + $this->yyidx++; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[$this->yyidx] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } elseif ($yyact === self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_parse_failed() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); + } while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + } + + public function yy_syntax_error($yymajor, $TOKEN) + { +// line 238 "src/Parser/ConfigfileParser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_config_file_error(); + } + + public function yy_accept() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); + } while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } +// line 231 "src/Parser/ConfigfileParser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + } + + public function doParse($yymajor, $yytokenvalue) + { + $yyerrorhit = 0; /* True if yymajor has invoked an error */ + + if ($this->yyidx === null || $this->yyidx < 0) { + $this->yyidx = 0; + $this->yyerrcnt = -1; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = 0; + $x->major = 0; + $this->yystack = array(); + $this->yystack[] = $x; + } + $yyendofinput = ($yymajor==0); + + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sInput %s\n", + $this->yyTracePrompt, $this->yyTokenName[$yymajor]); + } + + do { + $yyact = $this->yy_find_shift_action($yymajor); + if ($yymajor < self::YYERRORSYMBOL && + !$this->yy_is_expected_token($yymajor)) { + // force a syntax error + $yyact = self::YY_ERROR_ACTION; + } + if ($yyact < self::YYNSTATE) { + $this->yy_shift($yyact, $yymajor, $yytokenvalue); + $this->yyerrcnt--; + if ($yyendofinput && $this->yyidx >= 0) { + $yymajor = 0; + } else { + $yymajor = self::YYNOCODE; + } + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + $this->yy_reduce($yyact - self::YYNSTATE); + } elseif ($yyact === self::YY_ERROR_ACTION) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sSyntax Error!\n", + $this->yyTracePrompt); + } + if (self::YYERRORSYMBOL) { + if ($this->yyerrcnt < 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $yymx = $this->yystack[$this->yyidx]->major; + if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", + $this->yyTracePrompt, $this->yyTokenName[$yymajor]); + } + $this->yy_destructor($yymajor, $yytokenvalue); + $yymajor = self::YYNOCODE; + } else { + while ($this->yyidx >= 0 && + $yymx !== self::YYERRORSYMBOL && + ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE + ){ + $this->yy_pop_parser_stack(); + } + if ($this->yyidx < 0 || $yymajor==0) { + $this->yy_destructor($yymajor, $yytokenvalue); + $this->yy_parse_failed(); + $yymajor = self::YYNOCODE; + } elseif ($yymx !== self::YYERRORSYMBOL) { + $u2 = 0; + $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); + } + } + $this->yyerrcnt = 3; + $yyerrorhit = 1; + } else { + if ($this->yyerrcnt <= 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $this->yyerrcnt = 3; + $this->yy_destructor($yymajor, $yytokenvalue); + if ($yyendofinput) { + $this->yy_parse_failed(); + } + $yymajor = self::YYNOCODE; + } + } else { + $this->yy_accept(); + $yymajor = self::YYNOCODE; + } + } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0); + } +} + diff --git a/core/template/src/Parser/ConfigfileParser.y b/core/template/src/Parser/ConfigfileParser.y new file mode 100644 index 0000000..23afc2d --- /dev/null +++ b/core/template/src/Parser/ConfigfileParser.y @@ -0,0 +1,352 @@ +/** +* ConfigfileParser +* +* This is the config file parser +* +* +* @package Smarty +* @subpackage Config +* @author Uwe Tews +*/ +%name TPC_ +%declare_class { + +namespace Smarty\Parser; + +use \Smarty\Lexer\ConfigfileLexer as Lexer; +use \Smarty\Compiler\Configfile as Configfile; + +/** +* Smarty Internal Plugin Configfileparse +* +* This is the config file parser. +* It is generated from the ConfigfileParser.y file +* @package Smarty +* @subpackage Compiler +* @author Uwe Tews +*/ +class ConfigfileParser +} +%include_class +{ + /** + * result status + * + * @var bool + */ + public $successful = true; + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + /** + * @var + */ + public $yymajor; + /** + * lexer object + * + * @var Lexer + */ + private $lex; + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + /** + * compiler object + * + * @var Configfile + */ + public $compiler = null; + /** + * smarty object + * + * @var Smarty + */ + public $smarty = null; + /** + * copy of config_overwrite property + * + * @var bool + */ + private $configOverwrite = false; + /** + * copy of config_read_hidden property + * + * @var bool + */ + private $configReadHidden = false; + /** + * helper map + * + * @var array + */ + private static $escapes_single = array('\\' => '\\', + '\'' => '\''); + + /** + * constructor + * + * @param Lexer $lex + * @param Configfile $compiler + */ + public function __construct(Lexer $lex, Configfile $compiler) + { + $this->lex = $lex; + $this->smarty = $compiler->getSmarty(); + $this->compiler = $compiler; + $this->configOverwrite = $this->smarty->config_overwrite; + $this->configReadHidden = $this->smarty->config_read_hidden; + } + + /** + * parse optional boolean keywords + * + * @param string $str + * + * @return bool + */ + private function parse_bool($str) + { + $str = strtolower($str); + if (in_array($str, array('on', 'yes', 'true'))) { + $res = true; + } else { + $res = false; + } + return $res; + } + + /** + * parse single quoted string + * remove outer quotes + * unescape inner quotes + * + * @param string $qstr + * + * @return string + */ + private static function parse_single_quoted_string($qstr) + { + $escaped_string = substr($qstr, 1, strlen($qstr) - 2); //remove outer quotes + + $ss = preg_split('/(\\\\.)/', $escaped_string, - 1, PREG_SPLIT_DELIM_CAPTURE); + + $str = ''; + foreach ($ss as $s) { + if (strlen($s) === 2 && $s[0] === '\\') { + if (isset(self::$escapes_single[$s[1]])) { + $s = self::$escapes_single[$s[1]]; + } + } + $str .= $s; + } + return $str; + } + + /** + * parse double quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_double_quoted_string($qstr) + { + $inner_str = substr($qstr, 1, strlen($qstr) - 2); + return stripcslashes($inner_str); + } + + /** + * parse triple quoted string + * + * @param string $qstr + * + * @return string + */ + private static function parse_tripple_double_quoted_string($qstr) + { + return stripcslashes($qstr); + } + + /** + * set a config variable in target array + * + * @param array $var + * @param array $target_array + */ + private function set_var(array $var, array &$target_array) + { + $key = $var['key']; + $value = $var['value']; + + if ($this->configOverwrite || !isset($target_array['vars'][$key])) { + $target_array['vars'][$key] = $value; + } else { + settype($target_array['vars'][$key], 'array'); + $target_array['vars'][$key][] = $value; + } + } + + /** + * add config variable to global vars + * + * @param array $vars + */ + private function add_global_vars(array $vars) + { + if (!isset($this->compiler->config_data['vars'])) { + $this->compiler->config_data['vars'] = array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data); + } + } + + /** + * add config variable to section + * + * @param string $section_name + * @param array $vars + */ + private function add_section_vars($section_name, array $vars) + { + if (!isset($this->compiler->config_data['sections'][$section_name]['vars'])) { + $this->compiler->config_data['sections'][$section_name]['vars'] = array(); + } + foreach ($vars as $var) { + $this->set_var($var, $this->compiler->config_data['sections'][$section_name]); + } + } +} + +%token_prefix TPC_ + +%parse_accept +{ + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; +} + +%syntax_error +{ + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_config_file_error(); +} + +%stack_overflow +{ + $this->internalError = true; + $this->compiler->trigger_config_file_error('Stack overflow in configfile parser'); +} + +// Complete config file +start(res) ::= global_vars sections. { + res = null; +} + +// Global vars +global_vars(res) ::= var_list(vl). { + $this->add_global_vars(vl); + res = null; +} + +// Sections +sections(res) ::= sections section. { + res = null; +} + +sections(res) ::= . { + res = null; +} + +section(res) ::= OPENB SECTION(i) CLOSEB newline var_list(vars). { + $this->add_section_vars(i, vars); + res = null; +} + +section(res) ::= OPENB DOT SECTION(i) CLOSEB newline var_list(vars). { + if ($this->configReadHidden) { + $this->add_section_vars(i, vars); + } + res = null; +} + +// Var list +var_list(res) ::= var_list(vl) newline. { + res = vl; +} + +var_list(res) ::= var_list(vl) var(v). { + res = array_merge(vl, array(v)); +} + +var_list(res) ::= . { + res = array(); +} + + +// Var +var(res) ::= ID(id) EQUAL value(v). { + res = array('key' => id, 'value' => v); +} + + +value(res) ::= FLOAT(i). { + res = (float) i; +} + +value(res) ::= INT(i). { + res = (int) i; +} + +value(res) ::= BOOL(i). { + res = $this->parse_bool(i); +} + +value(res) ::= SINGLE_QUOTED_STRING(i). { + res = self::parse_single_quoted_string(i); +} + +value(res) ::= DOUBLE_QUOTED_STRING(i). { + res = self::parse_double_quoted_string(i); +} + +value(res) ::= TRIPPLE_QUOTES(i) TRIPPLE_TEXT(c) TRIPPLE_QUOTES_END(ii). { + res = self::parse_tripple_double_quoted_string(c); +} + +value(res) ::= TRIPPLE_QUOTES(i) TRIPPLE_QUOTES_END(ii). { + res = ''; +} + +value(res) ::= NAKED_STRING(i). { + res = i; +} + +// NOTE: this is not a valid rule +// It is added hier to produce a usefull error message on a missing '='; +value(res) ::= OTHER(i). { + res = i; +} + + +// Newline and comments +newline(res) ::= NEWLINE. { + res = null; +} + +newline(res) ::= COMMENTSTART NEWLINE. { + res = null; +} + +newline(res) ::= COMMENTSTART NAKED_STRING NEWLINE. { + res = null; +} diff --git a/core/template/src/Parser/TemplateParser.php b/core/template/src/Parser/TemplateParser.php new file mode 100644 index 0000000..772df98 --- /dev/null +++ b/core/template/src/Parser/TemplateParser.php @@ -0,0 +1,3178 @@ + +*/ +class TemplateParser +{ +// line 35 "src/Parser/TemplateParser.y" + + const ERR1 = 'Security error: Call to private object member not allowed'; + const ERR2 = 'Security error: Call to dynamic object member not allowed'; + + /** + * result status + * + * @var bool + */ + public $successful = true; + + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + + /** + * @var + */ + public $yymajor; + + /** + * last index of array variable + * + * @var mixed + */ + public $last_index; + + /** + * last variable name + * + * @var string + */ + public $last_variable; + + /** + * root parse tree buffer + * + * @var TemplateParseTree + */ + public $root_buffer; + + /** + * current parse tree object + * + * @var \Smarty\ParseTree\Base + */ + public $current_buffer; + + /** + * lexer object + * + * @var Lexer + */ + public $lex; + + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + + /** + * {strip} status + * + * @var bool + */ + public $strip = false; + /** + * compiler object + * + * @var TemplateCompiler + */ + public $compiler = null; + + /** + * smarty object + * + * @var \Smarty\Smarty + */ + public $smarty = null; + + /** + * template object + * + * @var \Smarty\Template + */ + public $template = null; + + /** + * block nesting level + * + * @var int + */ + public $block_nesting_level = 0; + + /** + * security object + * + * @var \Smarty\Security + */ + public $security = null; + + /** + * template prefix array + * + * @var \Smarty\ParseTree\Base[] + */ + public $template_prefix = array(); + + /** + * template prefix array + * + * @var \Smarty\ParseTree\Base[] + */ + public $template_postfix = array(); + + /** + * constructor + * + * @param Lexer $lex + * @param TemplateCompiler $compiler + */ + public function __construct(Lexer $lex, TemplateCompiler $compiler) + { + $this->lex = $lex; + $this->compiler = $compiler; + $this->template = $this->compiler->getTemplate(); + $this->smarty = $this->template->getSmarty(); + $this->security = $this->smarty->security_policy ?? false; + $this->current_buffer = $this->root_buffer = new TemplateParseTree(); + } + + /** + * insert PHP code in current buffer + * + * @param string $code + */ + public function insertPhpCode($code) + { + $this->current_buffer->append_subtree($this, new Tag($this, $code)); + } + + /** + * error rundown + * + */ + public function errorRunDown() + { + while ($this->yystack !== array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + /** + * merge PHP code with prefix code and return parse tree tag object + * + * @param string $code + * + * @return Tag + */ + private function mergePrefixCode($code) + { + $tmp = ''; + foreach ($this->compiler->prefix_code as $preCode) { + $tmp .= $preCode; + } + $this->compiler->prefix_code = array(); + $tmp .= $code; + return new Tag($this, $this->compiler->processNocacheCode($tmp)); + } + + + const TP_VERT = 1; + const TP_COLON = 2; + const TP_TEXT = 3; + const TP_STRIPON = 4; + const TP_STRIPOFF = 5; + const TP_LITERALSTART = 6; + const TP_LITERALEND = 7; + const TP_LITERAL = 8; + const TP_SIMPELOUTPUT = 9; + const TP_SIMPLETAG = 10; + const TP_SMARTYBLOCKCHILDPARENT = 11; + const TP_LDEL = 12; + const TP_RDEL = 13; + const TP_DOLLARID = 14; + const TP_EQUAL = 15; + const TP_ID = 16; + const TP_PTR = 17; + const TP_LDELIF = 18; + const TP_LDELFOR = 19; + const TP_SEMICOLON = 20; + const TP_INCDEC = 21; + const TP_TO = 22; + const TP_STEP = 23; + const TP_LDELFOREACH = 24; + const TP_SPACE = 25; + const TP_AS = 26; + const TP_APTR = 27; + const TP_LDELSETFILTER = 28; + const TP_CLOSETAG = 29; + const TP_LDELSLASH = 30; + const TP_ATTR = 31; + const TP_INTEGER = 32; + const TP_COMMA = 33; + const TP_OPENP = 34; + const TP_CLOSEP = 35; + const TP_MATH = 36; + const TP_UNIMATH = 37; + const TP_ISIN = 38; + const TP_QMARK = 39; + const TP_NOT = 40; + const TP_TYPECAST = 41; + const TP_HEX = 42; + const TP_DOT = 43; + const TP_INSTANCEOF = 44; + const TP_SINGLEQUOTESTRING = 45; + const TP_DOUBLECOLON = 46; + const TP_NAMESPACE = 47; + const TP_AT = 48; + const TP_HATCH = 49; + const TP_OPENB = 50; + const TP_CLOSEB = 51; + const TP_DOLLAR = 52; + const TP_LOGOP = 53; + const TP_SLOGOP = 54; + const TP_TLOGOP = 55; + const TP_SINGLECOND = 56; + const TP_ARRAYOPEN = 57; + const TP_QUOTE = 58; + const TP_BACKTICK = 59; + const YY_NO_ACTION = 542; + const YY_ACCEPT_ACTION = 541; + const YY_ERROR_ACTION = 540; + + const YY_SZ_ACTTAB = 2565; +public static $yy_action = array( + 33, 106, 269, 306, 179, 305, 200, 247, 248, 249, + 1, 264, 138, 237, 202, 361, 6, 87, 284, 222, + 338, 361, 112, 107, 400, 321, 217, 261, 218, 130, + 224, 400, 21, 400, 49, 44, 400, 32, 45, 46, + 278, 226, 400, 282, 400, 203, 400, 53, 4, 139, + 302, 231, 28, 102, 225, 5, 54, 247, 248, 249, + 1, 20, 135, 192, 193, 271, 6, 87, 246, 222, + 216, 29, 112, 229, 7, 159, 217, 261, 218, 140, + 208, 272, 21, 509, 53, 44, 13, 302, 45, 46, + 278, 226, 149, 235, 153, 203, 257, 53, 4, 328, + 302, 302, 256, 304, 143, 5, 54, 247, 248, 249, + 1, 302, 100, 394, 86, 236, 6, 87, 3, 222, + 102, 257, 112, 144, 97, 394, 217, 261, 218, 102, + 224, 394, 21, 256, 446, 44, 178, 305, 45, 46, + 278, 226, 302, 282, 200, 203, 446, 53, 4, 115, + 302, 47, 22, 285, 41, 5, 54, 247, 248, 249, + 1, 139, 137, 267, 202, 141, 6, 87, 14, 222, + 541, 99, 112, 151, 15, 446, 217, 261, 218, 314, + 224, 216, 21, 256, 233, 44, 9, 446, 45, 46, + 278, 226, 325, 282, 268, 203, 53, 53, 4, 302, + 302, 152, 257, 361, 320, 5, 54, 247, 248, 249, + 1, 264, 137, 102, 194, 361, 6, 87, 37, 222, + 102, 361, 112, 257, 89, 316, 217, 261, 218, 314, + 224, 216, 21, 36, 49, 44, 200, 40, 45, 46, + 278, 226, 115, 282, 237, 203, 14, 53, 4, 115, + 302, 238, 15, 155, 107, 5, 54, 247, 248, 249, + 1, 466, 136, 256, 202, 200, 6, 87, 466, 222, + 255, 171, 112, 264, 446, 310, 217, 261, 218, 158, + 224, 257, 11, 142, 157, 44, 446, 183, 45, 46, + 278, 226, 26, 282, 256, 203, 49, 53, 4, 446, + 302, 184, 260, 323, 176, 5, 54, 247, 248, 249, + 1, 446, 137, 264, 189, 291, 6, 87, 183, 222, + 200, 302, 112, 253, 178, 305, 217, 261, 218, 263, + 213, 18, 21, 200, 184, 44, 49, 15, 45, 46, + 278, 226, 146, 282, 269, 203, 25, 53, 4, 220, + 302, 312, 107, 152, 290, 5, 54, 247, 248, 249, + 1, 219, 137, 147, 187, 130, 6, 87, 259, 222, + 16, 19, 112, 256, 167, 258, 217, 261, 218, 111, + 224, 173, 21, 96, 256, 44, 200, 23, 45, 46, + 278, 226, 177, 282, 227, 203, 335, 53, 4, 174, + 302, 180, 305, 170, 90, 5, 54, 247, 248, 249, + 1, 184, 137, 256, 202, 91, 6, 87, 482, 222, + 160, 482, 112, 214, 197, 482, 217, 261, 218, 184, + 188, 181, 21, 245, 302, 44, 164, 140, 45, 46, + 278, 226, 466, 282, 13, 203, 166, 53, 4, 466, + 302, 42, 43, 286, 12, 5, 54, 247, 248, 249, + 1, 264, 139, 447, 202, 40, 6, 87, 293, 294, + 295, 296, 112, 17, 311, 447, 217, 261, 218, 337, + 224, 183, 21, 260, 49, 48, 244, 245, 45, 46, + 278, 226, 24, 282, 303, 203, 8, 53, 4, 92, + 302, 42, 43, 286, 12, 5, 54, 247, 248, 249, + 1, 10, 139, 9, 202, 317, 6, 87, 293, 294, + 295, 296, 112, 116, 299, 35, 217, 261, 218, 225, + 224, 198, 21, 98, 34, 44, 329, 324, 45, 46, + 278, 226, 448, 282, 448, 203, 161, 53, 4, 172, + 302, 129, 175, 225, 232, 5, 54, 288, 215, 216, + 252, 101, 93, 109, 243, 191, 103, 85, 450, 162, + 450, 24, 101, 330, 182, 273, 274, 300, 298, 301, + 250, 251, 281, 204, 283, 113, 289, 262, 300, 298, + 301, 121, 288, 215, 216, 252, 270, 93, 109, 275, + 190, 103, 60, 277, 279, 225, 237, 101, 280, 297, + 273, 274, 129, 239, 199, 266, 107, 281, 204, 283, + 7, 289, 101, 300, 298, 301, 288, 88, 216, 254, + 163, 114, 109, 265, 191, 103, 85, 200, 300, 298, + 301, 101, 200, 259, 273, 274, 19, 165, 326, 362, + 258, 281, 204, 283, 396, 289, 234, 300, 298, 301, + 288, 362, 216, 327, 200, 114, 396, 362, 201, 119, + 72, 336, 396, 37, 259, 101, 393, 19, 273, 274, + 154, 258, 228, 339, 94, 281, 204, 283, 393, 289, + 256, 300, 298, 301, 393, 38, 314, 288, 314, 216, + 314, 314, 114, 207, 319, 201, 119, 72, 314, 314, + 314, 314, 101, 221, 184, 273, 274, 156, 314, 314, + 314, 95, 281, 204, 283, 314, 289, 256, 300, 298, + 301, 314, 314, 314, 288, 314, 216, 314, 314, 108, + 206, 319, 201, 122, 51, 314, 120, 314, 314, 101, + 314, 184, 273, 274, 314, 314, 314, 314, 314, 281, + 204, 283, 314, 289, 314, 300, 298, 301, 288, 314, + 216, 314, 314, 114, 314, 314, 201, 122, 67, 314, + 314, 314, 314, 101, 314, 314, 273, 274, 314, 314, + 314, 314, 314, 281, 204, 283, 314, 289, 314, 300, + 298, 301, 288, 314, 216, 314, 314, 114, 212, 314, + 201, 122, 67, 314, 314, 314, 314, 101, 314, 314, + 273, 274, 314, 314, 314, 314, 314, 281, 204, 283, + 314, 289, 314, 300, 298, 301, 288, 314, 216, 314, + 314, 114, 205, 314, 201, 119, 72, 314, 314, 314, + 314, 101, 314, 314, 273, 274, 314, 314, 314, 314, + 314, 281, 204, 283, 314, 289, 314, 300, 298, 301, + 314, 314, 314, 288, 314, 216, 314, 314, 114, 314, + 318, 201, 122, 78, 314, 314, 314, 314, 101, 314, + 482, 273, 274, 482, 314, 314, 314, 482, 281, 204, + 283, 314, 289, 209, 211, 298, 301, 288, 314, 216, + 314, 314, 108, 314, 314, 201, 122, 58, 314, 238, + 314, 314, 101, 314, 314, 273, 274, 314, 314, 482, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 288, 314, 216, 314, 314, 114, 314, 314, 201, + 118, 64, 314, 314, 314, 314, 101, 314, 314, 273, + 274, 314, 314, 314, 314, 314, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 288, 314, 216, 314, 314, + 114, 314, 314, 196, 117, 59, 314, 314, 314, 314, + 101, 314, 314, 273, 274, 314, 314, 314, 314, 314, + 281, 204, 283, 314, 289, 314, 300, 298, 301, 288, + 314, 216, 314, 314, 114, 314, 314, 201, 104, 84, + 314, 314, 314, 314, 101, 314, 314, 273, 274, 314, + 314, 314, 314, 314, 281, 204, 283, 314, 289, 314, + 300, 298, 301, 288, 314, 216, 314, 314, 114, 314, + 314, 201, 105, 83, 314, 314, 314, 314, 101, 314, + 314, 273, 274, 314, 314, 314, 314, 314, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 288, 314, 216, + 314, 314, 114, 314, 314, 201, 122, 55, 314, 314, + 314, 314, 101, 314, 314, 273, 274, 314, 314, 314, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 288, 314, 216, 314, 314, 114, 314, 314, 201, + 122, 66, 314, 314, 314, 314, 101, 314, 314, 273, + 274, 314, 314, 314, 314, 314, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 288, 314, 216, 314, 314, + 114, 314, 314, 201, 104, 56, 314, 314, 314, 314, + 101, 314, 314, 273, 274, 314, 314, 314, 314, 314, + 281, 204, 283, 314, 289, 314, 300, 298, 301, 288, + 314, 216, 314, 314, 114, 314, 314, 201, 122, 65, + 314, 314, 314, 314, 101, 314, 314, 273, 274, 314, + 314, 314, 314, 314, 281, 204, 283, 314, 289, 314, + 300, 298, 301, 288, 314, 216, 314, 314, 114, 314, + 314, 201, 122, 57, 314, 314, 314, 314, 101, 314, + 314, 273, 274, 314, 314, 314, 314, 314, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 288, 314, 216, + 314, 314, 114, 314, 314, 201, 122, 58, 314, 314, + 314, 314, 101, 314, 314, 273, 274, 314, 314, 314, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 288, 314, 216, 314, 314, 114, 314, 314, 201, + 122, 68, 314, 314, 314, 314, 101, 314, 314, 273, + 274, 314, 314, 314, 314, 314, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 288, 314, 216, 314, 314, + 114, 314, 314, 201, 122, 69, 314, 314, 314, 314, + 101, 314, 314, 273, 274, 314, 314, 314, 314, 314, + 281, 204, 283, 314, 289, 314, 300, 298, 301, 288, + 314, 216, 314, 314, 114, 314, 314, 201, 122, 70, + 314, 314, 314, 314, 101, 314, 314, 273, 274, 314, + 314, 314, 314, 314, 281, 204, 283, 314, 289, 314, + 300, 298, 301, 288, 314, 216, 314, 314, 114, 314, + 314, 201, 122, 71, 314, 314, 314, 314, 101, 314, + 314, 273, 274, 314, 314, 314, 314, 314, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 288, 314, 216, + 314, 314, 114, 314, 314, 201, 122, 73, 314, 314, + 314, 314, 101, 314, 314, 273, 274, 314, 314, 314, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 288, 314, 216, 314, 314, 114, 314, 314, 195, + 122, 61, 314, 314, 314, 314, 101, 314, 314, 273, + 274, 314, 314, 314, 314, 314, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 288, 314, 216, 314, 314, + 114, 314, 314, 201, 122, 62, 314, 314, 314, 314, + 101, 314, 314, 273, 274, 314, 314, 314, 314, 314, + 281, 204, 283, 314, 289, 314, 300, 298, 301, 288, + 314, 216, 314, 314, 114, 314, 314, 201, 122, 63, + 314, 314, 314, 314, 101, 314, 314, 273, 274, 314, + 314, 314, 314, 314, 281, 204, 283, 314, 289, 314, + 300, 298, 301, 288, 314, 216, 314, 314, 114, 314, + 314, 201, 122, 74, 314, 314, 314, 314, 101, 314, + 314, 273, 274, 314, 314, 314, 314, 314, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 288, 314, 216, + 314, 314, 114, 314, 314, 201, 122, 75, 314, 314, + 314, 314, 101, 314, 314, 273, 274, 314, 314, 314, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 288, 314, 216, 314, 314, 114, 314, 314, 201, + 122, 76, 314, 314, 314, 314, 101, 314, 314, 273, + 274, 314, 314, 314, 314, 314, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 288, 314, 216, 314, 314, + 114, 314, 314, 201, 122, 77, 314, 314, 314, 314, + 101, 314, 314, 273, 274, 314, 314, 314, 314, 314, + 281, 204, 283, 314, 289, 314, 300, 298, 301, 288, + 314, 216, 314, 314, 114, 314, 314, 201, 122, 79, + 314, 314, 314, 314, 101, 314, 314, 273, 274, 314, + 314, 314, 314, 314, 281, 204, 283, 314, 289, 314, + 210, 298, 301, 288, 314, 216, 314, 314, 114, 314, + 314, 201, 122, 80, 314, 314, 314, 314, 101, 314, + 314, 273, 274, 314, 314, 314, 314, 314, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 288, 314, 216, + 314, 314, 114, 314, 314, 201, 122, 81, 314, 314, + 314, 314, 101, 314, 314, 273, 274, 314, 314, 314, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 288, 314, 216, 314, 314, 114, 314, 314, 201, + 122, 82, 314, 314, 314, 314, 101, 314, 314, 273, + 274, 314, 314, 314, 314, 314, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 288, 314, 216, 314, 314, + 114, 314, 314, 201, 122, 50, 314, 314, 314, 314, + 101, 314, 314, 273, 274, 314, 314, 314, 314, 314, + 281, 204, 283, 314, 289, 314, 300, 298, 301, 288, + 314, 216, 314, 314, 114, 314, 314, 201, 122, 52, + 314, 314, 314, 314, 101, 314, 314, 273, 274, 314, + 314, 314, 314, 314, 281, 204, 283, 314, 289, 314, + 300, 298, 301, 288, 314, 216, 168, 314, 114, 314, + 314, 201, 134, 314, 314, 314, 256, 314, 101, 47, + 22, 285, 41, 314, 314, 314, 314, 333, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 288, 314, 216, + 145, 314, 114, 314, 314, 201, 128, 314, 314, 314, + 256, 314, 101, 47, 22, 285, 41, 314, 314, 314, + 314, 287, 281, 204, 283, 315, 289, 314, 300, 298, + 301, 247, 248, 249, 2, 314, 313, 314, 314, 314, + 6, 87, 259, 314, 314, 19, 112, 314, 14, 258, + 217, 261, 218, 314, 15, 39, 314, 14, 14, 42, + 43, 286, 12, 15, 15, 314, 314, 314, 42, 43, + 286, 12, 314, 314, 314, 314, 293, 294, 295, 296, + 308, 27, 314, 314, 315, 293, 294, 295, 296, 314, + 247, 248, 249, 2, 314, 313, 314, 110, 314, 6, + 87, 314, 314, 314, 314, 112, 314, 314, 148, 217, + 261, 218, 314, 42, 43, 286, 12, 314, 42, 43, + 286, 12, 314, 314, 314, 314, 314, 314, 314, 314, + 293, 294, 295, 296, 314, 293, 294, 295, 296, 309, + 27, 314, 314, 240, 241, 242, 133, 223, 314, 247, + 248, 249, 1, 314, 482, 314, 314, 482, 6, 87, + 3, 482, 466, 314, 112, 314, 276, 314, 217, 261, + 218, 288, 314, 216, 314, 314, 114, 314, 314, 201, + 132, 314, 314, 314, 314, 314, 101, 314, 466, 314, + 314, 466, 314, 482, 314, 466, 281, 204, 283, 314, + 289, 314, 300, 298, 301, 314, 288, 314, 216, 314, + 200, 114, 314, 314, 201, 123, 314, 314, 314, 314, + 314, 101, 365, 314, 314, 314, 230, 314, 314, 314, + 314, 281, 204, 283, 14, 289, 314, 300, 298, 301, + 15, 314, 288, 446, 216, 314, 169, 114, 314, 314, + 201, 124, 314, 314, 314, 446, 256, 101, 314, 47, + 22, 285, 41, 314, 314, 314, 314, 281, 204, 283, + 314, 289, 314, 300, 298, 301, 314, 288, 314, 216, + 314, 314, 114, 314, 314, 201, 125, 314, 314, 314, + 314, 314, 101, 314, 314, 314, 314, 314, 314, 314, + 314, 314, 281, 204, 283, 314, 289, 314, 300, 298, + 301, 314, 314, 288, 314, 216, 314, 314, 114, 314, + 314, 201, 126, 314, 314, 314, 314, 314, 101, 314, + 314, 314, 314, 314, 314, 314, 314, 314, 281, 204, + 283, 314, 289, 314, 300, 298, 301, 314, 288, 314, + 216, 314, 314, 114, 314, 314, 201, 127, 314, 314, + 314, 314, 314, 101, 314, 314, 314, 314, 314, 314, + 314, 314, 314, 281, 204, 283, 314, 289, 314, 300, + 298, 301, 314, 314, 288, 314, 216, 223, 314, 114, + 314, 314, 201, 131, 482, 314, 314, 482, 314, 101, + 314, 482, 466, 314, 314, 314, 276, 314, 314, 281, + 204, 283, 314, 289, 314, 300, 298, 301, 314, 314, + 409, 314, 314, 314, 314, 314, 314, 314, 466, 314, + 314, 466, 314, 482, 223, 466, 292, 314, 314, 314, + 314, 482, 314, 314, 482, 314, 314, 36, 482, 466, + 314, 223, 446, 276, 409, 409, 409, 409, 482, 314, + 314, 482, 314, 314, 446, 482, 466, 314, 314, 30, + 276, 409, 409, 409, 409, 466, 482, 314, 466, 482, + 482, 314, 466, 482, 466, 314, 314, 314, 276, 314, + 314, 314, 466, 314, 314, 466, 332, 482, 314, 466, + 314, 314, 314, 314, 314, 331, 42, 43, 286, 12, + 466, 314, 314, 466, 314, 482, 314, 466, 314, 42, + 43, 286, 12, 293, 294, 295, 296, 307, 314, 42, + 43, 286, 12, 185, 314, 314, 293, 294, 295, 296, + 186, 314, 314, 314, 322, 314, 293, 294, 295, 296, + 42, 43, 286, 12, 31, 314, 42, 43, 286, 12, + 314, 334, 314, 42, 43, 286, 12, 293, 294, 295, + 296, 314, 314, 293, 294, 295, 296, 314, 314, 314, + 293, 294, 295, 296, 42, 43, 286, 12, 42, 43, + 286, 12, 482, 314, 314, 482, 314, 314, 314, 482, + 466, 293, 294, 295, 296, 293, 294, 295, 296, 314, + 314, 314, 259, 314, 314, 19, 314, 314, 314, 258, + 314, 314, 314, 314, 314, 314, 466, 314, 14, 466, + 150, 482, 314, 466, 15, + ); + public static $yy_lookahead = array( + 2, 80, 100, 13, 102, 103, 1, 9, 10, 11, + 12, 21, 14, 70, 16, 25, 18, 19, 93, 21, + 77, 31, 24, 80, 13, 104, 28, 29, 30, 104, + 32, 20, 34, 22, 44, 37, 25, 39, 40, 41, + 42, 43, 31, 45, 33, 47, 35, 49, 50, 14, + 52, 16, 12, 17, 43, 57, 58, 9, 10, 11, + 12, 12, 14, 14, 16, 16, 18, 19, 65, 21, + 67, 12, 24, 14, 34, 16, 28, 29, 30, 43, + 32, 32, 34, 1, 49, 37, 50, 52, 40, 41, + 42, 43, 72, 45, 99, 47, 101, 49, 50, 51, + 52, 52, 82, 69, 14, 57, 58, 9, 10, 11, + 12, 52, 14, 13, 16, 15, 18, 19, 15, 21, + 17, 101, 24, 72, 34, 25, 28, 29, 30, 17, + 32, 31, 34, 82, 34, 37, 102, 103, 40, 41, + 42, 43, 52, 45, 1, 47, 46, 49, 50, 46, + 52, 85, 86, 87, 88, 57, 58, 9, 10, 11, + 12, 14, 14, 16, 16, 80, 18, 19, 25, 21, + 61, 62, 24, 72, 31, 34, 28, 29, 30, 65, + 32, 67, 34, 82, 43, 37, 33, 46, 40, 41, + 42, 43, 51, 45, 47, 47, 49, 49, 50, 52, + 52, 99, 101, 13, 51, 57, 58, 9, 10, 11, + 12, 21, 14, 17, 16, 25, 18, 19, 15, 21, + 17, 31, 24, 101, 110, 111, 28, 29, 30, 65, + 32, 67, 34, 15, 44, 37, 1, 2, 40, 41, + 42, 43, 46, 45, 70, 47, 25, 49, 50, 46, + 52, 77, 31, 72, 80, 57, 58, 9, 10, 11, + 12, 43, 14, 82, 16, 1, 18, 19, 50, 21, + 82, 76, 24, 21, 34, 111, 28, 29, 30, 99, + 32, 101, 34, 14, 72, 37, 46, 106, 40, 41, + 42, 43, 27, 45, 82, 47, 44, 49, 50, 34, + 52, 106, 107, 51, 76, 57, 58, 9, 10, 11, + 12, 46, 14, 21, 16, 51, 18, 19, 106, 21, + 1, 52, 24, 69, 102, 103, 28, 29, 30, 16, + 32, 25, 34, 1, 106, 37, 44, 31, 40, 41, + 42, 43, 70, 45, 100, 47, 27, 49, 50, 17, + 52, 59, 80, 99, 93, 57, 58, 9, 10, 11, + 12, 48, 14, 72, 16, 104, 18, 19, 9, 21, + 20, 12, 24, 82, 72, 16, 28, 29, 30, 79, + 32, 76, 34, 33, 82, 37, 1, 2, 40, 41, + 42, 43, 14, 45, 16, 47, 14, 49, 50, 76, + 52, 102, 103, 72, 80, 57, 58, 9, 10, 11, + 12, 106, 14, 82, 16, 80, 18, 19, 9, 21, + 99, 12, 24, 63, 64, 16, 28, 29, 30, 106, + 32, 6, 34, 8, 52, 37, 99, 43, 40, 41, + 42, 43, 43, 45, 50, 47, 99, 49, 50, 50, + 52, 36, 37, 38, 39, 57, 58, 9, 10, 11, + 12, 21, 14, 34, 16, 2, 18, 19, 53, 54, + 55, 56, 24, 15, 59, 46, 28, 29, 30, 21, + 32, 106, 34, 107, 44, 37, 7, 8, 40, 41, + 42, 43, 33, 45, 35, 47, 34, 49, 50, 99, + 52, 36, 37, 38, 39, 57, 58, 9, 10, 11, + 12, 34, 14, 33, 16, 35, 18, 19, 53, 54, + 55, 56, 24, 46, 103, 15, 28, 29, 30, 43, + 32, 64, 34, 81, 33, 37, 35, 51, 40, 41, + 42, 43, 33, 45, 35, 47, 99, 49, 50, 81, + 52, 70, 81, 43, 73, 57, 58, 65, 66, 67, + 68, 80, 70, 71, 7, 73, 74, 75, 33, 99, + 35, 33, 80, 35, 16, 83, 84, 96, 97, 98, + 13, 13, 90, 91, 92, 16, 94, 16, 96, 97, + 98, 16, 65, 66, 67, 68, 16, 70, 71, 14, + 73, 74, 75, 16, 32, 43, 70, 80, 32, 16, + 83, 84, 70, 77, 78, 73, 80, 90, 91, 92, + 34, 94, 80, 96, 97, 98, 65, 16, 67, 68, + 49, 70, 71, 91, 73, 74, 75, 1, 96, 97, + 98, 80, 1, 9, 83, 84, 12, 49, 51, 13, + 16, 90, 91, 92, 13, 94, 16, 96, 97, 98, + 65, 25, 67, 51, 1, 70, 25, 31, 73, 74, + 75, 16, 31, 15, 9, 80, 13, 12, 83, 84, + 72, 16, 48, 35, 76, 90, 91, 92, 25, 94, + 82, 96, 97, 98, 31, 22, 112, 65, 112, 67, + 112, 112, 70, 108, 109, 73, 74, 75, 112, 112, + 112, 112, 80, 48, 106, 83, 84, 72, 112, 112, + 112, 76, 90, 91, 92, 112, 94, 82, 96, 97, + 98, 112, 112, 112, 65, 112, 67, 112, 112, 70, + 108, 109, 73, 74, 75, 112, 77, 112, 112, 80, + 112, 106, 83, 84, 112, 112, 112, 112, 112, 90, + 91, 92, 112, 94, 112, 96, 97, 98, 65, 112, + 67, 112, 112, 70, 112, 112, 73, 74, 75, 112, + 112, 112, 112, 80, 112, 112, 83, 84, 112, 112, + 112, 112, 112, 90, 91, 92, 112, 94, 112, 96, + 97, 98, 65, 112, 67, 112, 112, 70, 105, 112, + 73, 74, 75, 112, 112, 112, 112, 80, 112, 112, + 83, 84, 112, 112, 112, 112, 112, 90, 91, 92, + 112, 94, 112, 96, 97, 98, 65, 112, 67, 112, + 112, 70, 105, 112, 73, 74, 75, 112, 112, 112, + 112, 80, 112, 112, 83, 84, 112, 112, 112, 112, + 112, 90, 91, 92, 112, 94, 112, 96, 97, 98, + 112, 112, 112, 65, 112, 67, 112, 112, 70, 112, + 109, 73, 74, 75, 112, 112, 112, 112, 80, 112, + 9, 83, 84, 12, 112, 112, 112, 16, 90, 91, + 92, 112, 94, 95, 96, 97, 98, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 75, 112, 77, + 112, 112, 80, 112, 112, 83, 84, 112, 112, 48, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 75, 112, 112, 112, 112, 80, 112, 112, 83, + 84, 112, 112, 112, 112, 112, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 65, 112, 67, 112, 112, + 70, 112, 112, 73, 74, 75, 112, 112, 112, 112, + 80, 112, 112, 83, 84, 112, 112, 112, 112, 112, + 90, 91, 92, 112, 94, 112, 96, 97, 98, 65, + 112, 67, 112, 112, 70, 112, 112, 73, 74, 75, + 112, 112, 112, 112, 80, 112, 112, 83, 84, 112, + 112, 112, 112, 112, 90, 91, 92, 112, 94, 112, + 96, 97, 98, 65, 112, 67, 112, 112, 70, 112, + 112, 73, 74, 75, 112, 112, 112, 112, 80, 112, + 112, 83, 84, 112, 112, 112, 112, 112, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 75, 112, 112, + 112, 112, 80, 112, 112, 83, 84, 112, 112, 112, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 75, 112, 112, 112, 112, 80, 112, 112, 83, + 84, 112, 112, 112, 112, 112, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 65, 112, 67, 112, 112, + 70, 112, 112, 73, 74, 75, 112, 112, 112, 112, + 80, 112, 112, 83, 84, 112, 112, 112, 112, 112, + 90, 91, 92, 112, 94, 112, 96, 97, 98, 65, + 112, 67, 112, 112, 70, 112, 112, 73, 74, 75, + 112, 112, 112, 112, 80, 112, 112, 83, 84, 112, + 112, 112, 112, 112, 90, 91, 92, 112, 94, 112, + 96, 97, 98, 65, 112, 67, 112, 112, 70, 112, + 112, 73, 74, 75, 112, 112, 112, 112, 80, 112, + 112, 83, 84, 112, 112, 112, 112, 112, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 75, 112, 112, + 112, 112, 80, 112, 112, 83, 84, 112, 112, 112, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 75, 112, 112, 112, 112, 80, 112, 112, 83, + 84, 112, 112, 112, 112, 112, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 65, 112, 67, 112, 112, + 70, 112, 112, 73, 74, 75, 112, 112, 112, 112, + 80, 112, 112, 83, 84, 112, 112, 112, 112, 112, + 90, 91, 92, 112, 94, 112, 96, 97, 98, 65, + 112, 67, 112, 112, 70, 112, 112, 73, 74, 75, + 112, 112, 112, 112, 80, 112, 112, 83, 84, 112, + 112, 112, 112, 112, 90, 91, 92, 112, 94, 112, + 96, 97, 98, 65, 112, 67, 112, 112, 70, 112, + 112, 73, 74, 75, 112, 112, 112, 112, 80, 112, + 112, 83, 84, 112, 112, 112, 112, 112, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 75, 112, 112, + 112, 112, 80, 112, 112, 83, 84, 112, 112, 112, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 75, 112, 112, 112, 112, 80, 112, 112, 83, + 84, 112, 112, 112, 112, 112, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 65, 112, 67, 112, 112, + 70, 112, 112, 73, 74, 75, 112, 112, 112, 112, + 80, 112, 112, 83, 84, 112, 112, 112, 112, 112, + 90, 91, 92, 112, 94, 112, 96, 97, 98, 65, + 112, 67, 112, 112, 70, 112, 112, 73, 74, 75, + 112, 112, 112, 112, 80, 112, 112, 83, 84, 112, + 112, 112, 112, 112, 90, 91, 92, 112, 94, 112, + 96, 97, 98, 65, 112, 67, 112, 112, 70, 112, + 112, 73, 74, 75, 112, 112, 112, 112, 80, 112, + 112, 83, 84, 112, 112, 112, 112, 112, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 75, 112, 112, + 112, 112, 80, 112, 112, 83, 84, 112, 112, 112, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 75, 112, 112, 112, 112, 80, 112, 112, 83, + 84, 112, 112, 112, 112, 112, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 65, 112, 67, 112, 112, + 70, 112, 112, 73, 74, 75, 112, 112, 112, 112, + 80, 112, 112, 83, 84, 112, 112, 112, 112, 112, + 90, 91, 92, 112, 94, 112, 96, 97, 98, 65, + 112, 67, 112, 112, 70, 112, 112, 73, 74, 75, + 112, 112, 112, 112, 80, 112, 112, 83, 84, 112, + 112, 112, 112, 112, 90, 91, 92, 112, 94, 112, + 96, 97, 98, 65, 112, 67, 112, 112, 70, 112, + 112, 73, 74, 75, 112, 112, 112, 112, 80, 112, + 112, 83, 84, 112, 112, 112, 112, 112, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 75, 112, 112, + 112, 112, 80, 112, 112, 83, 84, 112, 112, 112, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 75, 112, 112, 112, 112, 80, 112, 112, 83, + 84, 112, 112, 112, 112, 112, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 65, 112, 67, 112, 112, + 70, 112, 112, 73, 74, 75, 112, 112, 112, 112, + 80, 112, 112, 83, 84, 112, 112, 112, 112, 112, + 90, 91, 92, 112, 94, 112, 96, 97, 98, 65, + 112, 67, 112, 112, 70, 112, 112, 73, 74, 75, + 112, 112, 112, 112, 80, 112, 112, 83, 84, 112, + 112, 112, 112, 112, 90, 91, 92, 112, 94, 112, + 96, 97, 98, 65, 112, 67, 72, 112, 70, 112, + 112, 73, 74, 112, 112, 112, 82, 112, 80, 85, + 86, 87, 88, 112, 112, 112, 112, 89, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 65, 112, 67, + 72, 112, 70, 112, 112, 73, 74, 112, 112, 112, + 82, 112, 80, 85, 86, 87, 88, 112, 112, 112, + 112, 89, 90, 91, 92, 3, 94, 112, 96, 97, + 98, 9, 10, 11, 12, 112, 14, 112, 112, 112, + 18, 19, 9, 112, 112, 12, 24, 112, 25, 16, + 28, 29, 30, 112, 31, 23, 112, 25, 25, 36, + 37, 38, 39, 31, 31, 112, 112, 112, 36, 37, + 38, 39, 112, 112, 112, 112, 53, 54, 55, 56, + 58, 59, 112, 112, 3, 53, 54, 55, 56, 112, + 9, 10, 11, 12, 112, 14, 112, 20, 112, 18, + 19, 112, 112, 112, 112, 24, 112, 112, 26, 28, + 29, 30, 112, 36, 37, 38, 39, 112, 36, 37, + 38, 39, 112, 112, 112, 112, 112, 112, 112, 112, + 53, 54, 55, 56, 112, 53, 54, 55, 56, 58, + 59, 112, 112, 3, 4, 5, 6, 2, 112, 9, + 10, 11, 12, 112, 9, 112, 112, 12, 18, 19, + 15, 16, 17, 112, 24, 112, 21, 112, 28, 29, + 30, 65, 112, 67, 112, 112, 70, 112, 112, 73, + 74, 112, 112, 112, 112, 112, 80, 112, 43, 112, + 112, 46, 112, 48, 112, 50, 90, 91, 92, 112, + 94, 112, 96, 97, 98, 112, 65, 112, 67, 112, + 1, 70, 112, 112, 73, 74, 112, 112, 112, 112, + 112, 80, 13, 112, 112, 112, 17, 112, 112, 112, + 112, 90, 91, 92, 25, 94, 112, 96, 97, 98, + 31, 112, 65, 34, 67, 112, 72, 70, 112, 112, + 73, 74, 112, 112, 112, 46, 82, 80, 112, 85, + 86, 87, 88, 112, 112, 112, 112, 90, 91, 92, + 112, 94, 112, 96, 97, 98, 112, 65, 112, 67, + 112, 112, 70, 112, 112, 73, 74, 112, 112, 112, + 112, 112, 80, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 90, 91, 92, 112, 94, 112, 96, 97, + 98, 112, 112, 65, 112, 67, 112, 112, 70, 112, + 112, 73, 74, 112, 112, 112, 112, 112, 80, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 90, 91, + 92, 112, 94, 112, 96, 97, 98, 112, 65, 112, + 67, 112, 112, 70, 112, 112, 73, 74, 112, 112, + 112, 112, 112, 80, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 90, 91, 92, 112, 94, 112, 96, + 97, 98, 112, 112, 65, 112, 67, 2, 112, 70, + 112, 112, 73, 74, 9, 112, 112, 12, 112, 80, + 112, 16, 17, 112, 112, 112, 21, 112, 112, 90, + 91, 92, 112, 94, 112, 96, 97, 98, 112, 112, + 2, 112, 112, 112, 112, 112, 112, 112, 43, 112, + 112, 46, 112, 48, 2, 50, 51, 112, 112, 112, + 112, 9, 112, 112, 12, 112, 112, 15, 16, 17, + 112, 2, 34, 21, 36, 37, 38, 39, 9, 112, + 112, 12, 112, 112, 46, 16, 17, 112, 112, 2, + 21, 53, 54, 55, 56, 43, 9, 112, 46, 12, + 48, 112, 50, 16, 17, 112, 112, 112, 21, 112, + 112, 112, 43, 112, 112, 46, 13, 48, 112, 50, + 112, 112, 112, 112, 112, 35, 36, 37, 38, 39, + 43, 112, 112, 46, 112, 48, 112, 50, 112, 36, + 37, 38, 39, 53, 54, 55, 56, 13, 112, 36, + 37, 38, 39, 13, 112, 112, 53, 54, 55, 56, + 13, 112, 112, 112, 51, 112, 53, 54, 55, 56, + 36, 37, 38, 39, 2, 112, 36, 37, 38, 39, + 112, 13, 112, 36, 37, 38, 39, 53, 54, 55, + 56, 112, 112, 53, 54, 55, 56, 112, 112, 112, + 53, 54, 55, 56, 36, 37, 38, 39, 36, 37, + 38, 39, 9, 112, 112, 12, 112, 112, 112, 16, + 17, 53, 54, 55, 56, 53, 54, 55, 56, 112, + 112, 112, 9, 112, 112, 12, 112, 112, 112, 16, + 112, 112, 112, 112, 112, 112, 43, 112, 25, 46, + 27, 48, 112, 50, 31, +); + const YY_SHIFT_USE_DFLT = -11; + const YY_SHIFT_MAX = 239; + public static $yy_shift_ofst = array( + -11, 98, 98, 148, 198, 198, 248, 148, 148, 198, + 148, 248, -2, 48, 298, 148, 148, 148, 298, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 348, 148, 148, 148, 148, 148, 398, 148, 148, 148, + 448, 498, 498, 498, 498, 498, 498, 498, 498, 147, + 1962, 1953, 1953, 35, 1952, 2007, 2012, 2413, 2400, 2423, + 2444, 415, 2450, 2457, 2482, 2478, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, + 465, 465, 465, 465, 465, 465, 2139, 90, 143, 2011, + 2533, 1963, 36, 103, 143, 143, 90, 90, 235, 2070, + 2075, 634, 59, 636, 641, 663, 359, 359, 203, 221, + 269, 221, 306, 332, 196, 378, 378, 264, 385, 319, + 221, 5, 5, 5, 5, 5, 5, 5, 5, 112, + 112, 82, 5, -11, -11, 2315, 2362, 2379, 2397, 2513, + 49, 665, 409, 218, 221, 221, 458, 221, 382, 221, + 382, 221, 394, 394, 221, 221, 221, 221, 394, 40, + 394, 394, 394, 399, 394, 399, 394, 221, 221, 221, + 221, 5, 463, 5, 5, 463, 5, 462, 112, 112, + 112, -11, -11, -11, -11, -11, -11, 2348, 11, 100, + -10, 190, 881, 141, 265, 292, 252, 425, 479, 350, + 313, 440, 240, 429, 477, 459, 480, 153, 486, 501, + 509, 535, 538, 510, 557, 567, 568, 558, 569, 571, + 575, 580, 585, 587, 562, 572, 576, 586, 593, 462, + 611, 581, 598, 640, 597, 612, 655, 658, 648, 673, +); + const YY_REDUCE_USE_DFLT = -99; + const YY_REDUCE_MAX = 186; + public static $yy_reduce_ofst = array( + 109, 492, 527, 561, 595, 632, 669, 703, 737, 771, + 808, 842, 876, 910, 944, 978, 1012, 1046, 1080, 1114, + 1148, 1182, 1216, 1250, 1284, 1318, 1352, 1386, 1420, 1454, + 1488, 1522, 1556, 1590, 1624, 1658, 1692, 1726, 1760, 1794, + 1828, 1862, 2036, 2071, 2107, 2142, 2178, 2213, 2249, 542, + 1824, 1858, 2104, 481, 114, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 608, 536, 645, 164, + 20, 101, -98, 34, 181, 212, -57, 174, 195, 3, + 254, -5, -79, 228, 228, 228, 180, -5, 222, 51, + 272, 291, 302, 305, 222, -75, 261, 228, 228, 228, + 331, 323, 228, 228, 228, 228, 228, 228, 228, 222, + 299, 228, 228, 360, 228, 102, 102, 102, 102, 102, + 85, 122, 102, 102, 188, 188, 300, 188, 324, 188, + 335, 188, 244, 244, 188, 188, 188, 188, 244, 321, + 244, 244, 244, 337, 244, 347, 244, 188, 188, 188, + 188, 375, 376, 375, 375, 376, 375, 400, 421, 421, + 421, 467, 452, 468, 471, 447, 470, +); + public static $yyExpectedTokens = array( + array(), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(2, 9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 39, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 51, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 21, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 24, 28, 29, 30, 32, 34, 37, 40, 41, 42, 43, 45, 47, 49, 50, 52, 57, 58, ), + array(14, 16, 47, 49, 52, ), + array(23, 25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(25, 31, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(14, 16, 49, 52, ), + array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), + array(20, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(26, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(35, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 51, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, 59, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(2, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(13, 36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(36, 37, 38, 39, 53, 54, 55, 56, ), + array(1, 13, 17, 25, 31, 34, 46, ), + array(14, 34, 52, ), + array(1, 25, 31, ), + array(3, 9, 10, 11, 12, 14, 18, 19, 24, 28, 29, 30, 58, 59, ), + array(9, 12, 16, 25, 27, 31, ), + array(9, 12, 16, 25, 31, ), + array(17, 43, 50, ), + array(15, 17, 46, ), + array(1, 25, 31, ), + array(1, 25, 31, ), + array(14, 34, 52, ), + array(14, 34, 52, ), + array(1, 2, ), + array(3, 4, 5, 6, 9, 10, 11, 12, 18, 19, 24, 28, 29, 30, ), + array(2, 9, 12, 15, 16, 17, 21, 43, 46, 48, 50, ), + array(9, 12, 16, 48, ), + array(12, 14, 16, 52, ), + array(1, 13, 25, 31, ), + array(1, 13, 25, 31, ), + array(1, 13, 25, 31, ), + array(9, 12, 16, ), + array(9, 12, 16, ), + array(15, 17, 46, ), + array(25, 31, ), + array(14, 52, ), + array(25, 31, ), + array(25, 31, ), + array(1, 17, ), + array(17, 46, ), + array(14, 16, ), + array(14, 16, ), + array(1, 51, ), + array(1, 2, ), + array(1, 27, ), + array(25, 31, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(17, ), + array(17, ), + array(1, ), + array(1, ), + array(), + array(), + array(2, 9, 12, 16, 17, 21, 43, 46, 48, 50, 51, ), + array(2, 9, 12, 15, 16, 17, 21, 43, 46, 48, 50, ), + array(2, 9, 12, 16, 17, 21, 43, 46, 48, 50, ), + array(2, 9, 12, 16, 17, 21, 43, 46, 48, 50, ), + array(9, 12, 16, 17, 43, 46, 48, 50, ), + array(12, 14, 16, 32, 52, ), + array(9, 12, 16, 48, ), + array(9, 12, 16, ), + array(15, 43, 50, ), + array(25, 31, ), + array(25, 31, ), + array(15, 21, ), + array(25, 31, ), + array(14, 52, ), + array(25, 31, ), + array(14, 52, ), + array(25, 31, ), + array(43, 50, ), + array(43, 50, ), + array(25, 31, ), + array(25, 31, ), + array(25, 31, ), + array(25, 31, ), + array(43, 50, ), + array(12, 34, ), + array(43, 50, ), + array(43, 50, ), + array(43, 50, ), + array(43, 50, ), + array(43, 50, ), + array(43, 50, ), + array(43, 50, ), + array(25, 31, ), + array(25, 31, ), + array(25, 31, ), + array(25, 31, ), + array(1, ), + array(2, ), + array(1, ), + array(1, ), + array(2, ), + array(1, ), + array(34, ), + array(17, ), + array(17, ), + array(17, ), + array(), + array(), + array(), + array(), + array(), + array(), + array(2, 34, 36, 37, 38, 39, 46, 53, 54, 55, 56, ), + array(13, 20, 22, 25, 31, 33, 35, 43, ), + array(13, 15, 25, 31, 34, 46, ), + array(13, 21, 25, 31, 44, ), + array(13, 21, 25, 31, 44, ), + array(9, 12, 16, 48, ), + array(34, 43, 46, 51, ), + array(27, 34, 46, ), + array(21, 44, 59, ), + array(21, 44, 51, ), + array(6, 8, ), + array(7, 8, ), + array(20, 33, ), + array(16, 48, ), + array(21, 44, ), + array(34, 46, ), + array(34, 46, ), + array(34, 46, ), + array(33, 35, ), + array(33, 35, ), + array(33, 51, ), + array(43, 51, ), + array(33, 35, ), + array(33, 35, ), + array(33, 35, ), + array(33, 35, ), + array(15, 43, ), + array(7, ), + array(13, ), + array(13, ), + array(16, ), + array(16, ), + array(16, ), + array(16, ), + array(16, ), + array(14, ), + array(16, ), + array(43, ), + array(32, ), + array(32, ), + array(34, ), + array(16, ), + array(34, ), + array(16, ), + array(49, ), + array(49, ), + array(16, ), + array(51, ), + array(51, ), + array(16, ), + array(15, ), + array(35, ), + array(22, ), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), +); + public static $yy_default = array( + 350, 540, 540, 540, 525, 525, 540, 501, 501, 524, + 452, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 390, 369, 390, 540, 540, 540, 395, 540, 540, 540, + 363, 540, 540, 540, 540, 540, 374, 500, 413, 420, + 499, 526, 528, 527, 419, 421, 418, 422, 451, 449, + 397, 401, 402, 392, 395, 363, 433, 540, 390, 540, + 390, 390, 514, 454, 390, 390, 540, 540, 381, 340, + 453, 466, 540, 404, 404, 404, 466, 466, 454, 390, + 540, 390, 390, 384, 454, 540, 540, 404, 404, 404, + 371, 386, 404, 411, 424, 425, 426, 412, 417, 454, + 511, 424, 410, 348, 508, 453, 453, 453, 453, 453, + 540, 468, 466, 482, 360, 370, 540, 373, 540, 378, + 540, 379, 463, 464, 364, 366, 367, 368, 492, 466, + 491, 494, 493, 457, 458, 459, 460, 380, 376, 377, + 372, 382, 502, 385, 387, 503, 442, 466, 488, 515, + 512, 348, 507, 507, 507, 466, 466, 433, 429, 433, + 423, 423, 467, 433, 433, 423, 423, 346, 540, 540, + 540, 423, 433, 443, 540, 540, 540, 540, 429, 540, + 461, 461, 540, 429, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 429, 431, 540, 513, 540, 482, + 540, 540, 540, 540, 540, 438, 540, 540, 540, 398, + 341, 342, 343, 344, 345, 347, 349, 351, 352, 353, + 354, 355, 356, 357, 359, 388, 389, 484, 485, 486, + 506, 383, 504, 505, 427, 436, 437, 446, 447, 465, + 469, 470, 471, 405, 406, 407, 408, 409, 428, 430, + 432, 434, 438, 439, 440, 414, 415, 416, 441, 444, + 445, 479, 477, 516, 517, 518, 519, 455, 456, 490, + 461, 462, 483, 498, 358, 489, 536, 537, 529, 530, + 531, 534, 533, 535, 538, 539, 532, 521, 523, 522, + 520, 495, 480, 478, 476, 473, 474, 475, 481, 496, + 497, 435, 472, 510, 487, 482, 391, 375, 399, 403, +); + const YYNOCODE = 113; + const YYSTACKDEPTH = 500; + const YYNSTATE = 340; + const YYNRULE = 200; + const YYERRORSYMBOL = 60; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + public static $yyFallback = array( + ); + public function Trace($TraceFILE, $zTracePrompt) + { + if (!$TraceFILE) { + $zTracePrompt = 0; + } elseif (!$zTracePrompt) { + $TraceFILE = 0; + } + $this->yyTraceFILE = $TraceFILE; + $this->yyTracePrompt = $zTracePrompt; + } + + public function PrintTrace() + { + $this->yyTraceFILE = fopen('php://output', 'w'); + $this->yyTracePrompt = '
'; + } + + public $yyTraceFILE; + public $yyTracePrompt; + public $yyidx; /* Index of top element in stack */ + public $yyerrcnt; /* Shifts left before out of the error */ + public $yystack = array(); /* The parser's stack */ + + public $yyTokenName = array( + '$', 'VERT', 'COLON', 'TEXT', + 'STRIPON', 'STRIPOFF', 'LITERALSTART', 'LITERALEND', + 'LITERAL', 'SIMPELOUTPUT', 'SIMPLETAG', 'SMARTYBLOCKCHILDPARENT', + 'LDEL', 'RDEL', 'DOLLARID', 'EQUAL', + 'ID', 'PTR', 'LDELIF', 'LDELFOR', + 'SEMICOLON', 'INCDEC', 'TO', 'STEP', + 'LDELFOREACH', 'SPACE', 'AS', 'APTR', + 'LDELSETFILTER', 'CLOSETAG', 'LDELSLASH', 'ATTR', + 'INTEGER', 'COMMA', 'OPENP', 'CLOSEP', + 'MATH', 'UNIMATH', 'ISIN', 'QMARK', + 'NOT', 'TYPECAST', 'HEX', 'DOT', + 'INSTANCEOF', 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE', + 'AT', 'HATCH', 'OPENB', 'CLOSEB', + 'DOLLAR', 'LOGOP', 'SLOGOP', 'TLOGOP', + 'SINGLECOND', 'ARRAYOPEN', 'QUOTE', 'BACKTICK', + 'error', 'start', 'template', 'literal_e2', + 'literal_e1', 'smartytag', 'tagbody', 'tag', + 'outattr', 'eqoutattr', 'varindexed', 'output', + 'attributes', 'variablevalue', 'value', 'expr', + 'modifierlist', 'statement', 'statements', 'foraction', + 'varvar', 'modparameters', 'attribute', 'nullcoalescing', + 'ternary', 'tlop', 'lop', 'scond', + 'isin', 'array', 'function', 'ns1', + 'doublequoted_with_quotes', 'static_class_access', 'arraydef', 'variablelist', + 'variable', 'object', 'configvariable', 'arrayindex', + 'indexdef', 'varvarele', 'objectchain', 'objectelement', + 'method', 'params', 'modifier', 'modparameter', + 'arrayelements', 'arrayelement', 'doublequoted', 'doublequotedcontent', + ); + + public static $yyRuleName = array( + 'start ::= template', + 'template ::= template TEXT', + 'template ::= template STRIPON', + 'template ::= template STRIPOFF', + 'template ::= template LITERALSTART literal_e2 LITERALEND', + 'literal_e2 ::= literal_e1 LITERALSTART literal_e1 LITERALEND', + 'literal_e2 ::= literal_e1', + 'literal_e1 ::= literal_e1 LITERAL', + 'literal_e1 ::=', + 'template ::= template smartytag', + 'template ::=', + 'smartytag ::= SIMPELOUTPUT', + 'smartytag ::= SIMPLETAG', + 'smartytag ::= SMARTYBLOCKCHILDPARENT', + 'smartytag ::= LDEL tagbody RDEL', + 'smartytag ::= tag RDEL', + 'tagbody ::= outattr', + 'tagbody ::= DOLLARID eqoutattr', + 'tagbody ::= varindexed eqoutattr', + 'eqoutattr ::= EQUAL outattr', + 'outattr ::= output attributes', + 'output ::= variablevalue', + 'output ::= value', + 'output ::= expr', + 'tag ::= LDEL ID attributes', + 'tag ::= LDEL ID', + 'tag ::= LDEL ID modifierlist attributes', + 'tag ::= LDEL ID PTR ID attributes', + 'tag ::= LDEL ID PTR ID modifierlist attributes', + 'tag ::= LDELIF expr', + 'tag ::= LDELIF expr attributes', + 'tag ::= LDELIF statement', + 'tag ::= LDELIF statement attributes', + 'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes', + 'foraction ::= EQUAL expr', + 'foraction ::= INCDEC', + 'tag ::= LDELFOR statement TO expr attributes', + 'tag ::= LDELFOR statement TO expr STEP expr attributes', + 'tag ::= LDELFOREACH SPACE expr AS varvar attributes', + 'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes', + 'tag ::= LDELFOREACH attributes', + 'tag ::= LDELSETFILTER ID modparameters', + 'tag ::= LDELSETFILTER ID modparameters modifierlist', + 'smartytag ::= CLOSETAG', + 'tag ::= LDELSLASH ID', + 'tag ::= LDELSLASH ID modifierlist', + 'tag ::= LDELSLASH ID PTR ID', + 'tag ::= LDELSLASH ID PTR ID modifierlist', + 'attributes ::= attributes attribute', + 'attributes ::= attribute', + 'attributes ::=', + 'attribute ::= SPACE ID EQUAL ID', + 'attribute ::= ATTR expr', + 'attribute ::= ATTR value', + 'attribute ::= SPACE ID', + 'attribute ::= SPACE expr', + 'attribute ::= SPACE value', + 'attribute ::= SPACE INTEGER EQUAL expr', + 'statements ::= statement', + 'statements ::= statements COMMA statement', + 'statement ::= DOLLARID EQUAL INTEGER', + 'statement ::= DOLLARID EQUAL expr', + 'statement ::= varindexed EQUAL expr', + 'statement ::= OPENP statement CLOSEP', + 'expr ::= value', + 'expr ::= nullcoalescing', + 'expr ::= ternary', + 'expr ::= INCDEC DOLLARID', + 'expr ::= DOLLARID INCDEC', + 'expr ::= DOLLARID COLON ID', + 'expr ::= expr MATH value', + 'expr ::= expr UNIMATH value', + 'expr ::= expr tlop value', + 'expr ::= expr lop expr', + 'expr ::= expr scond', + 'isin ::= ISIN', + 'expr ::= expr isin array', + 'expr ::= expr isin value', + 'nullcoalescing ::= expr QMARK QMARK expr', + 'ternary ::= expr QMARK DOLLARID COLON expr', + 'ternary ::= expr QMARK value COLON expr', + 'ternary ::= expr QMARK expr COLON expr', + 'ternary ::= expr QMARK COLON expr', + 'value ::= variablevalue', + 'value ::= UNIMATH value', + 'value ::= NOT value', + 'value ::= TYPECAST value', + 'value ::= variablevalue INCDEC', + 'value ::= HEX', + 'value ::= INTEGER', + 'value ::= INTEGER DOT INTEGER', + 'value ::= INTEGER DOT', + 'value ::= DOT INTEGER', + 'value ::= ID', + 'value ::= function', + 'value ::= OPENP expr CLOSEP', + 'value ::= variablevalue INSTANCEOF ns1', + 'value ::= variablevalue INSTANCEOF variablevalue', + 'value ::= SINGLEQUOTESTRING', + 'value ::= doublequoted_with_quotes', + 'value ::= varindexed DOUBLECOLON static_class_access', + 'value ::= smartytag', + 'value ::= value modifierlist', + 'value ::= NAMESPACE', + 'value ::= arraydef', + 'value ::= ns1 DOUBLECOLON static_class_access', + 'ns1 ::= ID', + 'ns1 ::= NAMESPACE', + 'variablelist ::= variablelist COMMA variable', + 'variablelist ::= variablelist COMMA expr', + 'variablelist ::= variable', + 'variablelist ::= expr', + 'variablelist ::=', + 'variable ::= DOLLARID', + 'variable ::= varindexed', + 'variable ::= varvar AT ID', + 'variable ::= object', + 'configvariable ::= HATCH ID HATCH', + 'configvariable ::= HATCH ID HATCH arrayindex', + 'configvariable ::= HATCH variablevalue HATCH', + 'configvariable ::= HATCH variablevalue HATCH arrayindex', + 'variablevalue ::= variable', + 'variablevalue ::= configvariable', + 'varindexed ::= DOLLARID arrayindex', + 'varindexed ::= varvar arrayindex', + 'arrayindex ::= arrayindex indexdef', + 'arrayindex ::=', + 'indexdef ::= DOT DOLLARID', + 'indexdef ::= DOT varvar', + 'indexdef ::= DOT varvar AT ID', + 'indexdef ::= DOT ID', + 'indexdef ::= DOT INTEGER', + 'indexdef ::= DOT LDEL expr RDEL', + 'indexdef ::= OPENB ID CLOSEB', + 'indexdef ::= OPENB ID DOT ID CLOSEB', + 'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB', + 'indexdef ::= OPENB INTEGER CLOSEB', + 'indexdef ::= OPENB DOLLARID CLOSEB', + 'indexdef ::= OPENB variablevalue CLOSEB', + 'indexdef ::= OPENB value CLOSEB', + 'indexdef ::= OPENB expr CLOSEB', + 'indexdef ::= OPENB CLOSEB', + 'varvar ::= DOLLARID', + 'varvar ::= DOLLAR', + 'varvar ::= varvar varvarele', + 'varvarele ::= ID', + 'varvarele ::= SIMPELOUTPUT', + 'varvarele ::= LDEL expr RDEL', + 'object ::= varindexed objectchain', + 'objectchain ::= objectelement', + 'objectchain ::= objectchain objectelement', + 'objectelement ::= PTR ID arrayindex', + 'objectelement ::= PTR varvar arrayindex', + 'objectelement ::= PTR LDEL expr RDEL arrayindex', + 'objectelement ::= PTR ID LDEL expr RDEL arrayindex', + 'objectelement ::= PTR method', + 'function ::= ns1 OPENP variablelist CLOSEP', + 'method ::= ID OPENP params CLOSEP', + 'method ::= DOLLARID OPENP params CLOSEP', + 'params ::= params COMMA expr', + 'params ::= expr', + 'params ::=', + 'modifierlist ::= modifierlist modifier modparameters', + 'modifierlist ::= modifier modparameters', + 'modifier ::= VERT AT ID', + 'modifier ::= VERT ID', + 'modparameters ::= modparameters modparameter', + 'modparameters ::=', + 'modparameter ::= COLON value', + 'modparameter ::= COLON UNIMATH value', + 'modparameter ::= COLON array', + 'static_class_access ::= method', + 'static_class_access ::= method objectchain', + 'static_class_access ::= ID', + 'static_class_access ::= DOLLARID arrayindex', + 'static_class_access ::= DOLLARID arrayindex objectchain', + 'lop ::= LOGOP', + 'lop ::= SLOGOP', + 'tlop ::= TLOGOP', + 'scond ::= SINGLECOND', + 'arraydef ::= OPENB arrayelements CLOSEB', + 'arraydef ::= ARRAYOPEN arrayelements CLOSEP', + 'arrayelements ::= arrayelement', + 'arrayelements ::= arrayelements COMMA arrayelement', + 'arrayelements ::= arrayelements COMMA', + 'arrayelements ::=', + 'arrayelement ::= value APTR expr', + 'arrayelement ::= ID APTR expr', + 'arrayelement ::= expr', + 'doublequoted_with_quotes ::= QUOTE QUOTE', + 'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE', + 'doublequoted ::= doublequoted doublequotedcontent', + 'doublequoted ::= doublequotedcontent', + 'doublequotedcontent ::= BACKTICK variablevalue BACKTICK', + 'doublequotedcontent ::= BACKTICK expr BACKTICK', + 'doublequotedcontent ::= DOLLARID', + 'doublequotedcontent ::= LDEL variablevalue RDEL', + 'doublequotedcontent ::= LDEL expr RDEL', + 'doublequotedcontent ::= smartytag', + 'doublequotedcontent ::= TEXT', + ); + + public function tokenName($tokenType) + { + if ($tokenType === 0) { + return 'End of Input'; + } + if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { + return $this->yyTokenName[$tokenType]; + } else { + return 'Unknown'; + } + } + + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: break; /* If no destructor action specified: do nothing */ + } + } + + public function yy_pop_parser_stack() + { + if (empty($this->yystack)) { + return; + } + $yytos = array_pop($this->yystack); + if ($this->yyTraceFILE && $this->yyidx >= 0) { + fwrite($this->yyTraceFILE, + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . + "\n"); + } + $yymajor = $yytos->major; + self::yy_destructor($yymajor, $yytos->minor); + $this->yyidx--; + + return $yymajor; + } + + public function __destruct() + { + while ($this->yystack !== Array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + public function yy_get_expected_tokens($token) + { + static $res3 = array(); + static $res4 = array(); + $state = $this->yystack[$this->yyidx]->stateno; + $expected = self::$yyExpectedTokens[$state]; + if (isset($res3[$state][$token])) { + if ($res3[$state][$token]) { + return $expected; + } + } else { + if ($res3[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { + return $expected; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ === 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return array_unique($expected); + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; + $nextstate = $this->yy_find_reduce_action( + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno][0]); + if (isset(self::$yyExpectedTokens[$nextstate])) { + $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); + if (isset($res4[$nextstate][$token])) { + if ($res4[$nextstate][$token]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } else { + if ($res4[$nextstate][$token] = in_array($token, self::$yyExpectedTokens[$nextstate], true)) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); + } + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return array_unique($expected); + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return $expected; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return array_unique($expected); + } + + public function yy_is_expected_token($token) + { + static $res = array(); + static $res2 = array(); + if ($token === 0) { + return true; // 0 is not part of this + } + $state = $this->yystack[$this->yyidx]->stateno; + if (isset($res[$state][$token])) { + if ($res[$state][$token]) { + return true; + } + } else { + if ($res[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { + return true; + } + } + $stack = $this->yystack; + $yyidx = $this->yyidx; + do { + $yyact = $this->yy_find_shift_action($token); + if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { + // reduce action + $done = 0; + do { + if ($done++ === 100) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // too much recursion prevents proper detection + // so give up + return true; + } + $yyruleno = $yyact - self::YYNSTATE; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; + $nextstate = $this->yy_find_reduce_action( + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno][0]); + if (isset($res2[$nextstate][$token])) { + if ($res2[$nextstate][$token]) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } else { + if ($res2[$nextstate][$token] = (isset(self::$yyExpectedTokens[$nextstate]) && in_array($token, self::$yyExpectedTokens[$nextstate], true))) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + return true; + } + } + if ($nextstate < self::YYNSTATE) { + // we need to shift a non-terminal + $this->yyidx++; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = $nextstate; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; + continue 2; + } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + if (!$token) { + // end of input: this is valid + return true; + } + // the last token was just ignored, we can't accept + // by ignoring input, this is in essence ignoring a + // syntax error! + return false; + } elseif ($nextstate === self::YY_NO_ACTION) { + $this->yyidx = $yyidx; + $this->yystack = $stack; + // input accepted, but not shifted (I guess) + return true; + } else { + $yyact = $nextstate; + } + } while (true); + } + break; + } while (true); + $this->yyidx = $yyidx; + $this->yystack = $stack; + + return true; + } + + public function yy_find_shift_action($iLookAhead) + { + $stateno = $this->yystack[$this->yyidx]->stateno; + + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ + if (!isset(self::$yy_shift_ofst[$stateno])) { + // no shift actions + return self::$yy_default[$stateno]; + } + $i = self::$yy_shift_ofst[$stateno]; + if ($i === self::YY_SHIFT_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead === self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || + self::$yy_lookahead[$i] != $iLookAhead) { + if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) + && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { + if ($this->yyTraceFILE) { + fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'FALLBACK ' . + $this->yyTokenName[$iLookAhead] . ' => ' . + $this->yyTokenName[$iFallback] . "\n"); + } + + return $this->yy_find_shift_action($iFallback); + } + + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_find_reduce_action($stateno, $iLookAhead) + { + /* $stateno = $this->yystack[$this->yyidx]->stateno; */ + + if (!isset(self::$yy_reduce_ofst[$stateno])) { + return self::$yy_default[$stateno]; + } + $i = self::$yy_reduce_ofst[$stateno]; + if ($i === self::YY_REDUCE_USE_DFLT) { + return self::$yy_default[$stateno]; + } + if ($iLookAhead === self::YYNOCODE) { + return self::YY_NO_ACTION; + } + $i += $iLookAhead; + if ($i < 0 || $i >= self::YY_SZ_ACTTAB || + self::$yy_lookahead[$i] != $iLookAhead) { + return self::$yy_default[$stateno]; + } else { + return self::$yy_action[$i]; + } + } + + public function yy_shift($yyNewState, $yyMajor, $yypMinor) + { + $this->yyidx++; + if ($this->yyidx >= self::YYSTACKDEPTH) { + $this->yyidx--; + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); + } + while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } +// line 232 "src/Parser/TemplateParser.y" + + $this->internalError = true; + $this->compiler->trigger_template_error('Stack overflow in template parser'); + + return; + } + $yytos = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $yytos->stateno = $yyNewState; + $yytos->major = $yyMajor; + $yytos->minor = $yypMinor; + $this->yystack[] = $yytos; + if ($this->yyTraceFILE && $this->yyidx > 0) { + fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, + $yyNewState); + fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); + for ($i = 1; $i <= $this->yyidx; $i++) { + fprintf($this->yyTraceFILE, " %s", + $this->yyTokenName[$this->yystack[$i]->major]); + } + fwrite($this->yyTraceFILE,"\n"); + } + } + + public static $yyRuleInfo = array( + array( 0 => 61, 1 => 1 ), + array( 0 => 62, 1 => 2 ), + array( 0 => 62, 1 => 2 ), + array( 0 => 62, 1 => 2 ), + array( 0 => 62, 1 => 4 ), + array( 0 => 63, 1 => 4 ), + array( 0 => 63, 1 => 1 ), + array( 0 => 64, 1 => 2 ), + array( 0 => 64, 1 => 0 ), + array( 0 => 62, 1 => 2 ), + array( 0 => 62, 1 => 0 ), + array( 0 => 65, 1 => 1 ), + array( 0 => 65, 1 => 1 ), + array( 0 => 65, 1 => 1 ), + array( 0 => 65, 1 => 3 ), + array( 0 => 65, 1 => 2 ), + array( 0 => 66, 1 => 1 ), + array( 0 => 66, 1 => 2 ), + array( 0 => 66, 1 => 2 ), + array( 0 => 69, 1 => 2 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 71, 1 => 1 ), + array( 0 => 71, 1 => 1 ), + array( 0 => 71, 1 => 1 ), + array( 0 => 67, 1 => 3 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 67, 1 => 4 ), + array( 0 => 67, 1 => 5 ), + array( 0 => 67, 1 => 6 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 67, 1 => 3 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 67, 1 => 3 ), + array( 0 => 67, 1 => 8 ), + array( 0 => 79, 1 => 2 ), + array( 0 => 79, 1 => 1 ), + array( 0 => 67, 1 => 5 ), + array( 0 => 67, 1 => 7 ), + array( 0 => 67, 1 => 6 ), + array( 0 => 67, 1 => 8 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 67, 1 => 3 ), + array( 0 => 67, 1 => 4 ), + array( 0 => 65, 1 => 1 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 67, 1 => 3 ), + array( 0 => 67, 1 => 4 ), + array( 0 => 67, 1 => 5 ), + array( 0 => 72, 1 => 2 ), + array( 0 => 72, 1 => 1 ), + array( 0 => 72, 1 => 0 ), + array( 0 => 82, 1 => 4 ), + array( 0 => 82, 1 => 2 ), + array( 0 => 82, 1 => 2 ), + array( 0 => 82, 1 => 2 ), + array( 0 => 82, 1 => 2 ), + array( 0 => 82, 1 => 2 ), + array( 0 => 82, 1 => 4 ), + array( 0 => 78, 1 => 1 ), + array( 0 => 78, 1 => 3 ), + array( 0 => 77, 1 => 3 ), + array( 0 => 77, 1 => 3 ), + array( 0 => 77, 1 => 3 ), + array( 0 => 77, 1 => 3 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 88, 1 => 1 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 83, 1 => 4 ), + array( 0 => 84, 1 => 5 ), + array( 0 => 84, 1 => 5 ), + array( 0 => 84, 1 => 5 ), + array( 0 => 84, 1 => 4 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 2 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 91, 1 => 1 ), + array( 0 => 91, 1 => 1 ), + array( 0 => 95, 1 => 3 ), + array( 0 => 95, 1 => 3 ), + array( 0 => 95, 1 => 1 ), + array( 0 => 95, 1 => 1 ), + array( 0 => 95, 1 => 0 ), + array( 0 => 96, 1 => 1 ), + array( 0 => 96, 1 => 1 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 1 ), + array( 0 => 98, 1 => 3 ), + array( 0 => 98, 1 => 4 ), + array( 0 => 98, 1 => 3 ), + array( 0 => 98, 1 => 4 ), + array( 0 => 73, 1 => 1 ), + array( 0 => 73, 1 => 1 ), + array( 0 => 70, 1 => 2 ), + array( 0 => 70, 1 => 2 ), + array( 0 => 99, 1 => 2 ), + array( 0 => 99, 1 => 0 ), + array( 0 => 100, 1 => 2 ), + array( 0 => 100, 1 => 2 ), + array( 0 => 100, 1 => 4 ), + array( 0 => 100, 1 => 2 ), + array( 0 => 100, 1 => 2 ), + array( 0 => 100, 1 => 4 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 5 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 3 ), + array( 0 => 100, 1 => 2 ), + array( 0 => 80, 1 => 1 ), + array( 0 => 80, 1 => 1 ), + array( 0 => 80, 1 => 2 ), + array( 0 => 101, 1 => 1 ), + array( 0 => 101, 1 => 1 ), + array( 0 => 101, 1 => 3 ), + array( 0 => 97, 1 => 2 ), + array( 0 => 102, 1 => 1 ), + array( 0 => 102, 1 => 2 ), + array( 0 => 103, 1 => 3 ), + array( 0 => 103, 1 => 3 ), + array( 0 => 103, 1 => 5 ), + array( 0 => 103, 1 => 6 ), + array( 0 => 103, 1 => 2 ), + array( 0 => 90, 1 => 4 ), + array( 0 => 104, 1 => 4 ), + array( 0 => 104, 1 => 4 ), + array( 0 => 105, 1 => 3 ), + array( 0 => 105, 1 => 1 ), + array( 0 => 105, 1 => 0 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 2 ), + array( 0 => 106, 1 => 3 ), + array( 0 => 106, 1 => 2 ), + array( 0 => 81, 1 => 2 ), + array( 0 => 81, 1 => 0 ), + array( 0 => 107, 1 => 2 ), + array( 0 => 107, 1 => 3 ), + array( 0 => 107, 1 => 2 ), + array( 0 => 93, 1 => 1 ), + array( 0 => 93, 1 => 2 ), + array( 0 => 93, 1 => 1 ), + array( 0 => 93, 1 => 2 ), + array( 0 => 93, 1 => 3 ), + array( 0 => 86, 1 => 1 ), + array( 0 => 86, 1 => 1 ), + array( 0 => 85, 1 => 1 ), + array( 0 => 87, 1 => 1 ), + array( 0 => 94, 1 => 3 ), + array( 0 => 94, 1 => 3 ), + array( 0 => 108, 1 => 1 ), + array( 0 => 108, 1 => 3 ), + array( 0 => 108, 1 => 2 ), + array( 0 => 108, 1 => 0 ), + array( 0 => 109, 1 => 3 ), + array( 0 => 109, 1 => 3 ), + array( 0 => 109, 1 => 1 ), + array( 0 => 92, 1 => 2 ), + array( 0 => 92, 1 => 3 ), + array( 0 => 110, 1 => 2 ), + array( 0 => 110, 1 => 1 ), + array( 0 => 111, 1 => 3 ), + array( 0 => 111, 1 => 3 ), + array( 0 => 111, 1 => 1 ), + array( 0 => 111, 1 => 3 ), + array( 0 => 111, 1 => 3 ), + array( 0 => 111, 1 => 1 ), + array( 0 => 111, 1 => 1 ), + ); + + public static $yyReduceMap = array( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => 5, + 6 => 6, + 21 => 6, + 22 => 6, + 23 => 6, + 35 => 6, + 55 => 6, + 56 => 6, + 64 => 6, + 65 => 6, + 66 => 6, + 83 => 6, + 88 => 6, + 89 => 6, + 94 => 6, + 98 => 6, + 99 => 6, + 103 => 6, + 104 => 6, + 106 => 6, + 122 => 6, + 182 => 6, + 188 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, + 16 => 16, + 17 => 17, + 18 => 18, + 19 => 19, + 20 => 20, + 24 => 24, + 25 => 25, + 26 => 26, + 27 => 27, + 28 => 28, + 29 => 29, + 30 => 30, + 32 => 30, + 31 => 31, + 33 => 33, + 34 => 34, + 36 => 36, + 37 => 37, + 38 => 38, + 39 => 39, + 40 => 40, + 41 => 41, + 42 => 42, + 43 => 43, + 44 => 44, + 45 => 45, + 46 => 46, + 47 => 47, + 48 => 48, + 49 => 49, + 58 => 49, + 110 => 49, + 111 => 49, + 160 => 49, + 164 => 49, + 168 => 49, + 170 => 49, + 50 => 50, + 112 => 50, + 161 => 50, + 167 => 50, + 51 => 51, + 52 => 52, + 53 => 52, + 54 => 54, + 145 => 54, + 57 => 57, + 59 => 59, + 60 => 60, + 61 => 60, + 62 => 62, + 63 => 63, + 67 => 67, + 68 => 68, + 69 => 69, + 70 => 70, + 71 => 70, + 72 => 72, + 73 => 73, + 74 => 74, + 75 => 75, + 76 => 76, + 77 => 77, + 78 => 78, + 79 => 79, + 80 => 80, + 81 => 80, + 82 => 82, + 84 => 84, + 86 => 84, + 87 => 84, + 125 => 84, + 85 => 85, + 90 => 90, + 91 => 91, + 92 => 92, + 93 => 93, + 95 => 95, + 96 => 96, + 97 => 96, + 100 => 100, + 101 => 101, + 102 => 102, + 105 => 105, + 107 => 107, + 108 => 108, + 109 => 108, + 159 => 108, + 113 => 113, + 114 => 114, + 115 => 115, + 116 => 116, + 117 => 117, + 118 => 118, + 119 => 119, + 120 => 120, + 121 => 121, + 123 => 123, + 124 => 124, + 126 => 126, + 185 => 126, + 127 => 127, + 128 => 128, + 129 => 129, + 130 => 130, + 131 => 131, + 132 => 132, + 140 => 132, + 133 => 133, + 134 => 134, + 135 => 135, + 136 => 135, + 138 => 135, + 139 => 135, + 137 => 137, + 141 => 141, + 142 => 142, + 143 => 143, + 189 => 143, + 144 => 144, + 146 => 146, + 147 => 147, + 148 => 148, + 149 => 149, + 150 => 150, + 151 => 151, + 152 => 152, + 153 => 153, + 154 => 154, + 155 => 155, + 156 => 156, + 157 => 157, + 158 => 158, + 162 => 162, + 163 => 163, + 165 => 165, + 166 => 166, + 169 => 169, + 171 => 171, + 172 => 172, + 173 => 173, + 174 => 174, + 175 => 175, + 176 => 176, + 177 => 177, + 178 => 178, + 179 => 179, + 180 => 180, + 181 => 180, + 183 => 183, + 184 => 184, + 186 => 186, + 187 => 187, + 190 => 190, + 191 => 191, + 192 => 192, + 193 => 193, + 196 => 193, + 194 => 194, + 197 => 194, + 195 => 195, + 198 => 198, + 199 => 199, + ); +// line 245 "src/Parser/TemplateParser.y" + public function yy_r0(){ + $this->root_buffer->prepend_array($this, $this->template_prefix); + $this->root_buffer->append_array($this, $this->template_postfix); + $this->_retvalue = $this->root_buffer->to_smarty_php($this); + } +// line 252 "src/Parser/TemplateParser.y" + public function yy_r1(){ + $text = $this->yystack[ $this->yyidx + 0 ]->minor; + + if ((string)$text == '') { + $this->current_buffer->append_subtree($this, null); + } + + $this->current_buffer->append_subtree($this, new \Smarty\ParseTree\Text($text, $this->strip)); + } +// line 262 "src/Parser/TemplateParser.y" + public function yy_r2(){ + $this->strip = true; + } +// line 266 "src/Parser/TemplateParser.y" + public function yy_r3(){ + $this->strip = false; + } +// line 271 "src/Parser/TemplateParser.y" + public function yy_r4(){ + $this->current_buffer->append_subtree($this, new \Smarty\ParseTree\Text($this->yystack[$this->yyidx + -1]->minor)); + } +// line 276 "src/Parser/TemplateParser.y" + public function yy_r5(){ + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.$this->yystack[$this->yyidx + -1]->minor; + } +// line 279 "src/Parser/TemplateParser.y" + public function yy_r6(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +// line 283 "src/Parser/TemplateParser.y" + public function yy_r7(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + + } +// line 288 "src/Parser/TemplateParser.y" + public function yy_r8(){ + $this->_retvalue = ''; + } +// line 292 "src/Parser/TemplateParser.y" + public function yy_r9(){ + $this->current_buffer->append_subtree($this, $this->mergePrefixCode($this->yystack[$this->yyidx + 0]->minor)); + $this->compiler->has_variable_string = false; + $this->block_nesting_level = $this->compiler->getTagStackCount(); + } +// line 302 "src/Parser/TemplateParser.y" + public function yy_r11(){ + $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); + $attributes = []; + if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { + $attributes[] = 'nocache'; + $var = $match[1]; + } + $this->compiler->triggerTagNoCache($var); + $this->_retvalue = $this->compiler->compilePrintExpression('$_smarty_tpl->getValue(\''.$var.'\')', $attributes); + } +// line 314 "src/Parser/TemplateParser.y" + public function yy_r12(){ + $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); + if ($tag == 'strip') { + $this->strip = true; + $this->_retvalue = null; + } else { + if (defined($tag)) { + if ($this->security) { + $this->security->isTrustedConstant($tag, $this->compiler); + } + $this->_retvalue = $this->compiler->compilePrintExpression($tag); + } else { + if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { + $this->_retvalue = $this->compiler->compileTag($match[1],array('\'nocache\'')); + } else { + $this->_retvalue = $this->compiler->compileTag($tag,array()); + } + } + } + } +// line 335 "src/Parser/TemplateParser.y" + public function yy_r13(){ + $j = strrpos($this->yystack[$this->yyidx + 0]->minor,'.'); + if ($this->yystack[$this->yyidx + 0]->minor[$j+1] == 'c') { + // {$smarty.block.child} + $this->_retvalue = $this->compiler->compileChildBlock(); + } else { + // {$smarty.block.parent} + $this->_retvalue = $this->compiler->compileParentBlock(); + } + } +// line 346 "src/Parser/TemplateParser.y" + public function yy_r14(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 350 "src/Parser/TemplateParser.y" + public function yy_r15(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 354 "src/Parser/TemplateParser.y" + public function yy_r16(){ + $this->_retvalue = $this->compiler->compilePrintExpression($this->yystack[$this->yyidx + 0]->minor[0], $this->yystack[$this->yyidx + 0]->minor[1]); + } +// line 363 "src/Parser/TemplateParser.y" + public function yy_r17(){ + $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + 0]->minor[0]),array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'')),$this->yystack[$this->yyidx + 0]->minor[1])); + } +// line 367 "src/Parser/TemplateParser.y" + public function yy_r18(){ + $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + 0]->minor[0]),array('var'=>$this->yystack[$this->yyidx + -1]->minor['var'])),$this->yystack[$this->yyidx + 0]->minor[1]),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'])); + } +// line 371 "src/Parser/TemplateParser.y" + public function yy_r19(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +// line 375 "src/Parser/TemplateParser.y" + public function yy_r20(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } +// line 390 "src/Parser/TemplateParser.y" + public function yy_r24(){ + if (defined($this->yystack[$this->yyidx + -1]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + -1]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compilePrintExpression($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } + } +// line 400 "src/Parser/TemplateParser.y" + public function yy_r25(){ + if (defined($this->yystack[$this->yyidx + 0]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compilePrintExpression($this->yystack[$this->yyidx + 0]->minor); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor,array()); + } + } +// line 413 "src/Parser/TemplateParser.y" + public function yy_r26(){ + if (defined($this->yystack[$this->yyidx + -2]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + -2]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compilePrintExpression($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + 0]->minor, array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor)); + } + } +// line 425 "src/Parser/TemplateParser.y" + public function yy_r27(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + 0]->minor,array('object_method'=>$this->yystack[$this->yyidx + -1]->minor)); + } +// line 430 "src/Parser/TemplateParser.y" + public function yy_r28(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + 0]->minor,array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor, 'object_method'=>$this->yystack[$this->yyidx + -2]->minor)); + } +// line 435 "src/Parser/TemplateParser.y" + public function yy_r29(){ + $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->compiler->getLdelLength())); + $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 440 "src/Parser/TemplateParser.y" + public function yy_r30(){ + $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->compiler->getLdelLength())); + $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + 0]->minor,array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); + } +// line 445 "src/Parser/TemplateParser.y" + public function yy_r31(){ + $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->compiler->getLdelLength())); + $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 456 "src/Parser/TemplateParser.y" + public function yy_r33(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -4]->minor),array('var'=>$this->yystack[$this->yyidx + -2]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),1); + } +// line 460 "src/Parser/TemplateParser.y" + public function yy_r34(){ + $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; + } +// line 468 "src/Parser/TemplateParser.y" + public function yy_r36(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -3]->minor),array('to'=>$this->yystack[$this->yyidx + -1]->minor))),0); + } +// line 472 "src/Parser/TemplateParser.y" + public function yy_r37(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -5]->minor),array('to'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),0); + } +// line 477 "src/Parser/TemplateParser.y" + public function yy_r38(){ + $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -3]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor)))); + } +// line 481 "src/Parser/TemplateParser.y" + public function yy_r39(){ + $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor),array('key'=>$this->yystack[$this->yyidx + -3]->minor)))); + } +// line 484 "src/Parser/TemplateParser.y" + public function yy_r40(){ + $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + 0]->minor); + } +// line 489 "src/Parser/TemplateParser.y" + public function yy_r41(){ + $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -1]->minor),$this->yystack[$this->yyidx + 0]->minor)))); + } +// line 493 "src/Parser/TemplateParser.y" + public function yy_r42(){ + $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)),$this->yystack[$this->yyidx + 0]->minor))); + } +// line 499 "src/Parser/TemplateParser.y" + public function yy_r43(){ + $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' /'); + if ($tag === 'strip') { + $this->strip = false; + $this->_retvalue = null; + } else { + $this->_retvalue = $this->compiler->compileTag($tag.'close',array()); + } + } +// line 508 "src/Parser/TemplateParser.y" + public function yy_r44(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor.'close',array()); + } +// line 512 "src/Parser/TemplateParser.y" + public function yy_r45(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 517 "src/Parser/TemplateParser.y" + public function yy_r46(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('object_method'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 521 "src/Parser/TemplateParser.y" + public function yy_r47(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_method'=>$this->yystack[$this->yyidx + -1]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 529 "src/Parser/TemplateParser.y" + public function yy_r48(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; + } +// line 535 "src/Parser/TemplateParser.y" + public function yy_r49(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); + } +// line 540 "src/Parser/TemplateParser.y" + public function yy_r50(){ + $this->_retvalue = array(); + } +// line 545 "src/Parser/TemplateParser.y" + public function yy_r51(){ + if (defined($this->yystack[$this->yyidx + 0]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); + } + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); + } else { + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'\''.$this->yystack[$this->yyidx + 0]->minor.'\''); + } + } +// line 556 "src/Parser/TemplateParser.y" + public function yy_r52(){ + $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 564 "src/Parser/TemplateParser.y" + public function yy_r54(){ + $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; + } +// line 576 "src/Parser/TemplateParser.y" + public function yy_r57(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 589 "src/Parser/TemplateParser.y" + public function yy_r59(){ + $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; + } +// line 594 "src/Parser/TemplateParser.y" + public function yy_r60(){ + $this->_retvalue = array('var' => '\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'', 'value'=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 601 "src/Parser/TemplateParser.y" + public function yy_r62(){ + $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 605 "src/Parser/TemplateParser.y" + public function yy_r63(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 630 "src/Parser/TemplateParser.y" + public function yy_r67(){ + $this->_retvalue = '$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')->preIncDec(\'' . $this->yystack[$this->yyidx + -1]->minor . '\')'; + } +// line 635 "src/Parser/TemplateParser.y" + public function yy_r68(){ + $this->_retvalue = '$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + -1]->minor,1) .'\')->postIncDec(\'' . $this->yystack[$this->yyidx + 0]->minor . '\')'; + } +// line 640 "src/Parser/TemplateParser.y" + public function yy_r69(){ + $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'://' . $this->yystack[$this->yyidx + 0]->minor . '\')'; + } +// line 645 "src/Parser/TemplateParser.y" + public function yy_r70(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; + } +// line 655 "src/Parser/TemplateParser.y" + public function yy_r72(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor['pre']. $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor['op'].$this->yystack[$this->yyidx + 0]->minor .')'; + } +// line 659 "src/Parser/TemplateParser.y" + public function yy_r73(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +// line 663 "src/Parser/TemplateParser.y" + public function yy_r74(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor . $this->yystack[$this->yyidx + -1]->minor . ')'; + } +// line 667 "src/Parser/TemplateParser.y" + public function yy_r75(){ + static $isin = [ + 'isin' => 'in_array(', + 'isnotin' => '!in_array(', + ]; + $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $isin[$op]; + } +// line 676 "src/Parser/TemplateParser.y" + public function yy_r76(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; + } +// line 680 "src/Parser/TemplateParser.y" + public function yy_r77(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; + } +// line 685 "src/Parser/TemplateParser.y" + public function yy_r78(){ + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?? '.$this->yystack[$this->yyidx + 0]->minor; + } +// line 692 "src/Parser/TemplateParser.y" + public function yy_r79(){ + $this->compiler->triggerTagNoCache(substr($this->yystack[$this->yyidx + -2]->minor,1)); + $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? $_smarty_tpl->getValue(\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\') : '.$this->yystack[$this->yyidx + 0]->minor; + } +// line 697 "src/Parser/TemplateParser.y" + public function yy_r80(){ + $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; + } +// line 706 "src/Parser/TemplateParser.y" + public function yy_r82(){ + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.' ?: '.$this->yystack[$this->yyidx + 0]->minor; + } +// line 716 "src/Parser/TemplateParser.y" + public function yy_r84(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +// line 721 "src/Parser/TemplateParser.y" + public function yy_r85(){ + $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 742 "src/Parser/TemplateParser.y" + public function yy_r90(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 746 "src/Parser/TemplateParser.y" + public function yy_r91(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; + } +// line 750 "src/Parser/TemplateParser.y" + public function yy_r92(){ + $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 755 "src/Parser/TemplateParser.y" + public function yy_r93(){ + if (defined($this->yystack[$this->yyidx + 0]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); + } + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } else { + $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; + } + } +// line 772 "src/Parser/TemplateParser.y" + public function yy_r95(){ + $this->_retvalue = '('. $this->yystack[$this->yyidx + -1]->minor .')'; + } +// line 776 "src/Parser/TemplateParser.y" + public function yy_r96(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +// line 794 "src/Parser/TemplateParser.y" + public function yy_r100(){ + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); + if ($this->yystack[$this->yyidx + -2]->minor['var'] === '\'smarty\'') { + $this->compiler->appendPrefixCode("compile(array(),$this->compiler,$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).';?>'); + } else { + $this->compiler->triggerTagNoCache($this->yystack[$this->yyidx + -2]->minor['var']); + $this->compiler->appendPrefixCode("getValue(" . $this->yystack[$this->yyidx + -2]->minor['var'] . ')'.$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].';?>'); + } + $this->_retvalue = $prefixVar .'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; + } +// line 809 "src/Parser/TemplateParser.y" + public function yy_r101(){ + $prefixVar = $this->compiler->getNewPrefixVariable(); + $tmp = $this->compiler->appendCode('', (string) $this->yystack[$this->yyidx + 0]->minor); + $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); + $this->_retvalue = $prefixVar; + } +// line 816 "src/Parser/TemplateParser.y" + public function yy_r102(){ + $this->_retvalue = $this->compiler->compileModifier($this->yystack[$this->yyidx + 0]->minor, $this->yystack[$this->yyidx + -1]->minor); + } +// line 829 "src/Parser/TemplateParser.y" + public function yy_r105(){ + if (!in_array(strtolower($this->yystack[$this->yyidx + -2]->minor), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->compiler))) { + if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { + $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; + } else { + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; + } + } else { + $this->compiler->trigger_template_error ('static class \''.$this->yystack[$this->yyidx + -2]->minor.'\' is undefined or not allowed by security setting'); + } + } +// line 848 "src/Parser/TemplateParser.y" + public function yy_r107(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +// line 856 "src/Parser/TemplateParser.y" + public function yy_r108(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); + } +// line 883 "src/Parser/TemplateParser.y" + public function yy_r113(){ + $this->compiler->triggerTagNoCache(substr($this->yystack[$this->yyidx + 0]->minor,1)); + $this->_retvalue = array('$_smarty_tpl->hasVariable(\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\')','$_smarty_tpl->getValue(\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\')'); + } +// line 887 "src/Parser/TemplateParser.y" + public function yy_r114(){ + if ($this->yystack[$this->yyidx + 0]->minor['var'] === '\'smarty\'') { + $smarty_var = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); + $this->_retvalue = array('true', $smarty_var); + } else { + // used for array reset,next,prev,end,current + $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var']; + $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; + $this->compiler->triggerTagNoCache($this->yystack[$this->yyidx + 0]->minor['var']); + $this->_retvalue = array('true', '$_smarty_tpl->getValue(' . $this->yystack[$this->yyidx + 0]->minor['var'] . ')'.$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); + } + } +// line 901 "src/Parser/TemplateParser.y" + public function yy_r115(){ + $this->_retvalue = array('true', '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor); + } +// line 906 "src/Parser/TemplateParser.y" + public function yy_r116(){ + $this->_retvalue = array('true', $this->yystack[$this->yyidx + 0]->minor); + } +// line 911 "src/Parser/TemplateParser.y" + public function yy_r117(){ + $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -1]->minor . '\''); + } +// line 915 "src/Parser/TemplateParser.y" + public function yy_r118(){ + $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -2]->minor . '\'') . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; + } +// line 919 "src/Parser/TemplateParser.y" + public function yy_r119(){ + $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -1]->minor); + } +// line 923 "src/Parser/TemplateParser.y" + public function yy_r120(){ + $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -2]->minor) . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; + } +// line 927 "src/Parser/TemplateParser.y" + public function yy_r121(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor[1]; + } +// line 935 "src/Parser/TemplateParser.y" + public function yy_r123(){ + $this->_retvalue = array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'', 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 938 "src/Parser/TemplateParser.y" + public function yy_r124(){ + $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 951 "src/Parser/TemplateParser.y" + public function yy_r126(){ + return; + } +// line 957 "src/Parser/TemplateParser.y" + public function yy_r127(){ + $this->compiler->triggerTagNoCache(substr($this->yystack[$this->yyidx + 0]->minor,1)); + $this->_retvalue = '[$_smarty_tpl->getValue(\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\')]'; + } +// line 961 "src/Parser/TemplateParser.y" + public function yy_r128(){ + $this->compiler->triggerTagNoCache($this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = '[$_smarty_tpl->getValue(' . $this->yystack[$this->yyidx + 0]->minor . ')]'; + } +// line 966 "src/Parser/TemplateParser.y" + public function yy_r129(){ + $this->compiler->triggerTagNoCache($this->yystack[$this->yyidx + -2]->minor); + $this->_retvalue = '[$_smarty_tpl->getValue(' . $this->yystack[$this->yyidx + -2]->minor . ')->'.$this->yystack[$this->yyidx + 0]->minor.']'; + } +// line 971 "src/Parser/TemplateParser.y" + public function yy_r130(){ + $this->_retvalue = '[\''. $this->yystack[$this->yyidx + 0]->minor .'\']'; + } +// line 975 "src/Parser/TemplateParser.y" + public function yy_r131(){ + $this->_retvalue = '['. $this->yystack[$this->yyidx + 0]->minor .']'; + } +// line 980 "src/Parser/TemplateParser.y" + public function yy_r132(){ + $this->_retvalue = '['. $this->yystack[$this->yyidx + -1]->minor .']'; + } +// line 985 "src/Parser/TemplateParser.y" + public function yy_r133(){ + $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; + } +// line 989 "src/Parser/TemplateParser.y" + public function yy_r134(){ + $this->_retvalue = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; + } +// line 992 "src/Parser/TemplateParser.y" + public function yy_r135(){ + $this->_retvalue = '['.$this->yystack[$this->yyidx + -1]->minor.']'; + } +// line 998 "src/Parser/TemplateParser.y" + public function yy_r137(){ + $this->compiler->triggerTagNoCache(substr($this->yystack[$this->yyidx + -1]->minor,1)); + $this->_retvalue = '[$_smarty_tpl->getValue(\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\')]'; + } +// line 1015 "src/Parser/TemplateParser.y" + public function yy_r141(){ + $this->_retvalue = '[]'; + } +// line 1025 "src/Parser/TemplateParser.y" + public function yy_r142(){ + $this->_retvalue = '\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''; + } +// line 1029 "src/Parser/TemplateParser.y" + public function yy_r143(){ + $this->_retvalue = '\'\''; + } +// line 1034 "src/Parser/TemplateParser.y" + public function yy_r144(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1042 "src/Parser/TemplateParser.y" + public function yy_r146(){ + $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); + $this->compiler->triggerTagNoCache($var); + $this->_retvalue = '$_smarty_tpl->getValue(\''.$var.'\')'; + } +// line 1049 "src/Parser/TemplateParser.y" + public function yy_r147(){ + $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; + } +// line 1056 "src/Parser/TemplateParser.y" + public function yy_r148(){ + if ($this->yystack[$this->yyidx + -1]->minor['var'] === '\'smarty\'') { + $this->_retvalue = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; + } else { + $this->compiler->triggerTagNoCache($this->yystack[$this->yyidx + -1]->minor['var']); + $this->_retvalue = '$_smarty_tpl->getValue(' . $this->yystack[$this->yyidx + -1]->minor['var'] . ')'.$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; + } + } +// line 1066 "src/Parser/TemplateParser.y" + public function yy_r149(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +// line 1071 "src/Parser/TemplateParser.y" + public function yy_r150(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1076 "src/Parser/TemplateParser.y" + public function yy_r151(){ + if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) === '_') { + $this->compiler->trigger_template_error (self::ERR1); + } + $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1083 "src/Parser/TemplateParser.y" + public function yy_r152(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->compiler->triggerTagNoCache($this->yystack[$this->yyidx + -1]->minor); + $this->_retvalue = '->{$_smarty_tpl->getValue(' . $this->yystack[$this->yyidx + -1]->minor . ')'.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +// line 1091 "src/Parser/TemplateParser.y" + public function yy_r153(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +// line 1098 "src/Parser/TemplateParser.y" + public function yy_r154(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +// line 1106 "src/Parser/TemplateParser.y" + public function yy_r155(){ + $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1114 "src/Parser/TemplateParser.y" + public function yy_r156(){ + + if ($this->yystack[$this->yyidx + -3]->minor == 'isset') { + $this->_retvalue = '(true'; + if (count($this->yystack[$this->yyidx + -1]->minor) == 0) { + throw new CompilerException("Invalid number of arguments for isset. isset expects at least one parameter."); + } + foreach ($this->yystack[$this->yyidx + -1]->minor as $value) { + if (is_array($value)) { + $this->_retvalue .= ' && (' . $value[0] . ' && null !== (' . $value[1] . ' ?? null))'; + } else { + $this->_retvalue .= ' && (' . $value . ' !== null)'; + } + } + $this->_retvalue .= ')'; + } elseif ($this->yystack[$this->yyidx + -3]->minor == 'empty') { + if (count($this->yystack[$this->yyidx + -1]->minor) != 1) { + throw new CompilerException("Invalid number of arguments for empty. empty expects at exactly one parameter."); + } + if (is_array($this->yystack[$this->yyidx + -1]->minor[0])) { + $this->_retvalue .= '( !' . $this->yystack[$this->yyidx + -1]->minor[0][0] . ' || empty(' . $this->yystack[$this->yyidx + -1]->minor[0][1] . '))'; + } else { + $this->_retvalue = 'false == ' . $this->yystack[$this->yyidx + -1]->minor[0]; + } + } else { + $p = array(); + foreach ($this->yystack[$this->yyidx + -1]->minor as $value) { + if (is_array($value)) { + $p[] = $value[1]; + } else { + $p[] = $value; + } + } + $this->_retvalue = $this->compiler->compileModifierInExpression($this->yystack[$this->yyidx + -3]->minor, $p); + } + } +// line 1155 "src/Parser/TemplateParser.y" + public function yy_r157(){ + if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) === '_') { + $this->compiler->trigger_template_error (self::ERR1); + } + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . '('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; + } +// line 1162 "src/Parser/TemplateParser.y" + public function yy_r158(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); + $this->compiler->triggerTagNoCache(substr($this->yystack[$this->yyidx + -3]->minor,1)); + $this->compiler->appendPrefixCode("getValue('".substr($this->yystack[$this->yyidx + -3]->minor,1).'\')'.';?>'); + $this->_retvalue = $prefixVar .'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; + } +// line 1191 "src/Parser/TemplateParser.y" + public function yy_r162(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); + } +// line 1195 "src/Parser/TemplateParser.y" + public function yy_r163(){ + $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); + } +// line 1203 "src/Parser/TemplateParser.y" + public function yy_r165(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); + } +// line 1211 "src/Parser/TemplateParser.y" + public function yy_r166(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } +// line 1224 "src/Parser/TemplateParser.y" + public function yy_r169(){ + $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor); + } +// line 1233 "src/Parser/TemplateParser.y" + public function yy_r171(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method'); + } +// line 1238 "src/Parser/TemplateParser.y" + public function yy_r172(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'method'); + } +// line 1243 "src/Parser/TemplateParser.y" + public function yy_r173(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, ''); + } +// line 1248 "src/Parser/TemplateParser.y" + public function yy_r174(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'property'); + } +// line 1253 "src/Parser/TemplateParser.y" + public function yy_r175(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor, 'property'); + } +// line 1259 "src/Parser/TemplateParser.y" + public function yy_r176(){ + $this->_retvalue = ' '. trim($this->yystack[$this->yyidx + 0]->minor) . ' '; + } +// line 1263 "src/Parser/TemplateParser.y" + public function yy_r177(){ + static $lops = array( + 'eq' => ' == ', + 'ne' => ' != ', + 'neq' => ' != ', + 'gt' => ' > ', + 'ge' => ' >= ', + 'gte' => ' >= ', + 'lt' => ' < ', + 'le' => ' <= ', + 'lte' => ' <= ', + 'mod' => ' % ', + 'and' => ' && ', + 'or' => ' || ', + 'xor' => ' xor ', + ); + $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $lops[$op]; + } +// line 1282 "src/Parser/TemplateParser.y" + public function yy_r178(){ + static $tlops = array( + 'isdivby' => array('op' => ' % ', 'pre' => '!('), + 'isnotdivby' => array('op' => ' % ', 'pre' => '('), + 'isevenby' => array('op' => ' / ', 'pre' => '!(1 & '), + 'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isoddby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isnotoddby' => array('op' => ' / ', 'pre' => '!(1 & '), + ); + $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $tlops[$op]; + } +// line 1295 "src/Parser/TemplateParser.y" + public function yy_r179(){ + static $scond = array ( + 'iseven' => '!(1 & ', + 'isnoteven' => '(1 & ', + 'isodd' => '(1 & ', + 'isnotodd' => '!(1 & ', + ); + $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $scond[$op]; + } +// line 1309 "src/Parser/TemplateParser.y" + public function yy_r180(){ + $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; + } +// line 1320 "src/Parser/TemplateParser.y" + public function yy_r183(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1324 "src/Parser/TemplateParser.y" + public function yy_r184(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.','; + } +// line 1332 "src/Parser/TemplateParser.y" + public function yy_r186(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1336 "src/Parser/TemplateParser.y" + public function yy_r187(){ + $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1352 "src/Parser/TemplateParser.y" + public function yy_r190(){ + $this->compiler->leaveDoubleQuote(); + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php($this); + } +// line 1358 "src/Parser/TemplateParser.y" + public function yy_r191(){ + $this->yystack[$this->yyidx + -1]->minor->append_subtree($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 1363 "src/Parser/TemplateParser.y" + public function yy_r192(){ + $this->_retvalue = new Dq($this, $this->yystack[$this->yyidx + 0]->minor); + } +// line 1367 "src/Parser/TemplateParser.y" + public function yy_r193(){ + $this->_retvalue = new Code('(string)'.$this->yystack[$this->yyidx + -1]->minor); + } +// line 1371 "src/Parser/TemplateParser.y" + public function yy_r194(){ + $this->_retvalue = new Code('(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); + } +// line 1375 "src/Parser/TemplateParser.y" + public function yy_r195(){ + $this->_retvalue = new Code('(string)$_smarty_tpl->getValue(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')'); + } +// line 1387 "src/Parser/TemplateParser.y" + public function yy_r198(){ + $this->_retvalue = new Tag($this, $this->yystack[$this->yyidx + 0]->minor); + } +// line 1391 "src/Parser/TemplateParser.y" + public function yy_r199(){ + $this->_retvalue = new DqContent($this->yystack[$this->yyidx + 0]->minor); + } + + private $_retvalue; + + public function yy_reduce($yyruleno) + { + if ($this->yyTraceFILE && $yyruleno >= 0 + && $yyruleno < count(self::$yyRuleName)) { + fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", + $this->yyTracePrompt, $yyruleno, + self::$yyRuleName[$yyruleno]); + } + + $this->_retvalue = $yy_lefthand_side = null; + if (isset(self::$yyReduceMap[$yyruleno])) { + // call the action + $this->_retvalue = null; + $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); + $yy_lefthand_side = $this->_retvalue; + } + $yygoto = self::$yyRuleInfo[$yyruleno][0]; + $yysize = self::$yyRuleInfo[$yyruleno][1]; + $this->yyidx -= $yysize; + for ($i = $yysize; $i; $i--) { + // pop all of the right-hand side parameters + array_pop($this->yystack); + } + $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); + if ($yyact < self::YYNSTATE) { + if (!$this->yyTraceFILE && $yysize) { + $this->yyidx++; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = $yyact; + $x->major = $yygoto; + $x->minor = $yy_lefthand_side; + $this->yystack[$this->yyidx] = $x; + } else { + $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); + } + } elseif ($yyact === self::YYNSTATE + self::YYNRULE + 1) { + $this->yy_accept(); + } + } + + public function yy_parse_failed() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); + } while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } + } + + public function yy_syntax_error($yymajor, $TOKEN) + { +// line 225 "src/Parser/TemplateParser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); + } + + public function yy_accept() + { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); + } while ($this->yyidx >= 0) { + $this->yy_pop_parser_stack(); + } +// line 218 "src/Parser/TemplateParser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; + } + + public function doParse($yymajor, $yytokenvalue) + { + $yyerrorhit = 0; /* True if yymajor has invoked an error */ + + if ($this->yyidx === null || $this->yyidx < 0) { + $this->yyidx = 0; + $this->yyerrcnt = -1; + $x = (object) ['stateno' => null, 'major' => null, 'minor' => null]; + $x->stateno = 0; + $x->major = 0; + $this->yystack = array(); + $this->yystack[] = $x; + } + $yyendofinput = ($yymajor==0); + + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sInput %s\n", + $this->yyTracePrompt, $this->yyTokenName[$yymajor]); + } + + do { + $yyact = $this->yy_find_shift_action($yymajor); + if ($yymajor < self::YYERRORSYMBOL && + !$this->yy_is_expected_token($yymajor)) { + // force a syntax error + $yyact = self::YY_ERROR_ACTION; + } + if ($yyact < self::YYNSTATE) { + $this->yy_shift($yyact, $yymajor, $yytokenvalue); + $this->yyerrcnt--; + if ($yyendofinput && $this->yyidx >= 0) { + $yymajor = 0; + } else { + $yymajor = self::YYNOCODE; + } + } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { + $this->yy_reduce($yyact - self::YYNSTATE); + } elseif ($yyact === self::YY_ERROR_ACTION) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sSyntax Error!\n", + $this->yyTracePrompt); + } + if (self::YYERRORSYMBOL) { + if ($this->yyerrcnt < 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $yymx = $this->yystack[$this->yyidx]->major; + if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) { + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", + $this->yyTracePrompt, $this->yyTokenName[$yymajor]); + } + $this->yy_destructor($yymajor, $yytokenvalue); + $yymajor = self::YYNOCODE; + } else { + while ($this->yyidx >= 0 && + $yymx !== self::YYERRORSYMBOL && + ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE + ){ + $this->yy_pop_parser_stack(); + } + if ($this->yyidx < 0 || $yymajor==0) { + $this->yy_destructor($yymajor, $yytokenvalue); + $this->yy_parse_failed(); + $yymajor = self::YYNOCODE; + } elseif ($yymx !== self::YYERRORSYMBOL) { + $u2 = 0; + $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); + } + } + $this->yyerrcnt = 3; + $yyerrorhit = 1; + } else { + if ($this->yyerrcnt <= 0) { + $this->yy_syntax_error($yymajor, $yytokenvalue); + } + $this->yyerrcnt = 3; + $this->yy_destructor($yymajor, $yytokenvalue); + if ($yyendofinput) { + $this->yy_parse_failed(); + } + $yymajor = self::YYNOCODE; + } + } else { + $this->yy_accept(); + $yymajor = self::YYNOCODE; + } + } while ($yymajor !== self::YYNOCODE && $this->yyidx >= 0); + } +} + diff --git a/core/template/src/Parser/TemplateParser.y b/core/template/src/Parser/TemplateParser.y new file mode 100644 index 0000000..544148f --- /dev/null +++ b/core/template/src/Parser/TemplateParser.y @@ -0,0 +1,1394 @@ +/* + * This file is part of Smarty. + * + * (c) 2015 Uwe Tews + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +%stack_size 500 +%name TP_ +%declare_class { + +namespace Smarty\Parser; + +use \Smarty\Lexer\TemplateLexer as Lexer; +use \Smarty\ParseTree\Template as TemplateParseTree; +use \Smarty\Compiler\Template as TemplateCompiler; +use \Smarty\ParseTree\Code; +use \Smarty\ParseTree\Dq; +use \Smarty\ParseTree\DqContent; +use \Smarty\ParseTree\Tag; +use \Smarty\CompilerException; + +/** +* Smarty Template Parser Class +* +* This is the template parser. +* It is generated from the TemplateParser.y file +* +* @author Uwe Tews +*/ +class TemplateParser +} +%include_class +{ + const ERR1 = 'Security error: Call to private object member not allowed'; + const ERR2 = 'Security error: Call to dynamic object member not allowed'; + + /** + * result status + * + * @var bool + */ + public $successful = true; + + /** + * return value + * + * @var mixed + */ + public $retvalue = 0; + + /** + * @var + */ + public $yymajor; + + /** + * last index of array variable + * + * @var mixed + */ + public $last_index; + + /** + * last variable name + * + * @var string + */ + public $last_variable; + + /** + * root parse tree buffer + * + * @var TemplateParseTree + */ + public $root_buffer; + + /** + * current parse tree object + * + * @var \Smarty\ParseTree\Base + */ + public $current_buffer; + + /** + * lexer object + * + * @var Lexer + */ + public $lex; + + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + + /** + * {strip} status + * + * @var bool + */ + public $strip = false; + /** + * compiler object + * + * @var TemplateCompiler + */ + public $compiler = null; + + /** + * smarty object + * + * @var \Smarty\Smarty + */ + public $smarty = null; + + /** + * template object + * + * @var \Smarty\Template + */ + public $template = null; + + /** + * block nesting level + * + * @var int + */ + public $block_nesting_level = 0; + + /** + * security object + * + * @var \Smarty\Security + */ + public $security = null; + + /** + * template prefix array + * + * @var \Smarty\ParseTree\Base[] + */ + public $template_prefix = array(); + + /** + * template prefix array + * + * @var \Smarty\ParseTree\Base[] + */ + public $template_postfix = array(); + + /** + * constructor + * + * @param Lexer $lex + * @param TemplateCompiler $compiler + */ + public function __construct(Lexer $lex, TemplateCompiler $compiler) + { + $this->lex = $lex; + $this->compiler = $compiler; + $this->template = $this->compiler->getTemplate(); + $this->smarty = $this->template->getSmarty(); + $this->security = $this->smarty->security_policy ?? false; + $this->current_buffer = $this->root_buffer = new TemplateParseTree(); + } + + /** + * insert PHP code in current buffer + * + * @param string $code + */ + public function insertPhpCode($code) + { + $this->current_buffer->append_subtree($this, new Tag($this, $code)); + } + + /** + * error rundown + * + */ + public function errorRunDown() + { + while ($this->yystack !== array()) { + $this->yy_pop_parser_stack(); + } + if (is_resource($this->yyTraceFILE)) { + fclose($this->yyTraceFILE); + } + } + + /** + * merge PHP code with prefix code and return parse tree tag object + * + * @param string $code + * + * @return Tag + */ + private function mergePrefixCode($code) + { + $tmp = ''; + foreach ($this->compiler->prefix_code as $preCode) { + $tmp .= $preCode; + } + $this->compiler->prefix_code = array(); + $tmp .= $code; + return new Tag($this, $this->compiler->processNocacheCode($tmp)); + } + +} + +%token_prefix TP_ + +%parse_accept +{ + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; +} + +%syntax_error +{ + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); +} + +%stack_overflow +{ + $this->internalError = true; + $this->compiler->trigger_template_error('Stack overflow in template parser'); +} + + +%right VERT. +%left COLON. + + + // + // complete template + // +start(res) ::= template. { + $this->root_buffer->prepend_array($this, $this->template_prefix); + $this->root_buffer->append_array($this, $this->template_postfix); + res = $this->root_buffer->to_smarty_php($this); +} + + // template text +template ::= template TEXT(B). { + $text = $this->yystack[ $this->yyidx + 0 ]->minor; + + if ((string)$text == '') { + $this->current_buffer->append_subtree($this, null); + } + + $this->current_buffer->append_subtree($this, new \Smarty\ParseTree\Text($text, $this->strip)); +} + // strip on +template ::= template STRIPON. { + $this->strip = true; +} + // strip off +template ::= template STRIPOFF. { + $this->strip = false; +} + + // Literal +template ::= template LITERALSTART literal_e2(B) LITERALEND. { + $this->current_buffer->append_subtree($this, new \Smarty\ParseTree\Text(B)); +} + + +literal_e2(A) ::= literal_e1(B) LITERALSTART literal_e1(C) LITERALEND. { + A = B.C; +} +literal_e2(A) ::= literal_e1(B). { + A = B; +} + +literal_e1(A) ::= literal_e1(B) LITERAL(C). { + A = B.C; + +} + +literal_e1(A) ::= . { + A = ''; +} + // Smarty tag +template ::= template smartytag(B). { + $this->current_buffer->append_subtree($this, $this->mergePrefixCode(B)); + $this->compiler->has_variable_string = false; + $this->block_nesting_level = $this->compiler->getTagStackCount(); +} + + + // empty template +template ::= . + +smartytag(A) ::= SIMPELOUTPUT(B). { + $var = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); + $attributes = []; + if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { + $attributes[] = 'nocache'; + $var = $match[1]; + } + $this->compiler->triggerTagNoCache($var); + A = $this->compiler->compilePrintExpression('$_smarty_tpl->getValue(\''.$var.'\')', $attributes); +} + +// simple tag like {name} +smartytag(A)::= SIMPLETAG(B). { + $tag = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); + if ($tag == 'strip') { + $this->strip = true; + A = null; + } else { + if (defined($tag)) { + if ($this->security) { + $this->security->isTrustedConstant($tag, $this->compiler); + } + A = $this->compiler->compilePrintExpression($tag); + } else { + if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { + A = $this->compiler->compileTag($match[1],array('\'nocache\'')); + } else { + A = $this->compiler->compileTag($tag,array()); + } + } + } +} + // {$smarty.block.child} or {$smarty.block.parent} +smartytag(A) ::= SMARTYBLOCKCHILDPARENT(i). { + $j = strrpos(i,'.'); + if (i[$j+1] == 'c') { + // {$smarty.block.child} + A = $this->compiler->compileChildBlock(); + } else { + // {$smarty.block.parent} + A = $this->compiler->compileParentBlock(); + } +} + +smartytag(A) ::= LDEL tagbody(B) RDEL. { + A = B; +} + + smartytag(A) ::= tag(B) RDEL. { + A = B; + } + // output with optional attributes +tagbody(A) ::= outattr(B). { + A = $this->compiler->compilePrintExpression(B[0], B[1]); +} + +// +// Smarty tags start here +// + + // assign new style +tagbody(A) ::= DOLLARID(B) eqoutattr(C). { + A = $this->compiler->compileTag('assign',array_merge(array(array('value'=>C[0]),array('var'=>'\''.substr(B,1).'\'')),C[1])); +} + +tagbody(A) ::= varindexed(B) eqoutattr(C). { + A = $this->compiler->compileTag('assign',array_merge(array(array('value'=>C[0]),array('var'=>B['var'])),C[1]),array('smarty_internal_index'=>B['smarty_internal_index'])); +} + +eqoutattr(A) ::= EQUAL outattr(B). { + A = B; +} + +outattr(A) ::= output(B) attributes(C). { + A = array(B,C); +} + +output(A) ::= variablevalue(B). { + A = B; +} +output(A) ::= value(B). { + A = B; +} +output(A) ::= expr(B). { + A = B; +} + + // tag with optional Smarty2 style attributes +tag(res) ::= LDEL ID(i) attributes(a). { + if (defined(i)) { + if ($this->security) { + $this->security->isTrustedConstant(i, $this->compiler); + } + res = $this->compiler->compilePrintExpression(i, a); + } else { + res = $this->compiler->compileTag(i,a); + } +} +tag(res) ::= LDEL ID(i). { + if (defined(i)) { + if ($this->security) { + $this->security->isTrustedConstant(i, $this->compiler); + } + res = $this->compiler->compilePrintExpression(i); + } else { + res = $this->compiler->compileTag(i,array()); + } +} + + + // tag with modifier and optional Smarty2 style attributes +tag(res) ::= LDEL ID(i) modifierlist(l)attributes(a). { + if (defined(i)) { + if ($this->security) { + $this->security->isTrustedConstant(i, $this->compiler); + } + res = $this->compiler->compilePrintExpression(i, a, l); + } else { + res = $this->compiler->compileTag(i,a, array('modifierlist'=>l)); + } +} + + // registered object tag +tag(res) ::= LDEL ID(i) PTR ID(m) attributes(a). { + res = $this->compiler->compileTag(i,a,array('object_method'=>m)); +} + + // registered object tag with modifiers +tag(res) ::= LDEL ID(i) PTR ID(me) modifierlist(l) attributes(a). { + res = $this->compiler->compileTag(i,a,array('modifierlist'=>l, 'object_method'=>me)); +} + + // {if}, {elseif} and {while} tag +tag(res) ::= LDELIF(i) expr(ie). { + $tag = trim(substr(i,$this->compiler->getLdelLength())); + res = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>ie)); +} + +tag(res) ::= LDELIF(i) expr(ie) attributes(a). { + $tag = trim(substr(i,$this->compiler->getLdelLength())); + res = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,a,array('if condition'=>ie)); +} + +tag(res) ::= LDELIF(i) statement(ie). { + $tag = trim(substr(i,$this->compiler->getLdelLength())); + res = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>ie)); +} + +tag(res) ::= LDELIF(i) statement(ie) attributes(a). { + $tag = trim(substr(i,$this->compiler->getLdelLength())); + res = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,a,array('if condition'=>ie)); +} + + // {for} tag +tag(res) ::= LDELFOR statements(st) SEMICOLON expr(ie) SEMICOLON varindexed(v2) foraction(e2) attributes(a). { + res = $this->compiler->compileTag('for',array_merge(a,array(array('start'=>st),array('ifexp'=>ie),array('var'=>v2),array('step'=>e2))),1); +} + + foraction(res) ::= EQUAL expr(e). { + res = '='.e; +} + + foraction(res) ::= INCDEC(e). { + res = e; +} + +tag(res) ::= LDELFOR statement(st) TO expr(v) attributes(a). { + res = $this->compiler->compileTag('for',array_merge(a,array(array('start'=>st),array('to'=>v))),0); +} + +tag(res) ::= LDELFOR statement(st) TO expr(v) STEP expr(v2) attributes(a). { + res = $this->compiler->compileTag('for',array_merge(a,array(array('start'=>st),array('to'=>v),array('step'=>v2))),0); +} + + // {foreach} tag +tag(res) ::= LDELFOREACH SPACE expr(e) AS varvar(v0) attributes(a). { + res = $this->compiler->compileTag('foreach',array_merge(a,array(array('from'=>e),array('item'=>v0)))); +} + +tag(res) ::= LDELFOREACH SPACE expr(e) AS varvar(v1) APTR varvar(v0) attributes(a). { + res = $this->compiler->compileTag('foreach',array_merge(a,array(array('from'=>e),array('item'=>v0),array('key'=>v1)))); +} +tag(res) ::= LDELFOREACH attributes(a). { + res = $this->compiler->compileTag('foreach',a); +} + + // {setfilter} +tag(res) ::= LDELSETFILTER ID(m) modparameters(p). { + res = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array(m),p)))); +} + +tag(res) ::= LDELSETFILTER ID(m) modparameters(p) modifierlist(l). { + res = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array(m),p)),l))); +} + + + // end of block tag {/....} +smartytag(res)::= CLOSETAG(t). { + $tag = trim(substr(t, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' /'); + if ($tag === 'strip') { + $this->strip = false; + res = null; + } else { + res = $this->compiler->compileTag($tag.'close',array()); + } + } +tag(res) ::= LDELSLASH ID(i). { + res = $this->compiler->compileTag(i.'close',array()); +} + +tag(res) ::= LDELSLASH ID(i) modifierlist(l). { + res = $this->compiler->compileTag(i.'close',array(),array('modifier_list'=>l)); +} + + // end of block object tag {/....} +tag(res) ::= LDELSLASH ID(i) PTR ID(m). { + res = $this->compiler->compileTag(i.'close',array(),array('object_method'=>m)); +} + +tag(res) ::= LDELSLASH ID(i) PTR ID(m) modifierlist(l). { + res = $this->compiler->compileTag(i.'close',array(),array('object_method'=>m, 'modifier_list'=>l)); +} + +// +//Attributes of Smarty tags +// + // list of attributes +attributes(res) ::= attributes(a1) attribute(a2). { + res = a1; + res[] = a2; +} + + // single attribute +attributes(res) ::= attribute(a). { + res = array(a); +} + + // no attributes +attributes(res) ::= . { + res = array(); +} + + // attribute +attribute(res) ::= SPACE ID(v) EQUAL ID(id). { + if (defined(id)) { + if ($this->security) { + $this->security->isTrustedConstant(id, $this->compiler); + } + res = array(v=>id); + } else { + res = array(v=>'\''.id.'\''); + } +} + +attribute(res) ::= ATTR(v) expr(e). { + res = array(trim(v," =\n\r\t")=>e); +} + +attribute(res) ::= ATTR(v) value(e). { + res = array(trim(v," =\n\r\t")=>e); +} + +attribute(res) ::= SPACE ID(v). { + res = '\''.v.'\''; +} + +attribute(res) ::= SPACE expr(e). { + res = e; +} + +attribute(res) ::= SPACE value(v). { + res = v; +} + +attribute(res) ::= SPACE INTEGER(i) EQUAL expr(e). { + res = array(i=>e); +} + + + +// +// statement +// +statements(res) ::= statement(s). { + res = array(s); +} + +statements(res) ::= statements(s1) COMMA statement(s). { + s1[]=s; + res = s1; +} + +statement(res) ::= DOLLARID(i) EQUAL INTEGER(e). { + res = array('var' => '\''.substr(i,1).'\'', 'value'=>e); +} +statement(res) ::= DOLLARID(i) EQUAL expr(e). { + res = array('var' => '\''.substr(i,1).'\'', 'value'=>e); +} + +statement(res) ::= varindexed(vi) EQUAL expr(e). { + res = array('var' => vi, 'value'=>e); +} + +statement(res) ::= OPENP statement(st) CLOSEP. { + res = st; +} + + +// +// expressions +// + + // single value +expr(res) ::= value(v). { + res = v; +} + + // nullcoalescing +expr(res) ::= nullcoalescing(v). { + res = v; +} + + // ternary +expr(res) ::= ternary(v). { + res = v; +} + + // ++$a / --$a +expr(res) ::= INCDEC(i2) DOLLARID(i). { + res = '$_smarty_tpl->getVariable(\''. substr(i,1) .'\')->preIncDec(\'' . i2 . '\')'; +} + + // $a++ / $a-- +expr(res) ::= DOLLARID(i) INCDEC(i2). { + res = '$_smarty_tpl->getVariable(\''. substr(i,1) .'\')->postIncDec(\'' . i2 . '\')'; +} + + // resources/streams +expr(res) ::= DOLLARID(i) COLON ID(i2). { + res = '$_smarty_tpl->getStreamVariable(\''.substr(i,1).'://' . i2 . '\')'; +} + + // arithmetic expression +expr(res) ::= expr(e) MATH(m) value(v). { + res = e . trim(m) . v; +} + +expr(res) ::= expr(e) UNIMATH(m) value(v). { + res = e . trim(m) . v; +} + +// if expression + // special conditions +expr(res) ::= expr(e1) tlop(c) value(e2). { + res = c['pre']. e1.c['op'].e2 .')'; +} + // simple expression +expr(res) ::= expr(e1) lop(c) expr(e2). { + res = e1.c.e2; +} + +expr(res) ::= expr(e1) scond(c). { + res = c . e1 . ')'; +} + +isin(res) ::= ISIN(o). { + static $isin = [ + 'isin' => 'in_array(', + 'isnotin' => '!in_array(', + ]; + $op = strtolower(str_replace(' ', '', o)); + res = $isin[$op]; +} + +expr(res) ::= expr(e1) isin(c) array(a). { + res = c . e1.','.a.')'; +} + +expr(res) ::= expr(e1) isin(c) value(v). { + res = c . e1.',(array)'.v.')'; +} + +// null coalescing +nullcoalescing(res) ::= expr(v) QMARK QMARK expr(e2). { + res = v.' ?? '.e2; +} + +// +// ternary +// +ternary(res) ::= expr(v) QMARK DOLLARID(e1) COLON expr(e2). { + $this->compiler->triggerTagNoCache(substr(e1,1)); + res = v.' ? $_smarty_tpl->getValue(\''.substr(e1,1).'\') : '.e2; +} + +ternary(res) ::= expr(v) QMARK value(e1) COLON expr(e2). { + res = v.' ? '.e1.' : '.e2; +} + +ternary(res) ::= expr(v) QMARK expr(e1) COLON expr(e2). { + res = v.' ? '.e1.' : '.e2; +} + +// shorthand ternary +ternary(res) ::= expr(v) QMARK COLON expr(e2). { + res = v.' ?: '.e2; +} + + // value +value(res) ::= variablevalue(v). { + res = v; +} + + // +/- value +value(res) ::= UNIMATH(m) value(v). { + res = m.v; +} + + // logical negation +value(res) ::= NOT value(v). { + res = '!'.v; +} + +value(res) ::= TYPECAST(t) value(v). { + res = t.v; +} + +value(res) ::= variablevalue(v) INCDEC(o). { + res = v.o; +} + + // numeric +value(res) ::= HEX(n). { + res = n; +} + +value(res) ::= INTEGER(n). { + res = n; +} + +value(res) ::= INTEGER(n1) DOT INTEGER(n2). { + res = n1.'.'.n2; +} + +value(res) ::= INTEGER(n1) DOT. { + res = n1.'.'; +} + +value(res) ::= DOT INTEGER(n1). { + res = '.'.n1; +} + + // ID, true, false, null +value(res) ::= ID(id). { + if (defined(id)) { + if ($this->security) { + $this->security->isTrustedConstant(id, $this->compiler); + } + res = id; + } else { + res = '\''.id.'\''; + } +} + + // function call +value(res) ::= function(f). { + res = f; +} + + // expression +value(res) ::= OPENP expr(e) CLOSEP. { + res = '('. e .')'; +} + +value(res) ::= variablevalue(v1) INSTANCEOF(i) ns1(v2). { + res = v1.i.v2; +} +value(res) ::= variablevalue(v1) INSTANCEOF(i) variablevalue(v2). { + res = v1.i.v2; +} + + // singele quoted string +value(res) ::= SINGLEQUOTESTRING(t). { + res = t; +} + + // double quoted string +value(res) ::= doublequoted_with_quotes(s). { + res = s; +} + + +value(res) ::= varindexed(vi) DOUBLECOLON static_class_access(r). { + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); + if (vi['var'] === '\'smarty\'') { + $this->compiler->appendPrefixCode("compile(array(),$this->compiler,vi['smarty_internal_index']).';?>'); + } else { + $this->compiler->triggerTagNoCache(vi['var']); + $this->compiler->appendPrefixCode("getValue(" . vi['var'] . ')'.vi['smarty_internal_index'].';?>'); + } + res = $prefixVar .'::'.r[0].r[1]; +} + + // Smarty tag +value(res) ::= smartytag(st). { + $prefixVar = $this->compiler->getNewPrefixVariable(); + $tmp = $this->compiler->appendCode('', (string) st); + $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); + res = $prefixVar; +} + +value(res) ::= value(v) modifierlist(l). { + res = $this->compiler->compileModifier(l, v); +} + // name space constant +value(res) ::= NAMESPACE(c). { + res = c; +} + + // array +value(res) ::= arraydef(a). { + res = a; +} + // static class access +value(res) ::= ns1(c)DOUBLECOLON static_class_access(s). { + if (!in_array(strtolower(c), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess(c, s, $this->compiler))) { + if (isset($this->smarty->registered_classes[c])) { + res = $this->smarty->registered_classes[c].'::'.s[0].s[1]; + } else { + res = c.'::'.s[0].s[1]; + } + } else { + $this->compiler->trigger_template_error ('static class \''.c.'\' is undefined or not allowed by security setting'); + } +} +// +// namespace stuff +// + +ns1(res) ::= ID(i). { + res = i; +} + +ns1(res) ::= NAMESPACE(i). { + res = i; + } + + +// variable lists + +// multiple variables +variablelist(res) ::= variablelist(l) COMMA variable(v). { + res = array_merge(l,array(v)); +} + +variablelist(res) ::= variablelist(l) COMMA expr(e). { + res = array_merge(l,array(e)); +} + +// single variable +variablelist(res) ::= variable(v). { + res = array(v); +} + +// single expression +variablelist(res) ::= expr(e). { + res = array(e); +} + +// no variable +variablelist(res) ::= . { + res = array(); +} + +// +// variables +// + // Smarty variable (optional array) +variable(res) ::= DOLLARID(i). { + $this->compiler->triggerTagNoCache(substr(i,1)); + res = array('$_smarty_tpl->hasVariable(\''.substr(i,1).'\')','$_smarty_tpl->getValue(\''.substr(i,1).'\')'); +} +variable(res) ::= varindexed(vi). { + if (vi['var'] === '\'smarty\'') { + $smarty_var = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,vi['smarty_internal_index']); + res = array('true', $smarty_var); + } else { + // used for array reset,next,prev,end,current + $this->last_variable = vi['var']; + $this->last_index = vi['smarty_internal_index']; + $this->compiler->triggerTagNoCache(vi['var']); + res = array('true', '$_smarty_tpl->getValue(' . vi['var'] . ')'.vi['smarty_internal_index']); + } +} + + // variable with property +variable(res) ::= varvar(v) AT ID(p). { + res = array('true', '$_smarty_tpl->getVariable('. v .')->'.p); +} + + // object +variable(res) ::= object(o). { + res = array('true', o); +} + + // config variable +configvariable(res) ::= HATCH ID(i) HATCH. { + res = $this->compiler->compileConfigVariable('\'' . i . '\''); +} + +configvariable(res) ::= HATCH ID(i) HATCH arrayindex(a). { + res = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . i . '\'') . ') ? $tmp'.a.' :null)'; +} + +configvariable(res) ::= HATCH variablevalue(v) HATCH. { + res = $this->compiler->compileConfigVariable(v); +} + +configvariable(res) ::= HATCH variablevalue(v) HATCH arrayindex(a). { + res = '(is_array($tmp = ' . $this->compiler->compileConfigVariable(v) . ') ? $tmp'.a.' : null)'; +} + +variablevalue(res) ::= variable(v). { + res = v[1]; +} + +variablevalue(res) ::= configvariable(v). { + res = v; +} + +varindexed(res) ::= DOLLARID(i) arrayindex(a). { + res = array('var'=>'\''.substr(i,1).'\'', 'smarty_internal_index'=>a); +} +varindexed(res) ::= varvar(v) arrayindex(a). { + res = array('var'=>v, 'smarty_internal_index'=>a); +} + +// +// array index +// + // multiple array index +arrayindex(res) ::= arrayindex(a1) indexdef(a2). { + res = a1.a2; +} + + // no array index +arrayindex ::= . { + return; +} + +// single index definition + // Smarty2 style index +indexdef(res) ::= DOT DOLLARID(i). { + $this->compiler->triggerTagNoCache(substr(i,1)); + res = '[$_smarty_tpl->getValue(\''.substr(i,1).'\')]'; +} +indexdef(res) ::= DOT varvar(v). { + $this->compiler->triggerTagNoCache(v); + res = '[$_smarty_tpl->getValue(' . v . ')]'; +} + +indexdef(res) ::= DOT varvar(v) AT ID(p). { + $this->compiler->triggerTagNoCache(v); + res = '[$_smarty_tpl->getValue(' . v . ')->'.p.']'; +} + +indexdef(res) ::= DOT ID(i). { + res = '[\''. i .'\']'; +} + +indexdef(res) ::= DOT INTEGER(n). { + res = '['. n .']'; +} + + +indexdef(res) ::= DOT LDEL expr(e) RDEL. { + res = '['. e .']'; +} + + // section tag index +indexdef(res) ::= OPENB ID(i)CLOSEB. { + res = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.i.'\'][\'index\']').']'; +} + +indexdef(res) ::= OPENB ID(i) DOT ID(i2) CLOSEB. { + res = '['.(new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,'[\'section\'][\''.i.'\'][\''.i2.'\']').']'; +} +indexdef(res) ::= OPENB SINGLEQUOTESTRING(s) CLOSEB. { + res = '['.s.']'; +} +indexdef(res) ::= OPENB INTEGER(n) CLOSEB. { + res = '['.n.']'; +} +indexdef(res) ::= OPENB DOLLARID(i) CLOSEB. { + $this->compiler->triggerTagNoCache(substr(i,1)); + res = '[$_smarty_tpl->getValue(\''.substr(i,1).'\')]'; +} +indexdef(res) ::= OPENB variablevalue(v) CLOSEB. { + res = '['.v.']'; +} +indexdef(res) ::= OPENB value(v) CLOSEB. { + res = '['.v.']'; +} + + // PHP style index +indexdef(res) ::= OPENB expr(e) CLOSEB. { + res = '['. e .']'; +} + + // for assign append array +indexdef(res) ::= OPENB CLOSEB. { + res = '[]'; +} + + +// +// variable variable names +// + + // singel identifier element +varvar(res) ::= DOLLARID(i). { + res = '\''.substr(i,1).'\''; +} + // single $ +varvar(res) ::= DOLLAR. { + res = '\'\''; +} + + // sequence of identifier elements +varvar(res) ::= varvar(v1) varvarele(v2). { + res = v1.'.'.v2; +} + + // fix sections of element +varvarele(res) ::= ID(s). { + res = '\''.s.'\''; +} +varvarele(res) ::= SIMPELOUTPUT(i). { + $var = trim(substr(i, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); + $this->compiler->triggerTagNoCache($var); + res = '$_smarty_tpl->getValue(\''.$var.'\')'; +} + + // variable sections of element +varvarele(res) ::= LDEL expr(e) RDEL. { + res = '('.e.')'; +} + +// +// objects +// +object(res) ::= varindexed(vi) objectchain(oc). { + if (vi['var'] === '\'smarty\'') { + res = (new \Smarty\Compile\SpecialVariableCompiler())->compile(array(),$this->compiler,vi['smarty_internal_index']).oc; + } else { + $this->compiler->triggerTagNoCache(vi['var']); + res = '$_smarty_tpl->getValue(' . vi['var'] . ')'.vi['smarty_internal_index'].oc; + } +} + + // single element +objectchain(res) ::= objectelement(oe). { + res = oe; +} + + // chain of elements +objectchain(res) ::= objectchain(oc) objectelement(oe). { + res = oc.oe; +} + + // variable +objectelement(res)::= PTR ID(i) arrayindex(a). { + if ($this->security && substr(i,0,1) === '_') { + $this->compiler->trigger_template_error (self::ERR1); + } + res = '->'.i.a; +} + +objectelement(res)::= PTR varvar(v) arrayindex(a). { + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->compiler->triggerTagNoCache(v); + res = '->{$_smarty_tpl->getValue(' . v . ')'.a.'}'; +} + +objectelement(res)::= PTR LDEL expr(e) RDEL arrayindex(a). { + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + res = '->{'.e.a.'}'; +} + +objectelement(res)::= PTR ID(ii) LDEL expr(e) RDEL arrayindex(a). { + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + res = '->{\''.ii.'\'.'.e.a.'}'; +} + + // method +objectelement(res)::= PTR method(f). { + res = '->'.f; +} + + +// +// function +// +function(res) ::= ns1(f) OPENP variablelist(v) CLOSEP. { + + if (f == 'isset') { + res = '(true'; + if (count(v) == 0) { + throw new CompilerException("Invalid number of arguments for isset. isset expects at least one parameter."); + } + foreach (v as $value) { + if (is_array($value)) { + res .= ' && (' . $value[0] . ' && null !== (' . $value[1] . ' ?? null))'; + } else { + res .= ' && (' . $value . ' !== null)'; + } + } + res .= ')'; + } elseif (f == 'empty') { + if (count(v) != 1) { + throw new CompilerException("Invalid number of arguments for empty. empty expects at exactly one parameter."); + } + if (is_array(v[0])) { + res .= '( !' . v[0][0] . ' || empty(' . v[0][1] . '))'; + } else { + res = 'false == ' . v[0]; + } + } else { + $p = array(); + foreach (v as $value) { + if (is_array($value)) { + $p[] = $value[1]; + } else { + $p[] = $value; + } + } + res = $this->compiler->compileModifierInExpression(f, $p); + } +} + + +// +// method +// +method(res) ::= ID(f) OPENP params(p) CLOSEP. { + if ($this->security && substr(f,0,1) === '_') { + $this->compiler->trigger_template_error (self::ERR1); + } + res = f . '('. implode(',',p) .')'; +} + +method(res) ::= DOLLARID(f) OPENP params(p) CLOSEP. { + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); + $this->compiler->triggerTagNoCache(substr(f,1)); + $this->compiler->appendPrefixCode("getValue('".substr(f,1).'\')'.';?>'); + res = $prefixVar .'('. implode(',',p) .')'; +} + +// function/method parameter + // multiple parameters +params(res) ::= params(p) COMMA expr(e). { + res = array_merge(p,array(e)); +} + + // single parameter +params(res) ::= expr(e). { + res = array(e); +} + + // no parameter +params(res) ::= . { + res = array(); +} + +// +// modifier +// +modifierlist(res) ::= modifierlist(l) modifier(m) modparameters(p). { + res = array_merge(l,array(array_merge(m,p))); +} + +modifierlist(res) ::= modifier(m) modparameters(p). { + res = array(array_merge(m,p)); +} + +modifier(res) ::= VERT AT ID(m). { + res = array(m); +} + +modifier(res) ::= VERT ID(m). { + res = array(m); +} + +// +// modifier parameter +// + // multiple parameter +modparameters(res) ::= modparameters(mps) modparameter(mp). { + res = array_merge(mps,mp); +} + + // no parameter +modparameters(res) ::= . { + res = array(); +} + + // parameter expression +modparameter(res) ::= COLON value(mp). { + res = array(mp); +} +modparameter(res) ::= COLON UNIMATH(m) value(mp). { + res = array(trim(m).mp); +} + +modparameter(res) ::= COLON array(mp). { + res = array(mp); +} + + // static class methode call +static_class_access(res) ::= method(m). { + res = array(m, '', 'method'); +} + + // static class methode call with object chainig +static_class_access(res) ::= method(m) objectchain(oc). { + res = array(m, oc, 'method'); +} + + // static class constant +static_class_access(res) ::= ID(v). { + res = array(v, ''); +} + + // static class variables +static_class_access(res) ::= DOLLARID(v) arrayindex(a). { + res = array(v, a, 'property'); +} + + // static class variables with object chain +static_class_access(res) ::= DOLLARID(v) arrayindex(a) objectchain(oc). { + res = array(v, a.oc, 'property'); +} + + +// if conditions and operators +lop(res) ::= LOGOP(o). { + res = ' '. trim(o) . ' '; +} + +lop(res) ::= SLOGOP(o). { + static $lops = array( + 'eq' => ' == ', + 'ne' => ' != ', + 'neq' => ' != ', + 'gt' => ' > ', + 'ge' => ' >= ', + 'gte' => ' >= ', + 'lt' => ' < ', + 'le' => ' <= ', + 'lte' => ' <= ', + 'mod' => ' % ', + 'and' => ' && ', + 'or' => ' || ', + 'xor' => ' xor ', + ); + $op = strtolower(preg_replace('/\s*/', '', o)); + res = $lops[$op]; +} +tlop(res) ::= TLOGOP(o). { + static $tlops = array( + 'isdivby' => array('op' => ' % ', 'pre' => '!('), + 'isnotdivby' => array('op' => ' % ', 'pre' => '('), + 'isevenby' => array('op' => ' / ', 'pre' => '!(1 & '), + 'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isoddby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isnotoddby' => array('op' => ' / ', 'pre' => '!(1 & '), + ); + $op = strtolower(preg_replace('/\s*/', '', o)); + res = $tlops[$op]; + } + +scond(res) ::= SINGLECOND(o). { + static $scond = array ( + 'iseven' => '!(1 & ', + 'isnoteven' => '(1 & ', + 'isodd' => '(1 & ', + 'isnotodd' => '!(1 & ', + ); + $op = strtolower(str_replace(' ', '', o)); + res = $scond[$op]; +} + +// +// ARRAY element assignment +// +arraydef(res) ::= OPENB arrayelements(a) CLOSEB. { + res = 'array('.a.')'; +} +arraydef(res) ::= ARRAYOPEN arrayelements(a) CLOSEP. { + res = 'array('.a.')'; +} + +arrayelements(res) ::= arrayelement(a). { + res = a; +} + +arrayelements(res) ::= arrayelements(a1) COMMA arrayelement(a). { + res = a1.','.a; +} + +arrayelements(res) ::= arrayelements(a) COMMA. { + res = a.','; +} + +arrayelements ::= . { + return; +} + +arrayelement(res) ::= value(e1) APTR expr(e2). { + res = e1.'=>'.e2; +} + +arrayelement(res) ::= ID(i) APTR expr(e2). { + res = '\''.i.'\'=>'.e2; +} + +arrayelement(res) ::= expr(e). { + res = e; +} + + +// +// double quoted strings +// +doublequoted_with_quotes(res) ::= QUOTE QUOTE. { + res = '\'\''; +} + +doublequoted_with_quotes(res) ::= QUOTE doublequoted(s) QUOTE. { + $this->compiler->leaveDoubleQuote(); + res = s->to_smarty_php($this); +} + + +doublequoted(res) ::= doublequoted(o1) doublequotedcontent(o2). { + o1->append_subtree($this, o2); + res = o1; +} + +doublequoted(res) ::= doublequotedcontent(o). { + res = new Dq($this, o); +} + +doublequotedcontent(res) ::= BACKTICK variablevalue(v) BACKTICK. { + res = new Code('(string)'.v); +} + +doublequotedcontent(res) ::= BACKTICK expr(e) BACKTICK. { + res = new Code('(string)('.e.')'); +} + +doublequotedcontent(res) ::= DOLLARID(i). { + res = new Code('(string)$_smarty_tpl->getValue(\''. substr(i,1) .'\')'); +} + +doublequotedcontent(res) ::= LDEL variablevalue(v) RDEL. { + res = new Code('(string)'.v); +} + +doublequotedcontent(res) ::= LDEL expr(e) RDEL. { + res = new Code('(string)('.e.')'); +} + +doublequotedcontent(res) ::= smartytag(st). { + res = new Tag($this, st); +} + +doublequotedcontent(res) ::= TEXT(o). { + res = new DqContent(o); +} + diff --git a/core/template/src/Resource/BasePlugin.php b/core/template/src/Resource/BasePlugin.php new file mode 100644 index 0000000..6d22222 --- /dev/null +++ b/core/template/src/Resource/BasePlugin.php @@ -0,0 +1,145 @@ + FilePlugin::class, + 'string' => StringPlugin::class, + 'extends' => ExtendsPlugin::class, + 'stream' => StreamPlugin::class, + 'eval' => StringEval::class, + ]; + + /** + * Source must be recompiled on every occasion + * + * @var boolean + */ + public $recompiled = false; + + /** + * Flag if resource does allow compilation + * + * @return bool + */ + public function supportsCompiledTemplates(): bool { + return true; + } + + /** + * Check if resource must check time stamps when loading compiled or cached templates. + * Resources like 'extends' which use source components my disable timestamp checks on own resource. + * @return bool + */ + public function checkTimestamps() + { + return true; + } + + /** + * Load Resource Handler + * + * @param Smarty $smarty smarty object + * @param string $type name of the resource + * + * @return BasePlugin Resource Handler + * @throws Exception + */ + public static function load(Smarty $smarty, $type) + { + // try smarty's cache + if (isset($smarty->_resource_handlers[ $type ])) { + return $smarty->_resource_handlers[ $type ]; + } + // try registered resource + if (isset($smarty->registered_resources[ $type ])) { + return $smarty->_resource_handlers[ $type ] = $smarty->registered_resources[ $type ]; + } + // try sysplugins dir + if (isset(self::$sysplugins[ $type ])) { + $_resource_class = self::$sysplugins[ $type ]; + return $smarty->_resource_handlers[ $type ] = new $_resource_class(); + } + // try plugins dir + $_resource_class = 'Smarty_Resource_' . \smarty_ucfirst_ascii($type); + if (class_exists($_resource_class, false)) { + return $smarty->_resource_handlers[ $type ] = new $_resource_class(); + } + // try streams + $_known_stream = stream_get_wrappers(); + if (in_array($type, $_known_stream)) { + // is known stream + if (is_object($smarty->security_policy)) { + $smarty->security_policy->isTrustedStream($type); + } + return $smarty->_resource_handlers[ $type ] = new StreamPlugin(); + } + // TODO: try default_(template|config)_handler + // give up + throw new \Smarty\Exception("Unknown resource type '{$type}'"); + } + + /** + * Load template's source into current template object + * + * @param Source $source source object + * + * @return string template source + * @throws \Smarty\Exception if source cannot be loaded + */ + abstract public function getContent(Source $source); + + /** + * populate Source Object with metadata from Resource + * + * @param Source $source source object + * @param Template|null $_template template object + */ + abstract public function populate(Source $source, ?\Smarty\Template $_template = null); + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Source $source source object + */ + public function populateTimestamp(Source $source) + { + // intentionally left blank + } + + /* + * Check if resource must check time stamps when when loading complied or cached templates. + * Resources like 'extends' which use source components my disable timestamp checks on own resource. + * + * @return bool + */ + /** + * Determine basename for compiled filename + * + * @param \Smarty\Template\Source $source source object + * + * @return string resource's basename + */ + public function getBasename(\Smarty\Template\Source $source) + { + return basename(preg_replace('![^\w]+!', '_', $source->name)); + } + +} diff --git a/core/template/src/Resource/CustomPlugin.php b/core/template/src/Resource/CustomPlugin.php new file mode 100644 index 0000000..895e971 --- /dev/null +++ b/core/template/src/Resource/CustomPlugin.php @@ -0,0 +1,105 @@ +uid = sha1($source->type . ':' . $source->name); + $mtime = $this->fetchTimestamp($source->name); + if ($mtime !== null) { + $source->timestamp = $mtime; + } else { + $this->fetch($source->name, $content, $timestamp); + $source->timestamp = $timestamp ?? false; + if (isset($content)) { + $source->content = $content; + } + } + $source->exists = !!$source->timestamp; + } + + /** + * Load template's source into current template object + * + * @param Source $source source object + * + * @return string template source + * @throws Exception if source cannot be loaded + */ + public function getContent(Source $source) { + $this->fetch($source->name, $content, $timestamp); + if (isset($content)) { + return $content; + } + throw new Exception("Unable to read template {$source->type} '{$source->name}'"); + } + + /** + * Determine basename for compiled filename + * + * @param Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Source $source) { + return basename($this->generateSafeName($source->name)); + } + + /** + * Removes special characters from $name and limits its length to 127 characters. + * + * @param $name + * + * @return string + */ + private function generateSafeName($name): string { + return substr(preg_replace('/[^A-Za-z0-9._]/', '', (string)$name), 0, 127); + } +} diff --git a/core/template/src/Resource/ExtendsPlugin.php b/core/template/src/Resource/ExtendsPlugin.php new file mode 100644 index 0000000..960e379 --- /dev/null +++ b/core/template/src/Resource/ExtendsPlugin.php @@ -0,0 +1,116 @@ +name); + $smarty = $source->getSmarty(); + $exists = true; + foreach ($components as $component) { + $_s = Source::load(null, $smarty, $component); + $sources[ $_s->uid ] = $_s; + $uid .= $_s->uid; + if ($_template) { + $exists = $exists && $_s->exists; + } + } + $source->components = $sources; + $source->uid = sha1($uid . $source->getSmarty()->_joined_template_dir); + $source->exists = $exists; + if ($_template) { + $source->timestamp = $_s->timestamp; + } + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Source $source source object + */ + public function populateTimestamp(Source $source) + { + $source->exists = true; + /* @var Source $_s */ + foreach ($source->components as $_s) { + $source->exists = $source->exists && $_s->exists; + } + $source->timestamp = $source->exists ? $_s->getTimeStamp() : false; + } + + /** + * Load template's source from files into current template object + * + * @param Source $source source object + * + * @return string template source + * @throws \Smarty\Exception if source cannot be loaded + */ + public function getContent(Source $source) + { + if (!$source->exists) { + throw new \Smarty\Exception("Unable to load '{$source->type}:{$source->name}'"); + } + $_components = array_reverse($source->components); + $_content = ''; + /* @var Source $_s */ + foreach ($_components as $_s) { + // read content + $_content .= $_s->getContent(); + } + return $_content; + } + + /** + * Determine basename for compiled filename + * + * @param Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Source $source) + { + $search = array(':'); + if (\Smarty\Smarty::$_IS_WINDOWS) { + $search = array(':', '|'); + } + return str_replace($search, '.', basename($source->getResourceName())); + } + + /* + * Disable timestamp checks for extends resource. + * The individual source components will be checked. + * + * @return bool + */ + /** + * @return bool + */ + public function checkTimestamps() + { + return false; + } +} diff --git a/core/template/src/Resource/FilePlugin.php b/core/template/src/Resource/FilePlugin.php new file mode 100644 index 0000000..0033c83 --- /dev/null +++ b/core/template/src/Resource/FilePlugin.php @@ -0,0 +1,183 @@ +uid = sha1( + $source->name . ($source->isConfig ? $source->getSmarty()->_joined_config_dir : + $source->getSmarty()->_joined_template_dir) + ); + + if ($path = $this->getFilePath($source->name, $source->getSmarty(), $source->isConfig)) { + if (isset($source->getSmarty()->security_policy) && is_object($source->getSmarty()->security_policy)) { + $source->getSmarty()->security_policy->isTrustedResourceDir($path, $source->isConfig); + } + $source->exists = true; + $source->timestamp = filemtime($path); + } else { + $source->timestamp = $source->exists = false; + } + } + + /** + * populate Source Object with timestamp and exists from Resource + * + * @param Source $source source object + */ + public function populateTimestamp(Source $source) { + $path = $this->getFilePath($source->name, $source->getSmarty(), $source->isConfig); + if (!$source->exists) { + $source->exists = ($path !== false && is_file($path)); + } + if ($source->exists && $path !== false) { + $source->timestamp = filemtime($path); + } else { + $source->timestamp = 0; + } + } + + /** + * Load template's source from file into current template object + * + * @param Source $source source object + * + * @return string template source + * @throws Exception if source cannot be loaded + */ + public function getContent(Source $source) { + if ($source->exists) { + return file_get_contents($this->getFilePath($source->getResourceName(), $source->getSmarty(), $source->isConfig())); + } + throw new Exception( + 'Unable to read ' . ($source->isConfig ? 'config' : 'template') . + " {$source->type} '{$source->name}'" + ); + } + + /** + * Determine basename for compiled filename + * + * @param Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Source $source) { + return basename($source->getResourceName()); + } + + /** + * build template filepath by traversing the template_dir array + * + * @param $file + * @param Smarty $smarty + * @param bool $isConfig + * + * @return string fully qualified filepath + */ + public function getFilePath($file, \Smarty\Smarty $smarty, bool $isConfig = false) { + // absolute file ? + if ($file[0] === '/' || $file[1] === ':') { + $file = $smarty->_realpath($file, true); + return is_file($file) ? $file : false; + } + + // normalize DIRECTORY_SEPARATOR + if (strpos($file, DIRECTORY_SEPARATOR === '/' ? '\\' : '/') !== false) { + $file = str_replace(DIRECTORY_SEPARATOR === '/' ? '\\' : '/', DIRECTORY_SEPARATOR, $file); + } + $_directories = $smarty->getTemplateDir(null, $isConfig); + // template_dir index? + if ($file[0] === '[' && preg_match('#^\[([^\]]+)\](.+)$#', $file, $fileMatch)) { + $file = $fileMatch[2]; + $_indices = explode(',', $fileMatch[1]); + $_index_dirs = []; + foreach ($_indices as $index) { + $index = trim($index); + // try string indexes + if (isset($_directories[$index])) { + $_index_dirs[] = $_directories[$index]; + } elseif (is_numeric($index)) { + // try numeric index + $index = (int)$index; + if (isset($_directories[$index])) { + $_index_dirs[] = $_directories[$index]; + } else { + // try at location index + $keys = array_keys($_directories); + if (isset($_directories[$keys[$index]])) { + $_index_dirs[] = $_directories[$keys[$index]]; + } + } + } + } + if (empty($_index_dirs)) { + // index not found + return false; + } else { + $_directories = $_index_dirs; + } + } + // relative file name? + foreach ($_directories as $_directory) { + $path = $_directory . $file; + if (is_file($path)) { + return (strpos($path, '.' . DIRECTORY_SEPARATOR) !== false) ? $smarty->_realpath($path) : $path; + } + } + if (!isset($_index_dirs)) { + // Could be relative to cwd + $path = $smarty->_realpath($file, true); + if (is_file($path)) { + return $path; + } + } + return false; + } + + /** + * Returns the timestamp of the resource indicated by $resourceName, or false if it doesn't exist. + * + * @param string $resourceName + * @param Smarty $smarty + * @param bool $isConfig + * + * @return false|int + */ + public function getResourceNameTimestamp(string $resourceName, \Smarty\Smarty $smarty, bool $isConfig = false) { + if ($path = $this->getFilePath($resourceName, $smarty, $isConfig)) { + return filemtime($path); + } + return false; + } +} diff --git a/core/template/src/Resource/RecompiledPlugin.php b/core/template/src/Resource/RecompiledPlugin.php new file mode 100644 index 0000000..f1c64bc --- /dev/null +++ b/core/template/src/Resource/RecompiledPlugin.php @@ -0,0 +1,50 @@ +uid = false; + $source->content = $this->getContent($source); + $source->timestamp = $source->exists = !!$source->content; + } + + /** + * Load template's source from stream into current template object + * + * @param Source $source source object + * + * @return string template source + */ + public function getContent(Source $source) { + + if (strpos($source->getResourceName(), '://') !== false) { + $filepath = $source->getResourceName(); + } else { + $filepath = str_replace(':', '://', $source->getFullResourceName()); + } + + $t = ''; + // the availability of the stream has already been checked in Smarty\Resource\Base::fetch() + $fp = fopen($filepath, 'r+'); + if ($fp) { + while (!feof($fp) && ($current_line = fgets($fp)) !== false) { + $t .= $current_line; + } + fclose($fp); + return $t; + } else { + return false; + } + } + +} diff --git a/core/template/src/Resource/StringEval.php b/core/template/src/Resource/StringEval.php new file mode 100644 index 0000000..2aa60ff --- /dev/null +++ b/core/template/src/Resource/StringEval.php @@ -0,0 +1,85 @@ +uid = sha1($source->name); + $source->timestamp = $source->exists = true; + } + + /** + * Load template's source from $resource_name into current template object + * + * @param \Smarty\Template\Source $source source object + * + * @return string template source + *@uses decode() to decode base64 and urlencoded template_resources + * + */ + public function getContent(\Smarty\Template\Source $source) + { + return $this->decode($source->name); + } + + /** + * decode base64 and urlencode + * + * @param string $string template_resource to decode + * + * @return string decoded template_resource + */ + protected function decode($string) + { + // decode if specified + if (($pos = strpos($string, ':')) !== false) { + if (!strncmp($string, 'base64', 6)) { + return base64_decode(substr($string, 7)); + } elseif (!strncmp($string, 'urlencode', 9)) { + return urldecode(substr($string, 10)); + } + } + return $string; + } + + /** + * Determine basename for compiled filename + * + * @param \Smarty\Template\Source $source source object + * + * @return string resource's basename + */ + public function getBasename(\Smarty\Template\Source $source) + { + return ''; + } +} diff --git a/core/template/src/Resource/StringPlugin.php b/core/template/src/Resource/StringPlugin.php new file mode 100644 index 0000000..fb3692c --- /dev/null +++ b/core/template/src/Resource/StringPlugin.php @@ -0,0 +1,94 @@ +uid = sha1($source->name); + $source->timestamp = $source->exists = true; + } + + /** + * Load template's source from $resource_name into current template object + * + * @param Source $source source object + * + * @return string template source + * @uses decode() to decode base64 and urlencoded template_resources + * + */ + public function getContent(Source $source) { + return $this->decode($source->name); + } + + /** + * decode base64 and urlencode + * + * @param string $string template_resource to decode + * + * @return string decoded template_resource + */ + protected function decode($string) { + // decode if specified + if (($pos = strpos($string, ':')) !== false) { + if (!strncmp($string, 'base64', 6)) { + return base64_decode(substr($string, 7)); + } elseif (!strncmp($string, 'urlencode', 9)) { + return urldecode(substr($string, 10)); + } + } + return $string; + } + + /** + * Determine basename for compiled filename + * Always returns an empty string. + * + * @param Source $source source object + * + * @return string resource's basename + */ + public function getBasename(Source $source) { + return ''; + } + + /* + * Disable timestamp checks for string resource. + * + * @return bool + */ + /** + * @return bool + */ + public function checkTimestamps() { + return false; + } +} diff --git a/core/template/src/Runtime/Block.php b/core/template/src/Runtime/Block.php new file mode 100644 index 0000000..90eab9c --- /dev/null +++ b/core/template/src/Runtime/Block.php @@ -0,0 +1,92 @@ +name = $name; + $this->tplIndex = $tplIndex; + } + + /** + * Compiled block code overloaded by {block} class + * + * @param \Smarty\Template $tpl + */ + public function callBlock(\Smarty\Template $tpl) + { + } +} diff --git a/core/template/src/Runtime/CaptureRuntime.php b/core/template/src/Runtime/CaptureRuntime.php new file mode 100644 index 0000000..3f37c59 --- /dev/null +++ b/core/template/src/Runtime/CaptureRuntime.php @@ -0,0 +1,163 @@ +registerCallbacks($_template); + + $this->captureStack[] = [ + $buffer, + $assign, + $append, + ]; + $this->captureCount++; + ob_start(); + } + + /** + * Register callbacks in template class + * + * @param \Smarty\Template $_template + */ + private function registerCallbacks(Template $_template) { + + foreach ($_template->startRenderCallbacks as $callback) { + if (is_array($callback) && get_class($callback[0]) == self::class) { + // already registered + return; + } + } + + $_template->startRenderCallbacks[] = [ + $this, + 'startRender', + ]; + $_template->endRenderCallbacks[] = [ + $this, + 'endRender', + ]; + $this->startRender($_template); + } + + /** + * Start render callback + * + * @param \Smarty\Template $_template + */ + public function startRender(Template $_template) { + $this->countStack[] = $this->captureCount; + $this->captureCount = 0; + } + + /** + * Close capture section + * + * @param \Smarty\Template $_template + * + * @throws \Smarty\Exception + */ + public function close(Template $_template) { + if ($this->captureCount) { + [$buffer, $assign, $append] = array_pop($this->captureStack); + $this->captureCount--; + if (isset($assign)) { + $_template->assign($assign, ob_get_contents()); + } + if (isset($append)) { + $_template->append($append, ob_get_contents()); + } + $this->namedBuffer[$buffer] = ob_get_clean(); + } else { + $this->error($_template); + } + } + + /** + * Error exception on not matching {capture}{/capture} + * + * @param \Smarty\Template $_template + * + * @throws \Smarty\Exception + */ + public function error(Template $_template) { + throw new \Smarty\Exception("Not matching {capture}{/capture} in '{$_template->template_resource}'"); + } + + /** + * Return content of named capture buffer by key or as array + * + * @param \Smarty\Template $_template + * @param string|null $name + * + * @return string|string[]|null + */ + public function getBuffer(Template $_template, $name = null) { + if (isset($name)) { + return $this->namedBuffer[$name] ?? null; + } else { + return $this->namedBuffer; + } + } + + /** + * End render callback + * + * @param \Smarty\Template $_template + * + * @throws \Smarty\Exception + */ + public function endRender(Template $_template) { + if ($this->captureCount) { + $this->error($_template); + } else { + $this->captureCount = array_pop($this->countStack); + } + } +} diff --git a/core/template/src/Runtime/DefaultPluginHandlerRuntime.php b/core/template/src/Runtime/DefaultPluginHandlerRuntime.php new file mode 100644 index 0000000..f3be85c --- /dev/null +++ b/core/template/src/Runtime/DefaultPluginHandlerRuntime.php @@ -0,0 +1,73 @@ +defaultPluginHandler = $defaultPluginHandler; + } + + public function hasPlugin($tag, $plugin_type): bool { + if ($this->defaultPluginHandler === null) { + return false; + } + + $callback = null; + + // these are not used here + $script = null; + $cacheable = null; + + return (\call_user_func_array( + $this->defaultPluginHandler, + [ + $tag, + $plugin_type, + null, // This used to pass $this->template, but this parameter has been removed in 5.0 + &$callback, + &$script, + &$cacheable, + ] + ) && $callback); + } + + /** + * @throws Exception + */ + public function getCallback($tag, $plugin_type) { + + if ($this->defaultPluginHandler === null) { + return false; + } + + $callback = null; + + // these are not used here + $script = null; + $cacheable = null; + + if (\call_user_func_array( + $this->defaultPluginHandler, + [ + $tag, + $plugin_type, + null, // This used to pass $this->template, but this parameter has been removed in 5.0 + &$callback, + &$script, + &$cacheable, + ] + ) && $callback) { + return $callback; + } + throw new Exception("Default plugin handler: Returned callback for '{$tag}' not callable at runtime"); + } + +} \ No newline at end of file diff --git a/core/template/src/Runtime/ForeachRuntime.php b/core/template/src/Runtime/ForeachRuntime.php new file mode 100644 index 0000000..06da7d5 --- /dev/null +++ b/core/template/src/Runtime/ForeachRuntime.php @@ -0,0 +1,160 @@ +count($from); + } + } else { + settype($from, 'array'); + } + } + if (!isset($total)) { + $total = empty($from) ? 0 : ($needTotal ? count($from) : 1); + } + if ($tpl->hasVariable($item)) { + $saveVars['item'] = [ + $item, + $tpl->getVariable($item)->getValue(), + ]; + } + $tpl->assign($item,null); + if ($total === 0) { + $from = null; + } else { + if ($key) { + if ($tpl->hasVariable($key)) { + $saveVars['key'] = [ + $key, + clone $tpl->getVariable($key), + ]; + } + $tpl->assign($key, null); + } + } + if ($needTotal) { + $tpl->getVariable($item)->total = $total; + } + if ($name) { + $namedVar = "__smarty_foreach_{$name}"; + if ($tpl->hasVariable($namedVar)) { + $saveVars['named'] = [ + $namedVar, + clone $tpl->getVariable($namedVar), + ]; + } + $namedProp = []; + if (isset($properties['total'])) { + $namedProp['total'] = $total; + } + if (isset($properties['iteration'])) { + $namedProp['iteration'] = 0; + } + if (isset($properties['index'])) { + $namedProp['index'] = -1; + } + if (isset($properties['show'])) { + $namedProp['show'] = ($total > 0); + } + $tpl->assign($namedVar, $namedProp); + } + $this->stack[] = $saveVars; + return $from; + } + + /** + * [util function] counts an array, arrayAccess/traversable or PDOStatement object + * + * @param mixed $value + * + * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 + * for empty elements + * @throws \Exception + */ + public function count($value): int + { + if ($value instanceof \IteratorAggregate) { + // Note: getIterator() returns a Traversable, not an Iterator + // thus rewind() and valid() methods may not be present + return iterator_count($value->getIterator()); + } elseif ($value instanceof \Iterator) { + return $value instanceof \Generator ? 1 : iterator_count($value); + } elseif ($value instanceof \Countable) { + return count($value); + } + return count((array) $value); + } + + /** + * Restore saved variables + * + * will be called by {break n} or {continue n} for the required number of levels + * + * @param \Smarty\Template $tpl + * @param int $levels number of levels + */ + public function restore(Template $tpl, $levels = 1) { + while ($levels) { + $saveVars = array_pop($this->stack); + if (!empty($saveVars)) { + if (isset($saveVars['item'])) { + $tpl->getVariable($saveVars['item'][0])->setValue($saveVars['item'][1]); + } + if (isset($saveVars['key'])) { + $tpl->setVariable($saveVars['key'][0], $saveVars['key'][1]); + } + if (isset($saveVars['named'])) { + $tpl->setVariable($saveVars['named'][0], $saveVars['named'][1]); + } + } + $levels--; + } + } +} diff --git a/core/template/src/Runtime/InheritanceRuntime.php b/core/template/src/Runtime/InheritanceRuntime.php new file mode 100644 index 0000000..74ea854 --- /dev/null +++ b/core/template/src/Runtime/InheritanceRuntime.php @@ -0,0 +1,243 @@ +state === 3 && (strpos($tpl->template_resource, 'extendsall') === false)) { + $tpl->setInheritance(clone $tpl->getSmarty()->getRuntime('Inheritance')); + $tpl->getInheritance()->init($tpl, $initChild, $blockNames); + return; + } + ++$this->tplIndex; + $this->sources[$this->tplIndex] = $tpl->getSource(); + // start of child sub template(s) + if ($initChild) { + $this->state = 1; + if (!$this->inheritanceLevel) { + //grab any output of child templates + ob_start(); + } + ++$this->inheritanceLevel; + } + // if state was waiting for parent change state to parent + if ($this->state === 2) { + $this->state = 3; + } + } + + /** + * End of child template(s) + * - if outer level is reached flush output buffer and switch to wait for parent template state + * + * @param \Smarty\Template $tpl + * @param null|string $template optional name of inheritance parent template + * + * @throws \Exception + * @throws \Smarty\Exception + */ + public function endChild(Template $tpl, $template = null, ?string $currentDir = null) { + --$this->inheritanceLevel; + if (!$this->inheritanceLevel) { + ob_end_clean(); + $this->state = 2; + } + if (isset($template)) { + $tpl->renderSubTemplate( + $template, + $tpl->cache_id, + $tpl->compile_id, + $tpl->caching ? \Smarty\Template::CACHING_NOCACHE_CODE : 0, + $tpl->cache_lifetime, + [], + null, + $currentDir + ); + } + } + + /** + * \Smarty\Runtime\Block constructor. + * - if outer level {block} of child template ($state === 1) save it as child root block + * - otherwise process inheritance and render + * + * @param \Smarty\Template $tpl + * @param $className + * @param string $name + * @param int|null $tplIndex index of outer level {block} if nested + * + * @throws \Smarty\Exception + */ + public function instanceBlock(Template $tpl, $className, $name, $tplIndex = null) { + $block = new $className($name, isset($tplIndex) ? $tplIndex : $this->tplIndex); + if (isset($this->childRoot[$name])) { + $block->child = $this->childRoot[$name]; + } + if ($this->state === 1) { + $this->childRoot[$name] = $block; + return; + } + // make sure we got child block of child template of current block + while ($block->child && $block->child->child && $block->tplIndex <= $block->child->tplIndex) { + $block->child = $block->child->child; + } + $this->processBlock($tpl, $block); + } + + /** + * Goto child block or render this + * + * @param Template $tpl + * @param \Smarty\Runtime\Block $block + * @param \Smarty\Runtime\Block|null $parent + * + * @throws Exception + */ + private function processBlock( + Template $tpl, + \Smarty\Runtime\Block $block, + ?\Smarty\Runtime\Block $parent = null + ) { + if ($block->hide && !isset($block->child)) { + return; + } + if (isset($block->child) && $block->child->hide && !isset($block->child->child)) { + $block->child = null; + } + $block->parent = $parent; + if ($block->append && !$block->prepend && isset($parent)) { + $this->callParent($tpl, $block, '\'{block append}\''); + } + if ($block->callsChild || !isset($block->child) || ($block->child->hide && !isset($block->child->child))) { + $this->callBlock($block, $tpl); + } else { + $this->processBlock($tpl, $block->child, $block); + } + if ($block->prepend && isset($parent)) { + $this->callParent($tpl, $block, '{block prepend}'); + if ($block->append) { + if ($block->callsChild || !isset($block->child) + || ($block->child->hide && !isset($block->child->child)) + ) { + $this->callBlock($block, $tpl); + } else { + $this->processBlock($tpl, $block->child, $block); + } + } + } + $block->parent = null; + } + + /** + * Render child on \$smarty.block.child + * + * @param Template $tpl + * @param \Smarty\Runtime\Block $block + * + * @return null|string block content + * @throws Exception + */ + public function callChild(Template $tpl, \Smarty\Runtime\Block $block) { + if (isset($block->child)) { + $this->processBlock($tpl, $block->child, $block); + } + } + + /** + * Render parent block on \$smarty.block.parent or {block append/prepend} + * + * @param Template $tpl + * @param \Smarty\Runtime\Block $block + * @param string $tag + * + * @return null|string block content + * @throws Exception + */ + public function callParent(Template $tpl, \Smarty\Runtime\Block $block) { + if (isset($block->parent)) { + $this->callBlock($block->parent, $tpl); + } else { + throw new Exception("inheritance: illegal '{\$smarty.block.parent}' used in child template '" . + "{$tpl->getInheritance()->sources[$block->tplIndex]->getResourceName()}' block '{$block->name}'"); + } + } + + /** + * render block + * + * @param \Smarty\Runtime\Block $block + * @param Template $tpl + */ + public function callBlock(\Smarty\Runtime\Block $block, Template $tpl) { + $this->sourceStack[] = $tpl->getSource(); + $tpl->setSource($this->sources[$block->tplIndex]); + $block->callBlock($tpl); + $tpl->setSource(array_pop($this->sourceStack)); + } +} diff --git a/core/template/src/Runtime/TplFunctionRuntime.php b/core/template/src/Runtime/TplFunctionRuntime.php new file mode 100644 index 0000000..6c4b93d --- /dev/null +++ b/core/template/src/Runtime/TplFunctionRuntime.php @@ -0,0 +1,144 @@ +tplFunctions[$name] ?? ($tpl->getSmarty()->tplFunctions[$name] ?? null); + if (!isset($funcParam)) { + throw new \Smarty\Exception("Unable to find template function '{$name}'"); + } + + if (!$tpl->caching || ($tpl->caching && $nocache)) { + $function = $funcParam['call_name']; + } else { + if (isset($funcParam['call_name_caching'])) { + $function = $funcParam['call_name_caching']; + } else { + $function = $funcParam['call_name']; + } + } + if (!function_exists($function) && !$this->addTplFuncToCache($tpl, $name, $function)) { + throw new \Smarty\Exception("Unable to find template function '{$name}'"); + } + + $tpl->pushStack(); + $function($tpl, $params); + $tpl->popStack(); + } + + /** + * Register template functions defined by template + * + * @param \Smarty|\Smarty\Template|\Smarty\TemplateBase $obj + * @param array $tplFunctions source information array of + * template functions defined + * in template + * @param bool $override if true replace existing + * functions with same name + */ + public function registerTplFunctions(TemplateBase $obj, $tplFunctions, $override = true) { + $obj->tplFunctions = + $override ? array_merge($obj->tplFunctions, $tplFunctions) : array_merge($tplFunctions, $obj->tplFunctions); + // make sure that the template functions are known in parent templates + if ($obj->_isSubTpl()) { + $this->registerTplFunctions($obj->parent, $tplFunctions, false); + } else { + $obj->getSmarty()->tplFunctions = $override ? array_merge($obj->getSmarty()->tplFunctions, $tplFunctions) : + array_merge($tplFunctions, $obj->getSmarty()->tplFunctions); + } + } + + /** + * Return source parameter array for single or all template functions + * + * @param \Smarty\Template $tpl template object + * @param null|string $name template function name + * + * @return array|bool|mixed + */ + public function getTplFunction(Template $tpl, $name = null) { + if (isset($name)) { + return $tpl->tplFunctions[$name] ?? ($tpl->getSmarty()->tplFunctions[$name] ?? false); + } else { + return empty($tpl->tplFunctions) ? $tpl->getSmarty()->tplFunctions : $tpl->tplFunctions; + } + } + + /** + * Add template function to cache file for nocache calls + * + * @param Template $tpl + * @param string $_name template function name + * @param string $_function PHP function name + * + * @return bool + * @throws Exception + */ + private function addTplFuncToCache(Template $tpl, $_name, $_function) { + $funcParam = $tpl->tplFunctions[$_name]; + if (is_file($funcParam['compiled_filepath'])) { + // read compiled file + $code = file_get_contents($funcParam['compiled_filepath']); + // grab template function + if (preg_match("/\/\* {$_function} \*\/([\S\s]*?)\/\*\/ {$_function} \*\//", $code, $match)) { + // grab source info from file dependency + preg_match("/\s*'{$funcParam['uid']}'([\S\s]*?)\),/", $code, $match1); + unset($code); + // make PHP function known + eval($match[0]); + if (function_exists($_function)) { + + // Some magic code existed here, testing if the cached property had been set + // and then bubbling up until it found a parent template that had the cached property. + // This is no longer possible, so somehow this might break. + + // add template function code to cache file + $content = $tpl->getCached()->readCache($tpl); + if ($content) { + // check if we must update file dependency + if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) { + $content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content); + } + $tpl->getCached()->writeCache( + $tpl, + preg_replace('/\s*\?>\s*$/', "\n", $content) . + "\n" . preg_replace( + [ + '/^\s*<\?php\s+/', + '/\s*\?>\s*$/', + ], + "\n", + $match[0] + ) + ); + } + return true; + } + } + } + return false; + } + +} diff --git a/core/template/src/Security.php b/core/template/src/Security.php new file mode 100644 index 0000000..250b3bc --- /dev/null +++ b/core/template/src/Security.php @@ -0,0 +1,560 @@ + array('method_1', 'method_2'), // allowed methods listed + * 'class_2' => array(), // all methods of class allowed + * ) + * If set to null none is allowed. + * + * @var array + */ + public $trusted_static_methods = []; + + /** + * This is an array of trusted static properties. + * If empty access to all static classes and properties is allowed. + * Format: + * array ( + * 'class_1' => array('prop_1', 'prop_2'), // allowed properties listed + * 'class_2' => array(), // all properties of class allowed + * ) + * If set to null none is allowed. + * + * @var array + */ + public $trusted_static_properties = []; + + /** + * This is an array of allowed tags. + * If empty no restriction by allowed_tags. + * + * @var array + */ + public $allowed_tags = []; + + /** + * This is an array of disabled tags. + * If empty no restriction by disabled_tags. + * + * @var array + */ + public $disabled_tags = []; + + /** + * This is an array of allowed modifier plugins. + * If empty no restriction by allowed_modifiers. + * + * @var array + */ + public $allowed_modifiers = []; + + /** + * This is an array of disabled modifier plugins. + * If empty no restriction by disabled_modifiers. + * + * @var array + */ + public $disabled_modifiers = []; + + /** + * This is an array of disabled special $smarty variables. + * + * @var array + */ + public $disabled_special_smarty_vars = []; + + /** + * This is an array of trusted streams. + * If empty all streams are allowed. + * To disable all streams set $streams = null. + * + * @var array + */ + public $streams = ['file']; + + /** + * + flag if constants can be accessed from template + * + * @var boolean + */ + public $allow_constants = true; + + /** + * + flag if super globals can be accessed from template + * + * @var boolean + */ + public $allow_super_globals = true; + + /** + * max template nesting level + * + * @var int + */ + public $max_template_nesting = 0; + + /** + * current template nesting level + * + * @var int + */ + private $_current_template_nesting = 0; + + /** + * Cache for $resource_dir lookup + * + * @var array + */ + protected $_resource_dir = []; + + /** + * Cache for $template_dir lookup + * + * @var array + */ + protected $_template_dir = []; + + /** + * Cache for $config_dir lookup + * + * @var array + */ + protected $_config_dir = []; + + /** + * Cache for $secure_dir lookup + * + * @var array + */ + protected $_secure_dir = []; + + /** + * @param Smarty $smarty + */ + public function __construct(Smarty $smarty) { + $this->smarty = $smarty; + } + + /** + * Check if static class is trusted. + * + * @param string $class_name + * @param object $compiler compiler object + * + * @return boolean true if class is trusted + */ + public function isTrustedStaticClass($class_name, $compiler) { + if (isset($this->static_classes) + && (empty($this->static_classes) || in_array($class_name, $this->static_classes)) + ) { + return true; + } + $compiler->trigger_template_error("access to static class '{$class_name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if static class method/property is trusted. + * + * @param string $class_name + * @param string $params + * @param object $compiler compiler object + * + * @return boolean true if class method is trusted + */ + public function isTrustedStaticClassAccess($class_name, $params, $compiler) { + if (!isset($params[2])) { + // fall back + return $this->isTrustedStaticClass($class_name, $compiler); + } + if ($params[2] === 'method') { + $allowed = $this->trusted_static_methods; + $name = substr($params[0], 0, strpos($params[0], '(')); + } else { + $allowed = $this->trusted_static_properties; + // strip '$' + $name = substr($params[0], 1); + } + if (isset($allowed)) { + if (empty($allowed)) { + // fall back + return $this->isTrustedStaticClass($class_name, $compiler); + } + if (isset($allowed[$class_name]) + && (empty($allowed[$class_name]) || in_array($name, $allowed[$class_name])) + ) { + return true; + } + } + $compiler->trigger_template_error("access to static class '{$class_name}' {$params[2]} '{$name}' not allowed by security setting"); + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if tag is trusted. + * + * @param string $tag_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + */ + public function isTrustedTag($tag_name, $compiler) { + $tag_name = strtolower($tag_name); + + // check for internal always required tags + if (in_array($tag_name, ['assign', 'call'])) { + return true; + } + // check security settings + if (empty($this->allowed_tags)) { + if (empty($this->disabled_tags) || !in_array($tag_name, $this->disabled_tags)) { + return true; + } else { + $compiler->trigger_template_error("tag '{$tag_name}' disabled by security setting", null, true); + } + } elseif (in_array($tag_name, $this->allowed_tags) && !in_array($tag_name, $this->disabled_tags)) { + return true; + } else { + $compiler->trigger_template_error("tag '{$tag_name}' not allowed by security setting", null, true); + } + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if special $smarty variable is trusted. + * + * @param string $var_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + */ + public function isTrustedSpecialSmartyVar($var_name, $compiler) { + if (!in_array($var_name, $this->disabled_special_smarty_vars)) { + return true; + } else { + $compiler->trigger_template_error( + "special variable '\$smarty.{$var_name}' not allowed by security setting", + null, + true + ); + } + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if modifier plugin is trusted. + * + * @param string $modifier_name + * @param object $compiler compiler object + * + * @return boolean true if tag is trusted + */ + public function isTrustedModifier($modifier_name, $compiler) { + // check for internal always allowed modifier + if (in_array($modifier_name, ['default'])) { + return true; + } + // check security settings + if (empty($this->allowed_modifiers)) { + if (empty($this->disabled_modifiers) || !in_array($modifier_name, $this->disabled_modifiers)) { + return true; + } else { + $compiler->trigger_template_error( + "modifier '{$modifier_name}' disabled by security setting", + null, + true + ); + } + } elseif (in_array($modifier_name, $this->allowed_modifiers) + && !in_array($modifier_name, $this->disabled_modifiers) + ) { + return true; + } else { + $compiler->trigger_template_error( + "modifier '{$modifier_name}' not allowed by security setting", + null, + true + ); + } + return false; // should not, but who knows what happens to the compiler in the future? + } + + /** + * Check if constants are enabled or trusted + * + * @param string $const constant name + * @param object $compiler compiler object + * + * @return bool + */ + public function isTrustedConstant($const, $compiler) { + if (in_array($const, ['true', 'false', 'null'])) { + return true; + } + if (!empty($this->trusted_constants)) { + if (!in_array(strtolower($const), $this->trusted_constants)) { + $compiler->trigger_template_error("Security: access to constant '{$const}' not permitted"); + return false; + } + return true; + } + if ($this->allow_constants) { + return true; + } + $compiler->trigger_template_error("Security: access to constants not permitted"); + return false; + } + + /** + * Check if stream is trusted. + * + * @param string $stream_name + * + * @return boolean true if stream is trusted + * @throws Exception if stream is not trusted + */ + public function isTrustedStream($stream_name) { + if (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) { + return true; + } + throw new Exception("stream '{$stream_name}' not allowed by security setting"); + } + + /** + * Check if directory of file resource is trusted. + * + * @param string $filepath + * @param null|bool $isConfig + * + * @return bool true if directory is trusted + * @throws \Smarty\Exception if directory is not trusted + */ + public function isTrustedResourceDir($filepath, $isConfig = null) { + $_dir = $this->smarty->getTemplateDir(); + if ($this->_template_dir !== $_dir) { + $this->_updateResourceDir($this->_template_dir, $_dir); + $this->_template_dir = $_dir; + } + $_dir = $this->smarty->getConfigDir(); + if ($this->_config_dir !== $_dir) { + $this->_updateResourceDir($this->_config_dir, $_dir); + $this->_config_dir = $_dir; + } + if ($this->_secure_dir !== $this->secure_dir) { + $this->secure_dir = (array)$this->secure_dir; + foreach ($this->secure_dir as $k => $d) { + $this->secure_dir[$k] = $this->smarty->_realpath($d . DIRECTORY_SEPARATOR, true); + } + $this->_updateResourceDir($this->_secure_dir, $this->secure_dir); + $this->_secure_dir = $this->secure_dir; + } + $addPath = $this->_checkDir($filepath, $this->_resource_dir); + if ($addPath !== false) { + $this->_resource_dir = array_merge($this->_resource_dir, $addPath); + } + return true; + } + + /** + * Check if URI (e.g. {fetch} or {html_image}) is trusted + * To simplify things, isTrustedUri() resolves all input to "{$PROTOCOL}://{$HOSTNAME}". + * So "http://username:password@hello.world.example.org:8080/some-path?some=query-string" + * is reduced to "http://hello.world.example.org" prior to applying the patters from {@link $trusted_uri}. + * + * @param string $uri + * + * @return boolean true if URI is trusted + * @throws Exception if URI is not trusted + * @uses $trusted_uri for list of patterns to match against $uri + */ + public function isTrustedUri($uri) { + $_uri = parse_url($uri); + if (!empty($_uri['scheme']) && !empty($_uri['host'])) { + $_uri = $_uri['scheme'] . '://' . $_uri['host']; + foreach ($this->trusted_uri as $pattern) { + if (preg_match($pattern, $_uri)) { + return true; + } + } + } + throw new Exception("URI '{$uri}' not allowed by security setting"); + } + + /** + * Remove old directories and its sub folders, add new directories + * + * @param array $oldDir + * @param array $newDir + */ + private function _updateResourceDir($oldDir, $newDir) { + foreach ($oldDir as $directory) { + // $directory = $this->smarty->_realpath($directory, true); + $length = strlen($directory); + foreach ($this->_resource_dir as $dir) { + if (substr($dir, 0, $length) === $directory) { + unset($this->_resource_dir[$dir]); + } + } + } + foreach ($newDir as $directory) { + // $directory = $this->smarty->_realpath($directory, true); + $this->_resource_dir[$directory] = true; + } + } + + /** + * Check if file is inside a valid directory + * + * @param string $filepath + * @param array $dirs valid directories + * + * @return array|bool + * @throws \Smarty\Exception + */ + private function _checkDir($filepath, $dirs) { + $directory = dirname($this->smarty->_realpath($filepath, true)) . DIRECTORY_SEPARATOR; + $_directory = []; + if (!preg_match('#[\\\\/][.][.][\\\\/]#', $directory)) { + while (true) { + // test if the directory is trusted + if (isset($dirs[$directory])) { + return $_directory; + } + // abort if we've reached root + if (!preg_match('#[\\\\/][^\\\\/]+[\\\\/]$#', $directory)) { + // give up + break; + } + // remember the directory to add it to _resource_dir in case we're successful + $_directory[$directory] = true; + // bubble up one level + $directory = preg_replace('#[\\\\/][^\\\\/]+[\\\\/]$#', DIRECTORY_SEPARATOR, $directory); + } + } + // give up + throw new Exception(sprintf('Smarty Security: not trusted file path \'%s\' ', $filepath)); + } + + /** + * Loads security class and enables security + * + * @param \Smarty $smarty + * @param string|Security $security_class if a string is used, it must be class-name + * + * @return \Smarty current Smarty instance for chaining + * @throws \Smarty\Exception when an invalid class name is provided + */ + public static function enableSecurity(Smarty $smarty, $security_class) { + if ($security_class instanceof Security) { + $smarty->security_policy = $security_class; + return $smarty; + } elseif (is_object($security_class)) { + throw new Exception("Class '" . get_class($security_class) . "' must extend \\Smarty\\Security."); + } + if ($security_class === null) { + $security_class = $smarty->security_class; + } + if (!class_exists($security_class)) { + throw new Exception("Security class '$security_class' is not defined"); + } elseif ($security_class !== Security::class && !is_subclass_of($security_class, Security::class)) { + throw new Exception("Class '$security_class' must extend " . Security::class . "."); + } else { + $smarty->security_policy = new $security_class($smarty); + } + return $smarty; + } + + /** + * Start template processing + * + * @param $template + * + * @throws Exception + */ + public function startTemplate($template) { + if ($this->max_template_nesting > 0 && $this->_current_template_nesting++ >= $this->max_template_nesting) { + throw new Exception("maximum template nesting level of '{$this->max_template_nesting}' exceeded when calling '{$template->template_resource}'"); + } + } + + /** + * Exit template processing + */ + public function endTemplate() { + if ($this->max_template_nesting > 0) { + $this->_current_template_nesting--; + } + } + + /** + * Register callback functions call at start/end of template rendering + * + * @param \Smarty\Template $template + */ + public function registerCallBacks(Template $template) { + $template->startRenderCallbacks[] = [$this, 'startTemplate']; + $template->endRenderCallbacks[] = [$this, 'endTemplate']; + } +} diff --git a/core/template/src/Smarty.php b/core/template/src/Smarty.php new file mode 100644 index 0000000..4618c1a --- /dev/null +++ b/core/template/src/Smarty.php @@ -0,0 +1,2239 @@ + + * @author Uwe Tews + * @author Rodney Rehm + * @author Simon Wisselink + */ + +/** + * This is the main Smarty class + */ +class Smarty extends \Smarty\TemplateBase { + + /** + * smarty version + */ + const SMARTY_VERSION = '5.5.1'; + + /** + * define caching modes + */ + const CACHING_OFF = 0; + const CACHING_LIFETIME_CURRENT = 1; + const CACHING_LIFETIME_SAVED = 2; + /** + * define constant for clearing cache files be saved expiration dates + */ + const CLEAR_EXPIRED = -1; + /** + * define compile check modes + */ + const COMPILECHECK_OFF = 0; + const COMPILECHECK_ON = 1; + /** + * filter types + */ + const FILTER_POST = 'post'; + const FILTER_PRE = 'pre'; + const FILTER_OUTPUT = 'output'; + const FILTER_VARIABLE = 'variable'; + /** + * plugin types + */ + const PLUGIN_FUNCTION = 'function'; + const PLUGIN_BLOCK = 'block'; + const PLUGIN_COMPILER = 'compiler'; + const PLUGIN_MODIFIER = 'modifier'; + const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + + /** + * The character set to adhere to (defaults to "UTF-8") + */ + public static $_CHARSET = 'UTF-8'; + + /** + * The date format to be used internally + * (accepts date() and strftime()) + */ + public static $_DATE_FORMAT = '%b %e, %Y'; + + /** + * Flag denoting if PCRE should run in UTF-8 mode + */ + public static $_UTF8_MODIFIER = 'u'; + + /** + * Flag denoting if operating system is windows + */ + public static $_IS_WINDOWS = false; + + /** + * auto literal on delimiters with whitespace + * + * @var boolean + */ + public $auto_literal = true; + + /** + * display error on not assigned variables + * + * @var boolean + */ + public $error_unassigned = false; + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_templateDirNormalized = false; + + /** + * joined template directory string used in cache keys + * + * @var string + */ + public $_joined_template_dir = null; + + /** + * flag if config_dir is normalized + * + * @var bool + */ + public $_configDirNormalized = false; + + /** + * joined config directory string used in cache keys + * + * @var string + */ + public $_joined_config_dir = null; + + /** + * default template handler + * + * @var callable + */ + public $default_template_handler_func = null; + + /** + * default config handler + * + * @var callable + */ + public $default_config_handler_func = null; + + /** + * default plugin handler + * + * @var callable + */ + private $default_plugin_handler_func = null; + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_compileDirNormalized = false; + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_cacheDirNormalized = false; + + /** + * force template compiling? + * + * @var boolean + */ + public $force_compile = false; + + /** + * use sub dirs for compiled/cached files? + * + * @var boolean + */ + public $use_sub_dirs = false; + + /** + * merge compiled includes + * + * @var boolean + */ + public $merge_compiled_includes = false; + + /** + * force cache file creation + * + * @var boolean + */ + public $force_cache = false; + + /** + * template left-delimiter + * + * @var string + */ + private $left_delimiter = "{"; + + /** + * template right-delimiter + * + * @var string + */ + private $right_delimiter = "}"; + + /** + * array of strings which shall be treated as literal by compiler + * + * @var array string + */ + public $literals = []; + + /** + * class name + * This should be instance of \Smarty\Security. + * + * @var string + * @see \Smarty\Security + */ + public $security_class = \Smarty\Security::class; + + /** + * implementation of security class + * + * @var \Smarty\Security + */ + public $security_policy = null; + + /** + * debug mode + * Setting this to true enables the debug-console. Setting it to 2 enables individual Debug Console window by + * template name. + * + * @var boolean|int + */ + public $debugging = false; + + /** + * This determines if debugging is enable-able from the browser. + *
    + *
  • NONE => no debugging control allowed
  • + *
  • URL => enable debugging when SMARTY_DEBUG is found in the URL.
  • + *
+ * + * @var string + */ + public $debugging_ctrl = 'NONE'; + + /** + * Name of debugging URL-param. + * Only used when $debugging_ctrl is set to 'URL'. + * The name of the URL-parameter that activates debugging. + * + * @var string + */ + public $smarty_debug_id = 'SMARTY_DEBUG'; + + /** + * Path of debug template. + * + * @var string + */ + public $debug_tpl = null; + + /** + * When set, smarty uses this value as error_reporting-level. + * + * @var int + */ + public $error_reporting = null; + + /** + * Controls whether variables with the same name overwrite each other. + * + * @var boolean + */ + public $config_overwrite = true; + + /** + * Controls whether config values of on/true/yes and off/false/no get converted to boolean. + * + * @var boolean + */ + public $config_booleanize = true; + + /** + * Controls whether hidden config sections/vars are read from the file. + * + * @var boolean + */ + public $config_read_hidden = false; + + /** + * locking concurrent compiles + * + * @var boolean + */ + public $compile_locking = true; + + /** + * Controls whether cache resources should use locking mechanism + * + * @var boolean + */ + public $cache_locking = false; + + /** + * seconds to wait for acquiring a lock before ignoring the write lock + * + * @var float + */ + public $locking_timeout = 10; + + /** + * resource type used if none given + * Must be a valid key of $registered_resources. + * + * @var string + */ + public $default_resource_type = 'file'; + + /** + * cache resource + * Must be a subclass of \Smarty\Cacheresource\Base + * + * @var \Smarty\Cacheresource\Base + */ + private $cacheResource; + + /** + * config type + * + * @var string + */ + public $default_config_type = 'file'; + + /** + * check If-Modified-Since headers + * + * @var boolean + */ + public $cache_modified_check = false; + + /** + * registered plugins + * + * @var array + */ + public $registered_plugins = []; + + /** + * registered objects + * + * @var array + */ + public $registered_objects = []; + + /** + * registered classes + * + * @var array + */ + public $registered_classes = []; + + /** + * registered resources + * + * @var array + */ + public $registered_resources = []; + + /** + * registered cache resources + * + * @var array + * @deprecated since 5.0 + */ + private $registered_cache_resources = []; + + /** + * default modifier + * + * @var array + */ + public $default_modifiers = []; + + /** + * autoescape variable output + * + * @var boolean + */ + public $escape_html = false; + + /** + * start time for execution time calculation + * + * @var int + */ + public $start_time = 0; + + /** + * internal flag to enable parser debugging + * + * @var bool + */ + public $_parserdebug = false; + + /** + * Debug object + * + * @var \Smarty\Debug + */ + public $_debug = null; + + /** + * template directory + * + * @var array + */ + protected $template_dir = ['./templates/']; + + /** + * flags for normalized template directory entries + * + * @var array + */ + protected $_processedTemplateDir = []; + + /** + * config directory + * + * @var array + */ + protected $config_dir = ['./configs/']; + + /** + * flags for normalized template directory entries + * + * @var array + */ + protected $_processedConfigDir = []; + + /** + * compile directory + * + * @var string + */ + protected $compile_dir = './templates_c/'; + + /** + * cache directory + * + * @var string + */ + protected $cache_dir = './cache/'; + + /** + * PHP7 Compatibility mode + * + * @var bool + */ + private $isMutingUndefinedOrNullWarnings = false; + + /** + * Cache of loaded resource handlers. + * + * @var array + */ + public $_resource_handlers = []; + + /** + * Cache of loaded cacheresource handlers. + * + * @var array + */ + public $_cacheresource_handlers = []; + + /** + * List of extensions + * + * @var ExtensionInterface[] + */ + private $extensions = []; + /** + * @var BCPluginsAdapter + */ + private $BCPluginsAdapter; + + /** + * Initialize new Smarty object + */ + public function __construct() { + + $this->start_time = microtime(true); + // Check if we're running on Windows + \Smarty\Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; + // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8 + if (\Smarty\Smarty::$_CHARSET !== 'UTF-8') { + \Smarty\Smarty::$_UTF8_MODIFIER = ''; + } + + $this->BCPluginsAdapter = new BCPluginsAdapter($this); + + $this->extensions[] = new CoreExtension(); + $this->extensions[] = new DefaultExtension(); + $this->extensions[] = $this->BCPluginsAdapter; + + $this->cacheResource = new File(); + } + + /** + * Load an additional extension. + * + * @return void + */ + public function addExtension(ExtensionInterface $extension) { + $this->extensions[] = $extension; + } + + /** + * Returns all loaded extensions + * + * @return array|ExtensionInterface[] + */ + public function getExtensions(): array { + return $this->extensions; + } + + /** + * Replace the entire list extensions, allowing you to determine the exact order of the extensions. + * + * @param ExtensionInterface[] $extensions + * + * @return void + */ + public function setExtensions(array $extensions): void { + $this->extensions = $extensions; + } + + /** + * Check if a template resource exists + * + * @param string $resource_name template name + * + * @return bool status + * @throws \Smarty\Exception + */ + public function templateExists($resource_name) { + // create source object + $source = Template\Source::load(null, $this, $resource_name); + return $source->exists; + } + + /** + * Loads security class and enables security + * + * @param string|\Smarty\Security $security_class if a string is used, it must be class-name + * + * @return static current Smarty instance for chaining + * @throws \Smarty\Exception + */ + public function enableSecurity($security_class = null) { + \Smarty\Security::enableSecurity($this, $security_class); + return $this; + } + + /** + * Disable security + * + * @return static current Smarty instance for chaining + */ + public function disableSecurity() { + $this->security_policy = null; + return $this; + } + + /** + * Add template directory(s) + * + * @param string|array $template_dir directory(s) of template sources + * @param string $key of the array element to assign the template dir to + * @param bool $isConfig true for config_dir + * + * @return static current Smarty instance for chaining + */ + public function addTemplateDir($template_dir, $key = null, $isConfig = false) { + if ($isConfig) { + $processed = &$this->_processedConfigDir; + $dir = &$this->config_dir; + $this->_configDirNormalized = false; + } else { + $processed = &$this->_processedTemplateDir; + $dir = &$this->template_dir; + $this->_templateDirNormalized = false; + } + if (is_array($template_dir)) { + foreach ($template_dir as $k => $v) { + if (is_int($k)) { + // indexes are not merged but appended + $dir[] = $v; + } else { + // string indexes are overridden + $dir[$k] = $v; + unset($processed[$key]); + } + } + } else { + if ($key !== null) { + // override directory at specified index + $dir[$key] = $template_dir; + unset($processed[$key]); + } else { + // append new directory + $dir[] = $template_dir; + } + } + return $this; + } + + /** + * Get template directories + * + * @param mixed $index index of directory to get, null to get all + * @param bool $isConfig true for config_dir + * + * @return array|string list of template directories, or directory of $index + */ + public function getTemplateDir($index = null, $isConfig = false) { + if ($isConfig) { + $dir = &$this->config_dir; + } else { + $dir = &$this->template_dir; + } + if ($isConfig ? !$this->_configDirNormalized : !$this->_templateDirNormalized) { + $this->_normalizeTemplateConfig($isConfig); + } + if ($index !== null) { + return isset($dir[$index]) ? $dir[$index] : null; + } + return $dir; + } + + /** + * Set template directory + * + * @param string|array $template_dir directory(s) of template sources + * @param bool $isConfig true for config_dir + * + * @return static current Smarty instance for chaining + */ + public function setTemplateDir($template_dir, $isConfig = false) { + if ($isConfig) { + $this->config_dir = []; + $this->_processedConfigDir = []; + } else { + $this->template_dir = []; + $this->_processedTemplateDir = []; + } + $this->addTemplateDir($template_dir, null, $isConfig); + return $this; + } + + /** + * Adds a template directory before any existing directoires + * + * @param string $new_template_dir directory of template sources + * @param bool $is_config true for config_dir + * + * @return static current Smarty instance for chaining + */ + public function prependTemplateDir($new_template_dir, $is_config = false) { + $current_template_dirs = $is_config ? $this->config_dir : $this->template_dir; + array_unshift($current_template_dirs, $new_template_dir); + $this->setTemplateDir($current_template_dirs, $is_config); + return $this; + } + + /** + * Add config directory(s) + * + * @param string|array $config_dir directory(s) of config sources + * @param mixed $key key of the array element to assign the config dir to + * + * @return static current Smarty instance for chaining + */ + public function addConfigDir($config_dir, $key = null) { + return $this->addTemplateDir($config_dir, $key, true); + } + + /** + * Get config directory + * + * @param mixed $index index of directory to get, null to get all + * + * @return array configuration directory + */ + public function getConfigDir($index = null) { + return $this->getTemplateDir($index, true); + } + + /** + * Set config directory + * + * @param $config_dir + * + * @return static current Smarty instance for chaining + */ + public function setConfigDir($config_dir) { + return $this->setTemplateDir($config_dir, true); + } + + /** + * Registers plugin to be used in templates + * + * @param string $type plugin type + * @param string $name name of template tag + * @param callable $callback PHP callback to register + * @param bool $cacheable if true (default) this function is cache able + * + * @return $this + * @throws \Smarty\Exception + * + * @api Smarty::registerPlugin() + */ + public function registerPlugin($type, $name, $callback, $cacheable = true) { + if (isset($this->registered_plugins[$type][$name])) { + throw new Exception("Plugin tag '{$name}' already registered"); + } elseif (!is_callable($callback) && !class_exists($callback)) { + throw new Exception("Plugin '{$name}' not callable"); + } else { + $this->registered_plugins[$type][$name] = [$callback, (bool)$cacheable]; + } + return $this; + } + + /** + * Returns plugin previously registered using ::registerPlugin as a numerical array as follows or null if not found: + * [ + * 0 => the callback + * 1 => (bool) $cacheable + * 2 => (array) $cache_attr + * ] + * + * @param string $type plugin type + * @param string $name name of template tag + * + * @return array|null + * + * @api Smarty::unregisterPlugin() + */ + public function getRegisteredPlugin($type, $name): ?array { + if (isset($this->registered_plugins[$type][$name])) { + return $this->registered_plugins[$type][$name]; + } + return null; + } + + /** + * Unregisters plugin previously registered using ::registerPlugin + * + * @param string $type plugin type + * @param string $name name of template tag + * + * @return $this + * + * @api Smarty::unregisterPlugin() + */ + public function unregisterPlugin($type, $name) { + if (isset($this->registered_plugins[$type][$name])) { + unset($this->registered_plugins[$type][$name]); + } + return $this; + } + + /** + * Adds directory of plugin files + * + * @param null|array|string $plugins_dir + * + * @return static current Smarty instance for chaining + * @deprecated since 5.0 + */ + public function addPluginsDir($plugins_dir) { + trigger_error('Using Smarty::addPluginsDir() to load plugins is deprecated and will be ' . + 'removed in a future release. Use Smarty::addExtension() to add an extension or Smarty::registerPlugin to ' . + 'quickly register a plugin using a callback function.', E_USER_DEPRECATED); + + foreach ((array)$plugins_dir as $v) { + $path = $this->_realpath(rtrim($v ?? '', '/\\') . DIRECTORY_SEPARATOR, true); + $this->BCPluginsAdapter->loadPluginsFromDir($path); + } + + return $this; + } + + /** + * Get plugin directories + * + * @return array list of plugin directories + * @deprecated since 5.0 + */ + public function getPluginsDir() { + trigger_error('Using Smarty::getPluginsDir() is deprecated and will be ' . + 'removed in a future release. It will always return an empty array.', E_USER_DEPRECATED); + return []; + } + + /** + * Set plugins directory + * + * @param string|array $plugins_dir directory(s) of plugins + * + * @return static current Smarty instance for chaining + * @deprecated since 5.0 + */ + public function setPluginsDir($plugins_dir) { + trigger_error('Using Smarty::getPluginsDir() is deprecated and will be ' . + 'removed in a future release. For now, it will remove the DefaultExtension from the extensions list and ' . + 'proceed to call Smartyy::addPluginsDir..', E_USER_DEPRECATED); + + $this->extensions = array_filter( + $this->extensions, + function ($extension) { + return !($extension instanceof DefaultExtension); + } + ); + + return $this->addPluginsDir($plugins_dir); + } + + /** + * Registers a default plugin handler + * + * @param callable $callback class/method name + * + * @return $this + * @throws Exception if $callback is not callable + * + * @api Smarty::registerDefaultPluginHandler() + * + * @deprecated since 5.0 + */ + public function registerDefaultPluginHandler($callback) { + + trigger_error('Using Smarty::registerDefaultPluginHandler() is deprecated and will be ' . + 'removed in a future release. Please rewrite your plugin handler as an extension.', + E_USER_DEPRECATED); + + if (is_callable($callback)) { + $this->default_plugin_handler_func = $callback; + } else { + throw new Exception("Default plugin handler '$callback' not callable"); + } + return $this; + } + + /** + * Get compiled directory + * + * @return string path to compiled templates + */ + public function getCompileDir() { + if (!$this->_compileDirNormalized) { + $this->_normalizeDir('compile_dir', $this->compile_dir); + $this->_compileDirNormalized = true; + } + return $this->compile_dir; + } + + /** + * + * @param string $compile_dir directory to store compiled templates in + * + * @return static current Smarty instance for chaining + */ + public function setCompileDir($compile_dir) { + $this->_normalizeDir('compile_dir', $compile_dir); + $this->_compileDirNormalized = true; + return $this; + } + + /** + * Get cache directory + * + * @return string path of cache directory + */ + public function getCacheDir() { + if (!$this->_cacheDirNormalized) { + $this->_normalizeDir('cache_dir', $this->cache_dir); + $this->_cacheDirNormalized = true; + } + return $this->cache_dir; + } + + /** + * Set cache directory + * + * @param string $cache_dir directory to store cached templates in + * + * @return static current Smarty instance for chaining + */ + public function setCacheDir($cache_dir) { + $this->_normalizeDir('cache_dir', $cache_dir); + $this->_cacheDirNormalized = true; + return $this; + } + + private $templates = []; + + /** + * Creates a template object + * + * @param string $template_name + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param null $parent next higher level of Smarty variables + * + * @return Template template object + * @throws Exception + */ + public function createTemplate($template_name, $cache_id = null, $compile_id = null, $parent = null): Template { + + $data = []; + + // Shuffle params for backward compatibility: if 2nd param is an object, it's the parent + if (is_object($cache_id)) { + $parent = $cache_id; + $cache_id = null; + } + + // Shuffle params for backward compatibility: if 2nd param is an array, it's data + if (is_array($cache_id)) { + $data = $cache_id; + $cache_id = null; + } + + return $this->doCreateTemplate($template_name, $cache_id, $compile_id, $parent, null, null, false, $data); + } + + /** + * Get unique template id + * + * @param string $resource_name + * @param null|mixed $cache_id + * @param null|mixed $compile_id + * @param null $caching + * + * @return string + */ + private function generateUniqueTemplateId( + $resource_name, + $cache_id = null, + $compile_id = null, + $caching = null + ): string { + // defaults for optional params + $cache_id = $cache_id ?? $this->cache_id; + $compile_id = $compile_id ?? $this->compile_id; + $caching = (int)$caching ?? $this->caching; + + // Add default resource type to resource name if it is missing + if (strpos($resource_name, ':') === false) { + $resource_name = "{$this->default_resource_type}:{$resource_name}"; + } + + $_templateId = $resource_name . '#' . $cache_id . '#' . $compile_id . '#' . $caching; + + // hash very long IDs to prevent problems with filename length + // do not hash shorter IDs, so they remain recognizable + if (strlen($_templateId) > 150) { + $_templateId = sha1($_templateId); + } + + return $_templateId; + } + + /** + * Normalize path + * - remove /./ and /../ + * - make it absolute if required + * + * @param string $path file path + * @param bool $realpath if true - convert to absolute + * false - convert to relative + * null - keep as it is but + * remove /./ /../ + * + * @return string + */ + public function _realpath($path, $realpath = null) { + $nds = ['/' => '\\', '\\' => '/']; + preg_match( + '%^(?(?:[[:alpha:]]:[\\\\/]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u', + $path, + $parts + ); + $path = $parts['path']; + if ($parts['root'] === '\\') { + $parts['root'] = substr(getcwd(), 0, 2) . $parts['root']; + } else { + if ($realpath !== null && !$parts['root']) { + $path = getcwd() . DIRECTORY_SEPARATOR . $path; + } + } + // normalize DIRECTORY_SEPARATOR + $path = str_replace($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR, $path); + $parts['root'] = str_replace($nds[DIRECTORY_SEPARATOR], DIRECTORY_SEPARATOR, $parts['root']); + do { + $path = preg_replace( + ['#[\\\\/]{2}#', '#[\\\\/][.][\\\\/]#', '#[\\\\/]([^\\\\/.]+)[\\\\/][.][.][\\\\/]#'], + DIRECTORY_SEPARATOR, + $path, + -1, + $count + ); + } while ($count > 0); + return $realpath !== false ? $parts['root'] . $path : str_ireplace(getcwd(), '.', $parts['root'] . $path); + } + + /** + * @param boolean $use_sub_dirs + */ + public function setUseSubDirs($use_sub_dirs) { + $this->use_sub_dirs = $use_sub_dirs; + } + + /** + * @param int $error_reporting + */ + public function setErrorReporting($error_reporting) { + $this->error_reporting = $error_reporting; + } + + /** + * @param boolean $escape_html + */ + public function setEscapeHtml($escape_html) { + $this->escape_html = $escape_html; + } + + /** + * Return auto_literal flag + * + * @return boolean + */ + public function getAutoLiteral() { + return $this->auto_literal; + } + + /** + * Set auto_literal flag + * + * @param boolean $auto_literal + */ + public function setAutoLiteral($auto_literal = true) { + $this->auto_literal = $auto_literal; + } + + /** + * @param boolean $force_compile + */ + public function setForceCompile($force_compile) { + $this->force_compile = $force_compile; + } + + /** + * @param boolean $merge_compiled_includes + */ + public function setMergeCompiledIncludes($merge_compiled_includes) { + $this->merge_compiled_includes = $merge_compiled_includes; + } + + /** + * Get left delimiter + * + * @return string + */ + public function getLeftDelimiter() { + return $this->left_delimiter; + } + + /** + * Set left delimiter + * + * @param string $left_delimiter + */ + public function setLeftDelimiter($left_delimiter) { + $this->left_delimiter = $left_delimiter; + } + + /** + * Get right delimiter + * + * @return string $right_delimiter + */ + public function getRightDelimiter() { + return $this->right_delimiter; + } + + /** + * Set right delimiter + * + * @param string + */ + public function setRightDelimiter($right_delimiter) { + $this->right_delimiter = $right_delimiter; + } + + /** + * @param boolean $debugging + */ + public function setDebugging($debugging) { + $this->debugging = $debugging; + } + + /** + * @param boolean $config_overwrite + */ + public function setConfigOverwrite($config_overwrite) { + $this->config_overwrite = $config_overwrite; + } + + /** + * @param boolean $config_booleanize + */ + public function setConfigBooleanize($config_booleanize) { + $this->config_booleanize = $config_booleanize; + } + + /** + * @param boolean $config_read_hidden + */ + public function setConfigReadHidden($config_read_hidden) { + $this->config_read_hidden = $config_read_hidden; + } + + /** + * @param boolean $compile_locking + */ + public function setCompileLocking($compile_locking) { + $this->compile_locking = $compile_locking; + } + + /** + * @param string $default_resource_type + */ + public function setDefaultResourceType($default_resource_type) { + $this->default_resource_type = $default_resource_type; + } + + /** + * Test install + * + * @param null $errors + */ + public function testInstall(&$errors = null) { + \Smarty\TestInstall::testInstall($this, $errors); + } + + /** + * Get Smarty object + * + * @return static + */ + public function getSmarty() { + return $this; + } + + /** + * Normalize and set directory string + * + * @param string $dirName cache_dir or compile_dir + * @param string $dir filepath of folder + */ + private function _normalizeDir($dirName, $dir) { + $this->{$dirName} = $this->_realpath(rtrim($dir ?? '', "/\\") . DIRECTORY_SEPARATOR, true); + } + + /** + * Normalize template_dir or config_dir + * + * @param bool $isConfig true for config_dir + */ + private function _normalizeTemplateConfig($isConfig) { + if ($isConfig) { + $processed = &$this->_processedConfigDir; + $dir = &$this->config_dir; + } else { + $processed = &$this->_processedTemplateDir; + $dir = &$this->template_dir; + } + if (!is_array($dir)) { + $dir = (array)$dir; + } + foreach ($dir as $k => $v) { + if (!isset($processed[$k])) { + $dir[$k] = $this->_realpath(rtrim($v ?? '', "/\\") . DIRECTORY_SEPARATOR, true); + $processed[$k] = true; + } + } + + if ($isConfig) { + $this->_configDirNormalized = true; + $this->_joined_config_dir = join('#', $this->config_dir); + } else { + $this->_templateDirNormalized = true; + $this->_joined_template_dir = join('#', $this->template_dir); + } + + } + + /** + * Mutes errors for "undefined index", "undefined array key" and "trying to read property of null". + * + * @void + */ + public function muteUndefinedOrNullWarnings(): void { + $this->isMutingUndefinedOrNullWarnings = true; + } + + /** + * Indicates if Smarty will mute errors for "undefined index", "undefined array key" and "trying to read property of null". + * + * @return bool + */ + public function isMutingUndefinedOrNullWarnings(): bool { + return $this->isMutingUndefinedOrNullWarnings; + } + + /** + * Empty cache for a specific template + * + * @param string $template_name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * @param string $type resource type + * + * @return int number of cache files deleted + * @throws \Smarty\Exception + * + * @api Smarty::clearCache() + */ + public function clearCache( + $template_name, + $cache_id = null, + $compile_id = null, + $exp_time = null + ) { + return $this->getCacheResource()->clear($this, $template_name, $cache_id, $compile_id, $exp_time); + } + + /** + * Empty cache folder + * + * @param integer $exp_time expiration time + * @param string $type resource type + * + * @return int number of cache files deleted + * + * @api Smarty::clearAllCache() + */ + public function clearAllCache($exp_time = null) { + return $this->getCacheResource()->clearAll($this, $exp_time); + } + + /** + * Delete compiled template file + * + * @param string $resource_name template name + * @param string $compile_id compile id + * @param integer $exp_time expiration time + * + * @return int number of template files deleted + * @throws \Smarty\Exception + * + * @api Smarty::clearCompiledTemplate() + */ + public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) { + $_compile_dir = $this->getCompileDir(); + if ($_compile_dir === '/') { //We should never want to delete this! + return 0; + } + $_compile_id = isset($compile_id) ? preg_replace('![^\w]+!', '_', $compile_id) : null; + $_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^'; + if (isset($resource_name)) { + $_save_stat = $this->caching; + $this->caching = \Smarty\Smarty::CACHING_OFF; + /* @var Template $tpl */ + $tpl = $this->doCreateTemplate($resource_name); + $this->caching = $_save_stat; + if (!$tpl->getSource()->handler->recompiled && $tpl->getSource()->exists) { + $_resource_part_1 = basename(str_replace('^', DIRECTORY_SEPARATOR, $tpl->getCompiled()->filepath)); + $_resource_part_1_length = strlen($_resource_part_1); + } else { + return 0; + } + $_resource_part_2 = str_replace('.php', '.cache.php', $_resource_part_1); + $_resource_part_2_length = strlen($_resource_part_2); + } + $_dir = $_compile_dir; + if ($this->use_sub_dirs && isset($_compile_id)) { + $_dir .= $_compile_id . $_dir_sep; + } + if (isset($_compile_id)) { + $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep; + $_compile_id_part_length = strlen($_compile_id_part); + } + $_count = 0; + try { + $_compileDirs = new RecursiveDirectoryIterator($_dir); + } catch (\UnexpectedValueException $e) { + // path not found / not a dir + return 0; + } + $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST); + foreach ($_compile as $_file) { + if (substr(basename($_file->getPathname()), 0, 1) === '.') { + continue; + } + $_filepath = (string)$_file; + if ($_file->isDir()) { + if (!$_compile->isDot()) { + // delete folder if empty + @rmdir($_file->getPathname()); + } + } else { + // delete only php files + if (substr($_filepath, -4) !== '.php') { + continue; + } + $unlink = false; + if ((!isset($_compile_id) || + (isset($_filepath[$_compile_id_part_length]) && + $a = !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length))) + && (!isset($resource_name) || (isset($_filepath[$_resource_part_1_length]) + && substr_compare( + $_filepath, + $_resource_part_1, + -$_resource_part_1_length, + $_resource_part_1_length + ) === 0) || (isset($_filepath[$_resource_part_2_length]) + && substr_compare( + $_filepath, + $_resource_part_2, + -$_resource_part_2_length, + $_resource_part_2_length + ) === 0)) + ) { + if (isset($exp_time)) { + if (is_file($_filepath) && time() - filemtime($_filepath) >= $exp_time) { + $unlink = true; + } + } else { + $unlink = true; + } + } + if ($unlink && is_file($_filepath) && @unlink($_filepath)) { + $_count++; + if (function_exists('opcache_invalidate') + && (!function_exists('ini_get') || strlen(ini_get('opcache.restrict_api')) < 1) + ) { + opcache_invalidate($_filepath, true); + } elseif (function_exists('apc_delete_file')) { + apc_delete_file($_filepath); + } + } + } + } + return $_count; + } + + /** + * Compile all template files + * + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * + * @return integer number of template files recompiled + * @api Smarty::compileAllTemplates() + * + */ + public function compileAllTemplates( + $extension = '.tpl', + $force_compile = false, + $time_limit = 0, + $max_errors = null + ) { + return $this->compileAll($extension, $force_compile, $time_limit, $max_errors); + } + + /** + * Compile all config files + * + * @param string $extension file extension + * @param bool $force_compile force all to recompile + * @param int $time_limit + * @param int $max_errors + * + * @return int number of template files recompiled + * @api Smarty::compileAllConfig() + * + */ + public function compileAllConfig( + $extension = '.conf', + $force_compile = false, + $time_limit = 0, + $max_errors = null + ) { + return $this->compileAll($extension, $force_compile, $time_limit, $max_errors, true); + } + + /** + * Compile all template or config files + * + * @param string $extension template file name extension + * @param bool $force_compile force all to recompile + * @param int $time_limit set maximum execution time + * @param int $max_errors set maximum allowed errors + * @param bool $isConfig flag true if called for config files + * + * @return int number of template files compiled + */ + protected function compileAll( + $extension, + $force_compile, + $time_limit, + $max_errors, + $isConfig = false + ) { + // switch off time limit + if (function_exists('set_time_limit')) { + @set_time_limit($time_limit); + } + $_count = 0; + $_error_count = 0; + $sourceDir = $isConfig ? $this->getConfigDir() : $this->getTemplateDir(); + // loop over array of source directories + foreach ($sourceDir as $_dir) { + $_dir_1 = new RecursiveDirectoryIterator( + $_dir, + defined('FilesystemIterator::FOLLOW_SYMLINKS') ? + FilesystemIterator::FOLLOW_SYMLINKS : 0 + ); + $_dir_2 = new RecursiveIteratorIterator($_dir_1); + foreach ($_dir_2 as $_fileinfo) { + $_file = $_fileinfo->getFilename(); + if (substr(basename($_fileinfo->getPathname()), 0, 1) === '.' || strpos($_file, '.svn') !== false) { + continue; + } + if (substr_compare($_file, $extension, -strlen($extension)) !== 0) { + continue; + } + if ($_fileinfo->getPath() !== substr($_dir, 0, -1)) { + $_file = substr($_fileinfo->getPath(), strlen($_dir)) . DIRECTORY_SEPARATOR . $_file; + } + echo "\n", $_dir, '---', $_file; + flush(); + $_start_time = microtime(true); + $_smarty = clone $this; + // + $_smarty->force_compile = $force_compile; + try { + $_tpl = $this->doCreateTemplate($_file); + $_tpl->caching = self::CACHING_OFF; + $_tpl->setSource( + $isConfig ? \Smarty\Template\Config::load($_tpl) : \Smarty\Template\Source::load($_tpl) + ); + if ($_tpl->mustCompile()) { + $_tpl->compileTemplateSource(); + $_count++; + echo ' compiled in ', microtime(true) - $_start_time, ' seconds'; + flush(); + } else { + echo ' is up to date'; + flush(); + } + } catch (\Exception $e) { + echo "\n ------>Error: ", $e->getMessage(), "\n"; + $_error_count++; + } + // free memory + unset($_tpl); + if ($max_errors !== null && $_error_count === $max_errors) { + echo "\ntoo many errors\n"; + exit(1); + } + } + } + echo "\n"; + return $_count; + } + + /** + * check client side cache + * + * @param \Smarty\Template\Cached $cached + * @param Template $_template + * @param string $content + * + * @throws \Exception + * @throws \Smarty\Exception + */ + public function cacheModifiedCheck(Template\Cached $cached, Template $_template, $content) { + $_isCached = $_template->isCached() && !$_template->getCompiled()->getNocacheCode(); + $_last_modified_date = + @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); + if ($_isCached && $cached->timestamp <= strtotime($_last_modified_date)) { + switch (PHP_SAPI) { + case 'cgi': // php-cgi < 5.3 + case 'cgi-fcgi': // php-cgi >= 5.3 + case 'fpm-fcgi': // php-fpm >= 5.3.3 + header('Status: 304 Not Modified'); + break; + case 'cli': + if (/* ^phpunit */ + !empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS']) /* phpunit$ */ + ) { + $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified'; + } + break; + default: + if (/* ^phpunit */ + !empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS']) /* phpunit$ */ + ) { + $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = '304 Not Modified'; + } else { + header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified'); + } + break; + } + } else { + switch (PHP_SAPI) { + case 'cli': + if (/* ^phpunit */ + !empty($_SERVER['SMARTY_PHPUNIT_DISABLE_HEADERS']) /* phpunit$ */ + ) { + $_SERVER['SMARTY_PHPUNIT_HEADERS'][] = + 'Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT'; + } + break; + default: + header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $cached->timestamp) . ' GMT'); + break; + } + echo $content; + } + } + + public function getModifierCallback(string $modifierName) { + foreach ($this->getExtensions() as $extension) { + if ($callback = $extension->getModifierCallback($modifierName)) { + return [new CallbackWrapper($modifierName, $callback), 'handle']; + } + } + return null; + } + + public function getFunctionHandler(string $functionName): ?\Smarty\FunctionHandler\FunctionHandlerInterface { + foreach ($this->getExtensions() as $extension) { + if ($handler = $extension->getFunctionHandler($functionName)) { + return $handler; + } + } + return null; + } + + public function getBlockHandler(string $blockTagName): ?\Smarty\BlockHandler\BlockHandlerInterface { + foreach ($this->getExtensions() as $extension) { + if ($handler = $extension->getBlockHandler($blockTagName)) { + return $handler; + } + } + return null; + } + + public function getModifierCompiler(string $modifier): ?\Smarty\Compile\Modifier\ModifierCompilerInterface { + foreach ($this->getExtensions() as $extension) { + if ($handler = $extension->getModifierCompiler($modifier)) { + return $handler; + } + } + return null; + } + + /** + * Run pre-filters over template source + * + * @param string $source the content which shall be processed by the filters + * @param Template $template template object + * + * @return string the filtered source + */ + public function runPreFilters($source, Template $template) { + + foreach ($this->getExtensions() as $extension) { + /** @var \Smarty\Filter\FilterInterface $filter */ + foreach ($extension->getPreFilters() as $filter) { + $source = $filter->filter($source, $template); + } + } + + // return filtered output + return $source; + } + + /** + * Run post-filters over template's compiled code + * + * @param string $code the content which shall be processed by the filters + * @param Template $template template object + * + * @return string the filtered code + */ + public function runPostFilters($code, Template $template) { + + foreach ($this->getExtensions() as $extension) { + /** @var \Smarty\Filter\FilterInterface $filter */ + foreach ($extension->getPostFilters() as $filter) { + $code = $filter->filter($code, $template); + } + } + + // return filtered output + return $code; + } + + /** + * Run filters over template output + * + * @param string $content the content which shall be processed by the filters + * @param Template $template template object + * + * @return string the filtered (modified) output + */ + public function runOutputFilters($content, Template $template) { + + foreach ($this->getExtensions() as $extension) { + /** @var \Smarty\Filter\FilterInterface $filter */ + foreach ($extension->getOutputFilters() as $filter) { + $content = $filter->filter($content, $template); + } + } + + // return filtered output + return $content; + } + + /** + * Writes file in a safe way to disk + * + * @param string $_filepath complete filepath + * @param string $_contents file content + * + * @return boolean true + * @throws Exception + */ + public function writeFile($_filepath, $_contents) { + $_error_reporting = error_reporting(); + error_reporting($_error_reporting & ~E_NOTICE & ~E_WARNING); + $_dirpath = dirname($_filepath); + // if subdirs, create dir structure + if ($_dirpath !== '.') { + $i = 0; + // loop if concurrency problem occurs + // see https://bugs.php.net/bug.php?id=35326 + while (!is_dir($_dirpath)) { + if (@mkdir($_dirpath, 0777, true)) { + break; + } + clearstatcache(); + if (++$i === 3) { + error_reporting($_error_reporting); + throw new Exception("unable to create directory {$_dirpath}"); + } + sleep(1); + } + } + // write to tmp file, then move to overt file lock race condition + $_tmp_file = $_dirpath . DIRECTORY_SEPARATOR . str_replace(['.', ','], '_', uniqid('wrt', true)); + if (!file_put_contents($_tmp_file, $_contents)) { + error_reporting($_error_reporting); + throw new Exception("unable to write file {$_tmp_file}"); + } + /* + * Windows' rename() fails if the destination exists, + * Linux' rename() properly handles the overwrite. + * Simply unlink()ing a file might cause other processes + * currently reading that file to fail, but linux' rename() + * seems to be smart enough to handle that for us. + */ + if (\Smarty\Smarty::$_IS_WINDOWS) { + // remove original file + if (is_file($_filepath)) { + @unlink($_filepath); + } + // rename tmp file + $success = @rename($_tmp_file, $_filepath); + } else { + // rename tmp file + $success = @rename($_tmp_file, $_filepath); + if (!$success) { + // remove original file + if (is_file($_filepath)) { + @unlink($_filepath); + } + // rename tmp file + $success = @rename($_tmp_file, $_filepath); + } + } + if (!$success) { + error_reporting($_error_reporting); + throw new Exception("unable to write file {$_filepath}"); + } + // set file permissions + @chmod($_filepath, 0666 & ~umask()); + error_reporting($_error_reporting); + return true; + } + + private $runtimes = []; + + /** + * Loads and returns a runtime extension or null if not found + * + * @param string $type + * + * @return object|null + */ + public function getRuntime(string $type) { + + if (isset($this->runtimes[$type])) { + return $this->runtimes[$type]; + } + + // Lazy load runtimes when/if needed + switch ($type) { + case 'Capture': + return $this->runtimes[$type] = new CaptureRuntime(); + case 'Foreach': + return $this->runtimes[$type] = new ForeachRuntime(); + case 'Inheritance': + return $this->runtimes[$type] = new InheritanceRuntime(); + case 'TplFunction': + return $this->runtimes[$type] = new TplFunctionRuntime(); + case 'DefaultPluginHandler': + return $this->runtimes[$type] = new DefaultPluginHandlerRuntime( + $this->getDefaultPluginHandlerFunc() + ); + } + + throw new \Smarty\Exception('Trying to load invalid runtime ' . $type); + } + + /** + * Indicates if a runtime is available. + * + * @param string $type + * + * @return bool + */ + public function hasRuntime(string $type): bool { + try { + $this->getRuntime($type); + return true; + } catch (\Smarty\Exception $e) { + return false; + } + } + + /** + * @return callable|null + */ + public function getDefaultPluginHandlerFunc(): ?callable { + return $this->default_plugin_handler_func; + } + + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + * + * @return bool + * @throws \Smarty\Exception + * @api Smarty::loadFilter() + * + * @deprecated since 5.0 + */ + public function loadFilter($type, $name) { + + if ($type == \Smarty\Smarty::FILTER_VARIABLE) { + foreach ($this->getExtensions() as $extension) { + if ($extension->getModifierCallback($name)) { + + trigger_error('Using Smarty::loadFilter() to load variable filters is deprecated and will ' . + 'be removed in a future release. Use Smarty::addDefaultModifiers() to add a modifier.', + E_USER_DEPRECATED); + + $this->addDefaultModifiers([$name]); + return true; + } + } + } + + trigger_error('Using Smarty::loadFilter() to load filters is deprecated and will be ' . + 'removed in a future release. Use Smarty::addExtension() to add an extension or Smarty::registerFilter to ' . + 'quickly register a filter using a callback function.', E_USER_DEPRECATED); + + if ($type == \Smarty\Smarty::FILTER_OUTPUT && $name == 'trimwhitespace') { + $this->BCPluginsAdapter->addOutputFilter(new TrimWhitespace()); + return true; + } + + $_plugin = "smarty_{$type}filter_{$name}"; + if (!is_callable($_plugin) && class_exists($_plugin, false)) { + $_plugin = [$_plugin, 'execute']; + } + + if (is_callable($_plugin)) { + $this->registerFilter($type, $_plugin, $name); + return true; + } + + throw new Exception("{$type}filter '{$name}' not found or callable"); + } + + /** + * load a filter of specified type and name + * + * @param string $type filter type + * @param string $name filter name + * + * @return static + * @throws \Smarty\Exception + * @api Smarty::unloadFilter() + * + * + * @deprecated since 5.0 + */ + public function unloadFilter($type, $name) { + trigger_error('Using Smarty::unloadFilter() to unload filters is deprecated and will be ' . + 'removed in a future release. Use Smarty::addExtension() to add an extension or Smarty::(un)registerFilter to ' . + 'quickly (un)register a filter using a callback function.', E_USER_DEPRECATED); + + return $this->unregisterFilter($type, $name); + } + + private $_caching_type = 'file'; + + /** + * @param $type + * + * @return void + * @deprecated since 5.0 + */ + public function setCachingType($type) { + trigger_error('Using Smarty::setCachingType() is deprecated and will be ' . + 'removed in a future release. Use Smarty::setCacheResource() instead.', E_USER_DEPRECATED); + $this->_caching_type = $type; + $this->activateBCCacheResource(); + } + + /** + * @return string + * @deprecated since 5.0 + */ + public function getCachingType(): string { + trigger_error('Using Smarty::getCachingType() is deprecated and will be ' . + 'removed in a future release.', E_USER_DEPRECATED); + return $this->_caching_type; + } + + /** + * Registers a resource to fetch a template + * + * @param string $name name of resource type + * @param Base $resource_handler + * + * @return static + * + * @api Smarty::registerCacheResource() + * + * @deprecated since 5.0 + */ + public function registerCacheResource($name, \Smarty\Cacheresource\Base $resource_handler) { + + trigger_error('Using Smarty::registerCacheResource() is deprecated and will be ' . + 'removed in a future release. Use Smarty::setCacheResource() instead.', E_USER_DEPRECATED); + + $this->registered_cache_resources[$name] = $resource_handler; + $this->activateBCCacheResource(); + return $this; + } + + /** + * Unregisters a resource to fetch a template + * + * @param $name + * + * @return static + * @api Smarty::unregisterCacheResource() + * + * @deprecated since 5.0 + * + */ + public function unregisterCacheResource($name) { + + trigger_error('Using Smarty::unregisterCacheResource() is deprecated and will be ' . + 'removed in a future release.', E_USER_DEPRECATED); + + if (isset($this->registered_cache_resources[$name])) { + unset($this->registered_cache_resources[$name]); + } + return $this; + } + + private function activateBCCacheResource() { + if ($this->_caching_type == 'file') { + $this->setCacheResource(new File()); + } + if (isset($this->registered_cache_resources[$this->_caching_type])) { + $this->setCacheResource($this->registered_cache_resources[$this->_caching_type]); + } + } + + /** + * Registers a filter function + * + * @param string $type filter type + * @param callable $callback + * @param string|null $name optional filter name + * + * @return static + * @throws \Smarty\Exception + * + * @api Smarty::registerFilter() + */ + public function registerFilter($type, $callback, $name = null) { + $name = $name ?? $this->_getFilterName($callback); + if (!is_callable($callback)) { + throw new Exception("{$type}filter '{$name}' not callable"); + } + switch ($type) { + case 'variable': + $this->registerPlugin(self::PLUGIN_MODIFIER, $name, $callback); + trigger_error('Using Smarty::registerFilter() to register variable filters is deprecated and ' . + 'will be removed in a future release. Use Smarty::addDefaultModifiers() to add a modifier.', + E_USER_DEPRECATED); + + $this->addDefaultModifiers([$name]); + break; + case 'output': + $this->BCPluginsAdapter->addCallableAsOutputFilter($callback, $name); + break; + case 'pre': + $this->BCPluginsAdapter->addCallableAsPreFilter($callback, $name); + break; + case 'post': + $this->BCPluginsAdapter->addCallableAsPostFilter($callback, $name); + break; + default: + throw new Exception("Illegal filter type '{$type}'"); + } + + return $this; + } + + /** + * Return internal filter name + * + * @param callback $callable + * + * @return string|null internal filter name or null if callable cannot be serialized + */ + private function _getFilterName($callable) { + if (is_array($callable)) { + $_class_name = is_object($callable[0]) ? get_class($callable[0]) : $callable[0]; + return $_class_name . '_' . $callable[1]; + } elseif (is_string($callable)) { + return $callable; + } + return null; + } + + /** + * Unregisters a filter function. Smarty cannot unregister closures/anonymous functions if + * no name was given in ::registerFilter. + * + * @param string $type filter type + * @param callback|string $name the name previously used in ::registerFilter + * + * @return static + * @throws \Smarty\Exception + * @api Smarty::unregisterFilter() + * + * + */ + public function unregisterFilter($type, $name) { + + if (!is_string($name)) { + $name = $this->_getFilterName($name); + } + + if ($name) { + switch ($type) { + case 'output': + $this->BCPluginsAdapter->removeOutputFilter($name); + break; + case 'pre': + $this->BCPluginsAdapter->removePreFilter($name); + break; + case 'post': + $this->BCPluginsAdapter->removePostFilter($name); + break; + default: + throw new Exception("Illegal filter type '{$type}'"); + } + } + + return $this; + } + + /** + * Add default modifiers + * + * @param array|string $modifiers modifier or list of modifiers + * to add + * + * @return static + * @api Smarty::addDefaultModifiers() + * + */ + public function addDefaultModifiers($modifiers) { + if (is_array($modifiers)) { + $this->default_modifiers = array_merge($this->default_modifiers, $modifiers); + } else { + $this->default_modifiers[] = $modifiers; + } + return $this; + } + + /** + * Get default modifiers + * + * @return array list of default modifiers + * @api Smarty::getDefaultModifiers() + * + */ + public function getDefaultModifiers() { + return $this->default_modifiers; + } + + /** + * Set default modifiers + * + * @param array|string $modifiers modifier or list of modifiers + * to set + * + * @return static + * @api Smarty::setDefaultModifiers() + * + */ + public function setDefaultModifiers($modifiers) { + $this->default_modifiers = (array)$modifiers; + return $this; + } + + /** + * @return Cacheresource\Base + */ + public function getCacheResource(): Cacheresource\Base { + return $this->cacheResource; + } + + /** + * @param Cacheresource\Base $cacheResource + */ + public function setCacheResource(Cacheresource\Base $cacheResource): void { + $this->cacheResource = $cacheResource; + } + + /** + * fetches a rendered Smarty template + * + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * + * @return string rendered template output + * @throws Exception + * @throws Exception + */ + public function fetch($template = null, $cache_id = null, $compile_id = null) { + return $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->fetch(); + } + + /** + * displays a Smarty template + * + * @param string $template the resource handle of the template file or template object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * + * @throws \Exception + * @throws \Smarty\Exception + */ + public function display($template = null, $cache_id = null, $compile_id = null) { + $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->display(); + } + + /** + * @param $resource_name + * @param $cache_id + * @param $compile_id + * @param $parent + * @param $caching + * @param $cache_lifetime + * @param bool $isConfig + * @param array $data + * + * @return Template + * @throws Exception + */ + public function doCreateTemplate( + $resource_name, + $cache_id = null, + $compile_id = null, + $parent = null, + $caching = null, + $cache_lifetime = null, + bool $isConfig = false, + array $data = []): Template { + + if (!$this->_templateDirNormalized) { + $this->_normalizeTemplateConfig(false); + } + + $_templateId = $this->generateUniqueTemplateId($resource_name, $cache_id, $compile_id, $caching); + + if (!isset($this->templates[$_templateId])) { + $newTemplate = new Template($resource_name, $this, $parent ?: $this, $cache_id, $compile_id, $caching, $isConfig); + $newTemplate->templateId = $_templateId; // @TODO this could go in constructor ^? + $this->templates[$_templateId] = $newTemplate; + } + + $tpl = clone $this->templates[$_templateId]; + + $tpl->setParent($parent ?: $this); + + if ($cache_lifetime) { + $tpl->setCacheLifetime($cache_lifetime); + } + + // fill data if present + foreach ($data as $_key => $_val) { + $tpl->assign($_key, $_val); + } + + $tpl->tplFunctions = array_merge($parent->tplFunctions ?? [], $tpl->tplFunctions ?? []); + + if (!$this->debugging && $this->debugging_ctrl === 'URL') { + $tpl->getSmarty()->getDebug()->debugUrl($tpl->getSmarty()); + } + return $tpl; + } + + /** + * test if cache is valid + * + * @param null|string|Template $template the resource handle of the template file or template + * object + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * + * @return bool cache status + * @throws \Exception + * @throws \Smarty\Exception + * + * @api Smarty::isCached() + */ + public function isCached($template = null, $cache_id = null, $compile_id = null) { + return $this->returnOrCreateTemplate($template, $cache_id, $compile_id)->isCached(); + } + + /** + * @param $template + * @param $cache_id + * @param $compile_id + * @param $parent + * + * @return Template + * @throws Exception + */ + private function returnOrCreateTemplate($template, $cache_id = null, $compile_id = null) { + if (!($template instanceof Template)) { + $template = $this->createTemplate($template, $cache_id, $compile_id, $this); + $template->caching = $this->caching; + } + return $template; + } + + /** + * Sets if Smarty should check If-Modified-Since headers to determine cache validity. + * @param bool $cache_modified_check + * @return void + */ + public function setCacheModifiedCheck($cache_modified_check): void { + $this->cache_modified_check = (bool) $cache_modified_check; + } + +} + diff --git a/core/template/src/Template.php b/core/template/src/Template.php new file mode 100644 index 0000000..242fb23 --- /dev/null +++ b/core/template/src/Template.php @@ -0,0 +1,732 @@ +getSmarty()-getLeftDelimiter(). + * + * @var string + */ + private $left_delimiter = null; + + /** + * Template right-delimiter. If null, defaults to $this->getSmarty()-getRightDelimiter(). + * + * @var string + */ + private $right_delimiter = null; + + /** + * @var InheritanceRuntime|null + */ + private $inheritance; + + /** + * Create template data object + * Some of the global Smarty settings copied to template scope + * It load the required template resources and caching plugins + * + * @param string $template_resource template resource string + * @param Smarty $smarty Smarty instance + * @param \Smarty\Data|null $_parent back pointer to parent object with variables or null + * @param mixed $_cache_id cache id or null + * @param mixed $_compile_id compile id or null + * @param bool|int|null $_caching use caching? + * @param bool $_isConfig + * + * @throws \Smarty\Exception + */ + public function __construct( + $template_resource, + Smarty $smarty, + ?\Smarty\Data $_parent = null, + $_cache_id = null, + $_compile_id = null, + $_caching = null, + $_isConfig = false + ) { + $this->smarty = $smarty; + // Smarty parameter + $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id; + $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id; + $this->caching = (int)($_caching === null ? $this->smarty->caching : $_caching); + $this->cache_lifetime = $this->smarty->cache_lifetime; + $this->compile_check = (int)$smarty->compile_check; + $this->parent = $_parent; + // Template resource + $this->template_resource = $template_resource; + + $this->source = $_isConfig ? Config::load($this) : Source::load($this); + $this->compiled = Compiled::load($this); + + if ($smarty->security_policy) { + $smarty->security_policy->registerCallBacks($this); + } + } + + /** + * render template + * + * @param bool $no_output_filter if true do not run output filter + * @param null|bool $display true: display, false: fetch null: sub-template + * + * @return string + * @throws \Exception + * @throws \Smarty\Exception + */ + private function render($no_output_filter = true, $display = null) { + if ($this->smarty->debugging) { + $this->smarty->getDebug()->start_template($this, $display); + } + // checks if template exists + if ($this->compile_check && !$this->getSource()->exists) { + throw new Exception( + "Unable to load '{$this->getSource()->type}:{$this->getSource()->name}'" . + ($this->_isSubTpl() ? " in '{$this->parent->template_resource}'" : '') + ); + } + + // disable caching for evaluated code + if ($this->getSource()->handler->recompiled) { + $this->caching = \Smarty\Smarty::CACHING_OFF; + } + + foreach ($this->startRenderCallbacks as $callback) { + call_user_func($callback, $this); + } + + try { + + // read from cache or render + if ($this->caching === \Smarty\Smarty::CACHING_LIFETIME_CURRENT || $this->caching === \Smarty\Smarty::CACHING_LIFETIME_SAVED) { + $this->getCached()->render($this, $no_output_filter); + } else { + $this->getCompiled()->render($this); + } + + } finally { + foreach ($this->endRenderCallbacks as $callback) { + call_user_func($callback, $this); + } + } + + // display or fetch + if ($display) { + if ($this->caching && $this->smarty->cache_modified_check) { + $this->smarty->cacheModifiedCheck( + $this->getCached(), + $this, + isset($content) ? $content : ob_get_clean() + ); + } else { + if ((!$this->caching || $this->getCached()->getNocacheCode() || $this->getSource()->handler->recompiled) + && !$no_output_filter + ) { + echo $this->smarty->runOutputFilters(ob_get_clean(), $this); + } else { + echo ob_get_clean(); + } + } + if ($this->smarty->debugging) { + $this->smarty->getDebug()->end_template($this); + // debug output + $this->smarty->getDebug()->display_debug($this, true); + } + return ''; + } else { + if ($this->smarty->debugging) { + $this->smarty->getDebug()->end_template($this); + if ($this->smarty->debugging === 2 && $display === false) { + $this->smarty->getDebug()->display_debug($this, true); + } + } + if ( + !$no_output_filter + && (!$this->caching || $this->getCached()->getNocacheCode() || $this->getSource()->handler->recompiled) + ) { + + return $this->smarty->runOutputFilters(ob_get_clean(), $this); + } + // return cache content + return null; + } + } + + /** + * Runtime function to render sub-template + * + * @param string $template_name template name + * @param mixed $cache_id cache id + * @param mixed $compile_id compile id + * @param integer $caching cache mode + * @param integer $cache_lifetime lifetime of cache data + * @param array $extra_vars passed parameter template variables + * @param int|null $scope + * + * @throws Exception + */ + public function renderSubTemplate( + $template_name, + $cache_id, + $compile_id, + $caching, + $cache_lifetime, + array $extra_vars = [], + ?int $scope = null, + ?string $currentDir = null + ) { + + $name = $this->parseResourceName($template_name); + if ($currentDir && preg_match('/^\.{1,2}\//', $name)) { + // relative template resource name, append it to current template name + $template_name = $currentDir . DIRECTORY_SEPARATOR . $name; + } + + $tpl = $this->smarty->doCreateTemplate($template_name, $cache_id, $compile_id, $this, $caching, $cache_lifetime); + + $tpl->inheritance = $this->getInheritance(); // re-use the same Inheritance object inside the inheritance tree + + if ($scope) { + $tpl->defaultScope = $scope; + } + + if ($caching) { + if ($tpl->templateId !== $this->templateId && $caching !== \Smarty\Template::CACHING_NOCACHE_CODE) { + $tpl->getCached(true); + } else { + // re-use the same Cache object across subtemplates to gather hashes and file dependencies. + $tpl->setCached($this->getCached()); + } + } + + foreach ($extra_vars as $_key => $_val) { + $tpl->assign($_key, $_val); + } + if ($tpl->caching === \Smarty\Template::CACHING_NOCACHE_CODE) { + if ($tpl->getCompiled()->getNocacheCode()) { + $this->getCached()->hashes[$tpl->getCompiled()->nocache_hash] = true; + } + } + + $tpl->render(); + } + + /** + * Remove type indicator from resource name if present. + * E.g. $this->parseResourceName('file:template.tpl') returns 'template.tpl' + * + * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including). + * + * @param string $resource_name template_resource or config_resource to parse + * + * @return string + */ + private function parseResourceName($resource_name): string { + if (preg_match('/^([A-Za-z0-9_\-]{2,}):/', $resource_name, $match)) { + return substr($resource_name, strlen($match[0])); + } + return $resource_name; + } + + /** + * Check if this is a sub template + * + * @return bool true is sub template + */ + public function _isSubTpl() { + return isset($this->parent) && $this->parent instanceof Template; + } + + public function assign($tpl_var, $value = null, $nocache = false, $scope = null) { + return parent::assign($tpl_var, $value, $nocache, $scope); + } + + /** + * Compiles the template + * If the template is not evaluated the compiled template is saved on disk + * + * @TODO only used in compileAll and 1 unit test: can we move this and make compileAndWrite private? + * + * @throws \Exception + */ + public function compileTemplateSource() { + return $this->getCompiled()->compileAndWrite($this); + } + + /** + * Return cached content + * + * @return null|string + * @throws Exception + */ + public function getCachedContent() { + return $this->getCached()->getContent($this); + } + + /** + * Writes the content to cache resource + * + * @param string $content + * + * @return bool + * + * @TODO this method is only used in unit tests that (mostly) try to test CacheResources. + */ + public function writeCachedContent($content) { + if ($this->getSource()->handler->recompiled || !$this->caching + ) { + // don't write cache file + return false; + } + $codeframe = $this->createCodeFrame($content, '', true); + return $this->getCached()->writeCache($this, $codeframe); + } + + /** + * Get unique template id + * + * @return string + */ + public function getTemplateId() { + return $this->templateId; + } + + /** + * runtime error not matching capture tags + * + * @throws \Smarty\Exception + */ + public function capture_error() { + throw new Exception("Not matching {capture} open/close in '{$this->template_resource}'"); + } + + /** + * Return Compiled object + * + * @param bool $forceNew force new compiled object + */ + public function getCompiled($forceNew = false) { + if ($forceNew || !isset($this->compiled)) { + $this->compiled = Compiled::load($this); + } + return $this->compiled; + } + + /** + * Return Cached object + * + * @param bool $forceNew force new cached object + * + * @throws Exception + */ + public function getCached($forceNew = false): Cached { + if ($forceNew || !isset($this->cached)) { + $cacheResource = $this->smarty->getCacheResource(); + $this->cached = new Cached( + $this->source, + $cacheResource, + $this->compile_id, + $this->cache_id + ); + if ($this->isCachingEnabled()) { + $cacheResource->populate($this->cached, $this); + } else { + $this->cached->setValid(false); + } + } + return $this->cached; + } + + private function isCachingEnabled(): bool { + return $this->caching && !$this->getSource()->handler->recompiled; + } + + /** + * Helper function for InheritanceRuntime object + * + * @return InheritanceRuntime + * @throws Exception + */ + public function getInheritance(): InheritanceRuntime { + if (is_null($this->inheritance)) { + $this->inheritance = clone $this->getSmarty()->getRuntime('Inheritance'); + } + return $this->inheritance; + } + + /** + * Sets a new InheritanceRuntime object. + * + * @param InheritanceRuntime $inheritanceRuntime + * + * @return void + */ + public function setInheritance(InheritanceRuntime $inheritanceRuntime) { + $this->inheritance = $inheritanceRuntime; + } + + /** + * Return Compiler object + */ + public function getCompiler() { + if (!isset($this->compiler)) { + $this->compiler = $this->getSource()->createCompiler(); + } + return $this->compiler; + } + + /** + * Create code frame for compiled and cached templates + * + * @param string $content optional template content + * @param string $functions compiled template function and block code + * @param bool $cache flag for cache file + * @param Compiler\Template|null $compiler + * + * @return string + * @throws Exception + */ + public function createCodeFrame($content = '', $functions = '', $cache = false, ?\Smarty\Compiler\Template $compiler = null) { + return $this->getCodeFrameCompiler()->create($content, $functions, $cache, $compiler); + } + + /** + * Template data object destructor + */ + public function __destruct() { + if ($this->smarty->cache_locking && $this->getCached()->is_locked) { + $this->getCached()->handler->releaseLock($this->smarty, $this->getCached()); + } + } + + /** + * Returns if the current template must be compiled by the Smarty compiler + * It does compare the timestamps of template source and the compiled templates and checks the force compile + * configuration + * + * @return bool + * @throws \Smarty\Exception + */ + public function mustCompile(): bool { + if (!$this->getSource()->exists) { + if ($this->_isSubTpl()) { + $parent_resource = " in '{$this->parent->template_resource}'"; + } else { + $parent_resource = ''; + } + throw new Exception("Unable to load {$this->getSource()->type} '{$this->getSource()->name}'{$parent_resource}"); + } + + // @TODO move this logic to Compiled + return $this->smarty->force_compile + || $this->getSource()->handler->recompiled + || !$this->getCompiled()->exists + || ($this->compile_check && $this->getCompiled()->getTimeStamp() < $this->getSource()->getTimeStamp()); + } + + private function getCodeFrameCompiler(): Compiler\CodeFrame { + return new \Smarty\Compiler\CodeFrame($this); + } + + /** + * Get left delimiter + * + * @return string + */ + public function getLeftDelimiter() + { + return $this->left_delimiter ?? $this->getSmarty()->getLeftDelimiter(); + } + + /** + * Set left delimiter + * + * @param string $left_delimiter + */ + public function setLeftDelimiter($left_delimiter) + { + $this->left_delimiter = $left_delimiter; + } + + /** + * Get right delimiter + * + * @return string $right_delimiter + */ + public function getRightDelimiter() + { + return $this->right_delimiter ?? $this->getSmarty()->getRightDelimiter();; + } + + /** + * Set right delimiter + * + * @param string + */ + public function setRightDelimiter($right_delimiter) + { + $this->right_delimiter = $right_delimiter; + } + + /** + * gets a stream variable + * + * @param string $variable the stream of the variable + * + * @return mixed + * @throws \Smarty\Exception + * + */ + public function getStreamVariable($variable) + { + + trigger_error("Using stream variables (\`\{\$foo:bar\}\`)is deprecated.", E_USER_DEPRECATED); + + $_result = ''; + $fp = fopen($variable, 'r+'); + if ($fp) { + while (!feof($fp) && ($current_line = fgets($fp)) !== false) { + $_result .= $current_line; + } + fclose($fp); + return $_result; + } + if ($this->getSmarty()->error_unassigned) { + throw new Exception('Undefined stream variable "' . $variable . '"'); + } + return null; + } + /** + * @inheritdoc + */ + public function configLoad($config_file, $sections = null) + { + $confObj = parent::configLoad($config_file, $sections); + + $this->getCompiled()->file_dependency[ $confObj->getSource()->uid ] = + array($confObj->getSource()->getResourceName(), $confObj->getSource()->getTimeStamp(), $confObj->getSource()->type); + + return $confObj; + } + + public function fetch() { + $result = $this->_execute(0); + return $result === null ? ob_get_clean() : $result; + } + + public function display() { + $this->_execute(1); + } + + /** + * test if cache is valid + * + * @param mixed $cache_id cache id to be used with this template + * @param mixed $compile_id compile id to be used with this template + * @param object $parent next higher level of Smarty variables + * + * @return bool cache status + * @throws \Exception + * @throws \Smarty\Exception + * + * @api Smarty::isCached() + */ + public function isCached(): bool { + return (bool) $this->_execute(2); + } + + /** + * fetches a rendered Smarty template + * + * @param string $function function type 0 = fetch, 1 = display, 2 = isCache + * + * @return mixed + * @throws Exception + * @throws \Throwable + */ + private function _execute($function) { + + $smarty = $this->getSmarty(); + + // make sure we have integer values + $this->caching = (int)$this->caching; + // fetch template content + $level = ob_get_level(); + try { + $_smarty_old_error_level = + isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null; + + if ($smarty->isMutingUndefinedOrNullWarnings()) { + $errorHandler = new \Smarty\ErrorHandler(); + $errorHandler->activate(); + } + + if ($function === 2) { + if ($this->caching) { + // return cache status of template + $result = $this->getCached()->isCached($this); + } else { + return false; + } + } else { + + // After rendering a template, the tpl/config variables are reset, so the template can be re-used. + $this->pushStack(); + + // Start output-buffering. + ob_start(); + + $result = $this->render(false, $function); + + // Restore the template to its previous state + $this->popStack(); + } + + if (isset($errorHandler)) { + $errorHandler->deactivate(); + } + + if (isset($_smarty_old_error_level)) { + error_reporting($_smarty_old_error_level); + } + return $result; + } catch (\Throwable $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + if (isset($errorHandler)) { + $errorHandler->deactivate(); + } + + if (isset($_smarty_old_error_level)) { + error_reporting($_smarty_old_error_level); + } + throw $e; + } + } + + /** + * @return Config|Source|null + */ + public function getSource() { + return $this->source; + } + + /** + * @param Config|Source|null $source + */ + public function setSource($source): void { + $this->source = $source; + } + + /** + * Sets the Cached object, so subtemplates can share one Cached object to gather meta-data. + * + * @param Cached $cached + * + * @return void + */ + private function setCached(Cached $cached) { + $this->cached = $cached; + } + + /** + * @param string $compile_id + * + * @throws Exception + */ + public function setCompileId($compile_id) { + parent::setCompileId($compile_id); + $this->getCompiled(true); + if ($this->caching) { + $this->getCached(true); + } + } + + /** + * @param string $cache_id + * + * @throws Exception + */ + public function setCacheId($cache_id) { + parent::setCacheId($cache_id); + $this->getCached(true); + } + +} diff --git a/core/template/src/Template/Cached.php b/core/template/src/Template/Cached.php new file mode 100644 index 0000000..78635db --- /dev/null +++ b/core/template/src/Template/Cached.php @@ -0,0 +1,428 @@ +valid = $valid; + } + + /** + * CacheResource Handler + * + * @var \Smarty\Cacheresource\Base + */ + public $handler = null; + + /** + * Template Cache Id (\Smarty\Template::$cache_id) + * + * @var string + */ + public $cache_id = null; + + /** + * saved cache lifetime in seconds + * + * @var int + */ + public $cache_lifetime = 0; + + /** + * Id for cache locking + * + * @var string + */ + public $lock_id = null; + + /** + * flag that cache is locked by this instance + * + * @var bool + */ + public $is_locked = false; + + /** + * Source Object + * + * @var Source + */ + public $source = null; + + /** + * Nocache hash codes of processed compiled templates + * + * @var array + */ + public $hashes = []; + + /** + * Content buffer + * + * @var string + */ + public $content = null; + + /** + * create Cached Object container + * + * @param Source $source + * @param \Smarty\Cacheresource\Base $handler + * @param $compile_id + * @param $cache_id + */ + public function __construct(Source $source, \Smarty\Cacheresource\Base $handler, $compile_id, $cache_id) { + $this->compile_id = $compile_id; + $this->cache_id = $cache_id; + $this->source = $source; + $this->handler = $handler; + } + + /** + * Render cache template + * + * @param \Smarty\Template $_template + * @param bool $no_output_filter + * + * @throws \Exception + */ + public function render(Template $_template, $no_output_filter = true) { + + if (!$this->isCached($_template)) { + $this->updateCache($_template, $no_output_filter); + } else { + if (!$this->processed) { + $this->process($_template); + } + } + + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->start_cache($_template); + } + + $this->getRenderedTemplateCode($_template, $this->unifunc); + + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->end_cache($_template); + } + + } + + /** + * Check if cache is valid, lock cache if required + * + * @param Template $_template + * + * @return bool flag true if cache is valid + * @throws Exception + */ + public function isCached(Template $_template) { + if ($this->valid !== null) { + return $this->valid; + } + while (true) { + while (true) { + if ($this->exists === false || $_template->getSmarty()->force_compile || $_template->getSmarty()->force_cache) { + $this->valid = false; + } else { + $this->valid = true; + } + if ($this->valid && $_template->caching === \Smarty\Smarty::CACHING_LIFETIME_CURRENT + && $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime) + ) { + // lifetime expired + $this->valid = false; + } + if ($this->valid && $_template->compile_check === \Smarty\Smarty::COMPILECHECK_ON + && $_template->getSource()->getTimeStamp() > $this->timestamp + ) { + $this->valid = false; + } + if ($this->valid || !$_template->getSmarty()->cache_locking) { + break; + } + if (!$this->handler->locked($_template->getSmarty(), $this)) { + $this->handler->acquireLock($_template->getSmarty(), $this); + break 2; + } + $this->handler->populate($this, $_template); + } + if ($this->valid) { + if (!$_template->getSmarty()->cache_locking || $this->handler->locked($_template->getSmarty(), $this) === null) { + // load cache file for the following checks + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->start_cache($_template); + } + if ($this->handler->process($_template, $this) === false) { + $this->valid = false; + } else { + $this->processed = true; + } + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->end_cache($_template); + } + } else { + $this->is_locked = true; + continue; + } + } else { + return $this->valid; + } + if ($this->valid && $_template->caching === \Smarty\Smarty::CACHING_LIFETIME_SAVED + && $_template->getCached()->cache_lifetime >= 0 + && (time() > ($_template->getCached()->timestamp + $_template->getCached()->cache_lifetime)) + ) { + $this->valid = false; + } + if ($_template->getSmarty()->cache_locking) { + if (!$this->valid) { + $this->handler->acquireLock($_template->getSmarty(), $this); + } elseif ($this->is_locked) { + $this->handler->releaseLock($_template->getSmarty(), $this); + } + } + return $this->valid; + } + return $this->valid; + } + + /** + * Process cached template + * + * @param Template $_template template object + */ + private function process(Template $_template) { + if ($this->handler->process($_template, $this) === false) { + $this->valid = false; + } + $this->processed = $this->valid; + } + + /** + * Read cache content from handler + * + * @param Template $_template template object + * + * @return string|false content + */ + public function readCache(Template $_template) { + if (!$_template->getSource()->handler->recompiled) { + return $this->handler->retrieveCachedContent($_template); + } + return false; + } + + /** + * Write this cache object to handler + * + * @param string $content content to cache + * + * @return bool success + */ + public function writeCache(Template $_template, $content) { + if (!$_template->getSource()->handler->recompiled) { + if ($this->handler->storeCachedContent($_template, $content)) { + $this->content = null; + $this->timestamp = time(); + $this->exists = true; + $this->valid = true; + $this->cache_lifetime = $_template->cache_lifetime; + $this->processed = false; + if ($_template->getSmarty()->cache_locking) { + $this->handler->releaseLock($_template->getSmarty(), $this); + } + return true; + } + $this->content = null; + $this->timestamp = false; + $this->exists = false; + $this->valid = false; + $this->processed = false; + } + return false; + } + + /** + * Cache was invalid , so render from compiled and write to cache + * + * @param Template $_template + * @param bool $no_output_filter + * + * @throws \Smarty\Exception + */ + private function updateCache(Template $_template, $no_output_filter) { + + ob_start(); + + $_template->getCompiled()->render($_template); + + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->start_cache($_template); + } + + $this->removeNoCacheHash($_template, $no_output_filter); + $this->process($_template); + + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->end_cache($_template); + } + } + + /** + * Sanitize content and write it to cache resource + * + * @param Template $_template + * @param bool $no_output_filter + * + * @throws \Smarty\Exception + */ + private function removeNoCacheHash(Template $_template, $no_output_filter) { + $php_pattern = '/(<%|%>|<\?php|<\?|\?>|)/'; + $content = ob_get_clean(); + $hash_array = $this->hashes; + $hash_array[$_template->getCompiled()->nocache_hash] = true; + $hash_array = array_keys($hash_array); + $nocache_hash = '(' . implode('|', $hash_array) . ')'; + $_template->getCached()->setNocacheCode(false); + // get text between non-cached items + $cache_split = + preg_split( + "!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", + $content + ); + // get non-cached items + preg_match_all( + "!/\*%%SmartyNocache:{$nocache_hash}%%\*\/(.+?)/\*/%%SmartyNocache:{$nocache_hash}%%\*/!s", + $content, + $cache_parts + ); + $content = ''; + // loop over items, stitch back together + foreach ($cache_split as $curr_idx => $curr_split) { + if (preg_match($php_pattern, $curr_split)) { + // escape PHP tags in template content + $php_split = preg_split( + $php_pattern, + $curr_split + ); + preg_match_all( + $php_pattern, + $curr_split, + $php_parts + ); + foreach ($php_split as $idx_php => $curr_php) { + $content .= $curr_php; + if (isset($php_parts[0][$idx_php])) { + $content .= "\n"; + } + } + } else { + $content .= $curr_split; + } + if (isset($cache_parts[0][$curr_idx])) { + $_template->getCached()->setNocacheCode(true); + $content .= $cache_parts[2][$curr_idx]; + } + } + if ( + !$no_output_filter + && !$_template->getCached()->getNocacheCode() + ) { + $content = $_template->getSmarty()->runOutputFilters($content, $_template); + } + + $codeframe = (new \Smarty\Compiler\CodeFrame($_template))->create($content, '', true); + $this->writeCache($_template, $codeframe); + } + + /** + * @return Source|null + */ + public function getSource(): ?Source { + return $this->source; + } + + /** + * @param Source|null $source + */ + public function setSource(?Source $source): void { + $this->source = $source; + } + + /** + * Returns the generated content + * + * @param Template $template + * + * @return string|null + * @throws \Exception + */ + public function getContent(Template $template) { + ob_start(); + $this->render($template); + return ob_get_clean(); + } + + /** + * This function is executed automatically when a generated file is included + * - Decode saved properties + * - Check if file is valid + * + * @param Template $_template + * @param array $properties special template properties + * + * @return bool flag if compiled or cache file is valid + * @throws Exception + */ + public function isFresh(Template $_template, array $properties): bool { + + // on cache resources other than file check version stored in cache code + if (\Smarty\Smarty::SMARTY_VERSION !== $properties['version']) { + return false; + } + + $is_valid = true; + + if (!empty($properties['file_dependency']) && ($_template->compile_check === \Smarty\Smarty::COMPILECHECK_ON)) { + $is_valid = $this->checkFileDependencies($properties['file_dependency'], $_template); + } + + // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc + if ($_template->caching === \Smarty\Smarty::CACHING_LIFETIME_SAVED && $properties['cache_lifetime'] >= 0 + && (time() > ($this->timestamp + $properties['cache_lifetime'])) + ) { + $is_valid = false; + } + + $this->cache_lifetime = $properties['cache_lifetime']; + $this->setValid($is_valid); + + if ($is_valid) { + $this->unifunc = $properties['unifunc']; + $this->setNocacheCode($properties['has_nocache_code']); + $this->file_dependency = $properties['file_dependency']; + } + return $is_valid && !function_exists($properties['unifunc']); + } + +} diff --git a/core/template/src/Template/Compiled.php b/core/template/src/Template/Compiled.php new file mode 100644 index 0000000..5a07db0 --- /dev/null +++ b/core/template/src/Template/Compiled.php @@ -0,0 +1,305 @@ +getSource()->handler->supportsCompiledTemplates()) { + $compiled->populateCompiledFilepath($_template); + } + return $compiled; + } + + /** + * populate Compiled Object with compiled filepath + * + * @param Template $_template template object + **/ + private function populateCompiledFilepath(Template $_template) { + $source = $_template->getSource(); + $smarty = $_template->getSmarty(); + $this->filepath = $smarty->getCompileDir(); + if (isset($_template->compile_id)) { + $this->filepath .= preg_replace('![^\w]+!', '_', $_template->compile_id) . + ($smarty->use_sub_dirs ? DIRECTORY_SEPARATOR : '^'); + } + // if use_sub_dirs, break file into directories + if ($smarty->use_sub_dirs) { + $this->filepath .= $source->uid[0] . $source->uid[1] . DIRECTORY_SEPARATOR . $source->uid[2] . + $source->uid[3] . DIRECTORY_SEPARATOR . $source->uid[4] . $source->uid[5] . + DIRECTORY_SEPARATOR; + } + $this->filepath .= $source->uid . '_'; + if ($source->isConfig) { + $this->filepath .= (int)$smarty->config_read_hidden + (int)$smarty->config_booleanize * 2 + + (int)$smarty->config_overwrite * 4; + } else { + $this->filepath .= (int)$smarty->escape_html * 2; + } + $this->filepath .= '.' . $source->type . '_' . $source->getBasename(); + + if ($_template->caching) { + $this->filepath .= '.cache'; + } + $this->filepath .= '.php'; + $this->timestamp = $this->exists = is_file($this->filepath); + if ($this->exists) { + $this->timestamp = filemtime($this->filepath); + } + } + + /** + * render compiled template code + * + * @param Template $_template + * + * @return string + * @throws \Smarty\Exception + */ + public function render(Template $_template) { + + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->start_render($_template); + } + if (!$this->processed) { + $this->compileAndLoad($_template); + } + + // @TODO Can't Cached handle this? Maybe introduce an event to decouple. + if ($_template->caching) { + $_template->getCached()->file_dependency = + array_merge($_template->getCached()->file_dependency, $this->file_dependency); + } + + $this->getRenderedTemplateCode($_template, $this->unifunc); + + // @TODO Can't Cached handle this? Maybe introduce an event to decouple and remove the $_template->caching property. + if ($_template->caching && $this->getNocacheCode()) { + $_template->getCached()->hashes[$this->nocache_hash] = true; + } + + if ($_template->getSmarty()->debugging) { + $_template->getSmarty()->getDebug()->end_render($_template); + } + } + + /** + * load compiled template or compile from source + * + * @param Template $_smarty_tpl do not change variable name, is used by compiled template + * + * @throws Exception + */ + private function compileAndLoad(Template $_smarty_tpl) { + + if ($_smarty_tpl->getSource()->handler->recompiled) { + $this->recompile($_smarty_tpl); + return; + } + + if ($this->exists && !$_smarty_tpl->getSmarty()->force_compile + && !($_smarty_tpl->compile_check && $_smarty_tpl->getSource()->getTimeStamp() > $this->getTimeStamp()) + ) { + $this->loadCompiledTemplate($_smarty_tpl, false); + } + + if (!$this->isValid) { + $this->compileAndWrite($_smarty_tpl); + $this->loadCompiledTemplate($_smarty_tpl); + } + + $this->processed = true; + } + + /** + * compile template from source + * + * @param Template $_smarty_tpl do not change variable name, is used by compiled template + * + * @throws Exception + */ + private function recompile(Template $_smarty_tpl) { + $level = ob_get_level(); + ob_start(); + // call compiler + try { + eval('?>' . $this->doCompile($_smarty_tpl)); + } catch (\Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + throw $e; + } + ob_get_clean(); + $this->timestamp = time(); + $this->exists = true; + } + + /** + * compile template from source + * + * @param Template $_template + * + * @throws Exception + */ + public function compileAndWrite(Template $_template) { + // compile locking + if ($saved_timestamp = (!$_template->getSource()->handler->recompiled && is_file($this->filepath))) { + $saved_timestamp = $this->getTimeStamp(); + touch($this->filepath); + } + // compile locking + try { + // call compiler + $this->write($_template, $this->doCompile($_template)); + } catch (\Exception $e) { + // restore old timestamp in case of error + if ($saved_timestamp && is_file($this->filepath)) { + touch($this->filepath, $saved_timestamp); + } + throw $e; + } + } + + /** + * Do the actual compiling. + * + * @param Template $_smarty_tpl + * + * @return string + * @throws Exception + */ + private function doCompile(Template $_smarty_tpl): string { + $this->file_dependency = []; + $this->includes = []; + $this->nocache_hash = null; + $this->unifunc = null; + return $_smarty_tpl->getCompiler()->compileTemplate($_smarty_tpl); + } + + /** + * Write compiled code by handler + * + * @param Template $_template template object + * @param string $code compiled code + * + * @return bool success + * @throws \Smarty\Exception + */ + private function write(Template $_template, $code) { + if (!$_template->getSource()->handler->recompiled) { + if ($_template->getSmarty()->writeFile($this->filepath, $code) === true) { + $this->timestamp = $this->exists = is_file($this->filepath); + if ($this->exists) { + $this->timestamp = filemtime($this->filepath); + return true; + } + } + return false; + } + return true; + } + + /** + * Load fresh compiled template by including the PHP file + * HHVM requires a workaround because of a PHP incompatibility + * + * @param Template $_smarty_tpl do not change/remove variable name, is used by compiled template + * @param bool $invalidateCachedFiles forces a revalidation of the file in opcache or apc cache (if available) + * + */ + private function loadCompiledTemplate(Template $_smarty_tpl, bool $invalidateCachedFiles = true) { + + if ($invalidateCachedFiles) { + if (function_exists('opcache_invalidate') + && (!function_exists('ini_get') || strlen(ini_get("opcache.restrict_api")) < 1) + ) { + opcache_invalidate($this->filepath, true); + } elseif (function_exists('apc_compile_file')) { + apc_compile_file($this->filepath); + } + } + if (defined('HHVM_VERSION')) { + eval('?>' . file_get_contents($this->filepath)); + } else { + include $this->filepath; + } + + } + + /** + * This function is executed automatically when a compiled or cached template file is included + * - Decode saved properties from compiled template and cache files + * - Check if compiled or cache file is valid + * + * @param Template $_template + * @param array $properties special template properties + * + * @return bool flag if compiled or cache file is valid + * @throws Exception + */ + public function isFresh(Template $_template, array $properties): bool { + + // on cache resources other than file check version stored in cache code + if (\Smarty\Smarty::SMARTY_VERSION !== $properties['version']) { + return false; + } + + $is_valid = true; + if (!empty($properties['file_dependency']) && $_template->compile_check) { + $is_valid = $this->checkFileDependencies($properties['file_dependency'], $_template); + } + + $this->isValid = $is_valid; + $this->includes = $properties['includes'] ?? []; + + if ($is_valid) { + $this->unifunc = $properties['unifunc']; + $this->setNocacheCode($properties['has_nocache_code']); + $this->file_dependency = $properties['file_dependency']; + } + return $is_valid && !function_exists($properties['unifunc']); + } + + /** + * This method is here only to fix an issue when upgrading from Smarty v4 to v5. + */ + public function _decodeProperties($a, $b, $c = false): bool { return false; } + +} diff --git a/core/template/src/Template/Config.php b/core/template/src/Template/Config.php new file mode 100644 index 0000000..b2fcbf8 --- /dev/null +++ b/core/template/src/Template/Config.php @@ -0,0 +1,36 @@ + true]; + + public function createCompiler(): \Smarty\Compiler\BaseCompiler { + return new \Smarty\Compiler\Configfile($this->smarty); + } + + protected static function getDefaultHandlerFunc(Smarty $smarty) { + return $smarty->default_config_handler_func; + } +} diff --git a/core/template/src/Template/GeneratedPhpFile.php b/core/template/src/Template/GeneratedPhpFile.php new file mode 100644 index 0000000..f436e97 --- /dev/null +++ b/core/template/src/Template/GeneratedPhpFile.php @@ -0,0 +1,159 @@ +exists && !$this->timestamp) { + $this->timestamp = filemtime($this->filepath); + } + return $this->timestamp; + } + + /** + * @return bool + */ + public function getNocacheCode(): bool { + return $this->has_nocache_code; + } + + /** + * @param bool $has_nocache_code + */ + public function setNocacheCode(bool $has_nocache_code): void { + $this->has_nocache_code = $has_nocache_code; + } + + /** + * get rendered template content by calling compiled or cached template code + * + * @param string $unifunc function with template code + * + * @throws \Exception + */ + protected function getRenderedTemplateCode(\Smarty\Template $_template, $unifunc) { + $level = ob_get_level(); + try { + if (empty($unifunc) || !function_exists($unifunc)) { + throw new \Smarty\Exception("Invalid compiled template for '{$this->filepath}'"); + } + $unifunc($_template); + } catch (\Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + } + + /** + * @param $file_dependency + * @param Template $_template + * + * @return bool + * @throws Exception + */ + protected function checkFileDependencies($file_dependency, Template $_template): bool { + // check file dependencies at compiled code + foreach ($file_dependency as $_file_to_check) { + + $handler = \Smarty\Resource\BasePlugin::load($_template->getSmarty(), $_file_to_check[2]); + + if ($handler instanceof FilePlugin) { + if ($_template->getSource()->getResourceName() === $_file_to_check[0]) { + // do not recheck current template + continue; + } + $mtime = $handler->getResourceNameTimestamp($_file_to_check[0], $_template->getSmarty(), $_template->getSource()->isConfig); + } else { + + if ($handler->checkTimestamps()) { + // @TODO this doesn't actually check any dependencies, but only the main source file + // and that might to be irrelevant, as the comment "do not recheck current template" above suggests + $source = Source::load($_template, $_template->getSmarty()); + $mtime = $source->getTimeStamp(); + } else { + continue; + } + } + + if ($mtime === false || $mtime > $_file_to_check[1]) { + return false; + } + } + return true; + } + +} diff --git a/core/template/src/Template/Source.php b/core/template/src/Template/Source.php new file mode 100644 index 0000000..2c2022e --- /dev/null +++ b/core/template/src/Template/Source.php @@ -0,0 +1,285 @@ +handler = \Smarty\Resource\BasePlugin::load($smarty, $type); + + $this->smarty = $smarty; + $this->resource = $type . ':' . $name; + $this->type = $type; + $this->name = $name; + } + + /** + * initialize Source Object for given resource + * Either [$_template] or [$smarty, $template_resource] must be specified + * + * @param Template|null $_template template object + * @param Smarty|null $smarty smarty object + * @param null $template_resource resource identifier + * + * @return Source Source Object + * @throws Exception + */ + public static function load( + ?Template $_template = null, + ?Smarty $smarty = null, + $template_resource = null + ) { + if ($_template) { + $smarty = $_template->getSmarty(); + $template_resource = $_template->template_resource; + } + if (empty($template_resource)) { + throw new Exception('Source: Missing name'); + } + // parse resource_name, load resource handler, identify unique resource name + if (preg_match('/^([A-Za-z0-9_\-]{2,}):([\s\S]*)$/', $template_resource, $match)) { + $type = $match[1]; + $name = $match[2]; + } else { + // no resource given, use default + // or single character before the colon is not a resource type, but part of the filepath + $type = $smarty->default_resource_type; + $name = $template_resource; + } + + if (isset(self::$_incompatible_resources[$type])) { + throw new Exception("Unable to use resource '{$type}' for " . __METHOD__); + } + + // create new source object + $source = new static($smarty, $type, $name); + $source->handler->populate($source, $_template); + if (!$source->exists && static::getDefaultHandlerFunc($smarty)) { + $source->_getDefaultTemplate(static::getDefaultHandlerFunc($smarty)); + $source->handler->populate($source, $_template); + } + return $source; + } + + protected static function getDefaultHandlerFunc(Smarty $smarty) { + return $smarty->default_template_handler_func; + } + + /** + * Get source time stamp + * + * @return int + */ + public function getTimeStamp() { + if (!isset($this->timestamp)) { + $this->handler->populateTimestamp($this); + } + return $this->timestamp; + } + + /** + * Get source content + * + * @return string + * @throws \Smarty\Exception + */ + public function getContent() { + return $this->content ?? $this->handler->getContent($this); + } + + /** + * get default content from template or config resource handler + * + * @throws \Smarty\Exception + */ + public function _getDefaultTemplate($default_handler) { + $_content = $_timestamp = null; + $_return = \call_user_func_array( + $default_handler, + [$this->type, $this->name, &$_content, &$_timestamp, $this->smarty] + ); + if (is_string($_return)) { + $this->exists = is_file($_return); + if ($this->exists) { + $this->timestamp = filemtime($_return); + } else { + throw new Exception( + 'Default handler: Unable to load ' . + "default file '{$_return}' for '{$this->type}:{$this->name}'" + ); + } + $this->name = $_return; + $this->uid = sha1($_return); + } elseif ($_return === true) { + $this->content = $_content; + $this->exists = true; + $this->uid = $this->name = sha1($_content); + $this->handler = \Smarty\Resource\BasePlugin::load($this->smarty, 'eval'); + } else { + $this->exists = false; + throw new Exception( + 'Default handler: No ' . ($this->isConfig ? 'config' : 'template') . + " default content for '{$this->type}:{$this->name}'" + ); + } + } + + public function createCompiler(): \Smarty\Compiler\BaseCompiler { + return new \Smarty\Compiler\Template($this->smarty); + } + + public function getSmarty() { + return $this->smarty; + } + + /** + * Determine basename for compiled filename + * + * @return string resource's basename + */ + public function getBasename() + { + return $this->handler->getBasename($this); + } + + /** + * Return source name + * e.g.: 'sub/index.tpl' + * + * @return string + */ + public function getResourceName(): string { + return (string) $this->name; + } + + /** + * Return source name, including the type prefix. + * e.g.: 'file:sub/index.tpl' + * + * @return string + */ + public function getFullResourceName(): string { + return $this->type . ':' . $this->name; + } + + public function getFilepath(): ?string { + if ($this->handler instanceof FilePlugin) { + return $this->handler->getFilePath($this->name, $this->smarty, $this->isConfig); + } + return null; + } + + public function isConfig(): bool { + return $this->isConfig; + } + +} diff --git a/core/template/src/TemplateBase.php b/core/template/src/TemplateBase.php new file mode 100644 index 0000000..f01d110 --- /dev/null +++ b/core/template/src/TemplateBase.php @@ -0,0 +1,425 @@ +getSmarty(); + // test if allowed methods callable + if (!empty($allowed_methods_properties)) { + foreach ((array)$allowed_methods_properties as $method) { + if (!is_callable([$object, $method]) && !property_exists($object, $method)) { + throw new Exception("Undefined method or property '$method' in registered object"); + } + } + } + // test if block methods callable + if (!empty($block_methods)) { + foreach ((array)$block_methods as $method) { + if (!is_callable([$object, $method])) { + throw new Exception("Undefined method '$method' in registered object"); + } + } + } + // register the object + $smarty->registered_objects[$object_name] = + [$object, (array)$allowed_methods_properties, (boolean)$format, (array)$block_methods]; + return $this; + } + + /** + * Registers plugin to be used in templates + * + * @param string $object_name name of object + * + * @return static + * @api Smarty::unregisterObject() + * + */ + public function unregisterObject($object_name) { + $smarty = $this->getSmarty(); + if (isset($smarty->registered_objects[$object_name])) { + unset($smarty->registered_objects[$object_name]); + } + return $this; + } + + /** + * @return int + */ + public function getCompileCheck(): int { + return $this->compile_check; + } + + /** + * @param int $compile_check + */ + public function setCompileCheck($compile_check) { + $this->compile_check = (int)$compile_check; + } + + /** + * @param int $caching + */ + public function setCaching($caching) { + $this->caching = (int)$caching; + } + + /** + * @param int $cache_lifetime + */ + public function setCacheLifetime($cache_lifetime) { + $this->cache_lifetime = $cache_lifetime; + } + + /** + * @param string $compile_id + */ + public function setCompileId($compile_id) { + $this->compile_id = $compile_id; + } + + /** + * @param string $cache_id + */ + public function setCacheId($cache_id) { + $this->cache_id = $cache_id; + } + + /** + * creates a data object + * + * @param Data|null $parent next higher level of Smarty + * variables + * @param null $name optional data block name + * + * @return Data data object + * @throws Exception + * @api Smarty::createData() + * + */ + public function createData(?Data $parent = null, $name = null) { + /* @var Smarty $smarty */ + $smarty = $this->getSmarty(); + $dataObj = new Data($parent, $smarty, $name); + if ($smarty->debugging) { + $smarty->getDebug()->register_data($dataObj); + } + return $dataObj; + } + + /** + * return name of debugging template + * + * @return string + * @api Smarty::getDebugTemplate() + * + */ + public function getDebugTemplate() { + $smarty = $this->getSmarty(); + return $smarty->debug_tpl; + } + + /** + * @return Debug + */ + public function getDebug(): Debug { + if (!isset($this->debug)) { + $this->debug = new \Smarty\Debug(); + } + return $this->debug; + } + + + /** + * return a reference to a registered object + * + * @param string $object_name object name + * + * @return object + * @throws \Smarty\Exception if no such object is found + * + * @api Smarty::getRegisteredObject() + */ + public function getRegisteredObject($object_name) { + $smarty = $this->getSmarty(); + if (!isset($smarty->registered_objects[$object_name])) { + throw new Exception("'$object_name' is not a registered object"); + } + if (!is_object($smarty->registered_objects[$object_name][0])) { + throw new Exception("registered '$object_name' is not an object"); + } + return $smarty->registered_objects[$object_name][0]; + } + + /** + * Get literals + * + * @return array list of literals + * @api Smarty::getLiterals() + * + */ + public function getLiterals() { + $smarty = $this->getSmarty(); + return (array)$smarty->literals; + } + + /** + * Add literals + * + * @param array|string $literals literal or list of literals + * to addto add + * + * @return static + * @throws \Smarty\Exception + * @api Smarty::addLiterals() + * + */ + public function addLiterals($literals = null) { + if (isset($literals)) { + $this->_setLiterals($this->getSmarty(), (array)$literals); + } + return $this; + } + + /** + * Set literals + * + * @param array|string $literals literal or list of literals + * to setto set + * + * @return static + * @throws \Smarty\Exception + * @api Smarty::setLiterals() + * + */ + public function setLiterals($literals = null) { + $smarty = $this->getSmarty(); + $smarty->literals = []; + if (!empty($literals)) { + $this->_setLiterals($smarty, (array)$literals); + } + return $this; + } + + /** + * common setter for literals for easier handling of duplicates the + * Smarty::$literals array gets filled with identical key values + * + * @param Smarty $smarty + * @param array $literals + * + * @throws \Smarty\Exception + */ + private function _setLiterals(Smarty $smarty, $literals) { + $literals = array_combine($literals, $literals); + $error = isset($literals[$smarty->getLeftDelimiter()]) ? [$smarty->getLeftDelimiter()] : []; + $error = isset($literals[$smarty->getRightDelimiter()]) ? $error[] = $smarty->getRightDelimiter() : $error; + if (!empty($error)) { + throw new Exception( + 'User defined literal(s) "' . $error . + '" may not be identical with left or right delimiter' + ); + } + $smarty->literals = array_merge((array)$smarty->literals, (array)$literals); + } + + /** + * Registers static classes to be used in templates + * + * @param string $class_name + * @param string $class_impl the referenced PHP class to + * register + * + * @return static + * @throws \Smarty\Exception + * @api Smarty::registerClass() + * + */ + public function registerClass($class_name, $class_impl) { + $smarty = $this->getSmarty(); + // test if exists + if (!class_exists($class_impl)) { + throw new Exception("Undefined class '$class_impl' in register template class"); + } + // register the class + $smarty->registered_classes[$class_name] = $class_impl; + return $this; + } + + /** + * Register config default handler + * + * @param callable $callback class/method name + * + * @return static + * @throws Exception if $callback is not callable + * @api Smarty::registerDefaultConfigHandler() + * + */ + public function registerDefaultConfigHandler($callback) { + $smarty = $this->getSmarty(); + if (is_callable($callback)) { + $smarty->default_config_handler_func = $callback; + } else { + throw new Exception('Default config handler not callable'); + } + return $this; + } + + /** + * Register template default handler + * + * @param callable $callback class/method name + * + * @return static + * @throws Exception if $callback is not callable + * @api Smarty::registerDefaultTemplateHandler() + * + */ + public function registerDefaultTemplateHandler($callback) { + $smarty = $this->getSmarty(); + if (is_callable($callback)) { + $smarty->default_template_handler_func = $callback; + } else { + throw new Exception('Default template handler not callable'); + } + return $this; + } + + /** + * Registers a resource to fetch a template + * + * @param string $name name of resource type + * @param \Smarty\Resource\BasePlugin $resource_handler instance of Smarty\Resource\BasePlugin + * + * @return static + * + * @api Smarty::registerResource() + */ + public function registerResource($name, \Smarty\Resource\BasePlugin $resource_handler) { + $smarty = $this->getSmarty(); + $smarty->registered_resources[$name] = $resource_handler; + return $this; + } + + /** + * Unregisters a resource to fetch a template + * + * @param string $type name of resource type + * + * @return static + * @api Smarty::unregisterResource() + * + */ + public function unregisterResource($type) { + $smarty = $this->getSmarty(); + if (isset($smarty->registered_resources[$type])) { + unset($smarty->registered_resources[$type]); + } + return $this; + } + + /** + * set the debug template + * + * @param string $tpl_name + * + * @return static + * @throws Exception if file is not readable + * @api Smarty::setDebugTemplate() + * + */ + public function setDebugTemplate($tpl_name) { + $smarty = $this->getSmarty(); + if (!is_readable($tpl_name)) { + throw new Exception("Unknown file '{$tpl_name}'"); + } + $smarty->debug_tpl = $tpl_name; + return $this; + } + + + +} diff --git a/core/template/src/TestInstall.php b/core/template/src/TestInstall.php new file mode 100644 index 0000000..e24c398 --- /dev/null +++ b/core/template/src/TestInstall.php @@ -0,0 +1,211 @@ +\n"; + echo "Smarty Installation test...\n"; + echo "Testing template directory...\n"; + } + $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); + // test if all registered template_dir are accessible + foreach ($smarty->getTemplateDir() as $template_dir) { + $_template_dir = $template_dir; + $template_dir = realpath($template_dir); + // resolve include_path or fail existence + if (!$template_dir) { + $status = false; + $message = "FAILED: $_template_dir does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + continue; + } + if (!is_dir($template_dir)) { + $status = false; + $message = "FAILED: $template_dir is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + } elseif (!is_readable($template_dir)) { + $status = false; + $message = "FAILED: $template_dir is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'template_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "$template_dir is OK.\n"; + } + } + } + if ($errors === null) { + echo "Testing compile directory...\n"; + } + // test if registered compile_dir is accessible + $__compile_dir = $smarty->getCompileDir(); + $_compile_dir = realpath($__compile_dir); + if (!$_compile_dir) { + $status = false; + $message = "FAILED: {$__compile_dir} does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } elseif (!is_dir($_compile_dir)) { + $status = false; + $message = "FAILED: {$_compile_dir} is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } elseif (!is_readable($_compile_dir)) { + $status = false; + $message = "FAILED: {$_compile_dir} is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } elseif (!is_writable($_compile_dir)) { + $status = false; + $message = "FAILED: {$_compile_dir} is not writable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'compile_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "{$_compile_dir} is OK.\n"; + } + } + if ($errors === null) { + echo "Testing plugins directory...\n"; + } + if ($errors === null) { + echo "Testing cache directory...\n"; + } + // test if all registered cache_dir is accessible + $__cache_dir = $smarty->getCacheDir(); + $_cache_dir = realpath($__cache_dir); + if (!$_cache_dir) { + $status = false; + $message = "FAILED: {$__cache_dir} does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } elseif (!is_dir($_cache_dir)) { + $status = false; + $message = "FAILED: {$_cache_dir} is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } elseif (!is_readable($_cache_dir)) { + $status = false; + $message = "FAILED: {$_cache_dir} is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } elseif (!is_writable($_cache_dir)) { + $status = false; + $message = "FAILED: {$_cache_dir} is not writable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'cache_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "{$_cache_dir} is OK.\n"; + } + } + if ($errors === null) { + echo "Testing configs directory...\n"; + } + // test if all registered config_dir are accessible + foreach ($smarty->getConfigDir() as $config_dir) { + $_config_dir = $config_dir; + // resolve include_path or fail existence + if (!$config_dir) { + $status = false; + $message = "FAILED: $_config_dir does not exist"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + continue; + } + if (!is_dir($config_dir)) { + $status = false; + $message = "FAILED: $config_dir is not a directory"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + } elseif (!is_readable($config_dir)) { + $status = false; + $message = "FAILED: $config_dir is not readable"; + if ($errors === null) { + echo $message . ".\n"; + } else { + $errors[ 'config_dir' ] = $message; + } + } else { + if ($errors === null) { + echo "$config_dir is OK.\n"; + } + } + } + if ($errors === null) { + echo "Tests complete.\n"; + echo "\n"; + } + return $status; + } +} diff --git a/core/template/src/UndefinedVariable.php b/core/template/src/UndefinedVariable.php new file mode 100644 index 0000000..53f13f4 --- /dev/null +++ b/core/template/src/UndefinedVariable.php @@ -0,0 +1,19 @@ +value = $value; + } + + /** + * if true any output of this variable will be not cached + * + * @var boolean + */ + private $nocache = false; + + /** + * @param bool $nocache + */ + public function setNocache(bool $nocache): void { + $this->nocache = $nocache; + } + + /** + * create Smarty variable object + * + * @param mixed $value the value to assign + * @param boolean $nocache if true any output of this variable will be not cached + */ + public function __construct($value = null, $nocache = false) + { + $this->value = $value; + $this->nocache = $nocache; + } + + public function getValue() { + return $this->value; + } + + /** + * <> String conversion + * + * @return string + */ + public function __toString() + { + return (string)$this->value; + } + + /** + * Handles ++$a and --$a in templates. + * + * @param $operator '++' or '--', defaults to '++' + * + * @return int|mixed + * @throws Exception + */ + public function preIncDec($operator = '++') { + if ($operator == '--') { + return --$this->value; + } elseif ($operator == '++') { + return ++$this->value; + } else { + throw new Exception("Invalid incdec operator. Use '--' or '++'."); + } + return $this->value; + } + + /** + * Handles $a++ and $a-- in templates. + * + * @param $operator '++' or '--', defaults to '++' + * + * @return int|mixed + * @throws Exception + */ + public function postIncDec($operator = '++') { + if ($operator == '--') { + return $this->value--; + } elseif ($operator == '++') { + return $this->value++; + } else { + throw new Exception("Invalid incdec operator. Use '--' or '++'."); + } + } + + /** + * @return bool + */ + public function isNocache(): bool { + return $this->nocache; + } + +} diff --git a/core/template/src/debug.tpl b/core/template/src/debug.tpl new file mode 100644 index 0000000..ab09358 --- /dev/null +++ b/core/template/src/debug.tpl @@ -0,0 +1,174 @@ +{capture name='_smarty_debug' assign='debug_output'} + + + + Smarty Debug Console + + + + +

Smarty {$smarty.version} Debug Console + - {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}

+ + {if !empty($template_data)} +

included templates & config files (load time in seconds)

+
+ {foreach $template_data as $template} + {$template.name} +
   + (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) + +
+ {/foreach} +
+ {/if} + +

assigned template variables

+ + + {foreach $assigned_vars as $vars} + + + + + + {/foreach} +
+

${$vars@key}

+ {if isset($vars['nocache'])}Nocache
{/if} + {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
+

Value

+ {$vars['value']|debug_print_var:10:80 nofilter} +
+ {if isset($vars['attributes'])} +

Attributes

+ {$vars['attributes']|debug_print_var nofilter} + {/if} +
+ +

assigned config file variables

+ + + {foreach $config_vars as $vars} + + + + + {/foreach} + +
+

#{$vars@key}#

+ {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
+ {$vars['value']|debug_print_var:10:80 nofilter} +
+ + +{/capture} + diff --git a/core/template/src/functions.php b/core/template/src/functions.php new file mode 100644 index 0000000..590789b --- /dev/null +++ b/core/template/src/functions.php @@ -0,0 +1,253 @@ + + * + * @param DateTime|int|string $string date object, timestamp or string that can be converted using strtotime() + * + * @return int + */ +function smarty_make_timestamp($string) +{ + if (empty($string)) { + // use "now": + return time(); + } elseif ($string instanceof DateTime + || (interface_exists('DateTimeInterface', false) && $string instanceof DateTimeInterface) + ) { + return (int)$string->format('U'); // PHP 5.2 BC + } elseif (strlen($string) === 14 && ctype_digit((string)$string)) { + // it is mysql timestamp format of YYYYMMDDHHMMSS? + return mktime( + substr($string, 8, 2), + substr($string, 10, 2), + substr($string, 12, 2), + substr($string, 4, 2), + substr($string, 6, 2), + substr($string, 0, 4) + ); + } elseif (is_numeric($string)) { + // it is a numeric string, we handle it as timestamp + return (int)$string; + } else { + // strtotime should handle it + $time = strtotime($string); + if ($time === -1 || $time === false) { + // strtotime() was not able to parse $string, use "now": + return time(); + } + return $time; + } +} + +/** + * Multibyte string replace + * + * @param string|string[] $search the string to be searched + * @param string|string[] $replace the replacement string + * @param string $subject the source string + * @param int &$count number of matches found + * + * @return string replaced string + * @author Rodney Rehm + */ +function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) +{ + if (!is_array($search) && is_array($replace)) { + return false; + } + if (is_array($subject)) { + // call mb_replace for each single string in $subject + foreach ($subject as &$string) { + $string = smarty_mb_str_replace($search, $replace, $string, $c); + $count += $c; + } + } elseif (is_array($search)) { + if (!is_array($replace)) { + foreach ($search as &$string) { + $subject = smarty_mb_str_replace($string, $replace, $subject, $c); + $count += $c; + } + } else { + $n = max(count($search), count($replace)); + while ($n--) { + $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c); + $count += $c; + next($search); + next($replace); + } + } + } else { + $mb_reg_charset = mb_regex_encoding(); + // Check if mbstring regex is using UTF-8 + $reg_is_unicode = !strcasecmp($mb_reg_charset, "UTF-8"); + if(!$reg_is_unicode) { + // ...and set to UTF-8 if not + mb_regex_encoding("UTF-8"); + } + + // See if charset used by Smarty is matching one used by regex... + $current_charset = mb_regex_encoding(); + $convert_result = (bool)strcasecmp(\Smarty\Smarty::$_CHARSET, $current_charset); + if($convert_result) { + // ...convert to it if not. + $subject = mb_convert_encoding($subject, $current_charset, \Smarty\Smarty::$_CHARSET); + $search = mb_convert_encoding($search, $current_charset, \Smarty\Smarty::$_CHARSET); + $replace = mb_convert_encoding($replace, $current_charset, \Smarty\Smarty::$_CHARSET); + } + + $parts = mb_split(preg_quote($search), $subject ?? "") ?: array(); + // If original regex encoding was not unicode... + if(!$reg_is_unicode) { + // ...restore original regex encoding to avoid breaking the system. + mb_regex_encoding($mb_reg_charset); + } + if($parts === false) { + // This exception is thrown if call to mb_split failed. + // Usually it happens, when $search or $replace are not valid for given mb_regex_encoding(). + // There may be other cases for it to fail, please file an issue if you find a reproducible one. + throw new Exception("Source string is not a valid $current_charset sequence (probably)"); + } + + $count = count($parts) - 1; + $subject = implode($replace, $parts); + // Convert results back to charset used by Smarty, if needed. + if($convert_result) { + $subject = mb_convert_encoding($subject, \Smarty\Smarty::$_CHARSET, $current_charset); + } + } + return $subject; +} +/** + * escape_special_chars common function + * Function: smarty_function_escape_special_chars + * Purpose: used by other smarty functions to escape + * special chars except for already escaped ones + * + * @author Monte Ohrt + * + * @param string $string text that should by escaped + * + * @return string + */ +function smarty_function_escape_special_chars($string) +{ + if (!is_array($string)) { + $string = htmlspecialchars((string) $string, ENT_COMPAT, \Smarty\Smarty::$_CHARSET, false); + } + return $string; +} + +/** + * Smarty wordwrap supporting multibyte + * Name: smarty_mb_wordwrap + * Purpose: Wrap a string to a given number of characters + * + * @link https://php.net/manual/en/function.wordwrap.php for similarity + * + * @param string $str the string to wrap + * @param int $width the width of the output + * @param string $break the character used to break the line + * @param boolean $cut ignored parameter, just for the sake of + * + * @return string wrapped string + * @author Rodney Rehm + */ +function smarty_mb_wordwrap($str, $width = 75, $break = "\n", $cut = false) +{ + // break words into tokens using white space as a delimiter + $tokens = preg_split('!(\s)!S' . \Smarty\Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE); + $length = 0; + $t = ''; + $_previous = false; + $_space = false; + foreach ($tokens as $_token) { + $token_length = mb_strlen($_token, \Smarty\Smarty::$_CHARSET); + $_tokens = array($_token); + if ($token_length > $width) { + if ($cut) { + $_tokens = preg_split( + '!(.{' . $width . '})!S' . \Smarty\Smarty::$_UTF8_MODIFIER, + $_token, + -1, + PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE + ); + } + } + foreach ($_tokens as $token) { + $_space = !!preg_match('!^\s$!S' . \Smarty\Smarty::$_UTF8_MODIFIER, $token); + $token_length = mb_strlen($token, \Smarty\Smarty::$_CHARSET); + $length += $token_length; + if ($length > $width) { + // remove space before inserted break + if ($_previous) { + $t = mb_substr($t, 0, -1, \Smarty\Smarty::$_CHARSET); + } + if (!$_space) { + // add the break before the token + if (!empty($t)) { + $t .= $break; + } + $length = $token_length; + } + } elseif ($token === "\n") { + // hard break must reset counters + $length = 0; + } + $_previous = $_space; + // add the token + $t .= $token; + } + } + return $t; +} diff --git a/inc/.gitignore b/inc/.gitignore new file mode 100644 index 0000000..7e9e3af --- /dev/null +++ b/inc/.gitignore @@ -0,0 +1 @@ +config.inc.php diff --git a/inc/SimpleOpenID.class.php b/inc/SimpleOpenID.class.php new file mode 100644 index 0000000..c8ce198 --- /dev/null +++ b/inc/SimpleOpenID.class.php @@ -0,0 +1,426 @@ +SetIdentity($_POST['openid_url']); + :: SET RETURN URL :: + $openid->SetApprovedURL('http://www.yoursite.com/return.php'); // Script which handles a response from OpenID Server + :: SET TRUST ROOT :: + $openid->SetTrustRoot('http://www.yoursite.com/'); + :: FETCH SERVER URL FROM IDENTITY PAGE :: [Note: It is recomended to cache this (Session, Cookie, Database)] + $openid->GetOpenIDServer(); // Returns false if server is not found + :: REDIRECT USER TO OPEN ID SERVER FOR APPROVAL :: + + :: (OPTIONAL) SET OPENID SERVER :: + $openid->SetOpenIDServer($server_url); // If you have cached previously this, you don't have to call GetOpenIDServer and set value this directly + + STEP 2) + Once user gets returned we must validate signature + :: VALIDATE REQUEST :: + true|false = $openid->ValidateWithServer(); + + ERRORS: + array = $openid->GetError(); // Get latest Error code + + FIELDS: + OpenID allowes you to retreive a profile. To set what fields you'd like to get use (accepts either string or array): + $openid->SetRequiredFields(array('email','fullname','dob','gender','postcode','country','language','timezone')); + or + $openid->SetOptionalFields('postcode'); + +IMPORTANT TIPS: +OPENID as is now, is not trust system. It is a great single-sign on method. If you want to +store information about OpenID in your database for later use, make sure you handle url identities +properly. +For example: + https://steve.myopenid.com/ + https://steve.myopenid.com + http://steve.myopenid.com/ + http://steve.myopenid.com + ... are representing one single user. Some OpenIDs can be in format openidserver.com/users/user/ - keep this in mind when storing identities + + To help you store an OpenID in your DB, you can use function: + $openid_db_safe = $openid->OpenID_Standarize($upenid); + This may not be comatible with current specs, but it works in current enviroment. Use this function to get openid + in one format like steve.myopenid.com (without trailing slashes and http/https). + Use output to insert Identity to database. Don't use this for validation - it may fail. + +*/ + +class SimpleOpenID{ + var $openid_url_identity; + var $openid_url_type; + var $openid_url_orig; + var $URLs = array(); + var $error = array(); + var $fields = array(); + + function SimpleOpenID(){ + if (!function_exists('curl_exec')) { + die('Error: Class SimpleOpenID requires curl extension to work'); + } + } + function SetOpenIDServer($a){ + $this->URLs['openid_server'] = $a; + } + function SetTrustRoot($a){ + $this->URLs['trust_root'] = $a; + } + function SetCancelURL($a){ + $this->URLs['cancel'] = $a; + } + function SetApprovedURL($a){ + $this->URLs['approved'] = $a; + } + function SetPolicyURL($a) { + $this->URLs['policyurl'] = $a; + } + function SetRequiredFields($a){ + if (is_array($a)){ + $this->fields['required'] = $a; + }else{ + $this->fields['required'][] = $a; + } + } + function SetOptionalFields($a){ + if (is_array($a)){ + $this->fields['optional'] = $a; + }else{ + $this->fields['optional'][] = $a; + } + } + function SetIdentity($a){ // Set Identity URL + $this->openid_url_orig = $a; + $this->openid_url_type = 1; + + $xriprefixes = array("xri://", "xri://\$ip*", "xri://\$dns*"); + $inameprefixes = array("=", "@", "+", "$", "!"); + + foreach ($inameprefixes as $prefix) { + if (substr($a, 0, 1) == $prefix) { + $this->openid_url_type = 2; + $this->openid_url_identity = $a; + return; + } + } + foreach ($xriprefixes as $prefix) { + if(substr($a, 0, strlen($prefix)) == $prefix) { + $a = substr($a, strlen($prefix), strlen($a)-strlen($prefix)); + $this->openid_url_type = 2; + $this->openid_url_identity = $a; + return; + } + } + if(substr($a, 0, 7) != 'http://') { + $a = 'http://'.$a; + // RS change - append a slash - Wordpress example remysharp.wordpress.com - not found + slash = ok. + if (substr($a, -1) != '/') $a .= '/'; + $this->openid_url_type = 1; + $this->openid_url_identity = $a; + return; + } + $this->openid_url_identity = $a; + } + function GetIdentity(){ // Get Identity + return $this->openid_url_identity; + } + function GetError(){ + $e = $this->error; + return array('code'=>$e[0],'description'=>$e[1]); + } + + function ErrorStore($code, $desc = null){ + $errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server using this identity.'; + if ($desc == null){ + $desc = $errs[$code]; + } + $this->error = array($code,$desc); + } + + function IsError(){ + if (count($this->error) > 0){ + return true; + }else{ + return false; + } + } + + function splitResponse($response) { + $r = array(); + $response = explode("\n", $response); + foreach($response as $line) { + $line = trim($line); + if ($line != "") { + @list($key, $value) = explode(":", $line, 2); + $r[trim($key)] = trim($value); + } + } + return $r; + } + + function OpenID_Standarize($openid_identity){ + if ($this->openid_url_type == 2) { + return $openid_identity; + } + + $u = parse_url(strtolower(trim($openid_identity))); + if ($u['path'] == '/'){ + $u['path'] = ''; + } + if(substr($u['path'],-1,1) == '/'){ + $u['path'] = substr($u['path'], 0, strlen($u['path'])-1); + } + if (isset($u['query'])){ // If there is a query string, then use identity as is + return $u['host'] . $u['path'] . '?' . $u['query']; + }else{ + return $u['host'] . $u['path']; + } + } + + function array2url($arr){ // converts associated array to URL Query String + if (!is_array($arr)){ + return false; + } + $query = ''; + foreach($arr as $key => $value){ + $query .= $key . "=" . $value . "&"; + } + return $query; + } + function CURL_Request($url, $method="GET", $params = "") { // Remember, SSL MUST BE SUPPORTED + if (is_array($params)) $params = $this->array2url($params); + + if ($this->openid_url_type == 2) { $url = 'http://xri.net/'.$url; } + + if ($method == 'GET' && $params != '') { + // mod the URL - but first check whether there's existing args - RS change + if (stripos($url, '?')) { + $url .= '&' . $params; + } else { + $url .= '?' . $params; + } + } + + $curl = curl_init($url); + + @curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_HTTPGET, ($method == "GET")); + curl_setopt($curl, CURLOPT_POST, ($method == "POST")); + + if ($this->openid_url_type == 2) { + $headers = array("Accept: application/xrds+xml"); + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + } + + if ($method == "POST") curl_setopt($curl, CURLOPT_POSTFIELDS, $params); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($curl); + + if (curl_errno($curl) == 0){ + $response; + }else{ + $this->ErrorStore('OPENID_CURL', curl_error($curl)); + } + return $response; + } + + function HTML2OpenIDServer($content) { + $get = array(); + // Get details of their OpenID server and (optional) delegate + $reg1 = '/]*rel="openid.server"[^>]*href="([^"]+)"[^>]*\/?>/i'; + $reg2 = '/]*href="([^"]+)"[^>]*rel="openid.server"[^>]*\/?>/i'; + + preg_match_all($reg1, $content, $matches1); + preg_match_all($reg1, $content, $matches2); + + // match on non-xhtml - RS change + preg_match_all(preg_replace('/"/', "'", $reg1), $content, $matches3); + preg_match_all(preg_replace('/"/', "'", $reg2), $content, $matches4); + + $servers = array_merge($matches1[1], $matches2[1], $matches3[1], $matches4[1]); + + $reg1 = '/]*rel="openid.delegate"[^>]*href="([^"]+)"[^>]*\/?>/i'; + $reg2 = '/]*href="([^"]+)"[^>]*rel="openid.delegate"[^>]*\/?>/i'; + + preg_match_all($reg1, $content, $matches1); + preg_match_all($reg2, $content, $matches2); + preg_match_all(preg_replace('/"/', "'", $reg1), $content, $matches3); + preg_match_all(preg_replace('/"/', "'", $reg2), $content, $matches4); + $delegates = array_merge($matches1[1], $matches2[1], $matches3[1], $matches4[1]); + + if (count($servers) == 0 && count($delegates) == 0) { + preg_match_all('/]*http-equiv="X-XRDS-Location"[^>]*content="([^"]+)"[^>]*\/>/i', $content, $matches3); + preg_match_all('/]*content="([^"]+)"[^>]*http-equiv="X-XRDS-Location"[^>]*\/>/i', $content, $matches4); + if ($matches3[1][0] != "") { $url = $matches3[1][0]; } + else if ($matches4[1][0] != "") { $url = $matches4[1][0]; } + if ($url != "") { + $response = $this->CURL_Request($url); + list($servers, $delegates) = $this->XRDS2OpenIDServer($response); + } + } + + $ret = array($servers, $delegates); + return $ret; + } + + function XRDS2OpenIDServer($content) { + $arrcon = explode("\n", $content); + $services = array(); + $delegates = array(); + $i=0; + while ($i < count($arrcon)) { + if (substr(trim($arrcon[$i]),0,8) == "]*>([^<]+)<\/URI>/i', $service, $matches1); + preg_match_all('/]*>([^<]+)<\/openid:Delegate>/i', $service, $matches2); + } + } + $servers = $matches1[1]; + $delegates = $matches2[1]; + $ret = array($servers, $delegates); + return $ret; + } + + function CheckHeadersForXRDS($content) { + $arrcon = explode("\n", $content); + $i = 0; + while ($i < count($arrcon)) { + if (substr($arrcon[$i],0,16) == "X-XRDS-Location:") { + $keyval = explode(':', $arrcon[$i], 2); + $newurl = trim($keyval[1]); + return $newurl; + } + $i++; + } + return ""; + } + + function GetOpenIDServer(){ + $response = $this->CURL_Request($this->openid_url_identity); + $xrds_url = $this->CheckHeadersForXRDS($response); + if ($xrds_url != "") { + $response = $this->CURL_Request($xrds_url); + list($servers, $delegates) = $this->XRDS2OpenIDServer($response); + } + else if ($this->openid_url_type == 1) { + list($servers, $delegates) = $this->HTML2OpenIDServer($response); + } + else if ($this->openid_url_type == 2) { + list($servers, $delegates) = $this->XRDS2OpenIDServer($response); + } + + if (count($servers) == 0){ + $this->ErrorStore('OPENID_NOSERVERSFOUND'); + return false; + } + if ($delegates[0] != ""){ + $this->openid_url_identity = $delegates[0]; + } + $this->SetOpenIDServer($servers[0]); + return $servers[0]; + } + + function GetRedirectURL(){ + $params = array(); + $params['openid.return_to'] = urlencode($this->URLs['approved']); + $params['openid.mode'] = 'checkid_setup'; + $params['openid.identity'] = urlencode($this->openid_url_identity); + $params['openid.trust_root'] = urlencode($this->URLs['trust_root']); + + if (count($this->fields['required']) > 0){ + $params['openid.sreg.required'] = implode(',',$this->fields['required']); + } + if (count($this->fields['optional']) > 0){ + $params['openid.sreg.optional'] = implode(',',$this->fields['optional']); + } + $params['openid.sreg.policy_url'] = urlencode($this->URLs['policyurl']); + + $join = stripos($this->URLs['openid_server'], '?') ? '&' : '?'; + + return $this->URLs['openid_server'] . $join. $this->array2url($params); + } + + function Redirect(){ + $redirect_to = $this->GetRedirectURL(); + if (headers_sent()){ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe) + echo ''; + }else{ // Default Header Redirect + header('Location: ' . $redirect_to); + } + } + + function ValidateWithServer(){ + $params = array( + 'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']), + 'openid.signed' => urlencode($_GET['openid_signed']), + 'openid.sig' => urlencode($_GET['openid_sig']) + ); + // Send only required parameters to confirm validity + $arr_signed = explode(",",str_replace('sreg.','sreg_',$_GET['openid_signed'])); + for ($i=0; $iGetOpenIDServer(); + + // print "
";
+    // print_r($_GET);
+    // print_r($params);
+    // print_r($openid_server);
+    // print "
"; + + if ($openid_server == false){ + return false; + } + // RS change - GET => POST http://openid.net/specs/openid-authentication-1_1.html#mode_check_authentication + $response = $this->CURL_Request($openid_server,'POST',$params); + $data = $this->splitResponse($response); + + + if ($data['is_valid'] == "true") { + return true; + }else{ + return false; + } + } + +} + +?> \ No newline at end of file diff --git a/inc/admin.class.php b/inc/admin.class.php new file mode 100644 index 0000000..33071a6 --- /dev/null +++ b/inc/admin.class.php @@ -0,0 +1,104 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: admin.class.php 57 2009-07-10 19:34:56Z genuineparts $ +*/ + +$module["admin"]["name"]="Admin Class"; +$module["admin"]["ver"]="0.2.4"; +class admin { + + var $module_=array(); + + function create_admin_nav(){ + global $config, $db, $panel, $core, $session; + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + include_once dirname(dirname(__FILE__)).'/class_templates/admin_module.template.php'; + foreach($core->mod_ as $key=>$val){ + if(file_exists($root."/modules/".$val["file"]."/" . $val["file"] . ".module.php")){ + include_once $root.'/modules/'.$val["file"].'/' . $val["file"]. '.module.php'; + $class="module_".$val["file"]; + if(class_exists($class)){ + $this->module_[$val["file"]] = new $class(); + if(is_array($this->module_[$val["file"]]->admin_panels())){ + if($session->userdata[$val["file"].'_admin']==1){ + $panel->menu_item("group_only",$val["name"]); + foreach($this->module_[$val["file"]]->admin_panels() as $key => $val){ + if(isset($val[2])){ + $panel->menu_item($val[0],$val[1],$val[2]); + }else{ + $panel->menu_item($val[0],$val[1]); + } + } + } + } + } + } + } + + } + + function get_panel($task){ + global $config, $panel, $userinfo, $tpl, $error, $session, $meta, $mod; + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + if (strpos($task, '://') !== FALSE || strpos($task, '../') !== FALSE){ + $panel->content="Unser System hat festgestellt das ein XSS Versuch erfolgt ist.
Wir haben alle Daten geloggt und eine E-Mail an den Administrator wurde versandt.
Im übrigen kannst du deine Versuche aufgeben XSS und SQL-Injections werden IMMER abgefangen."; + $panel->title="Fehler."; + $panel->parse_page(); + return; + }else{ + $module=explode("_",$task,2); + if(isset($module[1]) && $module[1]!=""){ + $right=$module[1]; + $include=$root."/modules/".$module[1]."/admin/" . $module[0] . ".apnl.php"; + }else{ + $right=$task; + $include=$root."/admin/".$task . ".apnl.php"; + } + if($session->userdata[$right.'_admin']==1){ + if(file_exists($include)){ + include $include; + include_once dirname(dirname(__FILE__)).'/class_templates/admin_module.template.php'; + $class=$task."_panel"; + if(class_exists($class)){ + $content = new $class(); + $content->output(); + $panel->meta.= $content->meta(); + $panel->parse_page(); + } + }else{ + $panel->content="Das Panel konnte nicht gefunden werden."; + $panel->title="Fehler."; + $panel->parse_page(); + } + }else{ + $panel->content="You have not the necessary rights to view this page."; + $panel->title="Error."; + $panel->parse_page(); + } + } + } + +} +?> diff --git a/inc/ajax.class.php b/inc/ajax.class.php new file mode 100644 index 0000000..280d401 --- /dev/null +++ b/inc/ajax.class.php @@ -0,0 +1,111 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: ajax.class.php 31 2009-06-20 20:41:07Z genuineparts $ +*/ + +$module["core"]["name"]="Ajax Class"; +$module["core"]["ver"]="0.6.0"; + +use Smarty\Smarty; + +class ajax{ + var $db; + var $log; + var $tpl; + + function __construct(& $db,& $log,& $tpl) { + global $config; + $this->log = & $log; + $this->db = & $db; + $this->tpl = & $tpl; + } + + + function get_ajax_module($task,$subtask=""){ + global $config, $userdata, $core, $db, $userinfo, $tpl, $error, $session, $meta, $mod, $plugin; + include dirname(dirname(__FILE__)).'/class_templates/ajax_module.template.php'; + $content=""; + if (strpos($task, '://') !== FALSE || strpos($task, '../') !== FALSE){ + $this->tpl->assign('messagetitle',"Intruder Alert!"); + $this->tpl->assign('message', "Unser System hat festgestellt das ein XSS Versuch erfolgt ist.
Wir haben alle Daten geloggt und eine E-Mail an den Administrator wurde versandt."); + if($config["logging"]) + $this->log->write("XSS ATTACK: Someone tried calling ".$task."!",1); + + return $tpl->fetch('message.tpl',"INTRUDER"); + }elseif((file_exists("modules/".$task."/" . $task . ".ajax.php") && is_array($core->mod_[$task]) )|| $task==""){ + if($task!=""){ + include 'modules/'.$task.'/' . $task. '.ajax.php'; + + if(class_exists($task)){ + $mod = new $task(); + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + if(isset($config["theme"]) && is_dir($root . '/modules/'.$task.'/templates/'.$config["theme"]) && !$mod -> uses_default_templates){ + $mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/'.$config["theme"]); + }elseif($mod -> uses_default_templates){ + if(isset($config["theme"]) && is_dir($root . '/themes/'.$config["theme"])){ + $mod -> tpl-> setTemplateDir($root . '/themes/'.$config["theme"]); + + }else{ + $mod -> tpl-> setTemplateDir($root . '/themes/default'); + } + }else{ + $mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/default'); + } + + if($subtask!=""){ + $subtask="sub_".$subtask; + + if(!is_callable(array($mod,$subtask))){ + if($config["logging"]) + $this->log->write("FATAL ERROR: Modul ".$task." was found, but does not contain FUNCTION ".$subtask."!",1); + + return $error->http_error("404"); + }else{ + $content.=$mod->$subtask(); + } + }else{ + $content.=$mod->ajax(); + } + }else{ + if($config["logging"]) + $this->log->write("FATAL ERROR: Modul ".$task." was found, but does not contain CLASS ".$task."!",1); + + return $error->http_error("404"); + } + } + + }else{ + if($config["logging"]) + $this->log->write("Modul ".$task." not found!",2); + + return $error->http_error("404"); + + } + echo $content; + } + + +} +?> diff --git a/inc/cache.class.php b/inc/cache.class.php new file mode 100644 index 0000000..0a2c7e1 --- /dev/null +++ b/inc/cache.class.php @@ -0,0 +1,101 @@ + + * @package beFramed Core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +/* +Already defined by PHP. I'll leave it here for Info +define("LOG_EMERG", 0); +define("LOG_ALERT", 1); +define("LOG_CRIT", 2); +define("LOG_ERR", 3); +define("LOG_WARNING", 4); +define("LOG_INFO", 6); +define("LOG_DEBUG", 7); +*/ +$module["cache"]["name"]="Cache Class"; +$module["cache"]["ver"]="0.9.10"; +class cache { + var $server; + var $prefix; + var $obj; + var $port; + var $exp; + ///////////////////////////////////////// + // Module data + ///////////////////////////////////////// + + // + // __construct + // + // Buid logger + // + function __construct() { + global $config, $logger; + $this->server=$config['MEMCACHE_SERVER']; + $this->port=$config['MEMCACHE_PORT']; + $this->prefix=$config['MEMCACHE_PREFIX']; + $this->exp=$config['MEMCACHE_EXPIRATION']; + $this->obj = new Memcached($this->prefix); + $con = $this->connect($this->server,$this->port); + if(!$con){ + return false; + }else{ + return true; + } + + + } + + public function connect($host , $port){ + $servers = $this->obj->getServerList(); + if(is_array($servers)) { + foreach ($servers as $server) { + if($server['host'] == $host and $server['port'] == $port){ + return true; + } else { + return $this->obj->addServer($host , $port); + } + } + } + } + + function __destruct() { + $this->obj->quit(); + } + + function set($key,$var,$expiration=null){ + if($expriation=null){ + $expriation=$this->exp; + } + $this->obj->set($this->prefix.$key,$var,$expiration); + } + + + function get($key){ + return $this->obj->get($this->prefix.$key); + } + +} +?> diff --git a/inc/captcha.class.php b/inc/captcha.class.php new file mode 100644 index 0000000..fe9bcd7 --- /dev/null +++ b/inc/captcha.class.php @@ -0,0 +1,109 @@ +mCaptcha authorization token.Instructions.
'; + } else if ($config['captcha']==2) { + return '
'; + } else { + return ''; + } + } + + function validate($response){ + global $config,$functions; + if($config['captcha']==1) { + if(isset($response['mcaptcha__token']) && $response['mcaptcha__token']!=''){ + $token = $response['mcaptcha__token']; + } else { + return false; + } + $data = array( + 'token' => $token, + 'key' => $config['mcaptcha_sitekey'], + 'secret' => $config['mcaptcha_secret'] + ); + $json = json_encode($data); + $url = 'https://'.$config['mcaptcha_url'].'/api/v1/pow/siteverify'; + $ch = curl_init($url); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($ch, CURLOPT_POSTFIELDS, $json); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen($json) + )); + $fh=curl_exec($ch); + + // schlieĂźe den cURL-Handle und gebe die Systemresourcen frei + curl_close($ch); + if(!$fh){ + return false; + }else{ + $cresp = json_decode($fh, true); + if($cresp["valid"] === true){ + return true; + }else{ + return false; + } + } + }else if($config['captcha']==2) { + if(isset($response['g-recaptcha-response']) && $response['g-recaptcha-response']!=''){ + $data = $response['g-recaptcha-response']; + } else { + return false; + } + $ch = curl_init(); + + // setze die URL und andere Optionen + curl_setopt($ch, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify?secret=".$config['recaptcha_secret']."&response=".$data."&remoteip=".$functions->get_ip()); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + // fĂĽhre die Aktion aus und gebe die Daten an den Browser weiter + $fh=curl_exec($ch); + + // schlieĂźe den cURL-Handle und gebe die Systemresourcen frei + curl_close($ch); + if(!$fh){ + return false; + }else{ + $cresp = json_decode($fh, true); + if($cresp["success"] === true){ + return true; + }else{ + return false; + } + } + } else { + return true; + } + } +} +?> diff --git a/inc/config.default.inc.php b/inc/config.default.inc.php new file mode 100644 index 0000000..e287de3 --- /dev/null +++ b/inc/config.default.inc.php @@ -0,0 +1,44 @@ + diff --git a/inc/core.class.php b/inc/core.class.php new file mode 100644 index 0000000..980abaa --- /dev/null +++ b/inc/core.class.php @@ -0,0 +1,706 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: core.class.php 154 2012-03-27 21:50:46Z genuineparts $ +*/ + +$module['core']['name']='Core Class'; +$module['core']['ver']='0.9.81'; + +class Core{ + + /** + * + * Database Connection + * + * @var object + */ + var $db; + + /** + * + * Logging Class + * + * @var object + */ + var $log; + + /** + * + * Template Class + * + * @var object + */ + var $tpl; + + /** + * + * loaded Modules + * + * @var array + */ + var $mod_=array(); + + /** + * + * Sidebar Modules + * + * @var array + */ + var $nav=array(); + + /** + * + * Major Version + * + * @var string + */ + var $ver_major='1'; + + /** + * + * Minor Version + * + * @var string + */ + var $ver_minor='0'; + + /** + * + * Revision + * + * @var string + */ + var $ver_rev='0'; + + /** + * + * Codename + * + * @var string + */ + var $ver_codename='Antiochos'; + + /** + * + * Navbits + * + * @var array + */ + var $navbits=array(); + + /** + * Constructor + * + * @param Database + * @param Log + * @param Template + */ + function __construct(& $db,& $log,& $tpl) { + global $config; + $this->log = & $log; + $this->db = & $db; + $this->tpl = & $tpl; + $this->nav['left']=TRUE; + $this->nav['right']=TRUE; + $this -> add_navbit($config['sitetitle'],$config['path'].'/index.php'); + } + + /** + * Loads all installed modules from the database + * + */ + function load_modules(){ + global $config, $db; + $result = $db->query("SELECT * FROM " . $config['prefix'] . "module"); + while ($row = $db->fetch_array($result)){ + $this->mod_[$row['file']] = $row; + } + + } + + /** + * Creates the Sidebar + * + * @param string The side for which the Content should be rendered (l=left, r=right) + * @return false|string + */ + function create_nav($side){ + global $config, $cache, $db, $session, $lang, $plugin; + $navrow = ''; + $navtpl= $this->tpl; + $root = $_SERVER['DOCUMENT_ROOT'] . $config['path']; + if($navtpl-> isCached('navmain.tpl','navmain'.$side)){ + $compilednav = $navtpl-> fetch('navmain.tpl','navmain'.$side); + return $compilednav; + }else{ + $nav = $cache->read('sidebar'); + if($nav==FALSE){ + $cache->update_sidebars(); + $nav = $cache->read('sidebar'); + } + if($nav[$side] != NULL){ + foreach($nav[$side] as $row){ + $nav_title = $row['name']; + $nav_content = $row['content']; + $nav_file = $row['file']; + if($nav_file == ''){ + preg_match_all ('{right=\"(?P.*?)\"}',$nav_content,$regs); + if(is_array($regs)){ + foreach($regs['value'] as $reg){ + if($session->userdata[$reg]){ + $nav_content=preg_replace("/\{right=\"".$reg."\"\}(.*?)\{\/right\}/si","\\1",$nav_content); + }else{ + $nav_content=preg_replace("/\{right=\"".$reg."\"\}(.*?)\{\/right\}/si","",$nav_content); + } + } + } + + if($session->userdata['uid']!=0){ + $nav_content=preg_replace("/\{logged_in\}(.*?)\{\/logged_in\}/si","\\1",$nav_content); + $nav_content=preg_replace("/\{logged_out\}(.*?)\{\/logged_out\}/si","",$nav_content); + }else{ + $nav_content=preg_replace("/\{logged_in\}(.*?)\{\/logged_in\}/si","",$nav_content); + $nav_content=preg_replace("/\{logged_out\}(.*?)\{\/logged_out\}/si","\\1",$nav_content); + } + if($session->userdata['allow_grimdark']!=0){ + $nav_content=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","\\1",$nav_content); + }else{ + $nav_content=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","",$nav_content); + } + + if(trim($nav_content)!=''){ + $navtpl->assign('navtitle', $nav_title); + $navtpl->assign('navcontent', $nav_content); + $navrow .= $navtpl->fetch('nav.tpl'); + } + + + }elseif(file_exists($root.'/nav_modules/nav_' . $nav_file .'.php')){ + $navtpl->assign('navtitle', $nav_title); + $navtpl->assign('navcontent', $nav_content); + // include a Navigation Module. The Navigation Module MUST return a variable $navcontent + include($root.'/nav_modules/nav_' . $nav_file .'.php'); + } + } + + $navtpl->assign('nav', $navrow); + + if($side=='l'){ + $sidename='leftside'; + }else{ + $sidename='rightside'; + } + + $navtpl->assign('sidename', $sidename); + $compilednav = $navtpl->fetch('navmain.tpl','navmain'.$side); + $plugin->run_hook('nav_finish',array(&$compilednav)); + return $compilednav; + }else{ + return false; + } + } + + } + + /** + * Outputs a Message + * + * @param string $title The title of the message + * @param string $message The message + * @param bool $redirect Should the user be redirected + * @param string $url The redirect URL + * @param integer $time The Time in seconds until the user gets redirected + * @param bool $minimal Should the Sidebars not get rendered + * + */ + + function message($title,$message,$redirect=FALSE,$url='',$time=4,$minimal=FALSE,$fetch_page=TRUE){ + global $config, $userdata, $userinfo, $tpl, $session, $lang, $meta; + if(!isset($session->userdata) && $fetch_page){ + $session->page_begin('Message', FALSE); + } + + if($url!='' && $redirect){ + $tpl->assign('message', $message.'
'.$lang->_('CLICKREDIRECT').''); + }elseif($url!='' && !$redirect){ + $tpl->assign('message', $message.'
'.$lang->_('CLICKCONTINUE').''); + }else{ + $tpl->assign('message', $message); + } + $tpl->assign('messagetitle', $title); + if($redirect && $url!=''){ + if(substr( $url, 0, 4 ) != "http") { + $url = '//'.$config['domain'].$config['path'].$url; + } + $meta.=''; + } + $this->make_page($tpl->fetch('message.tpl'),$minimal); + + } + + /** + * Outputs a Message + * + * @deprec 0.8.60 - 2009/06/20 + * @param string $title The title of the message + * @param string $message The message + * @param bool $redirect Should the user be redirected + * @param string $url The redirect URL + * @param integer $time The Time in seconds until the user gets redirected + * + */ + function redirect_message($title,$message,$redirect=FALSE,$url='',$time=4){ + $this->message($title,$message,$redirect,$url,$time,TRUE); + } + + /** + * Adds a Navbit + * + * @param string $title The title of the navbit + * @param string $url The navbit url + * + */ + function add_navbit($title,$url=''){ + $this->navbits[]=array('name'=>$title,'url'=>$url); + } + + /** + * Clears Navbits + * + */ + function clear_navbits(){ + unset($this->navbits); + } + + /** + * get Navbits + * + * @returns string + * + */ + function get_navbits(){ + foreach($this->navbits as $key => $nav){ + if(isset($this->navbits[$key+1])){ + if($nav['url']==''){ + $bit=''.$nav['name'].''; + }else{ + $bit=''.$nav['name'].''; + } + }else{ + if($nav['url']==''){ + $bit=''.$nav['name'].''; + }else{ + $bit=''.$nav['name'].''; + } + } + + if(!$navs){ + $navs=$bit; + }else{ + $navs.=' / '.$bit; + } + } + + return $navs; + } + + /** + * Gets a module and renders the main content + * + * @param string $task The name of the module + * @param string $subtask The name of the subfunction + * @return void|string + * + */ + function get_module($task,$subtask=''){ + global $config, $userdata, $db, $cache, $tpl, $error, $session, $meta, $mod, $footer, $plugin; + $content=''; + include dirname(dirname(__FILE__)).'/class_templates/page_module.template.php'; + if (strpos($task, '://') !== FALSE || strpos($task, '../') !== FALSE){ + $tpl->assign('messagetitle','Intruder Alert!'); + $tpl->assign('message', 'The System has caught a possible attack. The Admins have been informed.'); + if($config['logging']) + $this->log->write('XSS ATTACK: Someone tried calling '.$task.'!',1); + + return $tpl->fetch('message.tpl','INTRUDER'); + }elseif((file_exists('modules/'.$task.'/' . $task . '.output.php') && is_array($this->mod_[$task]) )|| $task==''){ + if($config['startmodule'] == $task){ + $result=$db->query("SELECT * FROM `".$config['prefix']."navigation` WHERE `side`='m' ORDER BY `sort`"); + }else{ + $result=$db->query("SELECT * FROM `".$config['prefix']."navigation` WHERE `side`='m' AND `valid`='E' ORDER BY `sort`"); + } + while($row=$db->fetch_array($result)){ + + if($row['name']=='maincontent'){ + if($task!=''){ + include 'modules/'.$task.'/' . $task. '.output.php'; + if($config['logging']) + $this->log->write($task.' called.'); + + if(class_exists($task)){ + $mod = new $task(); + $mod->get=$_GET; + $mod->post=$_POST; + $mod->files=$_FILES; + $mod->request=$_REQUEST; + if(isset($_SESSION)){ + $mod->session=$_SESSION; + } + $mod->cookie=$_COOKIE; + $root = $_SERVER['DOCUMENT_ROOT'] . $config['path']; + if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/modules/'.$task.'/templates/'.$config['theme']) && !$mod -> uses_default_templates){ + $mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/'.$config['theme']); + }elseif($mod -> uses_default_templates){ + if(isset($config['theme']) && $config['theme']!='' && is_dir($root . '/themes/'.$config['theme'])){ + $mod -> tpl-> setTemplateDir($root . '/themes/'.$config['theme']); + + }else{ + $mod -> tpl-> setTemplateDir($root . '/themes/default'); + } + }else{ + $mod -> tpl-> setTemplateDir($root . '/modules/'.$task.'/templates/default'); + } + + $meta.= $mod->redirect; + if($subtask!=''){ + $submeta='meta_'.$subtask; + $subfooter='footer_'.$subtask; + $subtask='output_'.$subtask; + + if(!is_callable(array($mod,$subtask))){ + if($config['logging']) + $this->log->write('FATAL ERROR: Modul '.$task.' was found, but does not contain FUNCTION '.$subtask.'!',1); + + return $error->http_error('404'); + }else{ + if(!is_callable(array($mod,$submeta))){ + $meta.= $mod->meta(); + }else{ + $meta.= $mod->$submeta(); + } + if(!is_callable(array($mod,$subfooter))){ + $footer.= $mod->footer(); + }else{ + $footer.= $mod->$subfooter(); + } + $content.=$mod->$subtask(); + } + }else{ + $meta.= $mod->meta(); + $footer.= $mod->footer(); + $content.=$mod->output(); + } + }else{ + if($config['logging']) + $this->log->write('FATAL ERROR: Modul '.$task.' was found, but does not contain CLASS '.$task.'!',1); + + return $error->http_error('404'); + } + } + }else{ + if($row['file']!=''){ + $file_content=$plugin->run_hook($row['file'],array(&$tpl)); + $content.=$file_content; + }else{ + preg_match_all ('{right=\"(?P.*?)\"}',$row['content'],$regs); + if(is_array($regs)){ + foreach($regs['value'] as $reg){ + if($session->userdata[$reg]){ + $nav_content=preg_replace("/\{right=\"".$reg."\"\}(.*?)\{\/right\}/si","\\1",$row['content']); + }else{ + $nav_content=preg_replace("/\{right=\"".$reg."\"\}(.*?)\{\/right\}/si","",$row['content']); + } + } + } + $session->page_begin('content', false); + if($session->userdata['uid']!=0){ + $row['content']=preg_replace("/\{logged_in\}(.*?)\{\/logged_in\}/si","\\1",$row['content']); + $row['content']=preg_replace("/\{logged_out\}(.*?)\{\/logged_out\}/si","",$row['content']); + }else{ + $row['content']=preg_replace("/\{logged_in\}(.*?)\{\/logged_in\}/si","",$row['content']); + $row['content']=preg_replace("/\{logged_out\}(.*?)\{\/logged_out\}/si","\\1",$row['content']); + } + if($session->userdata['allow_grimdark']!=0){ + $row['content']=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","\\1",$row['content']); + }else{ + $row['content']=preg_replace("/\{allow_gd\}(.*?)\{\/allow_gd\}/si","",$row['content']); + } + $content.=$row['content']; + } + } + } + }else{ + if($config['logging']) + $this->log->write('Modul '.$task.' not found!',2); + + return $error->http_error('404'); + } + $this->make_page($content); + } + + function makeDownload($file, $dir, $type) { + $fullPath=$dir.$file; + // Must be fresh start + if( headers_sent()) + die('Headers Sent'); + + // Required for some browsers + if(ini_get('zlib.output_compression')) + ini_set('zlib.output_compression', 'Off'); + + // File Exists? + + if( file_exists($fullPath) ){ + + // Parse Info / Get Extension + $fsize = filesize($fullPath); + $path_parts = pathinfo($fullPath); + $ext = strtolower($path_parts["extension"]); + + // Determine Content Type + switch ($ext) { + case "pdf": $ctype="application/pdf"; break; + case "exe": $ctype="application/octet-stream"; break; + case "zip": $ctype="application/zip"; break; + case "doc": $ctype="application/msword"; break; + case "xls": $ctype="application/vnd.ms-excel"; break; + case "ppt": $ctype="application/vnd.ms-powerpoint"; break; + case "apk": $ctype='application/vnd.android.package-archive'; break; + case "gif": $ctype="image/gif"; break; + case "png": $ctype="image/png"; break; + case "jpeg": + case "jpg": $ctype="image/jpg"; break; + default: $ctype="application/force-download"; + } + + header("Pragma: no-cache"); // required + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT\n"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Content-Description: File Transfer"); + header("Cache-Control: no-cache, no-store, must-revalidate, post-check=0, pre-check=0"); + header("Content-Type: $ctype"); + header("Content-Disposition: attachment; filename=\"".basename($fullPath)."\";" ); + header("Content-Transfer-Encoding: binary"); + header("Content-Length: ".$fsize); + ob_clean(); + readfile( $fullPath ); + flush(); + } else { + die('File Not Found'); + } + } + + /** + * Renders the Page + * + * @param string $content The content for the page + * @param bool $minimal Render the Page in a minaml mode (e.g. for redirect) + * @param string $minimal_tpl Custom minimal template + * @param string $header_tpl Custom header template + * @param string $footer_tpl Custom footer template + * @return void + * + */ + + function make_page($content, $minimal=FALSE,$minimal_tpl='minimal_index.tpl',$header_tpl='header.tpl',$footer_tpl='footer.tpl'){ + global $config, $session, $start, $tpl, $db, $meta, $footer, $mod, $plugin,$plugin_content; + $plugin->run_hook('frontpage_start',array(&$tpl)); + if($config['p3p_active']==1){ + header('P3P: CP="'.$config['p3p_string'].'"'); + } + $tpl -> assign("path",$config["path"]."/"); + $tpl -> assign("themepath",'/themes/'.$config['theme']); + $tpl -> assign('sitetitle', $config['sitetitle']); + if(isset($mod->titleaddon) && $mod->titleaddon!=''){ + $tpl -> assign('titleaddon', ' - '.$mod->titleaddon); + } + $tpl -> assign('navbits',$this -> get_navbits()); + $tpl -> assign('meta', $meta); + + if($header_tpl!=''){ + $header=$tpl->fetch($header_tpl); + $tpl -> assign('header', $header); + } + + if(!$minimal){ + if($this->nav['right']){ + $rightnav = $this->create_nav('r'); + $tpl -> assign('rightnav', $rightnav); + } + if($this->nav['left']){ + $leftnav = $this->create_nav('l'); + $tpl -> assign('leftnav', $leftnav); + } + $plugin->run_hook('frontpage_middle',array(&$tpl)); + $tpl -> assign('content', $content); + $tpl -> display('index.tpl'); + }else{ + $tpl -> assign('content', $content); + $tpl -> display($minimal_tpl); + } + $tpl->assign('queries', $db->querys()); + $tpl->assign('user', $session->userdata); + $tpl->assign('memory', number_format((@memory_get_usage()/1048576),2).' Mb'); + $tpl->assign('version', $this->ver_major.'.'.$this->ver_minor.'.'.$this->ver_rev.' - '.$this->ver_codename); + $tpl -> assign('footer', $footer); + $end = getTime(); + $tpl->assign('gentime',round($end - $start,4)); + if($footer_tpl!=''){ + $tpl->display($footer_tpl); + } + $plugin->run_hook('frontpage_end',array(&$tpl)); + exit(); + } + + /** + * Uploads a file + * + * @param string $filename The name for the file + * @param string $tmpname The name of the Temporary (read uploaded) File + * @param integer $maxwidth Maximal width of the image + * @param integer $maxheight Maximal height of the image + * @param bool $resize Resize the image if its bigger + * @param bool $keep_ratio Keep the Height to Width ratio when resizing + * @return bool|string + * + */ + function upload_file($filename, $tmpname, $maxwidth=160, $maxheight=160, $resize=FALSE, $keep_ratio=TRUE){ + global $config, $lang; + if(file_exists($tmpname)){ + $sizes = getimagesize($tmpname); + $aspect_ratio = $sizes[1]/$sizes[0]; + if ($sizes[1] <= $maxheight && $sizes[0] <= $maxwidth){ + $new_width = $sizes[0]; + $new_height = $sizes[1]; + }elseif(!$resize){ + return sprintf($lang->_('PICSIZE'),$maxwidth,$maxheight); + }elseif($keep_ratio){ + $new_height = $maxheight; + $new_width = abs($new_height/$aspect_ratio); + if($new_width > $maxwidth){ + $new_width = $maxwidth; + $new_height = abs($new_width*$aspect_ratio); + } + }else{ + $new_width = $maxwidth; + $new_height = $maxheight; + } + + $destimg=ImageCreateTrueColor($new_width,$new_height); + + if(!$destimg) + return $lang->_('PICNOCREATE'); + + /** + * + * Needed to fix PNG Background Transparency + */ + imagealphablending($destimg, false); + imagesavealpha($destimg, true); + + $srcimg= $this->imagecreatefromfile($tmpname); + + if(!$srcimg) + return $lang->_('PICNOCREATE'); + + $cpy=ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)); + + if(!$cpy) + return $lang->_('NORESIZE'); + + $out=$this->imageoutput($sizes[2],$destimg,$filename); + + if(!$out) + return $lang->_('CANTSAVEPIC'); + + imagedestroy($destimg); + imagedestroy($srcimg); + return TRUE; + }else{ + return $tmpname.' - '.$lang->_('FILENOEXIST'); + } + + } + + function imagecreatefromfile($path){ + $info = @getimagesize($path); + + if(!$info) + { + return false; + } + + $functions = array( + IMAGETYPE_GIF => 'imagecreatefromgif', + IMAGETYPE_JPEG => 'imagecreatefromjpeg', + IMAGETYPE_PNG => 'imagecreatefrompng', + IMAGETYPE_WBMP => 'imagecreatefromwbmp', + IMAGETYPE_XBM => 'imagecreatefromwxbm', + ); + + if(!$functions[$info[2]]) + { + return false; + } + + if(!function_exists($functions[$info[2]])) + { + return false; + } + + return $functions[$info[2]]($path); + } + + function imageoutput($userfile_type, $image, $imgout=NULL){ + + $functions = array( + IMAGETYPE_GIF => 'imagegif', + IMAGETYPE_JPEG => 'imagejpeg', + IMAGETYPE_PNG => 'imagepng', + IMAGETYPE_WBMP => 'imagewbmp', + IMAGETYPE_XBM => 'imagewxbm', + ); + + if(!$functions[$userfile_type]) + { + return false; + } + + if(!function_exists($functions[$userfile_type])) + { + return false; + } + + if($functions[$userfile_type]=='imagejpeg'){ + return $functions[$userfile_type]($image, $imgout,100); + }elseif($functions[$userfile_type]=='imagepng'){ + return $functions[$userfile_type]($image, $imgout,0); + }else{ + return $functions[$userfile_type]($image, $imgout); + } + + } +} +?> diff --git a/inc/datacache.class.php b/inc/datacache.class.php new file mode 100644 index 0000000..0d1ea7f --- /dev/null +++ b/inc/datacache.class.php @@ -0,0 +1,113 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +class datacache { + + var $data = array(); + var $expires = array(); + + function __construct(){ + global $config, $db; + $res=$db->query('SELECT `cache`,`content`,`expire` FROM `' . $config['prefix'] . 'datacache`'); + while($row=$db->fetch_object($res)){ + $this->data[$row->cache]=@unserialize(base64_decode($row->content)); + $this->expires[$row->cache]=$row->expire; + } + } + + //Fetch userdata + function read($cache){ + global $config, $db; + if(isset($this->data[$cache]) && $this->data[$cache]){ + return $this->data[$cache]; + }else{ + $res=$db->query('SELECT `cache`,`content` FROM `' . $config['prefix'] . 'datacache` WHERE `cache`=\''.$db->escape($cache).'\' LIMIT 1') or die($db->error()); + $row=$db->fetch_row($res); + if(!$row[0]){ + $data=false; + }else{ + $data = @unserialize(base64_decode($row[1])); + } + return $data; + } + + + } + + function set($name,$data,$expires=0){ + global $db,$config; + $data=base64_encode(serialize($data)); + $test=$this->read($name); + if($test){ + $res=$db->query('UPDATE `' . $config['prefix'] . 'datacache` SET `content`=\''.$data.'\',`expire`=\''.$expires.'\' WHERE `cache`=\''.$db->escape($name).'\''); + if($res){ + return true; + } + }else{ + $res=$db->query('INSERT INTO `' . $config['prefix'] . 'datacache` (`cache`,`content`,`expire`) VALUES (\''.$db->escape($name).'\',\''.$data.'\',\''.$expires.'\')'); + if($res){ + return true; + } + } + return false; + } + + function is_expired($name){ + global $db,$config; + if(isset($this->expires[$name])){ + if($this->expires[$name]expires[$name]!=0){ + return true; + }else{ + return false; + } + } + $res=$db->query('SELECT `cache` FROM `' . $config['prefix'] . 'datacache` WHERE `cache`=\''.$db->escape($name).'\' AND `expire`< \''.time().'\' AND `expire`<>\'0\' LIMIT 1'); + $row=$db->fetch_row($res); + if($row[0]){ + return true; + } + return false; + } + + function update_sidebars(){ + global $db,$config; + + $res = $db->query('SELECT `name`, `content`, `file` FROM `' . $config['prefix'] . 'navigation` WHERE `side`=\'l\' ORDER BY `sort`'); + while ($row=$db->fetch_row($res)){ + $nav['l'][]=array('name'=>$row[0],'content'=>$row[1],'file'=>$row[2]); + } + + $res = $db->query('SELECT `name`, `content`, `file` FROM `' . $config['prefix'] . 'navigation` WHERE `side`=\'r\' ORDER BY `sort`'); + while ($row=$db->fetch_row($res)){ + $nav['r'][]=array('name'=>$row[0],'content'=>$row[1],'file'=>$row[2]); + } + $this->set('sidebar',$nav); + } + +} +?> diff --git a/inc/error.class.php b/inc/error.class.php new file mode 100644 index 0000000..0d04234 --- /dev/null +++ b/inc/error.class.php @@ -0,0 +1,67 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +$module["error"]["name"]="Error Class"; +$module["error"]["ver"]="0.9.0"; + +class errorhandler{ + var $type; + + function http_error($type){ + global $core,$session; + $session->page_begin("Error", FALSE); + switch($type){ + case 401: + header("HTTP/1.1 401 Unauthorized"); + return $core->message('Error 401 - Nicht Authorisiert!', 'Du bist nicht Authorisiert um hierauf zuzugreifen.',FALSE); + break; + case 403: + header("HTTP/1.1 403 Forbidden"); + header("Status: 403 Forbidden"); + return $core->message("Error 403 - Verboten", "Der Zugriff ist Verboten.",FALSE); + break; + case 404: + default: + header("HTTP/1.1 404 Not Found"); + header("Status: 404 Not Found"); + return $core->message('Error 404 - Nicht gefunden', 'Die von Dir angeforderte Seite konnte nicht gefunden werden.
Wenn Du dies fĂĽr einen Fehler hältst informiere bitte das Team!',FALSE); + break; + case 500: + header("HTTP/1.1 500 Internal Server Error"); + header("Status: 500 Internal Server Error"); + header("Retry-After: 120"); + return $core->message('Error 500 - Interner Serverfehler', 'Der Server kann die Anfrage wegen eines Fehlers nicht beantworten.',FALSE); + break; + case 503: + header("HTTP/1.1 503 Service Temporarily Unavailable"); + header("Status: 503 Service Temporarily Unavailable"); + header("Retry-After: 120"); + return $core->message("Error 503 - Dienst nicht verfügbar", "Der Dienst ist zurzeit nicht verfügbar. Grund könnten Wartungsarbeiten oder Kapazitätsprobleme sein, bitte versuche es später erneut.",FALSE); + break; + } + } +} +?> \ No newline at end of file diff --git a/inc/functions.class.php b/inc/functions.class.php new file mode 100644 index 0000000..cbc19ca --- /dev/null +++ b/inc/functions.class.php @@ -0,0 +1,356 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: sessions.class.php 129 2010-02-21 22:04:51Z genuineparts $ +*/ +class functions { + + function my_inet_pton($ip) + { + if(function_exists('inet_pton')) + { + return @inet_pton($ip); + } + else + { + /** + * Replace inet_pton() + * + * @category PHP + * @package PHP_Compat + * @license LGPL - http://www.gnu.org/licenses/lgpl.html + * @copyright 2004-2007 Aidan Lister , Arpad Ray + * @link http://php.net/inet_pton + * @author Arpad Ray + * @version $Revision: 269597 $ + */ + $r = ip2long($ip); + if($r !== false && $r != -1) + { + return pack('N', $r); + } + + $delim_count = substr_count($ip, ':'); + if($delim_count < 1 || $delim_count > 7) + { + return false; + } + + $r = explode(':', $ip); + $rcount = count($r); + if(($doub = array_search('', $r, 1)) !== false) + { + $length = (!$doub || $doub == $rcount - 1 ? 2 : 1); + array_splice($r, $doub, $length, array_fill(0, 8 + $length - $rcount, 0)); + } + + $r = array_map('hexdec', $r); + array_unshift($r, 'n*'); + $r = call_user_func_array('pack', $r); + + return $r; + } + } + + /** + * Converts a packed internet address to a human readable representation + * + * @param string $ip IP in 32bit or 128bit binary format + * @return string IP in human readable format + */ + function my_inet_ntop($ip) + { + if(function_exists('inet_ntop')) + { + return @inet_ntop($ip); + } + else + { + /** + * Replace inet_ntop() + * + * @category PHP + * @package PHP_Compat + * @license LGPL - http://www.gnu.org/licenses/lgpl.html + * @copyright 2004-2007 Aidan Lister , Arpad Ray + * @link http://php.net/inet_ntop + * @author Arpad Ray + * @version $Revision: 269597 $ + */ + switch(strlen($ip)) + { + case 4: + list(,$r) = unpack('N', $ip); + return long2ip($r); + case 16: + $r = substr(chunk_split(bin2hex($ip), 4, ':'), 0, -1); + $r = preg_replace( + array('/(?::?\b0+\b:?){2,}/', '/\b0+([^0])/e'), + array('::', '(int)"$1"?"$1":"0$1"'), + $r); + return $r; + } + return false; + } + } + + function get_ip(){ + global $config; + $ip = strtolower($_SERVER['REMOTE_ADDR']); + + if($config['ip_forwarded_check']) + { + $addresses = array(); + + if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) + { + $addresses = explode(',', strtolower($_SERVER['HTTP_X_FORWARDED_FOR'])); + } + elseif(isset($_SERVER['HTTP_X_REAL_IP'])) + { + $addresses = explode(',', strtolower($_SERVER['HTTP_X_REAL_IP'])); + } + + if(is_array($addresses)) + { + foreach($addresses as $val) + { + $val = trim($val); + // Validate IP address and exclude private addresses + if($this->my_inet_ntop($this->my_inet_pton($val)) == $val && !preg_match("#^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|fe80:|fe[c-f][0-f]:|f[c-d][0-f]{2}:)#", $val)) + { + $ip = $val; + break; + } + } + } + } + + if(!$ip) + { + if(isset($_SERVER['HTTP_CLIENT_IP'])) + { + $ip = strtolower($_SERVER['HTTP_CLIENT_IP']); + } + } + + return $ip; + } + + function my_rand($min=0, $max=PHP_INT_MAX){ + // backward compatibility + if($min === null || $max === null || $max < $min) + { + $min = 0; + $max = PHP_INT_MAX; + } + + if(version_compare(PHP_VERSION, '7.0', '>=')) + { + try + { + $result = random_int($min, $max); + } catch (Exception $e) { + } + + if(isset($result)) + { + return $result; + } + } + + $seed = $this->secure_seed_rng(); + + $distance = $max - $min; + return $min + floor($distance * ($seed / PHP_INT_MAX) ); + } + + function random_str($length=8, $complex=false){ + $set = array_merge(range(0, 9), range('A', 'Z'), range('a', 'z')); + $str = array(); + + // Complex strings have always at least 3 characters, even if $length < 3 + if($complex == true) + { + // At least one number + $str[] = $set[$this->my_rand(0, 9)]; + + // At least one big letter + $str[] = $set[$this->my_rand(10, 35)]; + + // At least one small letter + $str[] = $set[$this->my_rand(36, 61)]; + + $length -= 3; + } + + for($i = 0; $i < $length; ++$i) + { + $str[] = $set[$this->my_rand(0, 61)]; + } + + // Make sure they're in random order and convert them to a string + shuffle($str); + + return implode($str); + } + + function secure_seed_rng(){ + $bytes = PHP_INT_SIZE; + + do + { + + $output = $this->secure_binary_seed_rng($bytes); + + // convert binary data to a decimal number + if ($bytes == 4) + { + $elements = unpack('i', $output); + $output = abs($elements[1]); + } + else + { + $elements = unpack('N2', $output); + $output = abs($elements[1] << 32 | $elements[2]); + } + + } while($output > PHP_INT_MAX); + + return $output; + } + + function secure_binary_seed_rng($bytes){ + $output = null; + + if(version_compare(PHP_VERSION, '7.0', '>=')) + { + try + { + $output = random_bytes($bytes); + } catch (Exception $e) { + } + } + + if(strlen($output) < $bytes) + { + if(@is_readable('/dev/urandom') && ($handle = @fopen('/dev/urandom', 'rb'))) + { + $output = @fread($handle, $bytes); + @fclose($handle); + } + } + else + { + return $output; + } + + if(strlen($output) < $bytes) + { + if(function_exists('mcrypt_create_iv')) + { + if (DIRECTORY_SEPARATOR == '/') + { + $source = MCRYPT_DEV_URANDOM; + } + else + { + $source = MCRYPT_RAND; + } + + $output = @mcrypt_create_iv($bytes, $source); + } + } + else + { + return $output; + } + + if(strlen($output) < $bytes) + { + if(function_exists('openssl_random_pseudo_bytes')) + { + // PHP <5.3.4 had a bug which makes that function unusable on Windows + if ((DIRECTORY_SEPARATOR == '/') || version_compare(PHP_VERSION, '5.3.4', '>=')) + { + $output = openssl_random_pseudo_bytes($bytes, $crypto_strong); + if ($crypto_strong == false) + { + $output = null; + } + } + } + } + else + { + return $output; + } + + if(strlen($output) < $bytes) + { + if(class_exists('COM')) + { + try + { + $CAPI_Util = new COM('CAPICOM.Utilities.1'); + if(is_callable(array($CAPI_Util, 'GetRandom'))) + { + $output = $CAPI_Util->GetRandom($bytes, 0); + } + } catch (Exception $e) { + } + } + } + else + { + return $output; + } + + if(strlen($output) < $bytes) + { + // Close to what PHP basically uses internally to seed, but not quite. + $unique_state = microtime().@getmypid(); + + $rounds = ceil($bytes / 16); + + for($i = 0; $i < $rounds; $i++) + { + $unique_state = md5(microtime().$unique_state); + $output .= md5($unique_state); + } + + $output = substr($output, 0, ($bytes * 2)); + + $output = pack('H*', $output); + + return $output; + } + else + { + return $output; + } + } +} \ No newline at end of file diff --git a/inc/lang.class.php b/inc/lang.class.php new file mode 100644 index 0000000..feade45 --- /dev/null +++ b/inc/lang.class.php @@ -0,0 +1,82 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +$module["lang"]["name"]="Language Class"; +$module["lang"]["ver"]="0.1.1"; + +class lang{ + var $langname=array('de'=>'Deutsch','en'=>'English'); + var $language; + var $languagedir; + var $lf; + + function __construct($languagedir='/languages/'){ + $this->languagedir = dirname(dirname(__FILE__)).'/languages/'; + } + + function setlang($language){ + global $config, $error, $db, $log, $core, $plugin, $lang; + unset($this->language); + unset($this->lf); + if(!$language || $language==''){ + $language=$config['lang']; + if(!$language){ + $this->language='en'; + }else{ + $this->language=$language; + } + }else{ + $this->language=$language; + } + include_once $this->languagedir.$this->language.'.lang.php'; + $this->lf=$lf; + } + + function getlanguages(){ + $langdir = $this->languagedir; + $langs = opendir($langdir); + $i=0; + while ($lang = readdir($langs)) { + if (preg_match('/^.*?\.lang.php$/', $lang)) { + $langfile[$i]['short']=substr($lang,0,2); + $langfile[$i]['name']=$this->langname[$langfile[$i]['short']]; + $i++; + } + } + @closedir($langs); + return($langfile); + } + + function _($string){ + if(isset($this->lf[$string])){ + return($this->lf[$string]); + }else{ + return($string); + } + } + +} +?> diff --git a/inc/logger.class.php b/inc/logger.class.php new file mode 100644 index 0000000..13b10f9 --- /dev/null +++ b/inc/logger.class.php @@ -0,0 +1,115 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: logger.class.php 91 2009-10-22 20:47:08Z genuineparts $ +*/ + +$module["logger"]["name"]="Logging Class"; +$module["logger"]["ver"]="0.2.1"; +/* +Already defined by PHP. I'll leave it here for Info +define("LOG_EMERG", 0); +define("LOG_ALERT", 1); +define("LOG_CRIT", 2); +define("LOG_ERR", 3); +define("LOG_WARNING", 4); +define("LOG_INFO", 6); +define("LOG_DEBUG", 7); +*/ + +class logger { + var $type="file"; + var $logfile; + var $level=LOG_ERR; + var $filelink; + + function __construct($type="file", $logfile='/logs/logfile.log', $level=LOG_INFO) { + global $core, $config, $db; + $this->type=$type; + $this->logfile=$logfile; + $this->level=$level; + switch($this->type){ + case "syslog": + openlog("astatlog", LOG_ODELAY , LOG_USER); + break; + case "SQL": + if(!is_object($db)){ + $this->type="file"; + $this->filelink=$this->open_file($this->logfile); + } + break; + case "file": + default: + if($this->logfile==""){ + $this->logfile='/logs/logfile.log'; + } + $this->filelink=$this->open_file($this->logfile); + break; + } + $this->write("File Logging instanziert.", LOG_DEBUG); + } + + function __destruct() { + $this->close($this->filelink); + } + + function open_file($file){ + global $core, $config, $db; + $filelink = fopen($file, "a"); + return $filelink; + } + + + function close(){ + if($this->type=="file") + fclose($this->filelink); + } + + function write($text,$level=LOG_INFO,$line="",$file=""){ + global $db, $config; + if($level<=$this->level){ + $timestamp = date("d.m.Y, H:i:s",time()); + $date = date("d.m.Y",time()); + $time = date("H:i:s",time()); + $ip = $_SERVER["REMOTE_ADDR"]; + switch ($this->type) { + case "syslog": + syslog($level, '<' . $timestamp . '> '.$text.' IP: ' . $ip .' FILE: '. $file . ' LINE:' . $line); + break; + case "SQL": + $db->query("INSERT INTO ".$config["prefix"] . "logs (date,time,ip,file,line,text) VALUES ('".$date."','".$time."','".$ip."','".$file."','".$line."','".$text."')"); + break; + case "file": + default: + $log = "<" . $timestamp . ">;" . $ip . ";" . $file . ";" . $line . ";" . $text . "\r\n"; + fwrite($this->filelink, $log); + break; + } + } + + } + + +} +?> diff --git a/inc/mail.class.php b/inc/mail.class.php new file mode 100644 index 0000000..aedf575 --- /dev/null +++ b/inc/mail.class.php @@ -0,0 +1,111 @@ +attachments = array(); + $this->semi_rand = md5(time()); + $this->boundary = '==becast_'.$this->semi_rand ; + $this->headers = array( + 'From' => 'BeCast WebEngine Mail Class ', + 'MIME-Version' => '1.0', + 'Content-Type' => "multipart/mixed; boundary=\"".$this->boundary."\"" + ); + $this->bodytext("Body"); + } + + // For debugging purposes you can display the body you are about + // to send. + function get_body() { + $retval = $textbody; + $retval .= $htmlbody; + foreach($this->attachments as $tblck) + $retval .= $tblck; + + return $retval; + } + + // Convert the values in the header array into the correct format. + function get_header() { + $retval = ""; + foreach($this->headers as $key => $value) + $retval .= "$key: $value\n"; + + return $retval; + } + + // Add your own header entry or modify a header. + function set_header($name, $value) { + $this->headers[$name] = $value; + } + + // Attach a file to the message. + function attachfile($file, $type = "application/octetstream") { + if(!($fd = fopen($file, "r"))) { + $this->errstr = "Error opening ".$file." for reading."; + return 0; + } + $_buf = fread($fd, filesize($file)); + fclose($fd); + + $fname = $file; + for($x = strlen($file); $x > 0; $x--) + if($file[$x] == "/") + $fname = substr($file, $x, strlen($file) - $x); + + // Convert to base64 becuase mail attachments are not binary safe. + $_buf = chunk_split(base64_encode($_buf)); + + $this->attachments[$file] = "--" . $this->boundary . "\n"; + $this->attachments[$file] .= "Content-Type: ".$type."; name=\"".$fname."\"\n"; + $this->attachments[$file] .= "Content-Transfer-Encoding: base64\n"; + $this->attachments[$file] .= "Content-Disposition: attachment; " . + "filename=\"".$fname."\"\n\n"; + $this->attachments[$file] .= $_buf; + + return 1; + } + + function bodytext($text) { + $this->textbody = "--" . $this->boundary . "\n"; + $this->textbody .= "Content-Type: text/plain; charset=utf-8\n"; + $this->textbody .= "Content-Transfer-Encoding: base64\n\n"; + $this->textbody .= base64_encode($text); + } + + function htmltext($text) { + $this->htmlbody = "\n--" . $this->boundary . "\n"; + $this->htmlbody .= "Content-Type: text/html; charset=utf-8\n"; + $this->htmlbody .= "Content-Transfer-Encoding: base64\n\n"; + $this->htmlbody .= base64_encode($text); + } + + function clear_bodytext() { $this->textbody = ""; } + function clear_htmltext() { $this->htmlbody = ""; } + function get_error() { return $this->errstr; } + + // Send the headers and body using php's built in mail. + function sendmail($to = "root@localhost", $subject = "kein Betreff") { + if(isset($this->textbody)) $_body .= $this->textbody; + if(isset($this->htmlbody)) $_body .= $this->htmlbody; + + foreach($this->attachments as $tblck) + $_body .= $tblck; + + $_body .= "\n--$this->boundary--"; + + mail($to, '=?utf-8?B?'.base64_encode($subject).'?=', $_body, $this->get_header()); + } +} +?> diff --git a/inc/panel.class.php b/inc/panel.class.php new file mode 100644 index 0000000..3d1e6a4 --- /dev/null +++ b/inc/panel.class.php @@ -0,0 +1,252 @@ + + * @package BeCast Webengine core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: panel.class.php 128 2010-02-21 22:03:37Z genuineparts $ +*/ + +$module["panel"]["name"]="Panel Class"; +$module["panel"]["ver"]="0.3.4"; +class panel { + var $sidebar=""; + var $page=""; + var $bodyext=""; + var $title=""; + var $content=""; + var $meta=""; + var $form=""; + var $foot=""; + var $head=""; + var $menu_items =""; + + function page($additional_title="",$meta=""){ + global $config,$db,$core; + return ' + + + '.$config['sitetitle'].' + + + '.$this->meta.' + + bodyext.'> +
+ '.$this->menu().' +
+ '.$this->page.' +
+ +
+ '.$this->foot.' + + '; + } + + function parse_page(){ + $this->page.="

".$this->title."

+

".$this->content."

"; + $this->title=""; + $this->content=""; + echo $this->page(); + exit(); + } + + function menu_item($panel,$text, $img=""){ + global $config, $userdata, $userinfo, $session, $meta; + if($panel=="group_only"){ + $this->menu_items.="
  • ".$text."
  • "; + }elseif($panel=="admin_home"){ + $this->menu_items.="
  • ".$text."
  • "; + }elseif($panel=="page_home"){ + $this->menu_items.="
  • ".$text."
  • "; + }else{ + if($img!=""){ + $this->menu_items.="
  • ".$text."
  • "; + }else{ + $this->menu_items.="
  • ".$text."
  • "; + } + } + } + + function admin_message($title,$message,$redirect=FALSE,$panel="",$time="4"){ + global $config,$session,$lang; + $session->page_begin("Admin Message", True); + if($panel!="" && $redirect){ + $this->content=$message."
    ".$lang->_('CLICKREDIRECT').""; + }elseif($panel!="" && !$redirect){ + $this->content=$message."
    ".$lang->_('CLICKCONTINUE').""; + }else{ + $this->content=$message; + } + if($redirect && $panel!="") + $this->meta.=""; + $this->title=$title; + $this->parse_page(); + + } + + function menu(){ + + return ''; + + } + + function form ($args = array(),$return=FALSE,$extra=""){ + + $method = $args["method"] ? $args["method"] : 'post'; + $action = $args["action"] ? $args["action"] : $_SERVER['PHP_SELF']; + $form = '
    '; + if(!$return){ + $this->content .= $form; + }else{ + return $form; + } + } + function formClose () + { + + $form = '
    '; + if(!$return){ + $this->content .= $form; + }else{ + return $form; + } + } + + function button ($text = '', $name='', $extra='', $return=FALSE) + { + + $fld = ''; + if(!$return){ + $this->content .= $fld; + }else{ + return $fld; + } + } + + function radio ($args=array(),$extra="",$return=FALSE) + { + $name = $args["name"] ? $args["name"] : 'radiobutton'; + $value = $args["value"]; + if($value!=""){ + $extra .= ' value="'.$value.'"'; + } + $fld=$this->radioOrCheck ("radio",$name,$extra,$return); + if($return){ + return $fld; + } + } + function checkbox ($args=array(),$extra="",$return=FALSE) + { + $name = $args["name"] ? $args["name"] : 'checkbox'; + $value = $args["value"]; + if($value!=""){ + $extra .= ' value="'.$value.'"'; + } + $fld=$this->radioOrCheck ("checkbox",$name,$extra,$return); + if($return){ + return $fld; + } + } + /* private */ + function radioOrCheck ($type,$name="",$extra="",$return=FALSE) + { + $fld = ''; + if(!$return){ + $this->content .= $fld; + }else{ + return $fld; + } + } + + function field ($args=array(),$extra="",$return=FALSE) + { + $typ = $args["typ"] ? $args["typ"] : 'text'; + $name = $args["name"] ? $args["name"] : 'textfield'; + $value = $args["value"] ? $args["value"] : ''; + $fld = ''; // html: form field + if(!$return){ + $this->content .= $fld; + }else{ + return $fld; + } + } + function submit ($args=array(),$extra="",$return=FALSE) + { + $name = $args["name"] ? $args["name"] : 'submit'; + $fld = ''; // html: form submit button + if(!$return){ + $this->content .= $fld; + }else{ + return $fld; + } + } + + /* + $args[value] used for default text (as in "field" function) + */ + function textarea ($args = array(),$extra="",$return=FALSE) + { + $name = $args["name"] ? $args["name"] : 'field'; + $rows = $args["rows"] ? $args["rows"] : '3'; + $cols = $args["cols"] ? $args["cols"] : '30'; + $text = $args["value"] ? $args["value"] : ''; + + $fld = ''; + if(!$return){ + $this->content .= $fld; + }else{ + return $fld; + } + } + + /* + $values = array containing values (key = processing value, data = displaying value) + */ + function select ($values=array(),$selected="",$name="",$extra="",$return=FALSE) + { + $fld='"; + if(!$return){ + $this->content .= $fld; + }else{ + return $fld; + } + } + +} +?> diff --git a/inc/plugin.class.php b/inc/plugin.class.php new file mode 100644 index 0000000..c9e2e22 --- /dev/null +++ b/inc/plugin.class.php @@ -0,0 +1,99 @@ +query("SELECT * FROM " . $config["prefix"] . "module"); + while ($row = $db->fetch_array($result)){ + $this->plugin_[$row["file"]] = $row; + if($row["module"]=""){ + //$plugin="$ + }else{ + + } + //include_once(); + } + + } + + function use_hook($name,$function,$order=20,$file="") { + if(is_array($function)){ + $fname=serialize($function); + }else{ + $fname=$function; + } + if(!empty($this->hooks[$name][$order][$fname]) && is_array($this->hooks[$name][$order][$fname])){ + return true; + } + + $this->hooks[$name][$order][$fname] = array( + "function" => $function, + "file" => $file + ); + return true; + } + + + function run_hook($name,$variables=array()) { + if(array_key_exists($name,$this->hooks)){ + if(!is_array($this->hooks[$name])) + { + return false; + } + $this->current_hook = $name; + ksort($this->hooks[$name]); + foreach($this->hooks[$name] as $priority => $hooks) + { + if(is_array($hooks)) + { + foreach($hooks as $hook) + { + if($hook['file']) + { + require_once $hook['file']; + } + if(!is_array($variables)) + $variables=array(); + + $return = call_user_func_array($hook['function'], $variables); + + + } + } + } + $this->current_hook = ''; + return $return; + } + } + + +} +?> diff --git a/inc/sessions.class.php b/inc/sessions.class.php new file mode 100644 index 0000000..45aebd8 --- /dev/null +++ b/inc/sessions.class.php @@ -0,0 +1,396 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: sessions.class.php 129 2010-02-21 22:04:51Z genuineparts $ +*/ +class session { + + var $sid = 0; + var $uid = 0; + var $ip = ''; + var $packip = ''; + var $userdata = array(); + var $useragent = ''; + + function page_begin($page = "UNDEFINED", $needlogin = TRUE){ + global $config, $db, $log, $core, $lang, $plugin, $functions; + $plugin->run_hook('page_begin_start',array('page'=>$page,'needlogin'=>$needlogin)); + if($this->userdata['uid']==0 || !$this->userdata['uid']){ + $this->ip = $functions->get_ip(); + $this->packip = $functions->my_inet_pton($this->ip); + $this->useragent = $_SERVER["HTTP_USER_AGENT"]; + + //Check if the User has a Cookie + if (isset($_COOKIE[$config["cookiename"] . "_sid"])){ + //Retireve Data from Cookie + $sid = $_COOKIE[$config["cookiename"] . "_sid"]; + $sid = $db->escape(base64_decode($sid)); + $data = $db->fetch_array($db->query("SELECT sid,uid FROM `" . $config["prefix"] . "sessions` WHERE `sid`='".$sid."' AND `ip`=".$db->escape_binary($this->packip))); + + if($data['sid']){ + $this->sid=$data['sid']; + $this->uid=$data['uid']; + }else{ + $this->sid=0; + $this->uid=0; + } + } + + //Something's rotten. Still no SID. + if(!$this->sid){ + //This is some strange behavior, log it with low priority. + if($config["logging"]) + $log->write("SID not set.",5,__LINE__,__FILE__); + + $this->sid = 0; + $this->uid = 0; + } + + // If there is a Cookie log the user in (if he isn't already) + if (isset($_COOKIE[$config["cookiename"] . "_base"])){ + $cookiedata = $_COOKIE[$config["cookiename"] . "_base"]; + $cookiedata = explode("_",base64_decode($cookiedata),2); + $this->load_data($cookiedata[0],$cookiedata[1]); + } + + if($this->userdata['active']==2){ + $additional_message = ''; + if($this->userdata['bio']!=""){ + $additional_message = '
    '.$lang->_('REASON').' '.$this->userdata['bio']; + } + //$this->destroy_session($session->sid); + + $this->userdata['uid']=0; + + $this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); + $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message); + } + + // Still no Userdata, its a Guest + if(!isset($this->userdata['uid'])){ + if(!empty($this->sid)){ + $this->update_session($this->sid); + $this->userdata['uid']=0; + }else{ + $this->create_session(); + $this->userdata['uid']=0; + } + } + + $this->setcookie($config["cookiename"] . "_sid",base64_encode($this->sid),0,"/",$config['domain'],true); + } + $plugin->run_hook('page_begin_end',array('data'=>$this)); + + + if($needlogin != FALSE && $this->userdata["uid"]==0){ + header("LOCATION://" . $_SERVER["HTTP_HOST"] . $config['path'] . "/index.php?fail=needlogin"); + } + } + + //Fetch userdata + function load_data($uid, $loginkey){ + global $db,$config, $log, $plugin, $lang; + + $plugin->run_hook('load_data_start',array('loginkey'=>$loginkey,'uid'=>$uid, 'data'=>$this)); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON r.id=u.role WHERE u.`uid`='" . intval($uid) . "' and u.`loginkey`='" . $db->escape($loginkey) . "' LIMIT 1"); + $this->userdata=$db->fetch_array($result); + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "roleset` rs LEFT JOIN `" . $config["prefix"] . "role_values` rv ON rv.id=rs.role_value_id WHERE rs.role_id='".$this->userdata["role"]."'"); + + while($row=$db->fetch_array($result)){ + $this->userdata[$row["name"]]=$row["value"]; + } + if(!$this->userdata['uid']){ + + if($config["logging"]) + $log->write("No User found. UID: " .$uid,4,__LINE__,__FILE__); + + unset($this->userdata); + $this->uid=0; + return false; + } + + if($uid!=$this->userdata['uid'] || $loginkey!=$this->userdata['loginkey']){ + + if($config["logging"]){ + $log->write("HACK ATTEMPT. Cookie Spoof. UID: " .$uid,1,__LINE__,__FILE__); + } + unset($this->userdata); + $this->uid=0; + return false; + } + if($this->userdata['uid']!=0){ + if($this->userdata['lastip'] != $this->packip && array_key_exists('lastip', $this->userdata)){ + $lastip_add = ", lastip=".$db->escape_binary($this->packip); + } + else + { + $lastip_add = ''; + } + + $time = time(); + if($time - $this->userdata['lastactive'] > 900){ + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='" . $this->userdata['lastactive'] . "', `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'"); + //$mybb->user['lastvisit'] = $mybb->user['lastactive']; + } + else + { + $timespent = $time - $this->userdata['lastactive']; + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastactive`='" . $time . "'".$lastip_add." WHERE `uid`='" . $uid . "'"); + } + } + if(!empty($this->sid)){ + $this->update_session($this->sid, $this->userdata['uid']); + }else{ + $this->create_session($this->userdata['uid']); + } + $lang->setlang($this->userdata['lang']); + $plugin->run_hook('load_data_end',array('data'=>$this)); + } + + function setcookie($name,$data,$validto=0,$path=NULL,$domain=NULL,$httponly=false,$https=true) + { + if($domain!=''){ + // Fix the domain to accept domains with and without 'www.'. + if (strtolower( substr($domain, 0, 4) ) == 'www.' ){ + $domain = substr($domain, 4); + }else{ + $domain = $domain; + } + // Add the dot prefix to ensure compatibility with subdomains + if ( substr($domain, 0, 1) != '.' ){ + $domain = '.'.$domain; + } + } + if((isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS'])) || $https){ + $https = true; + } + $arr_cookie_options = array ( + 'expires' => $validto, + 'path' => $path, + 'domain' => $domain, // leading dot for compatibility or use subdomain + 'secure' => $https, // or false + 'httponly' => $httponly, // or false + 'samesite' => 'Strict' // None || Lax || Strict + ); + setcookie($name, $data, $arr_cookie_options); + } + + function update_session($sid, $uid=''){ + global $db,$config, $plugin, $lang; + $plugin->run_hook('update_session_start', array('sid'=>$sid,'uid'=>$uid, 'data'=>$this)); + if($uid){ + $sessiondata['uid'] = $uid; + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='".time()."' WHERE `uid`='".$uid."'"); + }else{ + $sessiondata['uid'] = 0; + $lang->setlang($config['lang']); + } + + $sid = $db->escape($sid); + $db->query("UPDATE `" . $config["prefix"] . "sessions` SET `uid`='".$sessiondata['uid']."',`time`='".time()."',`ip`=".$db->escape_binary($this->packip).", `useragent`='".$db->escape($this->useragent)."' WHERE `sid`='".$sid."'"); + $timeout=time()-1800; + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `time`<='".$timeout."'"); + $plugin->run_hook('update_session_end'); + } + + function create_session($uid=0){ + global $db,$config, $plugin, $lang, $functions; + $plugin->run_hook('create_session_start', array('uid'=>$uid, 'data'=>$this)); + if($uid > 0){ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `uid`='".intval($uid)."'"); + $sessiondata['uid'] = $uid; + }else{ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `ip`=".$db->escape_binary($this->packip)); + $sessiondata['uid'] = 0; + $lang->setlang($config['lang']); + } + + $sessiondata['sid'] = md5($functions->random_str(50)); + $db->query("INSERT INTO `" . $config["prefix"] . "sessions` (`sid`,`uid`,`time`,`useragent`,`ip`) VALUES ('".$sessiondata['sid']."','".$sessiondata['uid']."','".time()."','".$db->escape($this->useragent)."',".$db->escape_binary($this->packip).")"); + $db->query("UPDATE `" . $config["prefix"] . "users` SET `lastvisit`='".time()."' WHERE `uid`='".$uid."'"); + $this->sid = $sessiondata['sid']; + $this->uid = $sessiondata['uid']; + $plugin->run_hook('create_session_end'); + } + + function destroy_session($sid) + { + global $db,$config, $plugin; + $plugin->run_hook('destroy_session_start', array('data'=>$this)); + if($sid !=""){ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `sid`='".$db->escape($sid)."'"); + }else{ + $db->query("DELETE FROM `" . $config["prefix"] . "sessions` WHERE `ip`=".$db->escape_binary($this->packip)); + } + unset($this->userdata); + $this->setcookie($config["cookiename"] . '_sid','',-3600,'/',true); + $this->sid = 0; + $this->uid = 0; + $plugin->run_hook('destroy_session_end'); + } + + function check_login($username='',$password='',$openid='') + { + global $db,$config, $plugin, $lang, $core; + $plugin->run_hook('check_login_start', array('data'=>$this)); + if($username!='' && $password!=''){ + $username = $db->escape($username); + $result = $db->query("SELECT `uid`,`salt` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$username."' AND `active`>'0' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + // There is a user + $data=$db->fetch_array($result); + }else{ + return false; + } + $pass = hash('sha256',$db->escape($data['salt'].$password)); + $result = $db->query("SELECT `uid`,`loginkey`,`active`,`bio` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$username."' AND `password`='".$pass."' AND `active`>'0' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + // There is a user + $data=$db->fetch_array($result); + }else{ + return false; + } + if($data['active']==2){ + $additional_message = ''; + if($data['bio']!=""){ + $additional_message = '
    '.$lang->_('REASON').' '.$data['bio']; + } + unset($data); + + $this->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); + $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED').$additional_message); + return 'BANNED'; + } + $uid = $data['uid']; + $key = $data['loginkey']; + $this->login($uid,$key); + return $uid; + }elseif($openid!=''){ + $identity=$db->escape($openid); + $result = $db->query("SELECT `uid`,`loginkey` FROM `" . $config['prefix'] . "users` WHERE `openid_identity` = '".$identity."' AND `active`='1' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + // There is a user + $data=$db->fetch_array($result); + }else{ + return false; + } + $uid = $data['uid']; + $key = $data['loginkey']; + $this->login($uid,$key); + return $uid; + }else{ + return false; + } + } + + function login($uid,$key) + { + global $db,$config, $plugin; + $plugin->run_hook('logon_start', array('data'=>$this)); + $cookiedata['uid'] = $uid; + $cookiedata['loginkey'] = $key; + $cookiedata = base64_encode($cookiedata['uid'] .'_'. $cookiedata['loginkey']); + if(isset($_POST['remember']) && $_POST['remember']){ + $this->setcookie($config['cookiename'] . '_base', $cookiedata, time() + 60 * 60 * 24 * 365, $config['path'],$config['domain'],true); + }else{ + $this->setcookie($config['cookiename'] . '_base', $cookiedata, 0, $config['path'],$config['domain'],true); + } + $this->create_session($uid); + $plugin->run_hook('logon_end'); + } + + function get_users_with_right($right, $value) + { + global $db,$config; + $result = $db->query("SELECT u.* FROM `" . $config["prefix"] . "users` u LEFT JOIN `" . $config["prefix"] . "role` r ON u.`role`=r.`id` LEFT JOIN `" . $config["prefix"] . "roleset` rs ON rs.`role_id`=r.`id` LEFT JOIN `" . $config["prefix"] . "role_values` rv ON rv.`id`=rs.`role_value_id` WHERE rv.`name`='".$db->escape($right)."' AND rs.`value`='".$db->escape($value)."'"); + while($row=$db->fetch_array($result)){ + $return[]=$row; + } + return $return; + } + + function generate_Key($length=8){ + + $dummy = array_merge(range('0', '9'), range('a', 'z'), range('A', 'Z')); + + mt_srand((double)microtime()*1000000); + + for ($i = 1; $i <= (count($dummy)*2); $i++){ + $swap = mt_rand(0,count($dummy)-1); + $tmp = $dummy[$swap]; + $dummy[$swap] = $dummy[0]; + $dummy[0] = $tmp; + } + + return substr(implode('',$dummy),0,$length); + + } + + function sanitize_username($username){ + global $config; + $username = trim($username); + $username = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $username); + $username = str_replace(array(chr(160), chr(173), chr(0xCA), chr(8238), chr(8237), chr(8203),"]","[","/","\\"), array("", "-", "", "", "", "","","","",""), $username); + // Remove multiple spaces from the username + $username = preg_replace("#\s{2,}#", "", $username); + return $username; + } + + function verify_username($username){ + global $config; + + // Check if the username is not empty. + if($username == '') + { + return "Username empty."; + } + + // Check if the username belongs to the list of banned usernames. + $banned=explode("\n",$config['banned_usernames']); + if(is_array($banned)){ + foreach($banned as $banned_username){ + $banned_username = str_replace('*', '(.*)', trim($banned_username)); + if(preg_match("#\b{$banned_username}\b#i", $username)){ + return "Forbidden Username:".$banned_username; + } + } + } + // Check for certain characters in username (<, >, &, commas and slashes) + if(strpos($username, ".") !== false || strpos($username, ":") !== false || strpos($username, " ") !== false || strpos($username, "<") !== false || strpos($username, ">") !== false || strpos($username, "&") !== false || strpos($username, ")") !== false || strpos($username, "(") !== false || strpos($username, "\\") !== false || strpos($username, ";") !== false || strpos($username, ",") !== false || strpos($username, "~") !== false) + { + return "Forbidden Chars in Username"; + } + + // Check if the username is of the correct length. + if(($config['maxnamelength'] != 0 && strlen($username) > $config['maxnamelength']) || ($config['minnamelength'] != 0 && strlen($username) < $config['minnamelength'])) + { + return sprintf('The username must be %s Chars minimum and can be %s Chars long at max.',$config['minnamelength'],$config['maxnamelength']); + } + + return true; + } +} +?> diff --git a/index.php b/index.php new file mode 100644 index 0000000..a9e8132 --- /dev/null +++ b/index.php @@ -0,0 +1,73 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: index.php 100 2010-02-20 14:42:30Z genuineparts $ +*/ + +ini_set('display_errors', 1); +ini_set('display_startup_errors', 1); +error_reporting(E_ERROR); +$basepath=""; +//require 'xhprof/external/header.php'; +require_once 'core/init_core.inc.php'; + +$content = ""; +$body = ""; +$meta = ""; + + /** + * PLUGIN HOOK index_start + * + */ + $plugin->run_hook("index_start"); + + /** + * If the Page is in Maintenance Mode we have to fetch the Userdata ourself. + * + */ + if($config["maintenance"]==1){ + $session->page_begin("Maintenance", FALSE); + } + + /** + * If the User is a Admin continue even if the Page is in Maintenance Mode + * Else show a Maintenance Page + * + */ + if($config["maintenance"]==1 && $session->userdata["is_admin"]!=1){ + $core->message($lang->_('MAINTENANCE'),$lang->_('SITEINMAINTENANCE').':
    '.$config["maintenance_message"],FALSE,"","",TRUE); + }else{ + if(isset($_GET["task"])){ + $core->get_module($_GET["task"],$_GET["sub"]); + }else{ + $core->get_module($config["startmodule"],$config["startmodulesub"]); + } + } + + /** + * PLUGIN HOOK index_end + * + */ + $plugin->run_hook("index_end"); +?> diff --git a/js/accordeon/accordion.js b/js/accordeon/accordion.js new file mode 100644 index 0000000..a4ec23e --- /dev/null +++ b/js/accordeon/accordion.js @@ -0,0 +1,201 @@ +// accordion.js v2.0 +// +// Copyright (c) 2007 stickmanlabs +// Author: Kevin P Miller | http://www.stickmanlabs.com +// +// Accordion is freely distributable under the terms of an MIT-style license. +// +// I don't care what you think about the file size... +// Be a pro: +// http://www.thinkvitamin.com/features/webapps/serving-javascript-fast +// http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files +// + +/*-----------------------------------------------------------------------------------------------*/ + +if (typeof Effect == 'undefined') + throw("accordion.js requires including script.aculo.us' effects.js library!"); + +var accordion = Class.create(); +accordion.prototype = { + + // + // Setup the Variables + // + showAccordion : null, + currentAccordion : null, + duration : null, + effects : [], + animating : false, + + // + // Initialize the accordions + // + initialize: function(container, options) { + if (!$(container)) { + throw(container+" doesn't exist!"); + return false; + } + + this.options = Object.extend({ + resizeSpeed : 8, + classNames : { + toggle : 'accordion_toggle', + toggleActive : 'accordion_toggle_active', + content : 'accordion_content' + }, + defaultSize : { + height : null, + width : null + }, + direction : 'vertical', + onEvent : 'click' + }, options || {}); + + this.duration = ((11-this.options.resizeSpeed)*0.15); + + var accordions = $$('#'+container+' .'+this.options.classNames.toggle); + accordions.each(function(accordion) { + Event.observe(accordion, this.options.onEvent, this.activate.bind(this, accordion), false); + if (this.options.onEvent == 'click') { + accordion.onclick = function() {return false;}; + } + + if (this.options.direction == 'horizontal') { + var options = $H({width: '0px'}); + } else { + var options = $H({height: '0px'}); + } + options.merge({display: 'none'}); + + this.currentAccordion = $(accordion.next(0)).setStyle(options); + }.bind(this)); + }, + + // + // Activate an accordion + // + activate : function(accordion) { + if (this.animating) { + return false; + } + + this.effects = []; + + this.currentAccordion = $(accordion.next(0)); + this.currentAccordion.setStyle({ + display: 'block' + }); + + this.currentAccordion.previous(0).addClassName(this.options.classNames.toggleActive); + + if (this.options.direction == 'horizontal') { + this.scaling = $H({ + scaleX: true, + scaleY: false + }); + } else { + this.scaling = $H({ + scaleX: false, + scaleY: true + }); + } + + if (this.currentAccordion == this.showAccordion) { + this.deactivate(); + } else { + this._handleAccordion(); + } + }, + // + // Deactivate an active accordion + // + deactivate : function() { + var options = $H({ + duration: this.duration, + scaleContent: false, + transition: Effect.Transitions.sinoidal, + queue: { + position: 'end', + scope: 'accordionAnimation' + }, + scaleMode: { + originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : this.currentAccordion.scrollHeight, + originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : this.currentAccordion.scrollWidth + }, + afterFinish: function() { + this.showAccordion.setStyle({ + height: 'auto', + display: 'none' + }); + this.showAccordion = null; + this.animating = false; + }.bind(this) + }); + options.merge(this.scaling); + + this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive); + + new Effect.Scale(this.showAccordion, 0, options); + }, + + // + // Handle the open/close actions of the accordion + // + _handleAccordion : function() { + var options = $H({ + sync: true, + scaleFrom: 0, + scaleContent: false, + transition: Effect.Transitions.sinoidal, + scaleMode: { + originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : this.currentAccordion.scrollHeight, + originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : this.currentAccordion.scrollWidth + } + }); + options.merge(this.scaling); + + this.effects.push( + new Effect.Scale(this.currentAccordion, 100, options) + ); + + if (this.showAccordion) { + this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive); + + options = $H({ + sync: true, + scaleContent: false, + transition: Effect.Transitions.sinoidal + }); + options.merge(this.scaling); + + this.effects.push( + new Effect.Scale(this.showAccordion, 0, options) + ); + } + + new Effect.Parallel(this.effects, { + duration: this.duration, + queue: { + position: 'end', + scope: 'accordionAnimation' + }, + beforeStart: function() { + this.animating = true; + }.bind(this), + afterFinish: function() { + if (this.showAccordion) { + this.showAccordion.setStyle({ + display: 'none' + }); + } + $(this.currentAccordion).setStyle({ + height: 'auto' + }); + this.showAccordion = this.currentAccordion; + this.animating = false; + }.bind(this) + }); + } +} + \ No newline at end of file diff --git a/js/accordeon/effects.js b/js/accordeon/effects.js new file mode 100644 index 0000000..06f59b4 --- /dev/null +++ b/js/accordeon/effects.js @@ -0,0 +1,1090 @@ +// script.aculo.us effects.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() { + var color = '#'; + if(this.slice(0,4) == 'rgb(') { + var cols = this.slice(4,this.length-1).split(','); + var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); + } else { + if(this.slice(0,1) == '#') { + if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if(this.length==7) color = this.toLowerCase(); + } + } + return(color.length==7 ? color : (arguments[0] || this)); +} + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function(element) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +} + +Element.collectTextNodesIgnoreClass = function(element, className) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? + Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +} + +Element.setContentZoom = function(element, percent) { + element = $(element); + element.setStyle({fontSize: (percent/100) + 'em'}); + if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + return element; +} + +Element.getOpacity = function(element){ + return $(element).getStyle('opacity'); +} + +Element.setOpacity = function(element, value){ + return $(element).setStyle({opacity:value}); +} + +Element.getInlineOpacity = function(element){ + return $(element).style.opacity || ''; +} + +Element.forceRerendering = function(element) { + try { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch(e) { } +}; + +/*--------------------------------------------------------------------------*/ + +Array.prototype.call = function() { + var args = arguments; + this.each(function(f){ f.apply(this, args) }); +} + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + tagifyText: function(element) { + if(typeof Builder == 'undefined') + throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); + + var tagifyStyle = 'position:relative'; + if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1'; + + element = $(element); + $A(element.childNodes).each( function(child) { + if(child.nodeType==3) { + child.nodeValue.toArray().each( function(character) { + element.insertBefore( + Builder.node('span',{style: tagifyStyle}, + character == ' ' ? String.fromCharCode(160) : character), + child); + }); + Element.remove(child); + } + }); + }, + multiple: function(element, effect) { + var elements; + if(((typeof element == 'object') || + (typeof element == 'function')) && + (element.length)) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || {}); + var masterDelay = options.delay; + + $A(elements).each( function(element, index) { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function(element, effect) { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || {}); + Effect[element.visible() ? + Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +var Effect2 = Effect; // deprecated + +/* ------------- transitions ------------- */ + +Effect.Transitions = { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + 0.5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; + }, + pulse: function(pos, pulses) { + pulses = pulses || 5; + return ( + Math.round((pos % (1/pulses)) * pulses) == 0 ? + ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : + 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) + ); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } +}; + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(); +Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), { + initialize: function() { + this.effects = []; + this.interval = null; + }, + _each: function(iterator) { + this.effects._each(iterator); + }, + add: function(effect) { + var timestamp = new Date().getTime(); + + var position = (typeof effect.options.queue == 'string') ? + effect.options.queue : effect.options.queue.position; + + switch(position) { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'with-last': + timestamp = this.effects.pluck('startOn').max() || timestamp; + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) + this.effects.push(effect); + + if(!this.interval) + this.interval = setInterval(this.loop.bind(this), 15); + }, + remove: function(effect) { + this.effects = this.effects.reject(function(e) { return e==effect }); + if(this.effects.length == 0) { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() { + var timePos = new Date().getTime(); + for(var i=0, len=this.effects.length;i= this.startOn) { + if(timePos >= this.finishOn) { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if(this.finish) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / (this.finishOn - this.startOn); + var frame = Math.round(pos * this.options.fps * this.options.duration); + if(frame > this.currentFrame) { + this.render(pos); + this.currentFrame = frame; + } + } + }, + render: function(pos) { + if(this.state == 'idle') { + this.state = 'running'; + this.event('beforeSetup'); + if(this.setup) this.setup(); + this.event('afterSetup'); + } + if(this.state == 'running') { + if(this.options.transition) pos = this.options.transition(pos); + pos *= (this.options.to-this.options.from); + pos += this.options.from; + this.position = pos; + this.event('beforeUpdate'); + if(this.update) this.update(pos); + this.event('afterUpdate'); + } + }, + cancel: function() { + if(!this.options.sync) + Effect.Queues.get(typeof this.options.queue == 'string' ? + 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function(eventName) { + if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); + if(this.options[eventName]) this.options[eventName](this); + }, + inspect: function() { + var data = $H(); + for(property in this) + if(typeof this[property] != 'function') data[property] = this[property]; + return '#'; + } +} + +Effect.Parallel = Class.create(); +Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), { + initialize: function(effects) { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function(position) { + this.effects.invoke('render', position); + }, + finish: function(position) { + this.effects.each( function(effect) { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if(effect.finish) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Event = Class.create(); +Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), { + initialize: function() { + var options = Object.extend({ + duration: 0 + }, arguments[0] || {}); + this.start(options); + }, + update: Prototype.emptyFunction +}); + +Effect.Opacity = Class.create(); +Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || {}); + this.start(options); + }, + update: function(position) { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(); +Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || {}); + this.start(options); + }, + setup: function() { + // Bug in Opera: Opera returns the "real" position of a static element or + // relative element that does not have top/left explicitly set. + // ==> Always set top and left for position relative elements in your stylesheets + // (to 0 if you do not need them) + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if(this.options.mode == 'absolute') { + // absolute movement, so we need to calc deltaX and deltaY + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function(position) { + this.element.setStyle({ + left: Math.round(this.options.x * position + this.originalLeft) + 'px', + top: Math.round(this.options.y * position + this.originalTop) + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function(element, toTop, toLeft) { + return new Effect.Move(element, + Object.extend({ x: toLeft, y: toTop }, arguments[3] || {})); +}; + +Effect.Scale = Class.create(); +Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), { + initialize: function(element, percent) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or {} with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || {}); + this.start(options); + }, + setup: function() { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = {}; + ['top','left','width','height','fontSize'].each( function(k) { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each( function(fontSizeType) { + if(fontSize.indexOf(fontSizeType)>0) { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; + + this.dims = null; + if(this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if(/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if(!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function(position) { + var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); + if(this.options.scaleContent && this.fontSize) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function(position) { + if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle); + }, + setDimensions: function(height, width) { + var d = {}; + if(this.options.scaleX) d.width = Math.round(width) + 'px'; + if(this.options.scaleY) d.height = Math.round(height) + 'px'; + if(this.options.scaleFromCenter) { + var topd = (height - this.dims[0])/2; + var leftd = (width - this.dims[1])/2; + if(this.elementPositioning == 'absolute') { + if(this.options.scaleY) d.top = this.originalTop-topd + 'px'; + if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; + } else { + if(this.options.scaleY) d.top = -topd + 'px'; + if(this.options.scaleX) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(); +Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {}); + this.start(options); + }, + setup: function() { + // Prevent executing on elements not in the layout flow + if(this.element.getStyle('display')=='none') { this.cancel(); return; } + // Disable background image during the effect + this.oldStyle = {}; + if (!this.options.keepBackgroundImage) { + this.oldStyle.backgroundImage = this.element.getStyle('background-image'); + this.element.setStyle({backgroundImage: 'none'}); + } + if(!this.options.endcolor) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if(!this.options.restorecolor) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); + this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); + }, + update: function(position) { + this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ + return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) }); + }, + finish: function() { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = Class.create(); +Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + this.start(arguments[1] || {}); + }, + setup: function() { + Position.prepare(); + var offsets = Position.cumulativeOffset(this.element); + if(this.options.offset) offsets[1] += this.options.offset; + var max = window.innerHeight ? + window.height - window.innerHeight : + document.body.scrollHeight - + (document.documentElement.clientHeight ? + document.documentElement.clientHeight : document.body.clientHeight); + this.scrollStart = Position.deltaY; + this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart; + }, + update: function(position) { + Position.prepare(); + window.scrollTo(Position.deltaX, + this.scrollStart + (position*this.delta)); + } +}); + +/* ------------- combination effects ------------- */ + +Effect.Fade = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function(effect) { + if(effect.options.to!=0) return; + effect.element.hide().setStyle({opacity: oldOpacity}); + }}, arguments[1] || {}); + return new Effect.Opacity(element,options); +} + +Effect.Appear = function(element) { + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + effect.element.forceRerendering(); + }, + beforeSetup: function(effect) { + effect.element.setOpacity(effect.options.from).show(); + }}, arguments[1] || {}); + return new Effect.Opacity(element,options); +} + +Effect.Puff = function(element) { + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel( + [ new Effect.Scale(element, 200, + { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], + Object.extend({ duration: 1.0, + beforeSetupInternal: function(effect) { + Position.absolutize(effect.effects[0].element) + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().setStyle(oldStyle); } + }, arguments[1] || {}) + ); +} + +Effect.BlindUp = function(element) { + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, + Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }, arguments[1] || {}) + ); +} + +Effect.BlindDown = function(element) { + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping(); + } + }, arguments[1] || {})); +} + +Effect.SwitchOff = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function(effect) { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); + } + }) + } + }, arguments[1] || {})); +} + +Effect.DropOut = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel( + [ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], + Object.extend( + { duration: 0.5, + beforeSetup: function(effect) { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); + } + }, arguments[1] || {})); +} + +Effect.Shake = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, + { x: 20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { + effect.element.undoPositioned().setStyle(oldStyle); + }}) }}) }}) }}) }}) }}); +} + +Effect.SlideDown = function(element) { + element = $(element).cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if(window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } + }, arguments[1] || {}) + ); +} + +Effect.SlideUp = function(element) { + element = $(element).cleanWhitespace(); + var oldInnerBottom = element.down().getStyle('bottom'); + return new Effect.Scale(element, window.opera ? 0 : 1, + Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + restoreAfterFinish: true, + beforeStartInternal: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if(window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom}); + effect.element.down().undoPositioned(); + } + }, arguments[1] || {}) + ); +} + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function(element) { + return new Effect.Scale(element, window.opera ? 1 : 0, { + restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }); +} + +Effect.Grow = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || {}); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function(effect) { + effect.element.hide().makeClipping().makePositioned(); + }, + afterFinishInternal: function(effect) { + new Effect.Parallel( + [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function(effect) { + effect.effects[0].element.setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); + } + }, options) + ) + } + }); +} + +Effect.Shrink = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || {}); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel( + [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function(effect) { + effect.effects[0].element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } + }, options) + ); +} + +Effect.Pulsate = function(element) { + element = $(element); + var options = arguments[1] || {}; + var oldOpacity = element.getInlineOpacity(); + var transition = options.transition || Effect.Transitions.sinoidal; + var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; + reverser.bind(transition); + return new Effect.Opacity(element, + Object.extend(Object.extend({ duration: 2.0, from: 0, + afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } + }, options), {transition: reverser})); +} + +Effect.Fold = function(element) { + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + element.makeClipping(); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function(effect) { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().setStyle(oldStyle); + } }); + }}, arguments[1] || {})); +}; + +Effect.Morph = Class.create(); +Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + style: {} + }, arguments[1] || {}); + if (typeof options.style == 'string') { + if(options.style.indexOf(':') == -1) { + var cssText = '', selector = '.' + options.style; + $A(document.styleSheets).reverse().each(function(styleSheet) { + if (styleSheet.cssRules) cssRules = styleSheet.cssRules; + else if (styleSheet.rules) cssRules = styleSheet.rules; + $A(cssRules).reverse().each(function(rule) { + if (selector == rule.selectorText) { + cssText = rule.style.cssText; + throw $break; + } + }); + if (cssText) throw $break; + }); + this.style = cssText.parseStyle(); + options.afterFinishInternal = function(effect){ + effect.element.addClassName(effect.options.style); + effect.transforms.each(function(transform) { + if(transform.style != 'opacity') + effect.element.style[transform.style.camelize()] = ''; + }); + } + } else this.style = options.style.parseStyle(); + } else this.style = $H(options.style) + this.start(options); + }, + setup: function(){ + function parseColor(color){ + if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; + color = color.parseColor(); + return $R(0,2).map(function(i){ + return parseInt( color.slice(i*2+1,i*2+3), 16 ) + }); + } + this.transforms = this.style.map(function(pair){ + var property = pair[0].underscore().dasherize(), value = pair[1], unit = null; + + if(value.parseColor('#zzzzzz') != '#zzzzzz') { + value = value.parseColor(); + unit = 'color'; + } else if(property == 'opacity') { + value = parseFloat(value); + if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + } else if(Element.CSS_LENGTH.test(value)) + var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), + value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; + + var originalValue = this.element.getStyle(property); + return $H({ + style: property, + originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), + targetValue: unit=='color' ? parseColor(value) : value, + unit: unit + }); + }.bind(this)).reject(function(transform){ + return ( + (transform.originalValue == transform.targetValue) || + ( + transform.unit != 'color' && + (isNaN(transform.originalValue) || isNaN(transform.targetValue)) + ) + ) + }); + }, + update: function(position) { + var style = $H(), value = null; + this.transforms.each(function(transform){ + value = transform.unit=='color' ? + $R(0,2).inject('#',function(m,v,i){ + return m+(Math.round(transform.originalValue[i]+ + (transform.targetValue[i] - transform.originalValue[i])*position)).toColorPart() }) : + transform.originalValue + Math.round( + ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit; + style[transform.style] = value; + }); + this.element.setStyle(style); + } +}); + +Effect.Transform = Class.create(); +Object.extend(Effect.Transform.prototype, { + initialize: function(tracks){ + this.tracks = []; + this.options = arguments[1] || {}; + this.addTracks(tracks); + }, + addTracks: function(tracks){ + tracks.each(function(track){ + var data = $H(track).values().first(); + this.tracks.push($H({ + ids: $H(track).keys().first(), + effect: Effect.Morph, + options: { style: data } + })); + }.bind(this)); + return this; + }, + play: function(){ + return new Effect.Parallel( + this.tracks.map(function(track){ + var elements = [$(track.ids) || $$(track.ids)].flatten(); + return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) }); + }).flatten(), + this.options + ); + } +}); + +Element.CSS_PROPERTIES = $w( + 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + + 'fontSize fontWeight height left letterSpacing lineHeight ' + + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ + 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + + 'right textIndent top width wordSpacing zIndex'); + +Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; + +String.prototype.parseStyle = function(){ + var element = Element.extend(document.createElement('div')); + element.innerHTML = '
    '; + var style = element.down().style, styleRules = $H(); + + Element.CSS_PROPERTIES.each(function(property){ + if(style[property]) styleRules[property] = style[property]; + }); + if(/MSIE/.test(navigator.userAgent) && !window.opera && this.indexOf('opacity') > -1) { + styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]; + } + return styleRules; +}; + +Element.morph = function(element, style) { + new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {})); + return element; +}; + +['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom', + 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( + function(f) { Element.Methods[f] = Element[f]; } +); + +Element.Methods.visualEffect = function(element, effect, options) { + s = effect.gsub(/_/, '-').camelize(); + effect_class = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[effect_class](element, options); + return $(element); +}; + +Element.addMethods(); \ No newline at end of file diff --git a/js/accordeon/prototype.js b/js/accordeon/prototype.js new file mode 100644 index 0000000..6a89643 --- /dev/null +++ b/js/accordeon/prototype.js @@ -0,0 +1,3278 @@ +/* Prototype JavaScript framework, version 1.5.1.1 + * (c) 2005-2007 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.5.1.1', + + Browser: { + IE: !!(window.attachEvent && !window.opera), + Opera: !!window.opera, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1 + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + (document.createElement('div').__proto__ !== + document.createElement('form').__proto__) + }, + + ScriptFragment: ']*>([\\S\\s]*?)<\/script>', + JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +} + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function(destination, source) { + for (var property in source) { + destination[property] = source[property]; + } + return destination; +} + +Object.extend(Object, { + inspect: function(object) { + try { + if (object === undefined) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + toJSON: function(object) { + var type = typeof object; + switch(type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } + if (object === null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (object.ownerDocument === document) return; + var results = []; + for (var property in object) { + var value = Object.toJSON(object[property]); + if (value !== undefined) + results.push(property.toJSON() + ': ' + value); + } + return '{' + results.join(', ') + '}'; + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({}, object); + } +}); + +Function.prototype.bind = function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } +} + +Function.prototype.bindAsEventListener = function(object) { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } +} + +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + }, + + toPaddedString: function(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; + }, + + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); + +Date.prototype.toJSON = function() { + return '"' + this.getFullYear() + '-' + + (this.getMonth() + 1).toPaddedString(2) + '-' + + this.getDate().toPaddedString(2) + 'T' + + this.getHours().toPaddedString(2) + ':' + + this.getMinutes().toPaddedString(2) + ':' + + this.getSeconds().toPaddedString(2) + '"'; +}; + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(this); + } finally { + this.currentlyExecuting = false; + } + } + } +} +Object.extend(String, { + interpret: function(value) { + return value == null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return this; + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : this; + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var self = arguments.callee; + self.text.data = this; + return self.div.innerHTML; + }, + + unescapeHTML: function() { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return {}; + + return match[1].split(separator || '&').inject({}, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var key = decodeURIComponent(pair.shift()); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + if (value != undefined) value = decodeURIComponent(value); + + if (key in hash) { + if (hash[key].constructor != Array) hash[key] = [hash[key]]; + hash[key].push(value); + } + else hash[key] = value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + var result = ''; + for (var i = 0; i < count; i++) result += this; + return result; + }, + + camelize: function() { + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; + + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); + + return camelized; + }, + + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { + var character = String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + isJSON: function() { + var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + evalJSON: function(sanitize) { + var json = this.unfilterJSON(); + try { + if (!sanitize || json.isJSON()) return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) === 0; + }, + + endsWith: function(pattern) { + var d = this.length - pattern.length; + return d >= 0 && this.lastIndexOf(pattern) === d; + }, + + empty: function() { + return this == ''; + }, + + blank: function() { + return /^\s*$/.test(this); + } +}); + +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(//g,'>'); + }, + unescapeHTML: function() { + return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (typeof replacement == 'function') return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +} + +String.prototype.parseQuery = String.prototype.toQueryParams; + +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); + +with (String.prototype.escapeHTML) div.appendChild(text); + +var Template = Class.create(); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; +Template.prototype = { + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + return this.template.gsub(this.pattern, function(match) { + var before = match[1]; + if (before == '\\') return match[2]; + return before + String.interpret(object[match[3]]); + }); + } +} + +var $break = {}, $continue = new Error('"throw $continue" is deprecated, use "return" instead'); + +var Enumerable = { + each: function(iterator) { + var index = 0; + try { + this._each(function(value) { + iterator(value, index++); + }); + } catch (e) { + if (e != $break) throw e; + } + return this; + }, + + eachSlice: function(number, iterator) { + var index = -number, slices = [], array = this.toArray(); + while ((index += number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.map(iterator); + }, + + all: function(iterator) { + var result = true; + this.each(function(value, index) { + result = result && !!(iterator || Prototype.K)(value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator) { + var result = false; + this.each(function(value, index) { + if (result = !!(iterator || Prototype.K)(value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator) { + var results = []; + this.each(function(value, index) { + results.push((iterator || Prototype.K)(value, index)); + }); + return results; + }, + + detect: function(iterator) { + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator) { + var results = []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(pattern, iterator) { + var results = []; + this.each(function(value, index) { + var stringValue = value.toString(); + if (stringValue.match(pattern)) + results.push((iterator || Prototype.K)(value, index)); + }) + return results; + }, + + include: function(object) { + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inGroupsOf: function(number, fillWith) { + fillWith = fillWith === undefined ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator) { + this.each(function(value, index) { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (result == undefined || value >= result) + result = value; + }); + return result; + }, + + min: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (result == undefined || value < result) + result = value; + }); + return result; + }, + + partition: function(iterator) { + var trues = [], falses = []; + this.each(function(value, index) { + ((iterator || Prototype.K)(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value, index) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator) { + var results = []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator) { + return this.map(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.map(); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (typeof args.last() == 'function') + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + size: function() { + return this.toArray().length; + }, + + inspect: function() { + return '#'; + } +} + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray +}); +var $A = Array.from = function(iterable) { + if (!iterable) return []; + if (iterable.toArray) { + return iterable.toArray(); + } else { + var results = []; + for (var i = 0, length = iterable.length; i < length; i++) + results.push(iterable[i]); + return results; + } +} + +if (Prototype.Browser.WebKit) { + $A = Array.from = function(iterable) { + if (!iterable) return []; + if (!(typeof iterable == 'function' && iterable == '[object NodeList]') && + iterable.toArray) { + return iterable.toArray(); + } else { + var results = []; + for (var i = 0, length = iterable.length; i < length; i++) + results.push(iterable[i]); + return results; + } + } +} + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) + Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(value && value.constructor == Array ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + indexOf: function(object) { + for (var i = 0, length = this.length; i < length; i++) + if (this[i] == object) return i; + return -1; + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + reduce: function() { + return this.length > 1 ? this : this[0]; + }, + + uniq: function(sorted) { + return this.inject([], function(array, value, index) { + if (0 == index || (sorted ? array.last() != value : !array.include(value))) + array.push(value); + return array; + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + }, + + toJSON: function() { + var results = []; + this.each(function(object) { + var value = Object.toJSON(object); + if (value !== undefined) results.push(value); + }); + return '[' + results.join(', ') + ']'; + } +}); + +Array.prototype.toArray = Array.prototype.clone; + +function $w(string) { + string = string.strip(); + return string ? string.split(/\s+/) : []; +} + +if (Prototype.Browser.Opera){ + Array.prototype.concat = function() { + var array = []; + for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for (var i = 0, length = arguments.length; i < length; i++) { + if (arguments[i].constructor == Array) { + for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + } +} +var Hash = function(object) { + if (object instanceof Hash) this.merge(object); + else Object.extend(this, object || {}); +}; + +Object.extend(Hash, { + toQueryString: function(obj) { + var parts = []; + parts.add = arguments.callee.addPair; + + this.prototype._each.call(obj, function(pair) { + if (!pair.key) return; + var value = pair.value; + + if (value && typeof value == 'object') { + if (value.constructor == Array) value.each(function(value) { + parts.add(pair.key, value); + }); + return; + } + parts.add(pair.key, value); + }); + + return parts.join('&'); + }, + + toJSON: function(object) { + var results = []; + this.prototype._each.call(object, function(pair) { + var value = Object.toJSON(pair.value); + if (value !== undefined) results.push(pair.key.toJSON() + ': ' + value); + }); + return '{' + results.join(', ') + '}'; + } +}); + +Hash.toQueryString.addPair = function(key, value, prefix) { + key = encodeURIComponent(key); + if (value === undefined) this.push(key); + else this.push(key + '=' + (value == null ? '' : encodeURIComponent(value))); +} + +Object.extend(Hash.prototype, Enumerable); +Object.extend(Hash.prototype, { + _each: function(iterator) { + for (var key in this) { + var value = this[key]; + if (value && value == Hash.prototype[key]) continue; + + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + merge: function(hash) { + return $H(hash).inject(this, function(mergedHash, pair) { + mergedHash[pair.key] = pair.value; + return mergedHash; + }); + }, + + remove: function() { + var result; + for(var i = 0, length = arguments.length; i < length; i++) { + var value = this[arguments[i]]; + if (value !== undefined){ + if (result === undefined) result = value; + else { + if (result.constructor != Array) result = [result]; + result.push(value) + } + } + delete this[arguments[i]]; + } + return result; + }, + + toQueryString: function() { + return Hash.toQueryString(this); + }, + + inspect: function() { + return '#'; + }, + + toJSON: function() { + return Hash.toJSON(this); + } +}); + +function $H(object) { + if (object instanceof Hash) return object; + return new Hash(object); +}; + +// Safari iterates over shadowed properties +if (function() { + var i = 0, Test = function(value) { this.key = value }; + Test.prototype.key = 'foo'; + for (var property in new Test('bar')) i++; + return i > 1; +}()) Hash.prototype._each = function(iterator) { + var cache = []; + for (var key in this) { + var value = this[key]; + if ((value && value == Hash.prototype[key]) || cache.include(key)) continue; + cache.push(key); + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } +}; +ObjectRange = Class.create(); +Object.extend(ObjectRange.prototype, Enumerable); +Object.extend(ObjectRange.prototype, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + while (this.include(value)) { + iterator(value); + value = value.succ(); + } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +} + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +} + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); + }, + + unregister: function(responder) { + this.responders = this.responders.without(responder); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (typeof responder[callback] == 'function') { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) {} + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { + Ajax.activeRequestCount++; + }, + onComplete: function() { + Ajax.activeRequestCount--; + } +}); + +Ajax.Base = function() {}; +Ajax.Base.prototype = { + setOptions: function(options) { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '' + } + Object.extend(this.options, options || {}); + + this.options.method = this.options.method.toLowerCase(); + if (typeof this.options.parameters == 'string') + this.options.parameters = this.options.parameters.toQueryParams(); + } +} + +Ajax.Request = Class.create(); +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Request.prototype = Object.extend(new Ajax.Base(), { + _complete: false, + + initialize: function(url, options) { + this.transport = Ajax.getTransport(); + this.setOptions(options); + this.request(url); + }, + + request: function(url) { + this.url = url; + this.method = this.options.method; + var params = Object.clone(this.options.parameters); + + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] = this.method; + this.method = 'post'; + } + + this.parameters = params; + + if (params = Hash.toQueryString(params)) { + // when GET, append parameters to URL + if (this.method == 'get') + this.url += (this.url.include('?') ? '&' : '?') + params; + else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + params += '&_='; + } + + try { + if (this.options.onCreate) this.options.onCreate(this.transport); + Ajax.Responders.dispatch('onCreate', this, this.transport); + + this.transport.open(this.method.toUpperCase(), this.url, + this.options.asynchronous); + + if (this.options.asynchronous) + setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10); + + this.transport.onreadystatechange = this.onStateChange.bind(this); + this.setRequestHeaders(); + + this.body = this.method == 'post' ? (this.options.postBody || params) : null; + this.transport.send(this.body); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { + this.dispatchException(e); + } + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState > 1 && !((readyState == 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + + setRequestHeaders: function() { + var headers = { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }; + + if (this.method == 'post') { + headers['Content-type'] = this.options.contentType + + (this.options.encoding ? '; charset=' + this.options.encoding : ''); + + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) + headers['Connection'] = 'close'; + } + + // user-defined headers + if (typeof this.options.requestHeaders == 'object') { + var extras = this.options.requestHeaders; + + if (typeof extras.push == 'function') + for (var i = 0, length = extras.length; i < length; i += 2) + headers[extras[i]] = extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] = pair.value }); + } + + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); + }, + + success: function() { + return !this.transport.status + || (this.transport.status >= 200 && this.transport.status < 300); + }, + + respondToReadyState: function(readyState) { + var state = Ajax.Request.Events[readyState]; + var transport = this.transport, json = this.evalJSON(); + + if (state == 'Complete') { + try { + this._complete = true; + (this.options['on' + this.transport.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(transport, json); + } catch (e) { + this.dispatchException(e); + } + + var contentType = this.getHeader('Content-type'); + if (contentType && contentType.strip(). + match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) + this.evalResponse(); + } + + try { + (this.options['on' + state] || Prototype.emptyFunction)(transport, json); + Ajax.Responders.dispatch('on' + state, this, transport, json); + } catch (e) { + this.dispatchException(e); + } + + if (state == 'Complete') { + // avoid memory leak in MSIE: clean up + this.transport.onreadystatechange = Prototype.emptyFunction; + } + }, + + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name); + } catch (e) { return null } + }, + + evalJSON: function() { + try { + var json = this.getHeader('X-JSON'); + return json ? json.evalJSON() : null; + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval((this.transport.responseText || '').unfilterJSON()); + } catch (e) { + this.dispatchException(e); + } + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Updater = Class.create(); + +Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { + initialize: function(container, url, options) { + this.container = { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container)) + } + + this.transport = Ajax.getTransport(); + this.setOptions(options); + + var onComplete = this.options.onComplete || Prototype.emptyFunction; + this.options.onComplete = (function(transport, param) { + this.updateContent(); + onComplete(transport, param); + }).bind(this); + + this.request(url); + }, + + updateContent: function() { + var receiver = this.container[this.success() ? 'success' : 'failure']; + var response = this.transport.responseText; + + if (!this.options.evalScripts) response = response.stripScripts(); + + if (receiver = $(receiver)) { + if (this.options.insertion) + new this.options.insertion(receiver, response); + else + receiver.update(response); + } + + if (this.success()) { + if (this.onComplete) + setTimeout(this.onComplete.bind(this), 10); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(); +Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { + initialize: function(container, url, options) { + this.setOptions(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = {}; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.options.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(request) { + if (this.options.decay) { + this.decay = (request.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = request.responseText; + } + this.timer = setTimeout(this.onTimerEvent.bind(this), + this.decay * this.frequency * 1000); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $(element) { + if (arguments.length > 1) { + for (var i = 0, elements = [], length = arguments.length; i < length; i++) + elements.push($(arguments[i])); + return elements; + } + if (typeof element == 'string') + element = document.getElementById(element); + return Element.extend(element); +} + +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath = function(expression, parentElement) { + var results = []; + var query = document.evaluate(expression, $(parentElement) || document, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0, length = query.snapshotLength; i < length; i++) + results.push(query.snapshotItem(i)); + return results; + }; + + document.getElementsByClassName = function(className, parentElement) { + var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; + return document._getElementsByXPath(q, parentElement); + } + +} else document.getElementsByClassName = function(className, parentElement) { + var children = ($(parentElement) || document.body).getElementsByTagName('*'); + var elements = [], child, pattern = new RegExp("(^|\\s)" + className + "(\\s|$)"); + for (var i = 0, length = children.length; i < length; i++) { + child = children[i]; + var elementClassName = child.className; + if (elementClassName.length == 0) continue; + if (elementClassName == className || elementClassName.match(pattern)) + elements.push(Element.extend(child)); + } + return elements; +}; + +/*--------------------------------------------------------------------------*/ + +if (!window.Element) var Element = {}; + +Element.extend = function(element) { + var F = Prototype.BrowserFeatures; + if (!element || !element.tagName || element.nodeType == 3 || + element._extended || F.SpecificElementExtensions || element == window) + return element; + + var methods = {}, tagName = element.tagName, cache = Element.extend.cache, + T = Element.Methods.ByTag; + + // extend methods for all tags (Safari doesn't need this) + if (!F.ElementExtensions) { + Object.extend(methods, Element.Methods), + Object.extend(methods, Element.Methods.Simulated); + } + + // extend methods for specific tags + if (T[tagName]) Object.extend(methods, T[tagName]); + + for (var property in methods) { + var value = methods[property]; + if (typeof value == 'function' && !(property in element)) + element[property] = cache.findOrStore(value); + } + + element._extended = Prototype.emptyFunction; + return element; +}; + +Element.extend.cache = { + findOrStore: function(value) { + return this[value] = this[value] || function() { + return value.apply(null, [this].concat($A(arguments))); + } + } +}; + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function(element) { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function(element) { + $(element).style.display = 'none'; + return element; + + }, + + show: function(element) { + $(element).style.display = ''; + return element; + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function(element, html) { + html = typeof html == 'undefined' ? '' : html.toString(); + $(element).innerHTML = html.stripScripts(); + setTimeout(function() {html.evalScripts()}, 10); + return element; + }, + + replace: function(element, html) { + element = $(element); + html = typeof html == 'undefined' ? '' : html.toString(); + if (element.outerHTML) { + element.outerHTML = html.stripScripts(); + } else { + var range = element.ownerDocument.createRange(); + range.selectNodeContents(element); + element.parentNode.replaceChild( + range.createContextualFragment(html.stripScripts()), element); + } + setTimeout(function() {html.evalScripts()}, 10); + return element; + }, + + inspect: function(element) { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if (value) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element = $(element); + var elements = []; + while (element = element[property]) + if (element.nodeType == 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $A($(element).getElementsByTagName('*')).each(Element.extend); + }, + + firstDescendant: function(element) { + element = $(element).firstChild; + while (element && element.nodeType != 1) element = element.nextSibling; + return $(element); + }, + + immediateDescendants: function(element) { + if (!(element = $(element).firstChild)) return []; + while (element && element.nodeType != 1) element = element.nextSibling; + if (element) return [element].concat($(element).nextSiblings()); + return []; + }, + + previousSiblings: function(element) { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function(element) { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function(element) { + element = $(element); + return element.previousSiblings().reverse().concat(element.nextSiblings()); + }, + + match: function(element, selector) { + if (typeof selector == 'string') + selector = new Selector(selector); + return selector.match($(element)); + }, + + up: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(element.parentNode); + var ancestors = element.ancestors(); + return expression ? Selector.findElement(ancestors, expression, index) : + ancestors[index || 0]; + }, + + down: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return element.firstDescendant(); + var descendants = element.descendants(); + return expression ? Selector.findElement(descendants, expression, index) : + descendants[index || 0]; + }, + + previous: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); + var previousSiblings = element.previousSiblings(); + return expression ? Selector.findElement(previousSiblings, expression, index) : + previousSiblings[index || 0]; + }, + + next: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); + var nextSiblings = element.nextSiblings(); + return expression ? Selector.findElement(nextSiblings, expression, index) : + nextSiblings[index || 0]; + }, + + getElementsBySelector: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element, args); + }, + + getElementsByClassName: function(element, className) { + return document.getElementsByClassName(className, element); + }, + + readAttribute: function(element, name) { + element = $(element); + if (Prototype.Browser.IE) { + if (!element.attributes) return null; + var t = Element._attributeTranslations; + if (t.values[name]) return t.values[name](element, name); + if (t.names[name]) name = t.names[name]; + var attribute = element.attributes[name]; + return attribute ? attribute.nodeValue : null; + } + return element.getAttribute(name); + }, + + getHeight: function(element) { + return $(element).getDimensions().height; + }, + + getWidth: function(element) { + return $(element).getDimensions().width; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + var elementClassName = element.className; + if (elementClassName.length == 0) return false; + if (elementClassName == className || + elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) + return true; + return false; + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + Element.classNames(element).add(className); + return element; + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + Element.classNames(element).remove(className); + return element; + }, + + toggleClassName: function(element, className) { + if (!(element = $(element))) return; + Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className); + return element; + }, + + observe: function() { + Event.observe.apply(Event, arguments); + return $A(arguments).first(); + }, + + stopObserving: function() { + Event.stopObserving.apply(Event, arguments); + return $A(arguments).first(); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + var node = element.firstChild; + while (node) { + var nextNode = node.nextSibling; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + element.removeChild(node); + node = nextNode; + } + return element; + }, + + empty: function(element) { + return $(element).innerHTML.blank(); + }, + + descendantOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + while (element = element.parentNode) + if (element == ancestor) return true; + return false; + }, + + scrollTo: function(element) { + element = $(element); + var pos = Position.cumulativeOffset(element); + window.scrollTo(pos[0], pos[1]); + return element; + }, + + getStyle: function(element, style) { + element = $(element); + style = style == 'float' ? 'cssFloat' : style.camelize(); + var value = element.style[style]; + if (!value) { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css[style] : null; + } + if (style == 'opacity') return value ? parseFloat(value) : 1.0; + return value == 'auto' ? null : value; + }, + + getOpacity: function(element) { + return $(element).getStyle('opacity'); + }, + + setStyle: function(element, styles, camelized) { + element = $(element); + var elementStyle = element.style; + + for (var property in styles) + if (property == 'opacity') element.setOpacity(styles[property]) + else + elementStyle[(property == 'float' || property == 'cssFloat') ? + (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') : + (camelized ? property : property.camelize())] = styles[property]; + + return element; + }, + + setOpacity: function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + return element; + }, + + getDimensions: function(element) { + element = $(element); + var display = $(element).getStyle('display'); + if (display != 'none' && display != null) // Safari bug + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + var originalDisplay = els.display; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = 'block'; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = originalDisplay; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (window.opera) { + element.style.top = 0; + element.style.left = 0; + } + } + return element; + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + return element; + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return element; + element._overflow = element.style.overflow || 'auto'; + if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') + element.style.overflow = 'hidden'; + return element; + }, + + undoClipping: function(element) { + element = $(element); + if (!element._overflow) return element; + element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; + element._overflow = null; + return element; + } +}; + +Object.extend(Element.Methods, { + childOf: Element.Methods.descendantOf, + childElements: Element.Methods.immediateDescendants +}); + +if (Prototype.Browser.Opera) { + Element.Methods._getStyle = Element.Methods.getStyle; + Element.Methods.getStyle = function(element, style) { + switch(style) { + case 'left': + case 'top': + case 'right': + case 'bottom': + if (Element._getStyle(element, 'position') == 'static') return null; + default: return Element._getStyle(element, style); + } + }; +} +else if (Prototype.Browser.IE) { + Element.Methods.getStyle = function(element, style) { + element = $(element); + style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); + var value = element.style[style]; + if (!value && element.currentStyle) value = element.currentStyle[style]; + + if (style == 'opacity') { + if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) + if (value[1]) return parseFloat(value[1]) / 100; + return 1.0; + } + + if (value == 'auto') { + if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) + return element['offset'+style.capitalize()] + 'px'; + return null; + } + return value; + }; + + Element.Methods.setOpacity = function(element, value) { + element = $(element); + var filter = element.getStyle('filter'), style = element.style; + if (value == 1 || value === '') { + style.filter = filter.replace(/alpha\([^\)]*\)/gi,''); + return element; + } else if (value < 0.00001) value = 0; + style.filter = filter.replace(/alpha\([^\)]*\)/gi, '') + + 'alpha(opacity=' + (value * 100) + ')'; + return element; + }; + + // IE is missing .innerHTML support for TABLE-related elements + Element.Methods.update = function(element, html) { + element = $(element); + html = typeof html == 'undefined' ? '' : html.toString(); + var tagName = element.tagName.toUpperCase(); + if (['THEAD','TBODY','TR','TD'].include(tagName)) { + var div = document.createElement('div'); + switch (tagName) { + case 'THEAD': + case 'TBODY': + div.innerHTML = '' + html.stripScripts() + '
    '; + depth = 2; + break; + case 'TR': + div.innerHTML = '' + html.stripScripts() + '
    '; + depth = 3; + break; + case 'TD': + div.innerHTML = '
    ' + html.stripScripts() + '
    '; + depth = 4; + } + $A(element.childNodes).each(function(node) { element.removeChild(node) }); + depth.times(function() { div = div.firstChild }); + $A(div.childNodes).each(function(node) { element.appendChild(node) }); + } else { + element.innerHTML = html.stripScripts(); + } + setTimeout(function() { html.evalScripts() }, 10); + return element; + } +} +else if (Prototype.Browser.Gecko) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1) ? 0.999999 : + (value === '') ? '' : (value < 0.00001) ? 0 : value; + return element; + }; +} + +Element._attributeTranslations = { + names: { + colspan: "colSpan", + rowspan: "rowSpan", + valign: "vAlign", + datetime: "dateTime", + accesskey: "accessKey", + tabindex: "tabIndex", + enctype: "encType", + maxlength: "maxLength", + readonly: "readOnly", + longdesc: "longDesc" + }, + values: { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + title: function(element) { + var node = element.getAttributeNode('title'); + return node.specified ? node.nodeValue : null; + } + } +}; + +(function() { + Object.extend(this, { + href: this._getAttr, + src: this._getAttr, + type: this._getAttr, + disabled: this._flag, + checked: this._flag, + readonly: this._flag, + multiple: this._flag + }); +}).call(Element._attributeTranslations.values); + +Element.Methods.Simulated = { + hasAttribute: function(element, attribute) { + var t = Element._attributeTranslations, node; + attribute = t.names[attribute] || attribute; + node = $(element).getAttributeNode(attribute); + return node && node.specified; + } +}; + +Element.Methods.ByTag = {}; + +Object.extend(Element, Element.Methods); + +if (!Prototype.BrowserFeatures.ElementExtensions && + document.createElement('div').__proto__) { + window.HTMLElement = {}; + window.HTMLElement.prototype = document.createElement('div').__proto__; + Prototype.BrowserFeatures.ElementExtensions = true; +} + +Element.hasAttribute = function(element, attribute) { + if (element.hasAttribute) return element.hasAttribute(attribute); + return Element.Methods.Simulated.hasAttribute(element, attribute); +}; + +Element.addMethods = function(methods) { + var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; + + if (!methods) { + Object.extend(Form, Form.Methods); + Object.extend(Form.Element, Form.Element.Methods); + Object.extend(Element.Methods.ByTag, { + "FORM": Object.clone(Form.Methods), + "INPUT": Object.clone(Form.Element.Methods), + "SELECT": Object.clone(Form.Element.Methods), + "TEXTAREA": Object.clone(Form.Element.Methods) + }); + } + + if (arguments.length == 2) { + var tagName = methods; + methods = arguments[1]; + } + + if (!tagName) Object.extend(Element.Methods, methods || {}); + else { + if (tagName.constructor == Array) tagName.each(extend); + else extend(tagName); + } + + function extend(tagName) { + tagName = tagName.toUpperCase(); + if (!Element.Methods.ByTag[tagName]) + Element.Methods.ByTag[tagName] = {}; + Object.extend(Element.Methods.ByTag[tagName], methods); + } + + function copy(methods, destination, onlyIfAbsent) { + onlyIfAbsent = onlyIfAbsent || false; + var cache = Element.extend.cache; + for (var property in methods) { + var value = methods[property]; + if (!onlyIfAbsent || !(property in destination)) + destination[property] = cache.findOrStore(value); + } + } + + function findDOMClass(tagName) { + var klass; + var trans = { + "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", + "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", + "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", + "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", + "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": + "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": + "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": + "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": + "FrameSet", "IFRAME": "IFrame" + }; + if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName.capitalize() + 'Element'; + if (window[klass]) return window[klass]; + + window[klass] = {}; + window[klass].prototype = document.createElement(tagName).__proto__; + return window[klass]; + } + + if (F.ElementExtensions) { + copy(Element.Methods, HTMLElement.prototype); + copy(Element.Methods.Simulated, HTMLElement.prototype, true); + } + + if (F.SpecificElementExtensions) { + for (var tag in Element.Methods.ByTag) { + var klass = findDOMClass(tag); + if (typeof klass == "undefined") continue; + copy(T[tag], klass.prototype); + } + } + + Object.extend(Element, Element.Methods); + delete Element.ByTag; +}; + +var Toggle = { display: Element.toggle }; + +/*--------------------------------------------------------------------------*/ + +Abstract.Insertion = function(adjacency) { + this.adjacency = adjacency; +} + +Abstract.Insertion.prototype = { + initialize: function(element, content) { + this.element = $(element); + this.content = content.stripScripts(); + + if (this.adjacency && this.element.insertAdjacentHTML) { + try { + this.element.insertAdjacentHTML(this.adjacency, this.content); + } catch (e) { + var tagName = this.element.tagName.toUpperCase(); + if (['TBODY', 'TR'].include(tagName)) { + this.insertContent(this.contentFromAnonymousTable()); + } else { + throw e; + } + } + } else { + this.range = this.element.ownerDocument.createRange(); + if (this.initializeRange) this.initializeRange(); + this.insertContent([this.range.createContextualFragment(this.content)]); + } + + setTimeout(function() {content.evalScripts()}, 10); + }, + + contentFromAnonymousTable: function() { + var div = document.createElement('div'); + div.innerHTML = '' + this.content + '
    '; + return $A(div.childNodes[0].childNodes[0].childNodes); + } +} + +var Insertion = new Object(); + +Insertion.Before = Class.create(); +Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { + initializeRange: function() { + this.range.setStartBefore(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, this.element); + }).bind(this)); + } +}); + +Insertion.Top = Class.create(); +Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(true); + }, + + insertContent: function(fragments) { + fragments.reverse(false).each((function(fragment) { + this.element.insertBefore(fragment, this.element.firstChild); + }).bind(this)); + } +}); + +Insertion.Bottom = Class.create(); +Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.appendChild(fragment); + }).bind(this)); + } +}); + +Insertion.After = Class.create(); +Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { + initializeRange: function() { + this.range.setStartAfter(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, + this.element.nextSibling); + }).bind(this)); + } +}); + +/*--------------------------------------------------------------------------*/ + +Element.ClassNames = Class.create(); +Element.ClassNames.prototype = { + initialize: function(element) { + this.element = $(element); + }, + + _each: function(iterator) { + this.element.className.split(/\s+/).select(function(name) { + return name.length > 0; + })._each(iterator); + }, + + set: function(className) { + this.element.className = className; + }, + + add: function(classNameToAdd) { + if (this.include(classNameToAdd)) return; + this.set($A(this).concat(classNameToAdd).join(' ')); + }, + + remove: function(classNameToRemove) { + if (!this.include(classNameToRemove)) return; + this.set($A(this).without(classNameToRemove).join(' ')); + }, + + toString: function() { + return $A(this).join(' '); + } +}; + +Object.extend(Element.ClassNames.prototype, Enumerable); +/* Portions of the Selector class are derived from Jack Slocum’s DomQuery, + * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style + * license. Please see http://www.yui-ext.com/ for more information. */ + +var Selector = Class.create(); + +Selector.prototype = { + initialize: function(expression) { + this.expression = expression.strip(); + this.compileMatcher(); + }, + + compileMatcher: function() { + // Selectors with namespaced attributes can't use the XPath version + if (Prototype.BrowserFeatures.XPath && !(/\[[\w-]*?:/).test(this.expression)) + return this.compileXPathMatcher(); + + var e = this.expression, ps = Selector.patterns, h = Selector.handlers, + c = Selector.criteria, le, p, m; + + if (Selector._cache[e]) { + this.matcher = Selector._cache[e]; return; + } + this.matcher = ["this.matcher = function(root) {", + "var r = root, h = Selector.handlers, c = false, n;"]; + + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + this.matcher.push(typeof c[i] == 'function' ? c[i](m) : + new Template(c[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.matcher.push("return h.unique(n);\n}"); + eval(this.matcher.join('\n')); + Selector._cache[this.expression] = this.matcher; + }, + + compileXPathMatcher: function() { + var e = this.expression, ps = Selector.patterns, + x = Selector.xpath, le, m; + + if (Selector._cache[e]) { + this.xpath = Selector._cache[e]; return; + } + + this.matcher = ['.//*']; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + if (m = e.match(ps[i])) { + this.matcher.push(typeof x[i] == 'function' ? x[i](m) : + new Template(x[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.xpath = this.matcher.join(''); + Selector._cache[this.expression] = this.xpath; + }, + + findElements: function(root) { + root = root || document; + if (this.xpath) return document._getElementsByXPath(this.xpath, root); + return this.matcher(root); + }, + + match: function(element) { + return this.findElements(document).include(element); + }, + + toString: function() { + return this.expression; + }, + + inspect: function() { + return "#"; + } +}; + +Object.extend(Selector, { + _cache: {}, + + xpath: { + descendant: "//*", + child: "/*", + adjacent: "/following-sibling::*[1]", + laterSibling: '/following-sibling::*', + tagName: function(m) { + if (m[1] == '*') return ''; + return "[local-name()='" + m[1].toLowerCase() + + "' or local-name()='" + m[1].toUpperCase() + "']"; + }, + className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", + id: "[@id='#{1}']", + attrPresence: "[@#{1}]", + attr: function(m) { + m[3] = m[5] || m[6]; + return new Template(Selector.xpath.operators[m[2]]).evaluate(m); + }, + pseudo: function(m) { + var h = Selector.xpath.pseudos[m[1]]; + if (!h) return ''; + if (typeof h === 'function') return h(m); + return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); + }, + operators: { + '=': "[@#{1}='#{3}']", + '!=': "[@#{1}!='#{3}']", + '^=': "[starts-with(@#{1}, '#{3}')]", + '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", + '*=': "[contains(@#{1}, '#{3}')]", + '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", + '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" + }, + pseudos: { + 'first-child': '[not(preceding-sibling::*)]', + 'last-child': '[not(following-sibling::*)]', + 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', + 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", + 'checked': "[@checked]", + 'disabled': "[@disabled]", + 'enabled': "[not(@disabled)]", + 'not': function(m) { + var e = m[6], p = Selector.patterns, + x = Selector.xpath, le, m, v; + + var exclusion = []; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in p) { + if (m = e.match(p[i])) { + v = typeof x[i] == 'function' ? x[i](m) : new Template(x[i]).evaluate(m); + exclusion.push("(" + v.substring(1, v.length - 1) + ")"); + e = e.replace(m[0], ''); + break; + } + } + } + return "[not(" + exclusion.join(" and ") + ")]"; + }, + 'nth-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); + }, + 'nth-last-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); + }, + 'nth-of-type': function(m) { + return Selector.xpath.pseudos.nth("position() ", m); + }, + 'nth-last-of-type': function(m) { + return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); + }, + 'first-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); + }, + 'last-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); + }, + 'only-of-type': function(m) { + var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); + }, + nth: function(fragment, m) { + var mm, formula = m[6], predicate; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + if (mm = formula.match(/^(\d+)$/)) // digit only + return '[' + fragment + "= " + mm[1] + ']'; + if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (mm[1] == "-") mm[1] = -1; + var a = mm[1] ? Number(mm[1]) : 1; + var b = mm[2] ? Number(mm[2]) : 0; + predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + + "((#{fragment} - #{b}) div #{a} >= 0)]"; + return new Template(predicate).evaluate({ + fragment: fragment, a: a, b: b }); + } + } + } + }, + + criteria: { + tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', + className: 'n = h.className(n, r, "#{1}", c); c = false;', + id: 'n = h.id(n, r, "#{1}", c); c = false;', + attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', + attr: function(m) { + m[3] = (m[5] || m[6]); + return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); + }, + pseudo: function(m) { + if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); + return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); + }, + descendant: 'c = "descendant";', + child: 'c = "child";', + adjacent: 'c = "adjacent";', + laterSibling: 'c = "laterSibling";' + }, + + patterns: { + // combinators must be listed first + // (and descendant needs to be last combinator) + laterSibling: /^\s*~\s*/, + child: /^\s*>\s*/, + adjacent: /^\s*\+\s*/, + descendant: /^\s/, + + // selectors follow + tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, + id: /^#([\w\-\*]+)(\b|$)/, + className: /^\.([\w\-\*]+)(\b|$)/, + pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/, + attrPresence: /^\[([\w]+)\]/, + attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/ + }, + + handlers: { + // UTILITY FUNCTIONS + // joins two collections + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + a.push(node); + return a; + }, + + // marks an array of nodes for counting + mark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._counted = true; + return nodes; + }, + + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._counted = undefined; + return nodes; + }, + + // mark each child node with its position (for nth calls) + // "ofType" flag indicates whether we're indexing for nth-of-type + // rather than nth-child + index: function(parentNode, reverse, ofType) { + parentNode._counted = true; + if (reverse) { + for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { + node = nodes[i]; + if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + } + } else { + for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) + if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + } + }, + + // filters out duplicates and extends all nodes + unique: function(nodes) { + if (nodes.length == 0) return nodes; + var results = [], n; + for (var i = 0, l = nodes.length; i < l; i++) + if (!(n = nodes[i])._counted) { + n._counted = true; + results.push(Element.extend(n)); + } + return Selector.handlers.unmark(results); + }, + + // COMBINATOR FUNCTIONS + descendant: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName('*')); + return results; + }, + + child: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) { + for (var j = 0, children = [], child; child = node.childNodes[j]; j++) + if (child.nodeType == 1 && child.tagName != '!') results.push(child); + } + return results; + }, + + adjacent: function(nodes) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + var next = this.nextElementSibling(node); + if (next) results.push(next); + } + return results; + }, + + laterSibling: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, Element.nextSiblings(node)); + return results; + }, + + nextElementSibling: function(node) { + while (node = node.nextSibling) + if (node.nodeType == 1) return node; + return null; + }, + + previousElementSibling: function(node) { + while (node = node.previousSibling) + if (node.nodeType == 1) return node; + return null; + }, + + // TOKEN FUNCTIONS + tagName: function(nodes, root, tagName, combinator) { + tagName = tagName.toUpperCase(); + var results = [], h = Selector.handlers; + if (nodes) { + if (combinator) { + // fastlane for ordinary descendant combinators + if (combinator == "descendant") { + for (var i = 0, node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName(tagName)); + return results; + } else nodes = this[combinator](nodes); + if (tagName == "*") return nodes; + } + for (var i = 0, node; node = nodes[i]; i++) + if (node.tagName.toUpperCase() == tagName) results.push(node); + return results; + } else return root.getElementsByTagName(tagName); + }, + + id: function(nodes, root, id, combinator) { + var targetNode = $(id), h = Selector.handlers; + if (!nodes && root == document) return targetNode ? [targetNode] : []; + if (nodes) { + if (combinator) { + if (combinator == 'child') { + for (var i = 0, node; node = nodes[i]; i++) + if (targetNode.parentNode == node) return [targetNode]; + } else if (combinator == 'descendant') { + for (var i = 0, node; node = nodes[i]; i++) + if (Element.descendantOf(targetNode, node)) return [targetNode]; + } else if (combinator == 'adjacent') { + for (var i = 0, node; node = nodes[i]; i++) + if (Selector.handlers.previousElementSibling(targetNode) == node) + return [targetNode]; + } else nodes = h[combinator](nodes); + } + for (var i = 0, node; node = nodes[i]; i++) + if (node == targetNode) return [targetNode]; + return []; + } + return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; + }, + + className: function(nodes, root, className, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + return Selector.handlers.byClassName(nodes, root, className); + }, + + byClassName: function(nodes, root, className) { + if (!nodes) nodes = Selector.handlers.descendant([root]); + var needle = ' ' + className + ' '; + for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { + nodeClassName = node.className; + if (nodeClassName.length == 0) continue; + if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) + results.push(node); + } + return results; + }, + + attrPresence: function(nodes, root, attr) { + var results = []; + for (var i = 0, node; node = nodes[i]; i++) + if (Element.hasAttribute(node, attr)) results.push(node); + return results; + }, + + attr: function(nodes, root, attr, value, operator) { + if (!nodes) nodes = root.getElementsByTagName("*"); + var handler = Selector.operators[operator], results = []; + for (var i = 0, node; node = nodes[i]; i++) { + var nodeValue = Element.readAttribute(node, attr); + if (nodeValue === null) continue; + if (handler(nodeValue, value)) results.push(node); + } + return results; + }, + + pseudo: function(nodes, name, value, root, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + if (!nodes) nodes = root.getElementsByTagName("*"); + return Selector.pseudos[name](nodes, value, root); + } + }, + + pseudos: { + 'first-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.previousElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'last-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.nextElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'only-child': function(nodes, value, root) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) + results.push(node); + return results; + }, + 'nth-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root); + }, + 'nth-last-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true); + }, + 'nth-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, false, true); + }, + 'nth-last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true, true); + }, + 'first-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, false, true); + }, + 'last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, true, true); + }, + 'only-of-type': function(nodes, formula, root) { + var p = Selector.pseudos; + return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); + }, + + // handles the an+b logic + getIndices: function(a, b, total) { + if (a == 0) return b > 0 ? [b] : []; + return $R(1, total).inject([], function(memo, i) { + if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); + return memo; + }); + }, + + // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type + nth: function(nodes, formula, root, reverse, ofType) { + if (nodes.length == 0) return []; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + var h = Selector.handlers, results = [], indexed = [], m; + h.mark(nodes); + for (var i = 0, node; node = nodes[i]; i++) { + if (!node.parentNode._counted) { + h.index(node.parentNode, reverse, ofType); + indexed.push(node.parentNode); + } + } + if (formula.match(/^\d+$/)) { // just a number + formula = Number(formula); + for (var i = 0, node; node = nodes[i]; i++) + if (node.nodeIndex == formula) results.push(node); + } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (m[1] == "-") m[1] = -1; + var a = m[1] ? Number(m[1]) : 1; + var b = m[2] ? Number(m[2]) : 0; + var indices = Selector.pseudos.getIndices(a, b, nodes.length); + for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { + for (var j = 0; j < l; j++) + if (node.nodeIndex == indices[j]) results.push(node); + } + } + h.unmark(nodes); + h.unmark(indexed); + return results; + }, + + 'empty': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + // IE treats comments as element nodes + if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; + results.push(node); + } + return results; + }, + + 'not': function(nodes, selector, root) { + var h = Selector.handlers, selectorType, m; + var exclusions = new Selector(selector).findElements(root); + h.mark(exclusions); + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node._counted) results.push(node); + h.unmark(exclusions); + return results; + }, + + 'enabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node.disabled) results.push(node); + return results; + }, + + 'disabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.disabled) results.push(node); + return results; + }, + + 'checked': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.checked) results.push(node); + return results; + } + }, + + operators: { + '=': function(nv, v) { return nv == v; }, + '!=': function(nv, v) { return nv != v; }, + '^=': function(nv, v) { return nv.startsWith(v); }, + '$=': function(nv, v) { return nv.endsWith(v); }, + '*=': function(nv, v) { return nv.include(v); }, + '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, + '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } + }, + + matchElements: function(elements, expression) { + var matches = new Selector(expression).findElements(), h = Selector.handlers; + h.mark(matches); + for (var i = 0, results = [], element; element = elements[i]; i++) + if (element._counted) results.push(element); + h.unmark(matches); + return results; + }, + + findElement: function(elements, expression, index) { + if (typeof expression == 'number') { + index = expression; expression = false; + } + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function(element, expressions) { + var exprs = expressions.join(','), expressions = []; + exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { + expressions.push(m[1].strip()); + }); + var results = [], h = Selector.handlers; + for (var i = 0, l = expressions.length, selector; i < l; i++) { + selector = new Selector(expressions[i].strip()); + h.concat(results, selector.findElements(element)); + } + return (l > 1) ? h.unique(results) : results; + } +}); + +function $$() { + return Selector.findChildElements(document, $A(arguments)); +} +var Form = { + reset: function(form) { + $(form).reset(); + return form; + }, + + serializeElements: function(elements, getHash) { + var data = elements.inject({}, function(result, element) { + if (!element.disabled && element.name) { + var key = element.name, value = $(element).getValue(); + if (value != null) { + if (key in result) { + if (result[key].constructor != Array) result[key] = [result[key]]; + result[key].push(value); + } + else result[key] = value; + } + } + return result; + }); + + return getHash ? data : Hash.toQueryString(data); + } +}; + +Form.Methods = { + serialize: function(form, getHash) { + return Form.serializeElements(Form.getElements(form), getHash); + }, + + getElements: function(form) { + return $A($(form).getElementsByTagName('*')).inject([], + function(elements, child) { + if (Form.Element.Serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + } + ); + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) return $A(inputs).map(Element.extend); + + for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || (name && input.name != name)) + continue; + matchingInputs.push(Element.extend(input)); + } + + return matchingInputs; + }, + + disable: function(form) { + form = $(form); + Form.getElements(form).invoke('disable'); + return form; + }, + + enable: function(form) { + form = $(form); + Form.getElements(form).invoke('enable'); + return form; + }, + + findFirstElement: function(form) { + return $(form).getElements().find(function(element) { + return element.type != 'hidden' && !element.disabled && + ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + form = $(form); + form.findFirstElement().activate(); + return form; + }, + + request: function(form, options) { + form = $(form), options = Object.clone(options || {}); + + var params = options.parameters; + options.parameters = form.serialize(true); + + if (params) { + if (typeof params == 'string') params = params.toQueryParams(); + Object.extend(options.parameters, params); + } + + if (form.hasAttribute('method') && !options.method) + options.method = form.method; + + return new Ajax.Request(form.readAttribute('action'), options); + } +} + +/*--------------------------------------------------------------------------*/ + +Form.Element = { + focus: function(element) { + $(element).focus(); + return element; + }, + + select: function(element) { + $(element).select(); + return element; + } +} + +Form.Element.Methods = { + serialize: function(element) { + element = $(element); + if (!element.disabled && element.name) { + var value = element.getValue(); + if (value != undefined) { + var pair = {}; + pair[element.name] = value; + return Hash.toQueryString(pair); + } + } + return ''; + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + return Form.Element.Serializers[method](element); + }, + + clear: function(element) { + $(element).value = ''; + return element; + }, + + present: function(element) { + return $(element).value != ''; + }, + + activate: function(element) { + element = $(element); + try { + element.focus(); + if (element.select && (element.tagName.toLowerCase() != 'input' || + !['button', 'reset', 'submit'].include(element.type))) + element.select(); + } catch (e) {} + return element; + }, + + disable: function(element) { + element = $(element); + element.blur(); + element.disabled = true; + return element; + }, + + enable: function(element) { + element = $(element); + element.disabled = false; + return element; + } +} + +/*--------------------------------------------------------------------------*/ + +var Field = Form.Element; +var $F = Form.Element.Methods.getValue; + +/*--------------------------------------------------------------------------*/ + +Form.Element.Serializers = { + input: function(element) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element); + default: + return Form.Element.Serializers.textarea(element); + } + }, + + inputSelector: function(element) { + return element.checked ? element.value : null; + }, + + textarea: function(element) { + return element.value; + }, + + select: function(element) { + return this[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + }, + + selectOne: function(element) { + var index = element.selectedIndex; + return index >= 0 ? this.optionValue(element.options[index]) : null; + }, + + selectMany: function(element) { + var values, length = element.length; + if (!length) return null; + + for (var i = 0, values = []; i < length; i++) { + var opt = element.options[i]; + if (opt.selected) values.push(this.optionValue(opt)); + } + return values; + }, + + optionValue: function(opt) { + // extend element because hasAttribute may not be native + return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; + } +} + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = function() {} +Abstract.TimedObserver.prototype = { + initialize: function(element, frequency, callback) { + this.frequency = frequency; + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + var value = this.getValue(); + var changed = ('string' == typeof this.lastValue && 'string' == typeof value + ? this.lastValue != value : String(this.lastValue) != String(value)); + if (changed) { + this.callback(this.element, value); + this.lastValue = value; + } + } +} + +Form.Element.Observer = Class.create(); +Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(); +Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = function() {} +Abstract.EventObserver.prototype = { + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + Form.getElements(this.element).each(this.registerCallback.bind(this)); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +} + +Form.Element.EventObserver = Class.create(); +Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(); +Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) { + var Event = new Object(); +} + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + + element: function(event) { + return $(event.target || event.srcElement); + }, + + isLeftClick: function(event) { + return (((event.which) && (event.which == 1)) || + ((event.button) && (event.button == 1))); + }, + + pointerX: function(event) { + return event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + pointerY: function(event) { + return event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + stop: function(event) { + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } else { + event.returnValue = false; + event.cancelBubble = true; + } + }, + + // find the first node with the given tagName, starting from the + // node the event was triggered on; traverses the DOM upwards + findElement: function(event, tagName) { + var element = Event.element(event); + while (element.parentNode && (!element.tagName || + (element.tagName.toUpperCase() != tagName.toUpperCase()))) + element = element.parentNode; + return element; + }, + + observers: false, + + _observeAndCache: function(element, name, observer, useCapture) { + if (!this.observers) this.observers = []; + if (element.addEventListener) { + this.observers.push([element, name, observer, useCapture]); + element.addEventListener(name, observer, useCapture); + } else if (element.attachEvent) { + this.observers.push([element, name, observer, useCapture]); + element.attachEvent('on' + name, observer); + } + }, + + unloadCache: function() { + if (!Event.observers) return; + for (var i = 0, length = Event.observers.length; i < length; i++) { + Event.stopObserving.apply(this, Event.observers[i]); + Event.observers[i][0] = null; + } + Event.observers = false; + }, + + observe: function(element, name, observer, useCapture) { + element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (Prototype.Browser.WebKit || element.attachEvent)) + name = 'keydown'; + + Event._observeAndCache(element, name, observer, useCapture); + }, + + stopObserving: function(element, name, observer, useCapture) { + element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (Prototype.Browser.WebKit || element.attachEvent)) + name = 'keydown'; + + if (element.removeEventListener) { + element.removeEventListener(name, observer, useCapture); + } else if (element.detachEvent) { + try { + element.detachEvent('on' + name, observer); + } catch (e) {} + } + } +}); + +/* prevent memory leaks in IE */ +if (Prototype.Browser.IE) + Event.observe(window, 'unload', Event.unloadCache, false); +var Position = { + // set to true if needed, warning: firefox performance problems + // NOT neeeded for page scrolling, only if draggable contained in + // scrollable elements + includeScrollOffsets: false, + + // must be called before calling withinIncludingScrolloffset, every time the + // page is scrolled + prepare: function() { + this.deltaX = window.pageXOffset + || document.documentElement.scrollLeft + || document.body.scrollLeft + || 0; + this.deltaY = window.pageYOffset + || document.documentElement.scrollTop + || document.body.scrollTop + || 0; + }, + + realOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return [valueL, valueT]; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return [valueL, valueT]; + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + if(element.tagName=='BODY') break; + var p = Element.getStyle(element, 'position'); + if (p == 'relative' || p == 'absolute') break; + } + } while (element); + return [valueL, valueT]; + }, + + offsetParent: function(element) { + if (element.offsetParent) return element.offsetParent; + if (element == document.body) return element; + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return element; + + return document.body; + }, + + // caches x/y coordinate pair to use with overlap + within: function(element, x, y) { + if (this.includeScrollOffsets) + return this.withinIncludingScrolloffsets(element, x, y); + this.xcomp = x; + this.ycomp = y; + this.offset = this.cumulativeOffset(element); + + return (y >= this.offset[1] && + y < this.offset[1] + element.offsetHeight && + x >= this.offset[0] && + x < this.offset[0] + element.offsetWidth); + }, + + withinIncludingScrolloffsets: function(element, x, y) { + var offsetcache = this.realOffset(element); + + this.xcomp = x + offsetcache[0] - this.deltaX; + this.ycomp = y + offsetcache[1] - this.deltaY; + this.offset = this.cumulativeOffset(element); + + return (this.ycomp >= this.offset[1] && + this.ycomp < this.offset[1] + element.offsetHeight && + this.xcomp >= this.offset[0] && + this.xcomp < this.offset[0] + element.offsetWidth); + }, + + // within must be called directly before + overlap: function(mode, element) { + if (!mode) return 0; + if (mode == 'vertical') + return ((this.offset[1] + element.offsetHeight) - this.ycomp) / + element.offsetHeight; + if (mode == 'horizontal') + return ((this.offset[0] + element.offsetWidth) - this.xcomp) / + element.offsetWidth; + }, + + page: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent == document.body) + if (Element.getStyle(element,'position')=='absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + if (!window.opera || element.tagName=='BODY') { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } + } while (element = element.parentNode); + + return [valueL, valueT]; + }, + + clone: function(source, target) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || {}) + + // find page position of source + source = $(source); + var p = Position.page(source); + + // find coordinate system to use + target = $(target); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(target,'position') == 'absolute') { + parent = Position.offsetParent(target); + delta = Position.page(parent); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if(options.setWidth) target.style.width = source.offsetWidth + 'px'; + if(options.setHeight) target.style.height = source.offsetHeight + 'px'; + }, + + absolutize: function(element) { + element = $(element); + if (element.style.position == 'absolute') return; + Position.prepare(); + + var offsets = Position.positionedOffset(element); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.width = width + 'px'; + element.style.height = height + 'px'; + }, + + relativize: function(element) { + element = $(element); + if (element.style.position == 'relative') return; + Position.prepare(); + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + } +} + +// Safari returns margins on body which is incorrect if the child is absolutely +// positioned. For performance reasons, redefine Position.cumulativeOffset for +// KHTML/WebKit only. +if (Prototype.Browser.WebKit) { + Position.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return [valueL, valueT]; + } +} + +Element.addMethods(); \ No newline at end of file diff --git a/js/addfields.js b/js/addfields.js new file mode 100644 index 0000000..675d47f --- /dev/null +++ b/js/addfields.js @@ -0,0 +1,16 @@ +var counter = 0; + +function moreFields() { + counter++; + var newFields = document.getElementById('readroot').cloneNode(true); + newFields.id = ''; + newFields.style.display = 'block'; + var newField = newFields.childNodes; + for (var i=0;i background in IE +Version 1.3, November 12th - 2005 - Fixed top bar position in Opera 7 +Version 1.4, December 28th - 2005 - Support for Spanish and Portuguese +Version 1.5, January 18th - 2006 - Fixed problem with next-previous buttons after a month has been selected from dropdown +Version 1.6, February 22nd - 2006 - Added variable which holds the path to images. + Format todays date at the bottom by use of the todayStringFormat variable + Pick todays date by clicking on todays date at the bottom of the calendar +Version 2.0 May, 25th - 2006 - Added support for time(hour and minutes) and changing year and hour when holding mouse over + and - options. (i.e. instead of click) +Version 2.1 July, 2nd - 2006 - Added support for more date formats(example: d.m.yyyy, i.e. one letter day and month). + +// Modifications by Gregg Buntin +Version 2.1.1 8/9/2007 gfb - Add switch to turn off Year Span Selection + This allows me to only have this year & next year in the drop down + +Version 2.1.2 8/30/2007 gfb - Add switch to start week on Sunday + Add switch to turn off week number display + Fix bug when using on an HTTPS page + +*/ +var turnOffYearSpan = false; // true = Only show This Year and Next, false = show +/- 5 years +var weekStartsOnSunday = false; // true = Start the week on Sunday, false = start the week on Monday +var showWeekNumber = false; // true = show week number, false = do not show week number + +var languageCode = 'ge'; // Possible values: en,ge,no,nl,es,pt-br,fr + // en = english, ge = german, no = norwegian,nl = dutch, es = spanish, pt-br = portuguese, fr = french, da = danish, hu = hungarian(Use UTF-8 doctype for hungarian) + +var calendar_display_time = true; + +// Format of current day at the bottom of the calendar +// [todayString] = the value of todayString +// [dayString] = day of week (examle: mon, tue, wed...) +// [UCFdayString] = day of week (examle: Mon, Tue, Wed...) ( First letter in uppercase) +// [day] = Day of month, 1..31 +// [monthString] = Name of current month +// [year] = Current year +var todayStringFormat = '[todayString] [UCFdayString]. [day]. [monthString] [year]'; +var pathToImages = 'js/calendar/images/'; // Relative to your HTML file + +var speedOfSelectBoxSliding = 200; // Milliseconds between changing year and hour when holding mouse over "-" and "+" - lower value = faster +var intervalSelectBox_minutes = 5; // Minute select box - interval between each option (5 = default) + +var calendar_offsetTop = 0; // Offset - calendar placement - You probably have to modify this value if you're not using a strict doctype +var calendar_offsetLeft = 0; // Offset - calendar placement - You probably have to modify this value if you're not using a strict doctype +var calendarDiv = false; + +var MSIE = false; +var Opera = false; +if(navigator.userAgent.indexOf('MSIE')>=0 && navigator.userAgent.indexOf('Opera')<0)MSIE=true; +if(navigator.userAgent.indexOf('Opera')>=0)Opera=true; + + +switch(languageCode){ + case "en": /* English */ + var monthArray = ['January','February','March','April','May','June','July','August','September','October','November','December']; + var monthArrayShort = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; + var dayArray = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']; + var weekString = 'Week'; + var todayString = ''; + break; + case "ge": /* German */ + var monthArray = ['Januar','Februar','Mďż˝rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember']; + var monthArrayShort = ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez']; + var dayArray = ['Mon','Die','Mit','Don','Fre','Sam','Son']; + var weekString = 'Woche'; + var todayString = 'Heute'; + break; + case "no": /* Norwegian */ + var monthArray = ['Januar','Februar','Mars','April','Mai','Juni','Juli','August','September','Oktober','November','Desember']; + var monthArrayShort = ['Jan','Feb','Mar','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Des']; + var dayArray = ['Man','Tir','Ons','Tor','Fre','Lør','Søn']; + var weekString = 'Uke'; + var todayString = 'Dagen i dag er'; + break; + case "nl": /* Dutch */ + var monthArray = ['Januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','November','December']; + var monthArrayShort = ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec']; + var dayArray = ['Ma','Di','Wo','Do','Vr','Za','Zo']; + var weekString = 'Week'; + var todayString = 'Vandaag'; + break; + case "es": /* Spanish */ + var monthArray = ['Enero','Febrero','Marzo','April','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre']; + var monthArrayShort =['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic']; + var dayArray = ['Lun','Mar','Mie','Jue','Vie','Sab','Dom']; + var weekString = 'Semana'; + var todayString = 'Hoy es'; + break; + case "pt-br": /* Brazilian portuguese (pt-br) */ + var monthArray = ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro']; + var monthArrayShort = ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez']; + var dayArray = ['Seg','Ter','Qua','Qui','Sex','Sáb','Dom']; + var weekString = 'Sem.'; + var todayString = 'Hoje é'; + break; + case "fr": /* French */ + var monthArray = ['Janvier','Fďż˝vrier','Mars','Avril','Mai','Juin','Juillet','Aoďż˝t','Septembre','Octobre','Novembre','Dďż˝cembre']; + var monthArrayShort = ['Jan','Fev','Mar','Avr','Mai','Jun','Jul','Aou','Sep','Oct','Nov','Dec']; + var dayArray = ['Lun','Mar','Mer','Jeu','Ven','Sam','Dim']; + var weekString = 'Sem'; + var todayString = "Aujourd'hui"; + break; + case "da": /*Danish*/ + var monthArray = ['januar','februar','marts','april','maj','juni','juli','august','september','oktober','november','december']; + var monthArrayShort = ['jan','feb','mar','apr','maj','jun','jul','aug','sep','okt','nov','dec']; + var dayArray = ['man','tirs','ons','tors','fre','lør','søn']; + var weekString = 'Uge'; + var todayString = 'I dag er den'; + break; + case "hu": /* Hungarian - Remember to use UTF-8 encoding, i.e. the tag */ + var monthArray = ['Január','Február','Március','ďż˝?prilis','Május','JĂşnius','JĂşlius','Augusztus','Szeptember','OktĂłber','November','December']; + var monthArrayShort = ['Jan','Feb','Márc','ďż˝?pr','Máj','JĂşn','JĂşl','Aug','Szep','Okt','Nov','Dec']; + var dayArray = ['HĂ©','Ke','Sze','Cs','PĂ©','Szo','Vas']; + var weekString = 'HĂ©t'; + var todayString = 'Mai nap'; + break; + case "it": /* Italian*/ + var monthArray = ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre']; + var monthArrayShort = ['Gen','Feb','Mar','Apr','Mag','Giu','Lugl','Ago','Set','Ott','Nov','Dic']; + var dayArray = ['Lun',';Mar','Mer','Gio','Ven','Sab','Dom']; + var weekString = 'Settimana'; + var todayString = 'Oggi è il'; + break; + case "sv": /* Swedish */ + var monthArray = ['Januari','Februari','Mars','April','Maj','Juni','Juli','Augusti','September','Oktober','November','December']; + var monthArrayShort = ['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec']; + var dayArray = ['Mån','Tis','Ons','Tor','Fre','Lör','Sön']; + var weekString = 'Vecka'; + var todayString = 'Idag är det den'; + break; + case "cz": /* Czech */ + var monthArray = ['leden','únor','březen','duben','květen','červen','červenec','srpen','září','říjen','listopad','prosinec']; + var monthArrayShort = ['led','ún','bř','dub','kvě','čer','čer-ec','srp','zář','říj','list','pros']; + var dayArray = ['Pon','Út','St','Čt','Pá','So','Ne']; + var weekString = 'týden'; + var todayString = ''; + break; +} + +if (weekStartsOnSunday) { + var tempDayName = dayArray[6]; + for(var theIx = 6; theIx > 0; theIx--) { + dayArray[theIx] = dayArray[theIx-1]; + } + dayArray[0] = tempDayName; +} + + + +var daysInMonthArray = [31,28,31,30,31,30,31,31,30,31,30,31]; +var currentMonth; +var currentYear; +var currentHour; +var currentMinute; +var calendarContentDiv; +var returnDateTo; +var returnFormat; +var activeSelectBoxMonth; +var activeSelectBoxYear; +var activeSelectBoxHour; +var activeSelectBoxMinute; + +var iframeObj = false; +//// fix for EI frame problem on time dropdowns 09/30/2006 +var iframeObj2 =false; +function EIS_FIX_EI1(where2fixit) +{ + + if(!iframeObj2)return; + iframeObj2.style.display = 'block'; + iframeObj2.style.height =document.getElementById(where2fixit).offsetHeight+1; + iframeObj2.style.width=document.getElementById(where2fixit).offsetWidth; + iframeObj2.style.left=getleftPos(document.getElementById(where2fixit))+1-calendar_offsetLeft; + iframeObj2.style.top=getTopPos(document.getElementById(where2fixit))-document.getElementById(where2fixit).offsetHeight-calendar_offsetTop; +} + +function EIS_Hide_Frame() +{ if(iframeObj2)iframeObj2.style.display = 'none';} +//// fix for EI frame problem on time dropdowns 09/30/2006 +var returnDateToYear; +var returnDateToMonth; +var returnDateToDay; +var returnDateToHour; +var returnDateToMinute; + +var inputYear; +var inputMonth; +var inputDay; +var inputHour; +var inputMinute; +var calendarDisplayTime = false; + +var selectBoxHighlightColor = '#D60808'; // Highlight color of select boxes +var selectBoxRolloverBgColor = '#E2EBED'; // Background color on drop down lists(rollover) + +var selectBoxMovementInProgress = false; +var activeSelectBox = false; + +function cancelCalendarEvent() +{ + return false; +} +function isLeapYear(inputYear) +{ + if(inputYear%400==0||(inputYear%4==0&&inputYear%100!=0)) return true; + return false; + +} +var activeSelectBoxMonth = false; +var activeSelectBoxDirection = false; + +function highlightMonthYear() +{ + if(activeSelectBoxMonth)activeSelectBoxMonth.className=''; + activeSelectBox = this; + + + if(this.className=='monthYearActive'){ + this.className=''; + }else{ + this.className = 'monthYearActive'; + activeSelectBoxMonth = this; + } + + if(this.innerHTML.indexOf('-')>=0 || this.innerHTML.indexOf('+')>=0){ + if(this.className=='monthYearActive') + selectBoxMovementInProgress = true; + else + selectBoxMovementInProgress = false; + if(this.innerHTML.indexOf('-')>=0)activeSelectBoxDirection = -1; else activeSelectBoxDirection = 1; + + }else selectBoxMovementInProgress = false; + +} + +function showMonthDropDown() +{ + if(document.getElementById('monthDropDown').style.display=='block'){ + document.getElementById('monthDropDown').style.display='none'; + //// fix for EI frame problem on time dropdowns 09/30/2006 + EIS_Hide_Frame(); + }else{ + document.getElementById('monthDropDown').style.display='block'; + document.getElementById('yearDropDown').style.display='none'; + document.getElementById('hourDropDown').style.display='none'; + document.getElementById('minuteDropDown').style.display='none'; + if (MSIE) + { EIS_FIX_EI1('monthDropDown')} + //// fix for EI frame problem on time dropdowns 09/30/2006 + + } +} + +function showYearDropDown() +{ + if(document.getElementById('yearDropDown').style.display=='block'){ + document.getElementById('yearDropDown').style.display='none'; + //// fix for EI frame problem on time dropdowns 09/30/2006 + EIS_Hide_Frame(); + }else{ + document.getElementById('yearDropDown').style.display='block'; + document.getElementById('monthDropDown').style.display='none'; + document.getElementById('hourDropDown').style.display='none'; + document.getElementById('minuteDropDown').style.display='none'; + if (MSIE) + { EIS_FIX_EI1('yearDropDown')} + //// fix for EI frame problem on time dropdowns 09/30/2006 + + } + +} +function showHourDropDown() +{ + if(document.getElementById('hourDropDown').style.display=='block'){ + document.getElementById('hourDropDown').style.display='none'; + //// fix for EI frame problem on time dropdowns 09/30/2006 + EIS_Hide_Frame(); + }else{ + document.getElementById('hourDropDown').style.display='block'; + document.getElementById('monthDropDown').style.display='none'; + document.getElementById('yearDropDown').style.display='none'; + document.getElementById('minuteDropDown').style.display='none'; + if (MSIE) + { EIS_FIX_EI1('hourDropDown')} + //// fix for EI frame problem on time dropdowns 09/30/2006 + } + +} +function showMinuteDropDown() +{ + if(document.getElementById('minuteDropDown').style.display=='block'){ + document.getElementById('minuteDropDown').style.display='none'; + //// fix for EI frame problem on time dropdowns 09/30/2006 + EIS_Hide_Frame(); + }else{ + document.getElementById('minuteDropDown').style.display='block'; + document.getElementById('monthDropDown').style.display='none'; + document.getElementById('yearDropDown').style.display='none'; + document.getElementById('hourDropDown').style.display='none'; + if (MSIE) + { EIS_FIX_EI1('minuteDropDown')} + //// fix for EI frame problem on time dropdowns 09/30/2006 + } + +} + +function selectMonth() +{ + document.getElementById('calendar_month_txt').innerHTML = this.innerHTML + currentMonth = this.id.replace(/[^\d]/g,''); + + document.getElementById('monthDropDown').style.display='none'; + //// fix for EI frame problem on time dropdowns 09/30/2006 + EIS_Hide_Frame(); + for(var no=0;no=0){ + currentMonth=currentMonth-1;; + if(currentMonth<0){ + currentMonth=11; + currentYear=currentYear-1; + } + }else{ + currentMonth=currentMonth+1;; + if(currentMonth>11){ + currentMonth=0; + currentYear=currentYear/1+1; + } + } + + writeCalendarContent(); + + +} + +function createMonthDiv(){ + var div = document.createElement('DIV'); + div.className='monthYearPicker'; + div.id = 'monthPicker'; + + for(var no=0;no=0){ + var startYear = yearItems[1].innerHTML/1 -1; + if(activeSelectBoxYear){ + activeSelectBoxYear.style.color=''; + } + }else{ + var startYear = yearItems[1].innerHTML/1 +1; + if(activeSelectBoxYear){ + activeSelectBoxYear.style.color=''; + + } + } + + for(var no=1;no=0){ + var startHour = hourItems[1].innerHTML/1 -1; + if(startHour<0)startHour=0; + if(activeSelectBoxHour){ + activeSelectBoxHour.style.color=''; + } + }else{ + var startHour = hourItems[1].innerHTML/1 +1; + if(startHour>14)startHour = 14; + if(activeSelectBoxHour){ + activeSelectBoxHour.style.color=''; + + } + } + var prefix = ''; + for(var no=1;no14)startHour=14; + + var subDiv = document.createElement('DIV'); + subDiv.innerHTML = '  - '; + subDiv.onclick = changeSelectBoxHour; + subDiv.onmouseover = highlightMonthYear; + subDiv.onmouseout = function(){ selectBoxMovementInProgress = false;}; + subDiv.onselectstart = cancelCalendarEvent; + div.appendChild(subDiv); + + for(var no=startHour;no=0){ + if(this.src.indexOf('left')>=0)this.src = pathToImages + 'left.gif'; + if(this.src.indexOf('right')>=0)this.src = pathToImages + 'right.gif'; + }else{ + if(this.src.indexOf('left')>=0)this.src = pathToImages + 'left_over.gif'; + if(this.src.indexOf('right')>=0)this.src = pathToImages + 'right_over.gif'; + } +} + +function highlightClose() +{ + if(this.src.indexOf('over')>=0){ + this.src = pathToImages + 'close.gif'; + }else{ + this.src = pathToImages + 'close_over.gif'; + } + +} + +function closeCalendar(){ + + document.getElementById('yearDropDown').style.display='none'; + document.getElementById('monthDropDown').style.display='none'; + document.getElementById('hourDropDown').style.display='none'; + document.getElementById('minuteDropDown').style.display='none'; + + calendarDiv.style.display='none'; + if(iframeObj){ + iframeObj.style.display='none'; + //// //// fix for EI frame problem on time dropdowns 09/30/2006 + EIS_Hide_Frame();} + if(activeSelectBoxMonth)activeSelectBoxMonth.className=''; + if(activeSelectBoxYear)activeSelectBoxYear.className=''; + + +} + +function writeTopBar() +{ + + var topBar = document.createElement('DIV'); + topBar.className = 'topBar'; + topBar.id = 'topBar'; + calendarDiv.appendChild(topBar); + + // Left arrow + var leftDiv = document.createElement('DIV'); + leftDiv.style.marginRight = '1px'; + var img = document.createElement('IMG'); + img.src = pathToImages + 'left.gif'; + img.onmouseover = highlightArrow; + img.onclick = switchMonth; + img.onmouseout = highlightArrow; + leftDiv.appendChild(img); + topBar.appendChild(leftDiv); + if(Opera)leftDiv.style.width = '16px'; + + // Right arrow + var rightDiv = document.createElement('DIV'); + rightDiv.style.marginRight = '1px'; + var img = document.createElement('IMG'); + img.src = pathToImages + 'right.gif'; + img.onclick = switchMonth; + img.onmouseover = highlightArrow; + img.onmouseout = highlightArrow; + rightDiv.appendChild(img); + if(Opera)rightDiv.style.width = '16px'; + topBar.appendChild(rightDiv); + + + // Month selector + var monthDiv = document.createElement('DIV'); + monthDiv.id = 'monthSelect'; + monthDiv.onmouseover = highlightSelect; + monthDiv.onmouseout = highlightSelect; + monthDiv.onclick = showMonthDropDown; + var span = document.createElement('SPAN'); + span.innerHTML = monthArray[currentMonth]; + span.id = 'calendar_month_txt'; + monthDiv.appendChild(span); + + var img = document.createElement('IMG'); + img.src = pathToImages + 'down.gif'; + img.style.position = 'absolute'; + img.style.right = '0px'; + monthDiv.appendChild(img); + monthDiv.className = 'selectBox'; + if(Opera){ + img.style.cssText = 'float:right;position:relative'; + img.style.position = 'relative'; + img.style.styleFloat = 'right'; + } + topBar.appendChild(monthDiv); + + var monthPicker = createMonthDiv(); + monthPicker.style.left = '37px'; + monthPicker.style.top = monthDiv.offsetTop + monthDiv.offsetHeight + 1 + 'px'; + monthPicker.style.width ='60px'; + monthPicker.id = 'monthDropDown'; + + calendarDiv.appendChild(monthPicker); + + // Year selector + var yearDiv = document.createElement('DIV'); + yearDiv.onmouseover = highlightSelect; + yearDiv.onmouseout = highlightSelect; + yearDiv.onclick = showYearDropDown; + var span = document.createElement('SPAN'); + span.innerHTML = currentYear; + span.id = 'calendar_year_txt'; + yearDiv.appendChild(span); + topBar.appendChild(yearDiv); + + var img = document.createElement('IMG'); + img.src = pathToImages + 'down.gif'; + yearDiv.appendChild(img); + yearDiv.className = 'selectBox'; + + if(Opera){ + yearDiv.style.width = '50px'; + img.style.cssText = 'float:right'; + img.style.position = 'relative'; + img.style.styleFloat = 'right'; + } + + var yearPicker = createYearDiv(); + yearPicker.style.left = '113px'; + yearPicker.style.top = monthDiv.offsetTop + monthDiv.offsetHeight + 1 + 'px'; + yearPicker.style.width = '35px'; + yearPicker.id = 'yearDropDown'; + calendarDiv.appendChild(yearPicker); + + + var img = document.createElement('IMG'); + img.src = pathToImages + 'close.gif'; + img.style.styleFloat = 'right'; + img.onmouseover = highlightClose; + img.onmouseout = highlightClose; + img.onclick = closeCalendar; + topBar.appendChild(img); + if(!document.all){ + img.style.position = 'absolute'; + img.style.right = '2px'; + } + + + +} + +function writeCalendarContent() +{ + var calendarContentDivExists = true; + if(!calendarContentDiv){ + calendarContentDiv = document.createElement('DIV'); + calendarDiv.appendChild(calendarContentDiv); + calendarContentDivExists = false; + } + currentMonth = currentMonth/1; + var d = new Date(); + + d.setFullYear(currentYear); + d.setDate(1); + d.setMonth(currentMonth); + + var dayStartOfMonth = d.getDay(); + if (! weekStartsOnSunday) { + if(dayStartOfMonth==0)dayStartOfMonth=7; + dayStartOfMonth--; + } + + document.getElementById('calendar_year_txt').innerHTML = currentYear; + document.getElementById('calendar_month_txt').innerHTML = monthArray[currentMonth]; + document.getElementById('calendar_hour_txt').innerHTML = currentHour; + document.getElementById('calendar_minute_txt').innerHTML = currentMinute; + + var existingTable = calendarContentDiv.getElementsByTagName('TABLE'); + if(existingTable.length>0){ + calendarContentDiv.removeChild(existingTable[0]); + } + + var calTable = document.createElement('TABLE'); + calTable.width = '100%'; + calTable.cellSpacing = '0'; + calendarContentDiv.appendChild(calTable); + + + + + var calTBody = document.createElement('TBODY'); + calTable.appendChild(calTBody); + var row = calTBody.insertRow(-1); + row.className = 'calendar_week_row'; + if (showWeekNumber) { + var cell = row.insertCell(-1); + cell.innerHTML = weekString; + cell.className = 'calendar_week_column'; + cell.style.backgroundColor = selectBoxRolloverBgColor; + } + + for(var no=0;no0 && colCounter%7==0){ + var row = calTBody.insertRow(-1); + if (showWeekNumber) { + var cell = row.insertCell(-1); + cell.className = 'calendar_week_column'; + var week = getWeek(currentYear,currentMonth,no); + cell.innerHTML = week; // Week + cell.style.backgroundColor = selectBoxRolloverBgColor; + } + } + var cell = row.insertCell(-1); + if(currentYear==inputYear && currentMonth == inputMonth && no==inputDay){ + cell.className='activeDay'; + } + cell.innerHTML = no; + cell.onclick = pickDate; + colCounter++; + } + + + if(!document.all){ + if(calendarContentDiv.offsetHeight) + document.getElementById('topBar').style.top = calendarContentDiv.offsetHeight + document.getElementById('timeBar').offsetHeight + document.getElementById('topBar').offsetHeight -1 + 'px'; + else{ + document.getElementById('topBar').style.top = ''; + document.getElementById('topBar').style.bottom = '0px'; + } + + } + + if(iframeObj){ + if(!calendarContentDivExists)setTimeout('resizeIframe()',350);else setTimeout('resizeIframe()',10); + } + + + + +} + +function resizeIframe() +{ + iframeObj.style.width = calendarDiv.offsetWidth + 'px'; + iframeObj.style.height = calendarDiv.offsetHeight + 'px' ; + + +} + +function pickTodaysDate() +{ + var d = new Date(); + currentMonth = d.getMonth(); + currentYear = d.getFullYear(); + pickDate(false,d.getDate()); + +} + +function pickDate(e,inputDay) +{ + var month = currentMonth/1 +1; + if(month<10)month = '0' + month; + var day; + if(!inputDay && this)day = this.innerHTML; else day = inputDay; + + if(day/1<10)day = '0' + day; + if(returnFormat){ + returnFormat = returnFormat.replace('dd',day); + returnFormat = returnFormat.replace('mm',month); + returnFormat = returnFormat.replace('yyyy',currentYear); + returnFormat = returnFormat.replace('hh',currentHour); + returnFormat = returnFormat.replace('ii',currentMinute); + returnFormat = returnFormat.replace('d',day/1); + returnFormat = returnFormat.replace('m',month/1); + + returnDateTo.value = returnFormat; + try{ + returnDateTo.onchange(); + }catch(e){ + + } + }else{ + for(var no=0;no0){ + + if(!format.match(/^[0-9]*?$/gi)){ + var items = inputField.value.split(/[^0-9]/gi); + var positionArray = new Array(); + positionArray['m'] = format.indexOf('mm'); + if(positionArray['m']==-1)positionArray['m'] = format.indexOf('m'); + positionArray['d'] = format.indexOf('dd'); + if(positionArray['d']==-1)positionArray['d'] = format.indexOf('d'); + positionArray['y'] = format.indexOf('yyyy'); + positionArray['h'] = format.indexOf('hh'); + positionArray['i'] = format.indexOf('ii'); + + var positionArrayNumeric = Array(); + positionArrayNumeric[0] = positionArray['m']; + positionArrayNumeric[1] = positionArray['d']; + positionArrayNumeric[2] = positionArray['y']; + positionArrayNumeric[3] = positionArray['h']; + positionArrayNumeric[4] = positionArray['i']; + + + positionArrayNumeric = positionArrayNumeric.sort(calendarSortItems); + var itemIndex = -1; + currentHour = '00'; + currentMinute = '00'; + for(var no=0;no=0){ + tmpHour = inputField.value.substr(hourPos,2); + currentHour = tmpHour; + }else{ + currentHour = '00'; + } + var minutePos = format.indexOf('ii'); + if(minutePos>=0){ + tmpMinute = inputField.value.substr(minutePos,2); + currentMinute = tmpMinute; + }else{ + currentMinute = '00'; + } + } + }else{ + var d = new Date(); + currentMonth = d.getMonth(); + currentYear = d.getFullYear(); + currentHour = '08'; + currentMinute = '00'; + tmpDay = d.getDate(); + } + + inputYear = currentYear; + inputMonth = currentMonth; + inputDay = tmpDay/1; + + + if(!calendarDiv){ + initCalendar(); + }else{ + if(calendarDiv.style.display=='block'){ + closeCalendar(); + return false; + } + writeCalendarContent(); + } + + + + returnFormat = format; + returnDateTo = inputField; + positionCalendar(buttonObj); + calendarDiv.style.visibility = 'visible'; + calendarDiv.style.display = 'block'; + if(iframeObj){ + iframeObj.style.display = ''; + iframeObj.style.height = '140px'; + iframeObj.style.width = '195px'; + iframeObj2.style.display = ''; + iframeObj2.style.height = '140px'; + iframeObj2.style.width = '195px'; + } + + setTimeProperties(); + updateYearDiv(); + updateMonthDiv(); + updateMinuteDiv(); + updateHourDiv(); + +} + +function displayCalendarSelectBox(yearInput,monthInput,dayInput,hourInput,minuteInput,buttonObj) +{ + if(!hourInput)calendarDisplayTime=false; else calendarDisplayTime = true; + + currentMonth = monthInput.options[monthInput.selectedIndex].value/1-1; + currentYear = yearInput.options[yearInput.selectedIndex].value; + if(hourInput){ + currentHour = hourInput.options[hourInput.selectedIndex].value; + inputHour = currentHour/1; + } + if(minuteInput){ + currentMinute = minuteInput.options[minuteInput.selectedIndex].value; + inputMinute = currentMinute/1; + } + + inputYear = yearInput.options[yearInput.selectedIndex].value; + inputMonth = monthInput.options[monthInput.selectedIndex].value/1 - 1; + inputDay = dayInput.options[dayInput.selectedIndex].value/1; + + if(!calendarDiv){ + initCalendar(); + }else{ + writeCalendarContent(); + } + + + + returnDateToYear = yearInput; + returnDateToMonth = monthInput; + returnDateToDay = dayInput; + returnDateToHour = hourInput; + returnDateToMinute = minuteInput; + + + + + returnFormat = false; + returnDateTo = false; + positionCalendar(buttonObj); + calendarDiv.style.visibility = 'visible'; + calendarDiv.style.display = 'block'; + if(iframeObj){ + iframeObj.style.display = ''; + iframeObj.style.height = calendarDiv.offsetHeight + 'px'; + iframeObj.style.width = calendarDiv.offsetWidth + 'px'; + //// fix for EI frame problem on time dropdowns 09/30/2006 + iframeObj2.style.display = ''; + iframeObj2.style.height = calendarDiv.offsetHeight + 'px'; + iframeObj2.style.width = calendarDiv.offsetWidth + 'px' + } + setTimeProperties(); + updateYearDiv(); + updateMonthDiv(); + updateHourDiv(); + updateMinuteDiv(); + +} diff --git a/js/calendar/dhtmlgoodies_calendar.css b/js/calendar/dhtmlgoodies_calendar.css new file mode 100644 index 0000000..7446316 --- /dev/null +++ b/js/calendar/dhtmlgoodies_calendar.css @@ -0,0 +1,140 @@ +#calendarDiv { + position: absolute; + width: 205px; + line-height: 10px; + border: 1px solid #317082; + padding: 1px; + background-color: #0a2145; + font-family: arial; + font-size: 10px; + padding-bottom: 20px; + visibility: hidden; +} +#calendarDiv span, +#calendarDiv img { + float: left; +} +#calendarDiv table { + margin: 0; +} +#calendarDiv .selectBox, +#calendarDiv .selectBoxOver { + line-height: 12px; + padding: 1px; + cursor: pointer; + background-color: #fdac46; + padding-left: 2px; +} + +#calendarDiv .selectBoxTime, +#calendarDiv .selectBoxTimeOver { + line-height: 12px; + padding: 1px; + cursor: pointer; + padding-left: 2px; +} + +#calendarDiv td { + padding: 3px; + margin: 0px; + font-size: 10px; +} + +#calendarDiv .selectBox { + border: 1px solid #e2ebed; + color: #000; + position: relative; +} +#calendarDiv .selectBoxOver { + border: 1px solid #fff; + background-color: #fdac46; + color: #000; + position: relative; +} +#calendarDiv .selectBoxTime { + border: 1px solid #317082; + color: #000; + position: relative; +} +#calendarDiv .selectBoxTimeOver { + border: 1px solid #216072; + color: #000; + position: relative; +} + +#calendarDiv .topBar { + height: 16px; + padding: 2px; + background-color: #fdac46; +} +#calendarDiv .activeDay { + /* Active day in the calendar */ + color: #ff0000; +} +#calendarDiv .todaysDate { + height: 17px; + line-height: 17px; + padding: 2px; + color: #000; + background-color: #fdac46; + text-align: center; + position: absolute; + bottom: 0px; + width: 201px; +} +#calendarDiv .todaysDate div { + float: left; +} + +#calendarDiv .timeBar { + height: 17px; + line-height: 17px; + background-color: #e2ebed; + width: 72px; + color: #fff; + position: absolute; + right: 0px; +} + +#calendarDiv .timeBar div { + float: left; + margin-right: 1px; +} + +#calendarDiv .monthYearPicker { + background-color: #e2ebed; + border: 1px solid #aaaaaa; + position: absolute; + color: #317082; + left: 0px; + top: 15px; + z-index: 1000; + display: none; +} +#calendarDiv #monthSelect { + width: 70px; +} +#calendarDiv .monthYearPicker div { + float: none; + clear: both; + padding: 1px; + margin: 1px; + cursor: pointer; +} +#calendarDiv .monthYearActive { + background-color: #317082; + color: #e2ebed; +} + +#calendarDiv td { + text-align: right; + cursor: pointer; +} + +#calendarDiv .topBar img { + cursor: pointer; +} +#calendarDiv .topBar div { + float: left; + margin-right: 1px; +} diff --git a/js/calendar/dhtmlgoodies_calendar.js b/js/calendar/dhtmlgoodies_calendar.js new file mode 100644 index 0000000..881f84d --- /dev/null +++ b/js/calendar/dhtmlgoodies_calendar.js @@ -0,0 +1,1534 @@ +/************************************************************************************************************ +JS Calendar +Copyright (C) September 2006 DTHMLGoodies.com, Alf Magne Kalleland + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Dhtmlgoodies.com., hereby disclaims all copyright interest in this script +written by Alf Magne Kalleland. + +Alf Magne Kalleland, 2006 +Owner of DHTMLgoodies.com + +************************************************************************************************************/ + +/* Update log: +(C) www.dhtmlgoodies.com, September 2005 + +Version 1.2, November 8th - 2005 - Added ':""), +a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
    ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
    ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_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,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.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,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* + * jQuery UI Progressbar 1.8.18 + * + * 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(a,b){a.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=a("
    ").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(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;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(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/* + * jQuery UI Effects 1.8.18 + * + * 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(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={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]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* + * jQuery UI Effects Fade 1.8.18 + * + * 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(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Fold 1.8.18 + * + * 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(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* + * jQuery UI Effects Highlight 1.8.18 + * + * 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(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Pulsate 1.8.18 + * + * 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(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/jquery.min.js b/js/jquery/jquery.min.js new file mode 100644 index 0000000..198b3ff --- /dev/null +++ b/js/jquery/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,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=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.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 d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+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(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,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"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.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?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){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,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.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]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),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]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.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!!m(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 a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},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 bc[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=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&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=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null: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=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=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(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.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:[]}},o.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&&(o.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.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[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}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.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 m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},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 V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(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 f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(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(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(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=f.clean(arguments);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,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.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 f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.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?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[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","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.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(c||!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 cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.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):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/js/jquery/jquery.min.old b/js/jquery/jquery.min.old new file mode 100644 index 0000000..82b98e1 --- /dev/null +++ b/js/jquery/jquery.min.old @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"
    ","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},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||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/js/nicEdit/nicEdit.js b/js/nicEdit/nicEdit.js new file mode 100644 index 0000000..1afc294 --- /dev/null +++ b/js/nicEdit/nicEdit.js @@ -0,0 +1,105 @@ +/* NicEdit - Micro Inline WYSIWYG + * Copyright 2007-2008 Brian Kirchoff + * + * NicEdit is distributed under the terms of the MIT license + * For more information visit http://nicedit.com/ + * Do not remove this copyright message + */ +var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A.nicEdit-main p { margin: 0; } + + + in the HEAD section of an HTML file is now all that's needed to include all of the script.aculo.us libraries, + given that they all can be accessed by the same path as scriptaculous.js is. + +* Fixed possible problem with greedy Droppables when using the dropOnEmpty option on Sortable.create + +* Added new CSS/background color features to Ajax.InPlaceEditor [Jon Tirsen] + +* Added unit test for Autocompleter, first Version + +* Added Event.simulateKey/s to unittest.js. Note that due to a bug in Firefox this will only work with Firefox up to v1.0.4 (see https://bugzilla.mozilla.org/show_bug.cgi?id=289940) + +* Fixed a condition where standard a href=xxx links wouldn't work in autocomplete results. These do now, the onclick event is not cancelled. [thx to Jasper Slits] + +* Fix showing ghosting marker only on ghosting Sortables + +* Some more Builder stuff, expanded builder unit tests + +* Moved stuff that didn't belong into specific libs into util.js; util.js is now required for all script.aculo.us libs + +* Corrected weirdness in unittest.js + +* Added dropOnEmpty option to Sortables to allow dropping on empty lists (see test/functional/sortable3_test.html) + +* Changed algoritm for drag/drop position setting + +* Changed workaround for class attributes (fixes a Firefox 1.0 error) from klass to className to be more Javascriptesque [thx to Martin Bialasinski] + +* Fixed a typo in ajax_inplaceeditor_test.html + +* Updated Rakefile to add unittest.js and util.js to the package + +* Added util.js which contains various utlity functions and extensions to Prototype + +* Major restructuring + +* Added TEXTAREA support to Ajax.InPlaceEditor [Sanford Barr] + +* Added Ghost Train alpha 0.1.0. See ghosttrain/test.html. + +* More features for Ajax.InPlaceEditor [Jon Tirsen] + +* Tweaks to unittest.css [Thomas Fuchs] + +* Refactoring and new features in unittest.js [Thomas Fuchs] [Jon Tirsen] + +* Fixed a wrong variable reference in Effect.Scale + +* Fix Element.makePositioned to recognize the 'static' position + +* Allow to choose the parameter name for Ajax.Autocompleter [Cameron Braid] + +* Changed resolving indicator DOM element more flexibility [Cameron Braid] + +* Fixed a reference in Ajax.InPlaceEditor + +* Added contributors to unittest.js + +* Souped-up Ajax.InPlaceEditor, added support for a form id and specifying all the texts through options [Jon Tirsen] + +* Make unit testing look good [Michael Schuerig] + +* Changed default revert duration for Draggables to distance-dependent algorithm [suggested by San] + +* Fix double unescaping in Autocompleter + +* Refactoring auf Autocompleter classes to use camelCase (note: changes the syntax of some of the options) + +* Add updateElement option to Autocompleter [Rob Sharp] + +* Updated Ajax.InPlaceEditor, refactoring of unit testing [Jon Tirsen] + +* Added preliminary version of Ajax.InPlaceEditor to controls.js; added experimental Firefox only functional testing for it (inplaceeditor_result.html) [Jon Tirsen] + +* Added some addtional test files. + +* Fixes a bug with Droppables not recognizing a drop if no hoverclass is given [thanks drewie] + +* Fixes to ghosting marker, allow a predefined marker (element with id "dropmarker"). + +* Changed Effect.Opacity to better handle 100% opacity + +* Various fixes to ghosting, improves compatiblity with Safari and IE. [thanks to David Zülke] + +* Added experimental ghosting option to Sortables. See sortable_functional_ghosting.html for usage. + +* Renamed the clone option on Draggables to "ghosting". + +* Added experimental "clone" option to Draggable to so that a "clone" stays in place while dragging a translucent version of the draggable element. Currently, this requires relatively positioned elements, and doesn't work with sortable lists (but should after some tweaking). See dragdrop_function_4.html test file for details. + +* Added Element.getStyle to find computed CSS styles of an element. Note: doesn't work in all cases in Safari, see my bug report at http://bugzilla.opendarwin.org/show_bug.cgi?id=4125 + +*1.1beta1* + +* Fixed rendering of last frame of animation when from/to is not 0.0/1.0. [thanks to David Zülke] + +* Updated internal Prototype JavaScript framework to version 1.4.0_pre2 (patched w/ workaround for Ajax.Updater init bug) + +* Some refactoring of controls.js to get rid of "dirty" implementation detail (dont' ask) + +* Added returning the generated combined effects to allow for .cancel() on all effects + +* Updated internal Prototype JavaScript framework to version 1.4.0_pre2 + +*Rails 0.13.1* + +* Updated Ajax.Autocompleter to deal with parameters options correctly [Martin Marinschek] + +* Updated controls.js to allow multple matches in local localcompletion [Ivan Krstic] + +* Make version of prototype.js in lib have a nicer Event object [David Zülke] + +* Added incremental and local autocompleting and loads of documentation to controls.js [Ivan Krstic] + +* Experimental: make version of prototype.js in lib destroy events on page unload to prevent browser memory leaks + +* Fixed a possible memory leak in dragdrop.js + +* Make version of prototype.js in lib compatible with some 3rd-party JavaScript libraries (like IE7) by refactoring to use Object.extend() for testing [David Zülke] + +* Make effects.js, dragdrop.js and controls.js compatible with some 3rd-party JavaScript libraries (like IE7) by refactoring to use Object.extend() [David Zülke] + +* Changed some tests to work better + +* Always reset background color on Effect.Highlight; this make change backwards-compatibility, to be sure include style="background-color:(target-color)" on your elements or else elements will fall back to their CSS rules (which is a good thing in most circumstances) + +* Removed a possible memory leaks with IE with sortables and droppables (removed references from elements) + +* Changes to class extension in effects.js + +* Make Effect.Highlight restore any previously set background color when finishing (makes effect work with set CSS classes) + +* Added capability to remove draggables/droppables and redeclare sortables in dragdrop.js + +* Added Effect.ScrollTo to smoothly scroll the page to an element + +* Better Firefox flickering handling on SlideUp/SlideDown + +* Some cleaning up in effects.js + +* Removed a possible memory leak in IE with draggables + +* Added support for cancelling dragging my hitting ESC + +* Changed logic of drag-and-drop to only include the last referenced droppable when firing a drop event. This change also offers slight performance gains. [Dominik Wagner] + +* Added addtional effects test page, added tests for scriptfragment matching + +*1.0.0* + +* Changed auto-hiding update div in Ajax.Autocompleter + +* Changed default serialization on Ajax.Autocompleter to use Form.Element.serialize + +* Added test file for drag/drop inside scrolled elements + +* Fixed dragging of unpositioned elements in Internet Explorer + +* Change default behaviour of Ajax.Autocompleter to do automatic overlapping, sizing and appear/fade effects + +* Fixed Internet Explorer hide-windowed-controls iframe handling + +* Changed Ajax.Autocompleter event handling + +* Added onShow/onHide callbacks to Ajax.Autocompleter to allow for customized handling/effects + +* Fixed SlideUp/SlideDown to restore the overflow CSS property (note: Firefox 1.0.X is buggy, set overflow:hidden as a workaround) + +* Fixed BlindUp/BlindDown to restore the overflow CSS property (note: Firefox 1.0.X is buggy, set overflow:hidden as a workaround) + +* Fixed draggables with revert:false on repeated drags behaving badly + +* Expanded the revert option on draggables to optionally take a function and revert only if it returns true + +* Added the dragged element as a parameter to the Draggables.notify callbacks [Michael Sokolov] + +* Removed a deprecated reference to Effect2 om Effect.Fold + +* Make the percentage on Element.setContentZoom absolute + +* Corrected rendering of Ajax.AutoCompleter when focus is lost while updating + +* Added (crude) functional tests + +* Some slight refactoring in controls.js + +* Changed dragdrop.js to use the Effect namespace for its effects + +* Updated to Prototype 1.3.0: removal of prototype-ext.js; refactoring. + +* Fixed behaviour of cursor keys in Safari on autocomplete script + +* Fixed Position.within_including_scrolloffsets + +* Fixed sortables that are absolutely positioned + +* Fixed unhandled whitespace in Ajax.Autocompleter + +* Updated prototype-ext.js to include additions for Ajax.Autocompleter + +* Added controls.js, contains AJAX autocompleting text fields from #960 + +* Refactored Event object + +* Renamed effects2.js to effects.js + +* Fixed draggables on pages with no droppables + +* Moved Event, Position and Element.Class to prototype-ext.js in preparation to Rails 0.13 + +* Added Effect.Transitions.pulse + +* Added Effect.Pulsate and Effect.Fold effect by Justin Palmer + +* Added transitions by Mark Pilgrim: .full, .none + +* Added effects by Mark Pilgrim: Effect.Grow, Effect.Shrink + +* Changed effects namespace to Effect. (Effect2 is deprecated, but works too) + +* Changed old Effect.ContentZoom class to Element.setContentZoom() function + +* Greatly expanded Effect.Highlight to have user-defined colors and autodetecting the background color + +* Converted remaining effects (Squish, Highlight) to new format + +* Sortable.create now passes the zindex, starteffect, reverteffect and endeffect options to the underlying Draggables + +* Sortable.serialize now honors the only option on Sortable.create + +* New overridable options on Draggables: zindex, starteffect, reverteffect, endeffect + +* Fix a Gecko engine flicker on Sortables in dragdrop.js + +* Fixed event.isLeftClick + +* Some small changes in effects2.js + +* Refactoring of dragdrop.js + +* Added an Object.prototype.inspect() and more verbose messages for js unit testing + +* Added test/unittest.js and initial tests in test/html. + +* Cleaning up of effects2.js (convert tabs to spaces) + +* Added Rakefile for distribution packaging (default task = make distribution, rake clean for cleaning up) + +* Initial check-in and directory layout for the script.aculo.us JavaScripts diff --git a/js/scriptaculous/.svn/text-base/README.rdoc.svn-base b/js/scriptaculous/.svn/text-base/README.rdoc.svn-base new file mode 100644 index 0000000..21f8c8c --- /dev/null +++ b/js/scriptaculous/.svn/text-base/README.rdoc.svn-base @@ -0,0 +1,59 @@ +== script.aculo.us web 2.0 javascript + +The Web is changing. The 30-year-old terminal-like technology it was originally +is gradually giving way to new ways of doing things. The power of AJAX allows +for rich user interaction without the trouble that has bugged traditional +web applications. + +Building upon the wonderful Prototype JavaScript library, script.aculo.us +provides you with some great additional ingredients to mix in. + +For more information, see http://script.aculo.us/ + +== What's new in this release? + +See the CHANGELOG file for information on what's new. + +You can follow http://twitter.com/scriptaculous if you want +to be updated as we fix bugs and add new features. + +== Installation/Usage + +script.aculo.us includes the Prototype JavaScript Framework +V1.6.0. You can use later versions, as they become available +(see http://prototypejs.org/). + +Put prototype.js, and the six files scriptaculous.js, +builder.js, effects.js, dragdrop.js, controls.js and slider.js +in a directory of your website, e.g. /javascripts. + +(The sound.js and unittest.js files are optional) + +Now, you can include the scripts by adding the following +tags to the HEAD section of your HTML pages: + + + + +scriptaculous.js will automatically load the other files of the +script.aculo.us distribution in, provided they are accessible +via the same path. + +See http://wiki.script.aculo.us/scriptaculous/show/Usage for detailed +usage instructions. + +== The distribution + +Besides the script.aculo.us files in src, there's a complete +test tree included which holds functional and unit tests for +script.aculo.us. + +If you need examples on how to implement things, the best place to +start is by opening test/run_functional_tests.html or +test/run_unit_tests.html in your browser, and looking at +the sources of the examples provided. + +== License + +script.aculo.us is licensed under the terms of the MIT License, +see the included MIT-LICENSE file. \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/accordion.js.svn-base b/js/scriptaculous/.svn/text-base/accordion.js.svn-base new file mode 100644 index 0000000..3bb2211 --- /dev/null +++ b/js/scriptaculous/.svn/text-base/accordion.js.svn-base @@ -0,0 +1,243 @@ +// accordion.js v2.0 +// +// Copyright (c) 2007 stickmanlabs +// Author: Kevin P Miller | http://www.stickmanlabs.com +// +// Accordion is freely distributable under the terms of an MIT-style license. +// +// I don't care what you think about the file size... +// Be a pro: +// http://www.thinkvitamin.com/features/webapps/serving-javascript-fast +// http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files +// +/* +2-2-2008 Trey Aughenbaugh +made a few updates based on the comments from here. +http://stickmanlabs.com/2007/07/12/accordion-v10-released/#comments + +-Updated it to work with new version of Prototype 1.6 and scriptaculous 1.8 +-Updated to remove flicker +Added ability to have a callback function. +Useful for making AJAX calls. +Also Added the ability to specifiy which call will get executed each time. +Use the ID sttribute of the DIV for reference. REQUIRED for callback. + +/* +/*-----------------------------------------------------------------------------------------------*/ + +if (typeof Effect == 'undefined') + throw("accordion.js requires including script.aculo.us' effects.js library!"); + +var accordion = Class.create(); +accordion.prototype = { + + // + // Setup the Variables + // + showAccordion : null, + currentAccordion : null, + duration : null, + effects : [], + animating : false, + AlreadyActivated: [], //Added by Trey + // + // Initialize the accordions + // + initialize: function(container, options) { + if (!$(container)) { + throw(container+" doesn't exist!"); + return false; + } + + this.options = Object.extend({ + resizeSpeed : 8, + classNames : { + toggle : 'accordion_toggle', + toggleActive : 'accordion_toggle_active', + content : 'accordion_content' + }, + defaultSize : { + height : null, + width : null + }, + direction : 'vertical', + onEvent : 'click', + onActivate: null, //Added by Trey: CallBack Function called when Tab is activated, sends elemet. + RepeatActivate: {} //Added by Trey + }, options || {}); + + this.duration = ((11-this.options.resizeSpeed)*0.15); + this.AlreadyActivated =[]; //Added by Trey + var accordions = $$('#'+container+' .'+this.options.classNames.toggle); + accordions.each(function(accordion) { + Event.observe(accordion, this.options.onEvent, this.activate.bind(this, accordion), false); + if (this.options.onEvent == 'click') { + accordion.onclick = function() {return false;}; + } + + if (this.options.direction == 'horizontal') { + var options = {width: '0px'}; + } else { + var options = {height: '0px'}; + } + //options.merge({display: 'none'}); + Object.extend(options, {display: 'none'}); + + this.currentAccordion = $(accordion.next(0)).setStyle(options); + }.bind(this)); + }, + + // + // Activate an accordion + // + activate : function(accordion) { + if (this.animating) { + return false; + } + + this.effects = []; + + this.currentAccordion = $(accordion.next(0)); + this.currentAccordion.setStyle({ + display: 'block' + }); + + this.currentAccordion.previous(0).addClassName(this.options.classNames.toggleActive); + + if (this.options.direction == 'horizontal') { + this.scaling = { + scaleX: true, + scaleY: false + }; + } else { + this.scaling = { + scaleX: false, + scaleY: true + }; + } + + if (this.currentAccordion == this.showAccordion) { + this.deactivate(); + } else { + +//This was added by Trey Aughenbaugh +//Allows calling a function before activating a new Menu + var bolCall = true; + var elementid = $(this.currentAccordion).id + var AA = this.AlreadyActivated.indexOf(elementid); + var RA = this.options.RepeatActivate[elementid]; + if (RA != undefined) + { + if ( AA != -1 ) + { + if ( RA != undefined ) + bolCall = RA; + } + else + { + this.AlreadyActivated.push(elementid); + } + } + + if (this.options.onActivate && bolCall) + this.options.onActivate(this.currentAccordion) ; + +//My Code Updates End Here.......................Orig Call Below. + this._handleAccordion(); + } + }, + // + // Deactivate an active accordion + // + deactivate : function() { + var options = { + duration: this.duration, + scaleContent: false, + transition: Effect.Transitions.sinoidal, + queue: { + position: 'end', + scope: 'accordionAnimation' + }, + scaleMode: { + originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : this.currentAccordion.scrollHeight, + originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : this.currentAccordion.scrollWidth + }, + afterFinish: function() { + this.showAccordion.setStyle({ + height: '0px', + display: 'none' + }); + this.showAccordion = null; + this.animating = false; + }.bind(this) + }; + //options.merge(this.scaling); + Object.extend(options, this.scaling); + + this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive); + + new Effect.Scale(this.showAccordion, 0, options); + }, + + // + // Handle the open/close actions of the accordion + // + _handleAccordion : function() { + var options = { + sync: true, + scaleFrom: 0, + scaleContent: false, + transition: Effect.Transitions.sinoidal, + scaleMode: { + originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : this.currentAccordion.scrollHeight, + originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : this.currentAccordion.scrollWidth + } + }; + //options.merge(this.scaling); + Object.extend(options, this.scaling); + + this.effects.push( + new Effect.Scale(this.currentAccordion, 100, options) + ); + + if (this.showAccordion) { + this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive); + + options = { + sync: true, + scaleContent: false, + transition: Effect.Transitions.sinoidal + }; + //options.merge(this.scaling); + Object.extend(options, this.scaling); + + this.effects.push( + new Effect.Scale(this.showAccordion, 0, options) + ); + } + + new Effect.Parallel(this.effects, { + duration: this.duration, + queue: { + position: 'end', + scope: 'accordionAnimation' + }, + beforeStart: function() { + this.animating = true; + }.bind(this), + afterFinish: function() { + if (this.showAccordion) { + this.showAccordion.setStyle({ + display: 'none' + }); + } + $(this.currentAccordion).setStyle({ + height: 'auto' + }); + this.showAccordion = this.currentAccordion; + this.animating = false; + }.bind(this) + }); + } +} + \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/builder.js.svn-base b/js/scriptaculous/.svn/text-base/builder.js.svn-base new file mode 100644 index 0000000..dba8bec --- /dev/null +++ b/js/scriptaculous/.svn/text-base/builder.js.svn-base @@ -0,0 +1,136 @@ +// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +var Builder = { + NODEMAP: { + AREA: 'map', + CAPTION: 'table', + COL: 'table', + COLGROUP: 'table', + LEGEND: 'fieldset', + OPTGROUP: 'select', + OPTION: 'select', + PARAM: 'object', + TBODY: 'table', + TD: 'table', + TFOOT: 'table', + TH: 'table', + THEAD: 'table', + TR: 'table' + }, + // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, + // due to a Firefox bug + node: function(elementName) { + elementName = elementName.toUpperCase(); + + // try innerHTML approach + var parentTag = this.NODEMAP[elementName] || 'div'; + var parentElement = document.createElement(parentTag); + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + ">"; + } catch(e) {} + var element = parentElement.firstChild || null; + + // see if browser added wrapping tags + if(element && (element.tagName.toUpperCase() != elementName)) + element = element.getElementsByTagName(elementName)[0]; + + // fallback to createElement approach + if(!element) element = document.createElement(elementName); + + // abort if nothing could be created + if(!element) return; + + // attributes (or text) + if(arguments[1]) + if(this._isStringOrNumber(arguments[1]) || + (arguments[1] instanceof Array) || + arguments[1].tagName) { + this._children(element, arguments[1]); + } else { + var attrs = this._attributes(arguments[1]); + if(attrs.length) { + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" +elementName + " " + + attrs + ">"; + } catch(e) {} + element = parentElement.firstChild || null; + // workaround firefox 1.0.X bug + if(!element) { + element = document.createElement(elementName); + for(attr in arguments[1]) + element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; + } + if(element.tagName.toUpperCase() != elementName) + element = parentElement.getElementsByTagName(elementName)[0]; + } + } + + // text, or array of children + if(arguments[2]) + this._children(element, arguments[2]); + + return $(element); + }, + _text: function(text) { + return document.createTextNode(text); + }, + + ATTR_MAP: { + 'className': 'class', + 'htmlFor': 'for' + }, + + _attributes: function(attributes) { + var attrs = []; + for(attribute in attributes) + attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + + '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); + return attrs.join(" "); + }, + _children: function(element, children) { + if(children.tagName) { + element.appendChild(children); + return; + } + if(typeof children=='object') { // array can hold nodes and text + children.flatten().each( function(e) { + if(typeof e=='object') + element.appendChild(e); + else + if(Builder._isStringOrNumber(e)) + element.appendChild(Builder._text(e)); + }); + } else + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); + }, + _isStringOrNumber: function(param) { + return(typeof param=='string' || typeof param=='number'); + }, + build: function(html) { + var element = this.node('div'); + $(element).update(html.strip()); + return element.down(); + }, + dump: function(scope) { + if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope + + var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ + "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ + "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ + "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); + + tags.each( function(tag){ + scope[tag] = function() { + return Builder.node.apply(Builder, [tag].concat($A(arguments))); + }; + }); + } +}; \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/controls.js.svn-base b/js/scriptaculous/.svn/text-base/controls.js.svn-base new file mode 100644 index 0000000..c56ccb7 --- /dev/null +++ b/js/scriptaculous/.svn/text-base/controls.js.svn-base @@ -0,0 +1,965 @@ +// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com) +// Contributors: +// Richard Livsey +// Rahul Bhargava +// Rob Wills +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// Autocompleter.Base handles all the autocompletion functionality +// that's independent of the data source for autocompletion. This +// includes drawing the autocompletion menu, observing keyboard +// and mouse events, and similar. +// +// Specific autocompleters need to provide, at the very least, +// a getUpdatedChoices function that will be invoked every time +// the text inside the monitored textbox changes. This method +// should get the text for which to provide autocompletion by +// invoking this.getToken(), NOT by directly accessing +// this.element.value. This is to allow incremental tokenized +// autocompletion. Specific auto-completion logic (AJAX, etc) +// belongs in getUpdatedChoices. +// +// Tokenized incremental autocompletion is enabled automatically +// when an autocompleter is instantiated with the 'tokens' option +// in the options parameter, e.g.: +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); +// will incrementally autocomplete with a comma as the token. +// Additionally, ',' in the above example can be replaced with +// a token array, e.g. { tokens: [',', '\n'] } which +// enables autocompletion on multiple tokens. This is most +// useful when one of the tokens is \n (a newline), as it +// allows smart autocompletion after linebreaks. + +if(typeof Effect == 'undefined') + throw("controls.js requires including script.aculo.us' effects.js library"); + +var Autocompleter = { }; +Autocompleter.Base = Class.create({ + baseInitialize: function(element, update, options) { + element = $(element); + this.element = element; + this.update = $(update); + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + this.oldElementValue = this.element.value; + + if(this.setOptions) + this.setOptions(options); + else + this.options = options || { }; + + this.options.paramName = this.options.paramName || this.element.name; + this.options.tokens = this.options.tokens || []; + this.options.frequency = this.options.frequency || 0.4; + this.options.minChars = this.options.minChars || 1; + this.options.onShow = this.options.onShow || + function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, { + setHeight: false, + offsetTop: element.offsetHeight + }); + } + Effect.Appear(update,{duration:0.15}); + }; + this.options.onHide = this.options.onHide || + function(element, update){ new Effect.Fade(update,{duration:0.15}) }; + + if(typeof(this.options.tokens) == 'string') + this.options.tokens = new Array(this.options.tokens); + // Force carriage returns as token delimiters anyway + if (!this.options.tokens.include('\n')) + this.options.tokens.push('\n'); + + this.observer = null; + + this.element.setAttribute('autocomplete','off'); + + Element.hide(this.update); + + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this)); + }, + + show: function() { + if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); + if(!this.iefix && + (Prototype.Browser.IE) && + (Element.getStyle(this.update, 'position')=='absolute')) { + new Insertion.After(this.update, + ''); + this.iefix = $(this.update.id+'_iefix'); + } + if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); + }, + + fixIEOverlapping: function() { + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); + this.iefix.style.zIndex = 1; + this.update.style.zIndex = 2; + Element.show(this.iefix); + }, + + hide: function() { + this.stopIndicator(); + if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); + if(this.iefix) Element.hide(this.iefix); + }, + + startIndicator: function() { + if(this.options.indicator) Element.show(this.options.indicator); + }, + + stopIndicator: function() { + if(this.options.indicator) Element.hide(this.options.indicator); + }, + + onKeyPress: function(event) { + if(this.active) + switch(event.keyCode) { + case Event.KEY_TAB: + case Event.KEY_RETURN: + this.selectEntry(); + Event.stop(event); + case Event.KEY_ESC: + this.hide(); + this.active = false; + Event.stop(event); + return; + case Event.KEY_LEFT: + case Event.KEY_RIGHT: + return; + case Event.KEY_UP: + this.markPrevious(); + this.render(); + Event.stop(event); + return; + case Event.KEY_DOWN: + this.markNext(); + this.render(); + Event.stop(event); + return; + } + else + if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; + + this.changed = true; + this.hasFocus = true; + + if(this.observer) clearTimeout(this.observer); + this.observer = + setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); + }, + + activate: function() { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + + onHover: function(event) { + var element = Event.findElement(event, 'LI'); + if(this.index != element.autocompleteIndex) + { + this.index = element.autocompleteIndex; + this.render(); + } + Event.stop(event); + }, + + onClick: function(event) { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + + onBlur: function(event) { + // needed to make click events working + setTimeout(this.hide.bind(this), 250); + this.hasFocus = false; + this.active = false; + }, + + render: function() { + if(this.entryCount > 0) { + for (var i = 0; i < this.entryCount; i++) + this.index==i ? + Element.addClassName(this.getEntry(i),"selected") : + Element.removeClassName(this.getEntry(i),"selected"); + if(this.hasFocus) { + this.show(); + this.active = true; + } + } else { + this.active = false; + this.hide(); + } + }, + + markPrevious: function() { + if(this.index > 0) this.index--; + else this.index = this.entryCount-1; + this.getEntry(this.index).scrollIntoView(true); + }, + + markNext: function() { + if(this.index < this.entryCount-1) this.index++; + else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); + }, + + getEntry: function(index) { + return this.update.firstChild.childNodes[index]; + }, + + getCurrentEntry: function() { + return this.getEntry(this.index); + }, + + selectEntry: function() { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + + updateElement: function(selectedElement) { + if (this.options.updateElement) { + this.options.updateElement(selectedElement); + return; + } + var value = ''; + if (this.options.select) { + var nodes = $(selectedElement).select('.' + this.options.select) || []; + if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); + } else + value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); + + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); + if (whitespace) + newValue += whitespace[0]; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); + } else { + this.element.value = value; + } + this.oldElementValue = this.element.value; + this.element.focus(); + + if (this.options.afterUpdateElement) + this.options.afterUpdateElement(this.element, selectedElement); + }, + + updateChoices: function(choices) { + if(!this.changed && this.hasFocus) { + this.update.innerHTML = choices; + Element.cleanWhitespace(this.update); + Element.cleanWhitespace(this.update.down()); + + if(this.update.firstChild && this.update.down().childNodes) { + this.entryCount = + this.update.down().childNodes.length; + for (var i = 0; i < this.entryCount; i++) { + var entry = this.getEntry(i); + entry.autocompleteIndex = i; + this.addObservers(entry); + } + } else { + this.entryCount = 0; + } + + this.stopIndicator(); + this.index = 0; + + if(this.entryCount==1 && this.options.autoSelect) { + this.selectEntry(); + this.hide(); + } else { + this.render(); + } + } + }, + + addObservers: function(element) { + Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); + Event.observe(element, "click", this.onClick.bindAsEventListener(this)); + }, + + onObserverEvent: function() { + this.changed = false; + this.tokenBounds = null; + if(this.getToken().length>=this.options.minChars) { + this.getUpdatedChoices(); + } else { + this.active = false; + this.hide(); + } + this.oldElementValue = this.element.value; + }, + + getToken: function() { + var bounds = this.getTokenBounds(); + return this.element.value.substring(bounds[0], bounds[1]).strip(); + }, + + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = this.element.value; + if (value.strip().empty()) return [-1, 0]; + var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + var tp; + for (var index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; + } + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); + } +}); + +Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) + return index; + return boundary; +}; + +Ajax.Autocompleter = Class.create(Autocompleter.Base, { + initialize: function(element, update, url, options) { + this.baseInitialize(element, update, options); + this.options.asynchronous = true; + this.options.onComplete = this.onComplete.bind(this); + this.options.defaultParams = this.options.parameters || null; + this.url = url; + }, + + getUpdatedChoices: function() { + this.startIndicator(); + + var entry = encodeURIComponent(this.options.paramName) + '=' + + encodeURIComponent(this.getToken()); + + this.options.parameters = this.options.callback ? + this.options.callback(this.element, entry) : entry; + + if(this.options.defaultParams) + this.options.parameters += '&' + this.options.defaultParams; + + new Ajax.Request(this.url, this.options); + }, + + onComplete: function(request) { + this.updateChoices(request.responseText); + } +}); + +// The local array autocompleter. Used when you'd prefer to +// inject an array of autocompletion options into the page, rather +// than sending out Ajax queries, which can be quite slow sometimes. +// +// The constructor takes four parameters. The first two are, as usual, +// the id of the monitored textbox, and id of the autocompletion menu. +// The third is the array you want to autocomplete from, and the fourth +// is the options block. +// +// Extra local autocompletion options: +// - choices - How many autocompletion choices to offer +// +// - partialSearch - If false, the autocompleter will match entered +// text only at the beginning of strings in the +// autocomplete array. Defaults to true, which will +// match text at the beginning of any *word* in the +// strings in the autocomplete array. If you want to +// search anywhere in the string, additionally set +// the option fullSearch to true (default: off). +// +// - fullSsearch - Search anywhere in autocomplete array strings. +// +// - partialChars - How many characters to enter before triggering +// a partial match (unlike minChars, which defines +// how many characters are required to do any match +// at all). Defaults to 2. +// +// - ignoreCase - Whether to ignore case when autocompleting. +// Defaults to true. +// +// It's possible to pass in a custom function as the 'selector' +// option, if you prefer to write your own autocompletion logic. +// In that case, the other options above will not apply unless +// you support them. + +Autocompleter.Local = Class.create(Autocompleter.Base, { + initialize: function(element, update, array, options) { + this.baseInitialize(element, update, options); + this.options.array = array; + }, + + getUpdatedChoices: function() { + this.updateChoices(this.options.selector(this)); + }, + + setOptions: function(options) { + this.options = Object.extend({ + choices: 10, + partialSearch: true, + partialChars: 2, + ignoreCase: true, + fullSearch: false, + selector: function(instance) { + var ret = []; // Beginning matches + var partial = []; // Inside matches + var entry = instance.getToken(); + var count = 0; + + for (var i = 0; i < instance.options.array.length && + ret.length < instance.options.choices ; i++) { + + var elem = instance.options.array[i]; + var foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase()) : + elem.indexOf(entry); + + while (foundPos != -1) { + if (foundPos == 0 && elem.length != entry.length) { + ret.push("
  • " + elem.substr(0, entry.length) + "" + + elem.substr(entry.length) + "
  • "); + break; + } else if (entry.length >= instance.options.partialChars && + instance.options.partialSearch && foundPos != -1) { + if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { + partial.push("
  • " + elem.substr(0, foundPos) + "" + + elem.substr(foundPos, entry.length) + "" + elem.substr( + foundPos + entry.length) + "
  • "); + break; + } + } + + foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : + elem.indexOf(entry, foundPos + 1); + + } + } + if (partial.length) + ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)); + return "
      " + ret.join('') + "
    "; + } + }, options || { }); + } +}); + +// AJAX in-place editor and collection editor +// Full rewrite by Christophe Porteneuve (April 2007). + +// Use this if you notice weird scrolling problems on some browsers, +// the DOM might be a bit confused when this gets called so do this +// waits 1 ms (with setTimeout) until it does the activation +Field.scrollFreeActivate = function(field) { + setTimeout(function() { + Field.activate(field); + }, 1); +}; + +Ajax.InPlaceEditor = Class.create({ + initialize: function(element, url, options) { + this.url = url; + this.element = element = $(element); + this.prepareOptions(); + this._controls = { }; + arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! + Object.extend(this.options, options || { }); + if (!this.options.formId && this.element.id) { + this.options.formId = this.element.id + '-inplaceeditor'; + if ($(this.options.formId)) + this.options.formId = ''; + } + if (this.options.externalControl) + this.options.externalControl = $(this.options.externalControl); + if (!this.options.externalControl) + this.options.externalControlOnly = false; + this._originalBackground = this.element.getStyle('background-color') || 'transparent'; + this.element.title = this.options.clickToEditText; + this._boundCancelHandler = this.handleFormCancellation.bind(this); + this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); + this._boundFailureHandler = this.handleAJAXFailure.bind(this); + this._boundSubmitHandler = this.handleFormSubmission.bind(this); + this._boundWrapperHandler = this.wrapUp.bind(this); + this.registerListeners(); + }, + checkForEscapeOrReturn: function(e) { + if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; + if (Event.KEY_ESC == e.keyCode) + this.handleFormCancellation(e); + else if (Event.KEY_RETURN == e.keyCode) + this.handleFormSubmission(e); + }, + createControl: function(mode, handler, extraClasses) { + var control = this.options[mode + 'Control']; + var text = this.options[mode + 'Text']; + if ('button' == control) { + var btn = document.createElement('input'); + btn.type = 'submit'; + btn.value = text; + btn.className = 'editor_' + mode + '_button'; + if ('cancel' == mode) + btn.onclick = this._boundCancelHandler; + this._form.appendChild(btn); + this._controls[mode] = btn; + } else if ('link' == control) { + var link = document.createElement('a'); + link.href = '#'; + link.appendChild(document.createTextNode(text)); + link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; + link.className = 'editor_' + mode + '_link'; + if (extraClasses) + link.className += ' ' + extraClasses; + this._form.appendChild(link); + this._controls[mode] = link; + } + }, + createEditField: function() { + var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); + var fld; + if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { + fld = document.createElement('input'); + fld.type = 'text'; + var size = this.options.size || this.options.cols || 0; + if (0 < size) fld.size = size; + } else { + fld = document.createElement('textarea'); + fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); + fld.cols = this.options.cols || 40; + } + fld.name = this.options.paramName; + fld.value = text; // No HTML breaks conversion anymore + fld.className = 'editor_field'; + if (this.options.submitOnBlur) + fld.onblur = this._boundSubmitHandler; + this._controls.editor = fld; + if (this.options.loadTextURL) + this.loadExternalText(); + this._form.appendChild(this._controls.editor); + }, + createForm: function() { + var ipe = this; + function addText(mode, condition) { + var text = ipe.options['text' + mode + 'Controls']; + if (!text || condition === false) return; + ipe._form.appendChild(document.createTextNode(text)); + }; + this._form = $(document.createElement('form')); + this._form.id = this.options.formId; + this._form.addClassName(this.options.formClassName); + this._form.onsubmit = this._boundSubmitHandler; + this.createEditField(); + if ('textarea' == this._controls.editor.tagName.toLowerCase()) + this._form.appendChild(document.createElement('br')); + if (this.options.onFormCustomization) + this.options.onFormCustomization(this, this._form); + addText('Before', this.options.okControl || this.options.cancelControl); + this.createControl('ok', this._boundSubmitHandler); + addText('Between', this.options.okControl && this.options.cancelControl); + this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); + addText('After', this.options.okControl || this.options.cancelControl); + }, + destroy: function() { + if (this._oldInnerHTML) + this.element.innerHTML = this._oldInnerHTML; + this.leaveEditMode(); + this.unregisterListeners(); + }, + enterEditMode: function(e) { + if (this._saving || this._editing) return; + this._editing = true; + this.triggerCallback('onEnterEditMode'); + if (this.options.externalControl) + this.options.externalControl.hide(); + this.element.hide(); + this.createForm(); + this.element.parentNode.insertBefore(this._form, this.element); + if (!this.options.loadTextURL) + this.postProcessEditField(); + if (e) Event.stop(e); + }, + enterHover: function(e) { + if (this.options.hoverClassName) + this.element.addClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onEnterHover'); + }, + getText: function() { + return this.element.innerHTML.unescapeHTML(); + }, + handleAJAXFailure: function(transport) { + this.triggerCallback('onFailure', transport); + if (this._oldInnerHTML) { + this.element.innerHTML = this._oldInnerHTML; + this._oldInnerHTML = null; + } + }, + handleFormCancellation: function(e) { + this.wrapUp(); + if (e) Event.stop(e); + }, + handleFormSubmission: function(e) { + var form = this._form; + var value = $F(this._controls.editor); + this.prepareSubmission(); + var params = this.options.callback(form, value) || ''; + if (Object.isString(params)) + params = params.toQueryParams(); + params.editorId = this.element.id; + if (this.options.htmlResponse) { + var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Updater({ success: this.element }, this.url, options); + } else { + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.url, options); + } + if (e) Event.stop(e); + }, + leaveEditMode: function() { + this.element.removeClassName(this.options.savingClassName); + this.removeForm(); + this.leaveHover(); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + if (this.options.externalControl) + this.options.externalControl.show(); + this._saving = false; + this._editing = false; + this._oldInnerHTML = null; + this.triggerCallback('onLeaveEditMode'); + }, + leaveHover: function(e) { + if (this.options.hoverClassName) + this.element.removeClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onLeaveHover'); + }, + loadExternalText: function() { + this._form.addClassName(this.options.loadingClassName); + this._controls.editor.disabled = true; + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._form.removeClassName(this.options.loadingClassName); + var text = transport.responseText; + if (this.options.stripLoadedTextTags) + text = text.stripTags(); + this._controls.editor.value = text; + this._controls.editor.disabled = false; + this.postProcessEditField(); + }.bind(this), + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + postProcessEditField: function() { + var fpc = this.options.fieldPostCreation; + if (fpc) + $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); + }, + prepareOptions: function() { + this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); + Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); + [this._extraDefaultOptions].flatten().compact().each(function(defs) { + Object.extend(this.options, defs); + }.bind(this)); + }, + prepareSubmission: function() { + this._saving = true; + this.removeForm(); + this.leaveHover(); + this.showSaving(); + }, + registerListeners: function() { + this._listeners = { }; + var listener; + $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { + listener = this[pair.value].bind(this); + this._listeners[pair.key] = listener; + if (!this.options.externalControlOnly) + this.element.observe(pair.key, listener); + if (this.options.externalControl) + this.options.externalControl.observe(pair.key, listener); + }.bind(this)); + }, + removeForm: function() { + if (!this._form) return; + this._form.remove(); + this._form = null; + this._controls = { }; + }, + showSaving: function() { + this._oldInnerHTML = this.element.innerHTML; + this.element.innerHTML = this.options.savingText; + this.element.addClassName(this.options.savingClassName); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + }, + triggerCallback: function(cbName, arg) { + if ('function' == typeof this.options[cbName]) { + this.options[cbName](this, arg); + } + }, + unregisterListeners: function() { + $H(this._listeners).each(function(pair) { + if (!this.options.externalControlOnly) + this.element.stopObserving(pair.key, pair.value); + if (this.options.externalControl) + this.options.externalControl.stopObserving(pair.key, pair.value); + }.bind(this)); + }, + wrapUp: function(transport) { + this.leaveEditMode(); + // Can't use triggerCallback due to backward compatibility: requires + // binding + direct element + this._boundComplete(transport, this.element); + } +}); + +Object.extend(Ajax.InPlaceEditor.prototype, { + dispose: Ajax.InPlaceEditor.prototype.destroy +}); + +Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { + initialize: function($super, element, url, options) { + this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; + $super(element, url, options); + }, + + createEditField: function() { + var list = document.createElement('select'); + list.name = this.options.paramName; + list.size = 1; + this._controls.editor = list; + this._collection = this.options.collection || []; + if (this.options.loadCollectionURL) + this.loadCollection(); + else + this.checkForExternalText(); + this._form.appendChild(this._controls.editor); + }, + + loadCollection: function() { + this._form.addClassName(this.options.loadingClassName); + this.showLoadingText(this.options.loadingCollectionText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + var js = transport.responseText.strip(); + if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check + throw('Server returned an invalid collection representation.'); + this._collection = eval(js); + this.checkForExternalText(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadCollectionURL, options); + }, + + showLoadingText: function(text) { + this._controls.editor.disabled = true; + var tempOption = this._controls.editor.firstChild; + if (!tempOption) { + tempOption = document.createElement('option'); + tempOption.value = ''; + this._controls.editor.appendChild(tempOption); + tempOption.selected = true; + } + tempOption.update((text || '').stripScripts().stripTags()); + }, + + checkForExternalText: function() { + this._text = this.getText(); + if (this.options.loadTextURL) + this.loadExternalText(); + else + this.buildOptionList(); + }, + + loadExternalText: function() { + this.showLoadingText(this.options.loadingText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._text = transport.responseText.strip(); + this.buildOptionList(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + + buildOptionList: function() { + this._form.removeClassName(this.options.loadingClassName); + this._collection = this._collection.map(function(entry) { + return 2 === entry.length ? entry : [entry, entry].flatten(); + }); + var marker = ('value' in this.options) ? this.options.value : this._text; + var textFound = this._collection.any(function(entry) { + return entry[0] == marker; + }.bind(this)); + this._controls.editor.update(''); + var option; + this._collection.each(function(entry, index) { + option = document.createElement('option'); + option.value = entry[0]; + option.selected = textFound ? entry[0] == marker : 0 == index; + option.appendChild(document.createTextNode(entry[1])); + this._controls.editor.appendChild(option); + }.bind(this)); + this._controls.editor.disabled = false; + Field.scrollFreeActivate(this._controls.editor); + } +}); + +//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** +//**** This only exists for a while, in order to let **** +//**** users adapt to the new API. Read up on the new **** +//**** API and convert your code to it ASAP! **** + +Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { + if (!options) return; + function fallback(name, expr) { + if (name in options || expr === undefined) return; + options[name] = expr; + }; + fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : + options.cancelLink == options.cancelButton == false ? false : undefined))); + fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : + options.okLink == options.okButton == false ? false : undefined))); + fallback('highlightColor', options.highlightcolor); + fallback('highlightEndColor', options.highlightendcolor); +}; + +Object.extend(Ajax.InPlaceEditor, { + DefaultOptions: { + ajaxOptions: { }, + autoRows: 3, // Use when multi-line w/ rows == 1 + cancelControl: 'link', // 'link'|'button'|false + cancelText: 'cancel', + clickToEditText: 'Click to edit', + externalControl: null, // id|elt + externalControlOnly: false, + fieldPostCreation: 'activate', // 'activate'|'focus'|false + formClassName: 'inplaceeditor-form', + formId: null, // id|elt + highlightColor: '#ffff99', + highlightEndColor: '#ffffff', + hoverClassName: '', + htmlResponse: true, + loadingClassName: 'inplaceeditor-loading', + loadingText: 'Loading...', + okControl: 'button', // 'link'|'button'|false + okText: 'ok', + paramName: 'value', + rows: 1, // If 1 and multi-line, uses autoRows + savingClassName: 'inplaceeditor-saving', + savingText: 'Saving...', + size: 0, + stripLoadedTextTags: false, + submitOnBlur: false, + textAfterControls: '', + textBeforeControls: '', + textBetweenControls: '' + }, + DefaultCallbacks: { + callback: function(form) { + return Form.serialize(form); + }, + onComplete: function(transport, element) { + // For backward compatibility, this one is bound to the IPE, and passes + // the element directly. It was too often customized, so we don't break it. + new Effect.Highlight(element, { + startcolor: this.options.highlightColor, keepBackgroundImage: true }); + }, + onEnterEditMode: null, + onEnterHover: function(ipe) { + ipe.element.style.backgroundColor = ipe.options.highlightColor; + if (ipe._effect) + ipe._effect.cancel(); + }, + onFailure: function(transport, ipe) { + alert('Error communication with the server: ' + transport.responseText.stripTags()); + }, + onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. + onLeaveEditMode: null, + onLeaveHover: function(ipe) { + ipe._effect = new Effect.Highlight(ipe.element, { + startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, + restorecolor: ipe._originalBackground, keepBackgroundImage: true + }); + } + }, + Listeners: { + click: 'enterEditMode', + keydown: 'checkForEscapeOrReturn', + mouseover: 'enterHover', + mouseout: 'leaveHover' + } +}); + +Ajax.InPlaceCollectionEditor.DefaultOptions = { + loadingCollectionText: 'Loading options...' +}; + +// Delayed observer, like Form.Element.Observer, +// but waits for delay after last key input +// Ideal for live-search fields + +Form.Element.DelayedObserver = Class.create({ + initialize: function(element, delay, callback) { + this.delay = delay || 0.5; + this.element = $(element); + this.callback = callback; + this.timer = null; + this.lastValue = $F(this.element); + Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); + }, + delayedListener: function(event) { + if(this.lastValue == $F(this.element)) return; + if(this.timer) clearTimeout(this.timer); + this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); + this.lastValue = $F(this.element); + }, + onTimerEvent: function() { + this.timer = null; + this.callback(this.element, $F(this.element)); + } +}); \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/dragdrop.js.svn-base b/js/scriptaculous/.svn/text-base/dragdrop.js.svn-base new file mode 100644 index 0000000..07c98e2 --- /dev/null +++ b/js/scriptaculous/.svn/text-base/dragdrop.js.svn-base @@ -0,0 +1,975 @@ +// script.aculo.us dragdrop.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +if(Object.isUndefined(Effect)) + throw("dragdrop.js requires including script.aculo.us' effects.js library"); + +var Droppables = { + drops: [], + + remove: function(element) { + this.drops = this.drops.reject(function(d) { return d.element==$(element) }); + }, + + add: function(element) { + element = $(element); + var options = Object.extend({ + greedy: true, + hoverclass: null, + tree: false + }, arguments[1] || { }); + + // cache containers + if(options.containment) { + options._containers = []; + var containment = options.containment; + if(Object.isArray(containment)) { + containment.each( function(c) { options._containers.push($(c)) }); + } else { + options._containers.push($(containment)); + } + } + + if(options.accept) options.accept = [options.accept].flatten(); + + Element.makePositioned(element); // fix IE + options.element = element; + + this.drops.push(options); + }, + + findDeepestChild: function(drops) { + deepest = drops[0]; + + for (i = 1; i < drops.length; ++i) + if (Element.isParent(drops[i].element, deepest.element)) + deepest = drops[i]; + + return deepest; + }, + + isContained: function(element, drop) { + var containmentNode; + if(drop.tree) { + containmentNode = element.treeNode; + } else { + containmentNode = element.parentNode; + } + return drop._containers.detect(function(c) { return containmentNode == c }); + }, + + isAffected: function(point, element, drop) { + return ( + (drop.element!=element) && + ((!drop._containers) || + this.isContained(element, drop)) && + ((!drop.accept) || + (Element.classNames(element).detect( + function(v) { return drop.accept.include(v) } ) )) && + Position.within(drop.element, point[0], point[1]) ); + }, + + deactivate: function(drop) { + if(drop.hoverclass) + Element.removeClassName(drop.element, drop.hoverclass); + this.last_active = null; + }, + + activate: function(drop) { + if(drop.hoverclass) + Element.addClassName(drop.element, drop.hoverclass); + this.last_active = drop; + }, + + show: function(point, element) { + if(!this.drops.length) return; + var drop, affected = []; + + this.drops.each( function(drop) { + if(Droppables.isAffected(point, element, drop)) + affected.push(drop); + }); + + if(affected.length>0) + drop = Droppables.findDeepestChild(affected); + + if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); + if (drop) { + Position.within(drop.element, point[0], point[1]); + if(drop.onHover) + drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); + + if (drop != this.last_active) Droppables.activate(drop); + } + }, + + fire: function(event, element) { + if(!this.last_active) return; + Position.prepare(); + + if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) + if (this.last_active.onDrop) { + this.last_active.onDrop(element, this.last_active.element, event); + return true; + } + }, + + reset: function() { + if(this.last_active) + this.deactivate(this.last_active); + } +}; + +var Draggables = { + drags: [], + observers: [], + + register: function(draggable) { + if(this.drags.length == 0) { + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.updateDrag.bindAsEventListener(this); + this.eventKeypress = this.keyPress.bindAsEventListener(this); + + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + Event.observe(document, "keypress", this.eventKeypress); + } + this.drags.push(draggable); + }, + + unregister: function(draggable) { + this.drags = this.drags.reject(function(d) { return d==draggable }); + if(this.drags.length == 0) { + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + Event.stopObserving(document, "keypress", this.eventKeypress); + } + }, + + activate: function(draggable) { + if(draggable.options.delay) { + this._timeout = setTimeout(function() { + Draggables._timeout = null; + window.focus(); + Draggables.activeDraggable = draggable; + }.bind(this), draggable.options.delay); + } else { + window.focus(); // allows keypress events if window isn't currently focused, fails for Safari + this.activeDraggable = draggable; + } + }, + + deactivate: function() { + this.activeDraggable = null; + }, + + updateDrag: function(event) { + if(!this.activeDraggable) return; + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + // Mozilla-based browsers fire successive mousemove events with + // the same coordinates, prevent needless redrawing (moz bug?) + if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; + this._lastPointer = pointer; + + this.activeDraggable.updateDrag(event, pointer); + }, + + endDrag: function(event) { + if(this._timeout) { + clearTimeout(this._timeout); + this._timeout = null; + } + if(!this.activeDraggable) return; + this._lastPointer = null; + this.activeDraggable.endDrag(event); + this.activeDraggable = null; + }, + + keyPress: function(event) { + if(this.activeDraggable) + this.activeDraggable.keyPress(event); + }, + + addObserver: function(observer) { + this.observers.push(observer); + this._cacheObserverCallbacks(); + }, + + removeObserver: function(element) { // element instead of observer fixes mem leaks + this.observers = this.observers.reject( function(o) { return o.element==element }); + this._cacheObserverCallbacks(); + }, + + notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' + if(this[eventName+'Count'] > 0) + this.observers.each( function(o) { + if(o[eventName]) o[eventName](eventName, draggable, event); + }); + if(draggable.options[eventName]) draggable.options[eventName](draggable, event); + }, + + _cacheObserverCallbacks: function() { + ['onStart','onEnd','onDrag'].each( function(eventName) { + Draggables[eventName+'Count'] = Draggables.observers.select( + function(o) { return o[eventName]; } + ).length; + }); + } +}; + +/*--------------------------------------------------------------------------*/ + +var Draggable = Class.create({ + initialize: function(element) { + var defaults = { + handle: false, + reverteffect: function(element, top_offset, left_offset) { + var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; + new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, + queue: {scope:'_draggable', position:'end'} + }); + }, + endeffect: function(element) { + var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; + new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, + queue: {scope:'_draggable', position:'end'}, + afterFinish: function(){ + Draggable._dragging[element] = false + } + }); + }, + zindex: 1000, + revert: false, + quiet: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } + delay: 0 + }; + + if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) + Object.extend(defaults, { + starteffect: function(element) { + element._opacity = Element.getOpacity(element); + Draggable._dragging[element] = true; + new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); + } + }); + + var options = Object.extend(defaults, arguments[1] || { }); + + this.element = $(element); + + if(options.handle && Object.isString(options.handle)) + this.handle = this.element.down('.'+options.handle, 0); + + if(!this.handle) this.handle = $(options.handle); + if(!this.handle) this.handle = this.element; + + if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { + options.scroll = $(options.scroll); + this._isScrollChild = Element.childOf(this.element, options.scroll); + } + + Element.makePositioned(this.element); // fix IE + + this.options = options; + this.dragging = false; + + this.eventMouseDown = this.initDrag.bindAsEventListener(this); + Event.observe(this.handle, "mousedown", this.eventMouseDown); + + Draggables.register(this); + }, + + destroy: function() { + Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); + Draggables.unregister(this); + }, + + currentDelta: function() { + return([ + parseInt(Element.getStyle(this.element,'left') || '0'), + parseInt(Element.getStyle(this.element,'top') || '0')]); + }, + + initDrag: function(event) { + if(!Object.isUndefined(Draggable._dragging[this.element]) && + Draggable._dragging[this.element]) return; + if(Event.isLeftClick(event)) { + // abort on form elements, fixes a Firefox issue + var src = Event.element(event); + if((tag_name = src.tagName.toUpperCase()) && ( + tag_name=='INPUT' || + tag_name=='SELECT' || + tag_name=='OPTION' || + tag_name=='BUTTON' || + tag_name=='TEXTAREA')) return; + + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var pos = Position.cumulativeOffset(this.element); + this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); + + Draggables.activate(this); + Event.stop(event); + } + }, + + startDrag: function(event) { + this.dragging = true; + if(!this.delta) + this.delta = this.currentDelta(); + + if(this.options.zindex) { + this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); + this.element.style.zIndex = this.options.zindex; + } + + if(this.options.ghosting) { + this._clone = this.element.cloneNode(true); + this._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); + if (!this._originallyAbsolute) + Position.absolutize(this.element); + this.element.parentNode.insertBefore(this._clone, this.element); + } + + if(this.options.scroll) { + if (this.options.scroll == window) { + var where = this._getWindowScroll(this.options.scroll); + this.originalScrollLeft = where.left; + this.originalScrollTop = where.top; + } else { + this.originalScrollLeft = this.options.scroll.scrollLeft; + this.originalScrollTop = this.options.scroll.scrollTop; + } + } + + Draggables.notify('onStart', this, event); + + if(this.options.starteffect) this.options.starteffect(this.element); + }, + + updateDrag: function(event, pointer) { + if(!this.dragging) this.startDrag(event); + + if(!this.options.quiet){ + Position.prepare(); + Droppables.show(pointer, this.element); + } + + Draggables.notify('onDrag', this, event); + + this.draw(pointer); + if(this.options.change) this.options.change(this); + + if(this.options.scroll) { + this.stopScrolling(); + + var p; + if (this.options.scroll == window) { + with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } + } else { + p = Position.page(this.options.scroll); + p[0] += this.options.scroll.scrollLeft + Position.deltaX; + p[1] += this.options.scroll.scrollTop + Position.deltaY; + p.push(p[0]+this.options.scroll.offsetWidth); + p.push(p[1]+this.options.scroll.offsetHeight); + } + var speed = [0,0]; + if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); + if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); + if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); + if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); + this.startScrolling(speed); + } + + // fix AppleWebKit rendering + if(Prototype.Browser.WebKit) window.scrollBy(0,0); + + Event.stop(event); + }, + + finishDrag: function(event, success) { + this.dragging = false; + + if(this.options.quiet){ + Position.prepare(); + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + Droppables.show(pointer, this.element); + } + + if(this.options.ghosting) { + if (!this._originallyAbsolute) + Position.relativize(this.element); + delete this._originallyAbsolute; + Element.remove(this._clone); + this._clone = null; + } + + var dropped = false; + if(success) { + dropped = Droppables.fire(event, this.element); + if (!dropped) dropped = false; + } + if(dropped && this.options.onDropped) this.options.onDropped(this.element); + Draggables.notify('onEnd', this, event); + + var revert = this.options.revert; + if(revert && Object.isFunction(revert)) revert = revert(this.element); + + var d = this.currentDelta(); + if(revert && this.options.reverteffect) { + if (dropped == 0 || revert != 'failure') + this.options.reverteffect(this.element, + d[1]-this.delta[1], d[0]-this.delta[0]); + } else { + this.delta = d; + } + + if(this.options.zindex) + this.element.style.zIndex = this.originalZ; + + if(this.options.endeffect) + this.options.endeffect(this.element); + + Draggables.deactivate(this); + Droppables.reset(); + }, + + keyPress: function(event) { + if(event.keyCode!=Event.KEY_ESC) return; + this.finishDrag(event, false); + Event.stop(event); + }, + + endDrag: function(event) { + if(!this.dragging) return; + this.stopScrolling(); + this.finishDrag(event, true); + Event.stop(event); + }, + + draw: function(point) { + var pos = Position.cumulativeOffset(this.element); + if(this.options.ghosting) { + var r = Position.realOffset(this.element); + pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; + } + + var d = this.currentDelta(); + pos[0] -= d[0]; pos[1] -= d[1]; + + if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { + pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; + pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; + } + + var p = [0,1].map(function(i){ + return (point[i]-pos[i]-this.offset[i]) + }.bind(this)); + + if(this.options.snap) { + if(Object.isFunction(this.options.snap)) { + p = this.options.snap(p[0],p[1],this); + } else { + if(Object.isArray(this.options.snap)) { + p = p.map( function(v, i) { + return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)); + } else { + p = p.map( function(v) { + return (v/this.options.snap).round()*this.options.snap }.bind(this)); + } + }} + + var style = this.element.style; + if((!this.options.constraint) || (this.options.constraint=='horizontal')) + style.left = p[0] + "px"; + if((!this.options.constraint) || (this.options.constraint=='vertical')) + style.top = p[1] + "px"; + + if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering + }, + + stopScrolling: function() { + if(this.scrollInterval) { + clearInterval(this.scrollInterval); + this.scrollInterval = null; + Draggables._lastScrollPointer = null; + } + }, + + startScrolling: function(speed) { + if(!(speed[0] || speed[1])) return; + this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; + this.lastScrolled = new Date(); + this.scrollInterval = setInterval(this.scroll.bind(this), 10); + }, + + scroll: function() { + var current = new Date(); + var delta = current - this.lastScrolled; + this.lastScrolled = current; + if(this.options.scroll == window) { + with (this._getWindowScroll(this.options.scroll)) { + if (this.scrollSpeed[0] || this.scrollSpeed[1]) { + var d = delta / 1000; + this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); + } + } + } else { + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; + } + + Position.prepare(); + Droppables.show(Draggables._lastPointer, this.element); + Draggables.notify('onDrag', this); + if (this._isScrollChild) { + Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); + Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; + Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; + if (Draggables._lastScrollPointer[0] < 0) + Draggables._lastScrollPointer[0] = 0; + if (Draggables._lastScrollPointer[1] < 0) + Draggables._lastScrollPointer[1] = 0; + this.draw(Draggables._lastScrollPointer); + } + + if(this.options.change) this.options.change(this); + }, + + _getWindowScroll: function(w) { + var T, L, W, H; + with (w.document) { + if (w.document.documentElement && documentElement.scrollTop) { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } else if (w.document.body) { + T = body.scrollTop; + L = body.scrollLeft; + } + if (w.innerWidth) { + W = w.innerWidth; + H = w.innerHeight; + } else if (w.document.documentElement && documentElement.clientWidth) { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } else { + W = body.offsetWidth; + H = body.offsetHeight; + } + } + return { top: T, left: L, width: W, height: H }; + } +}); + +Draggable._dragging = { }; + +/*--------------------------------------------------------------------------*/ + +var SortableObserver = Class.create({ + initialize: function(element, observer) { + this.element = $(element); + this.observer = observer; + this.lastValue = Sortable.serialize(this.element); + }, + + onStart: function() { + this.lastValue = Sortable.serialize(this.element); + }, + + onEnd: function() { + Sortable.unmark(); + if(this.lastValue != Sortable.serialize(this.element)) + this.observer(this.element) + } +}); + +var Sortable = { + SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, + + sortables: { }, + + _findRootElement: function(element) { + while (element.tagName.toUpperCase() != "BODY") { + if(element.id && Sortable.sortables[element.id]) return element; + element = element.parentNode; + } + }, + + options: function(element) { + element = Sortable._findRootElement($(element)); + if(!element) return; + return Sortable.sortables[element.id]; + }, + + destroy: function(element){ + element = $(element); + var s = Sortable.sortables[element.id]; + + if(s) { + Draggables.removeObserver(s.element); + s.droppables.each(function(d){ Droppables.remove(d) }); + s.draggables.invoke('destroy'); + + delete Sortable.sortables[s.element.id]; + } + }, + + create: function(element) { + element = $(element); + var options = Object.extend({ + element: element, + tag: 'li', // assumes li children, override with tag: 'tagname' + dropOnEmpty: false, + tree: false, + treeTag: 'ul', + overlap: 'vertical', // one of 'vertical', 'horizontal' + constraint: 'vertical', // one of 'vertical', 'horizontal', false + containment: element, // also takes array of elements (or id's); or false + handle: false, // or a CSS class + only: false, + delay: 0, + hoverclass: null, + ghosting: false, + quiet: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + format: this.SERIALIZE_RULE, + + // these take arrays of elements or ids and can be + // used for better initialization performance + elements: false, + handles: false, + + onChange: Prototype.emptyFunction, + onUpdate: Prototype.emptyFunction + }, arguments[1] || { }); + + // clear any old sortable with same element + this.destroy(element); + + // build options for the draggables + var options_for_draggable = { + revert: true, + quiet: options.quiet, + scroll: options.scroll, + scrollSpeed: options.scrollSpeed, + scrollSensitivity: options.scrollSensitivity, + delay: options.delay, + ghosting: options.ghosting, + constraint: options.constraint, + handle: options.handle }; + + if(options.starteffect) + options_for_draggable.starteffect = options.starteffect; + + if(options.reverteffect) + options_for_draggable.reverteffect = options.reverteffect; + else + if(options.ghosting) options_for_draggable.reverteffect = function(element) { + element.style.top = 0; + element.style.left = 0; + }; + + if(options.endeffect) + options_for_draggable.endeffect = options.endeffect; + + if(options.zindex) + options_for_draggable.zindex = options.zindex; + + // build options for the droppables + var options_for_droppable = { + overlap: options.overlap, + containment: options.containment, + tree: options.tree, + hoverclass: options.hoverclass, + onHover: Sortable.onHover + }; + + var options_for_tree = { + onHover: Sortable.onEmptyHover, + overlap: options.overlap, + containment: options.containment, + hoverclass: options.hoverclass + }; + + // fix for gecko engine + Element.cleanWhitespace(element); + + options.draggables = []; + options.droppables = []; + + // drop on empty handling + if(options.dropOnEmpty || options.tree) { + Droppables.add(element, options_for_tree); + options.droppables.push(element); + } + + (options.elements || this.findElements(element, options) || []).each( function(e,i) { + var handle = options.handles ? $(options.handles[i]) : + (options.handle ? $(e).select('.' + options.handle)[0] : e); + options.draggables.push( + new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); + Droppables.add(e, options_for_droppable); + if(options.tree) e.treeNode = element; + options.droppables.push(e); + }); + + if(options.tree) { + (Sortable.findTreeElements(element, options) || []).each( function(e) { + Droppables.add(e, options_for_tree); + e.treeNode = element; + options.droppables.push(e); + }); + } + + // keep reference + this.sortables[element.id] = options; + + // for onupdate + Draggables.addObserver(new SortableObserver(element, options.onUpdate)); + + }, + + // return all suitable-for-sortable elements in a guaranteed order + findElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.tag); + }, + + findTreeElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.treeTag); + }, + + onHover: function(element, dropon, overlap) { + if(Element.isParent(dropon, element)) return; + + if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { + return; + } else if(overlap>0.5) { + Sortable.mark(dropon, 'before'); + if(dropon.previousSibling != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, dropon); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } else { + Sortable.mark(dropon, 'after'); + var nextElement = dropon.nextSibling || null; + if(nextElement != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, nextElement); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + }, + + onEmptyHover: function(element, dropon, overlap) { + var oldParentNode = element.parentNode; + var droponOptions = Sortable.options(dropon); + + if(!Element.isParent(dropon, element)) { + var index; + + var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); + var child = null; + + if(children) { + var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); + + for (index = 0; index < children.length; index += 1) { + if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { + offset -= Element.offsetSize (children[index], droponOptions.overlap); + } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { + child = index + 1 < children.length ? children[index + 1] : null; + break; + } else { + child = children[index]; + break; + } + } + } + + dropon.insertBefore(element, child); + + Sortable.options(oldParentNode).onChange(element); + droponOptions.onChange(element); + } + }, + + unmark: function() { + if(Sortable._marker) Sortable._marker.hide(); + }, + + mark: function(dropon, position) { + // mark on ghosting only + var sortable = Sortable.options(dropon.parentNode); + if(sortable && !sortable.ghosting) return; + + if(!Sortable._marker) { + Sortable._marker = + ($('dropmarker') || Element.extend(document.createElement('DIV'))). + hide().addClassName('dropmarker').setStyle({position:'absolute'}); + document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); + } + var offsets = Position.cumulativeOffset(dropon); + Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); + + if(position=='after') + if(sortable.overlap == 'horizontal') + Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); + else + Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); + + Sortable._marker.show(); + }, + + _tree: function(element, options, parent) { + var children = Sortable.findElements(element, options) || []; + + for (var i = 0; i < children.length; ++i) { + var match = children[i].id.match(options.format); + + if (!match) continue; + + var child = { + id: encodeURIComponent(match ? match[1] : null), + element: element, + parent: parent, + children: [], + position: parent.children.length, + container: $(children[i]).down(options.treeTag) + }; + + /* Get the element containing the children and recurse over it */ + if (child.container) + this._tree(child.container, options, child); + + parent.children.push (child); + } + + return parent; + }, + + tree: function(element) { + element = $(element); + var sortableOptions = this.options(element); + var options = Object.extend({ + tag: sortableOptions.tag, + treeTag: sortableOptions.treeTag, + only: sortableOptions.only, + name: element.id, + format: sortableOptions.format + }, arguments[1] || { }); + + var root = { + id: null, + parent: null, + children: [], + container: element, + position: 0 + }; + + return Sortable._tree(element, options, root); + }, + + /* Construct a [i] index for a particular node */ + _constructIndex: function(node) { + var index = ''; + do { + if (node.id) index = '[' + node.position + ']' + index; + } while ((node = node.parent) != null); + return index; + }, + + sequence: function(element) { + element = $(element); + var options = Object.extend(this.options(element), arguments[1] || { }); + + return $(this.findElements(element, options) || []).map( function(item) { + return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; + }); + }, + + setSequence: function(element, new_sequence) { + element = $(element); + var options = Object.extend(this.options(element), arguments[2] || { }); + + var nodeMap = { }; + this.findElements(element, options).each( function(n) { + if (n.id.match(options.format)) + nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; + n.parentNode.removeChild(n); + }); + + new_sequence.each(function(ident) { + var n = nodeMap[ident]; + if (n) { + n[1].appendChild(n[0]); + delete nodeMap[ident]; + } + }); + }, + + serialize: function(element) { + element = $(element); + var options = Object.extend(Sortable.options(element), arguments[1] || { }); + var name = encodeURIComponent( + (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); + + if (options.tree) { + return Sortable.tree(element, arguments[1]).children.map( function (item) { + return [name + Sortable._constructIndex(item) + "[id]=" + + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); + }).flatten().join('&'); + } else { + return Sortable.sequence(element, arguments[1]).map( function(item) { + return name + "[]=" + encodeURIComponent(item); + }).join('&'); + } + } +}; + +// Returns true if child is contained within element +Element.isParent = function(child, element) { + if (!child.parentNode || child == element) return false; + if (child.parentNode == element) return true; + return Element.isParent(child.parentNode, element); +}; + +Element.findChildren = function(element, only, recursive, tagName) { + if(!element.hasChildNodes()) return null; + tagName = tagName.toUpperCase(); + if(only) only = [only].flatten(); + var elements = []; + $A(element.childNodes).each( function(e) { + if(e.tagName && e.tagName.toUpperCase()==tagName && + (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) + elements.push(e); + if(recursive) { + var grandchildren = Element.findChildren(e, only, recursive, tagName); + if(grandchildren) elements.push(grandchildren); + } + }); + + return (elements.length>0 ? elements.flatten() : []); +}; + +Element.offsetSize = function (element, type) { + return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; +}; \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/effects.js.svn-base b/js/scriptaculous/.svn/text-base/effects.js.svn-base new file mode 100644 index 0000000..f31a81a --- /dev/null +++ b/js/scriptaculous/.svn/text-base/effects.js.svn-base @@ -0,0 +1,1130 @@ +// script.aculo.us effects.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() { + var color = '#'; + if (this.slice(0,4) == 'rgb(') { + var cols = this.slice(4,this.length-1).split(','); + var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); + } else { + if (this.slice(0,1) == '#') { + if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if (this.length==7) color = this.toLowerCase(); + } + } + return (color.length==7 ? color : (arguments[0] || this)); +}; + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function(element) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +}; + +Element.collectTextNodesIgnoreClass = function(element, className) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? + Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +}; + +Element.setContentZoom = function(element, percent) { + element = $(element); + element.setStyle({fontSize: (percent/100) + 'em'}); + if (Prototype.Browser.WebKit) window.scrollBy(0,0); + return element; +}; + +Element.getInlineOpacity = function(element){ + return $(element).style.opacity || ''; +}; + +Element.forceRerendering = function(element) { + try { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch(e) { } +}; + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + Transitions: { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + .5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4; + return pos > 1 ? 1 : pos; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5; + }, + pulse: function(pos, pulses) { + return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5; + }, + spring: function(pos) { + return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } + }, + DefaultOptions: { + duration: 1.0, // seconds + fps: 100, // 100= assume 66fps max. + sync: false, // true for combining + from: 0.0, + to: 1.0, + delay: 0.0, + queue: 'parallel' + }, + tagifyText: function(element) { + var tagifyStyle = 'position:relative'; + if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; + + element = $(element); + $A(element.childNodes).each( function(child) { + if (child.nodeType==3) { + child.nodeValue.toArray().each( function(character) { + element.insertBefore( + new Element('span', {style: tagifyStyle}).update( + character == ' ' ? String.fromCharCode(160) : character), + child); + }); + Element.remove(child); + } + }); + }, + multiple: function(element, effect) { + var elements; + if (((typeof element == 'object') || + Object.isFunction(element)) && + (element.length)) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || { }); + var masterDelay = options.delay; + + $A(elements).each( function(element, index) { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function(element, effect) { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || { }); + Effect[element.visible() ? + Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(Enumerable, { + initialize: function() { + this.effects = []; + this.interval = null; + }, + _each: function(iterator) { + this.effects._each(iterator); + }, + add: function(effect) { + var timestamp = new Date().getTime(); + + var position = Object.isString(effect.options.queue) ? + effect.options.queue : effect.options.queue.position; + + switch(position) { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'with-last': + timestamp = this.effects.pluck('startOn').max() || timestamp; + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) + this.effects.push(effect); + + if (!this.interval) + this.interval = setInterval(this.loop.bind(this), 15); + }, + remove: function(effect) { + this.effects = this.effects.reject(function(e) { return e==effect }); + if (this.effects.length == 0) { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() { + var timePos = new Date().getTime(); + for(var i=0, len=this.effects.length;i= this.startOn) { + if (timePos >= this.finishOn) { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if (this.finish) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / this.totalTime, + frame = (pos * this.totalFrames).round(); + if (frame > this.currentFrame) { + this.render(pos); + this.currentFrame = frame; + } + } + }, + cancel: function() { + if (!this.options.sync) + Effect.Queues.get(Object.isString(this.options.queue) ? + 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function(eventName) { + if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); + if (this.options[eventName]) this.options[eventName](this); + }, + inspect: function() { + var data = $H(); + for(property in this) + if (!Object.isFunction(this[property])) data.set(property, this[property]); + return '#'; + } +}); + +Effect.Parallel = Class.create(Effect.Base, { + initialize: function(effects) { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function(position) { + this.effects.invoke('render', position); + }, + finish: function(position) { + this.effects.each( function(effect) { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if (effect.finish) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Tween = Class.create(Effect.Base, { + initialize: function(object, from, to) { + object = Object.isString(object) ? $(object) : object; + var args = $A(arguments), method = args.last(), + options = args.length == 5 ? args[3] : null; + this.method = Object.isFunction(method) ? method.bind(object) : + Object.isFunction(object[method]) ? object[method].bind(object) : + function(value) { object[method] = value }; + this.start(Object.extend({ from: from, to: to }, options || { })); + }, + update: function(position) { + this.method(position); + } +}); + +Effect.Event = Class.create(Effect.Base, { + initialize: function() { + this.start(Object.extend({ duration: 0 }, arguments[0] || { })); + }, + update: Prototype.emptyFunction +}); + +Effect.Opacity = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || { }); + this.start(options); + }, + update: function(position) { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if (this.options.mode == 'absolute') { + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function(position) { + this.element.setStyle({ + left: (this.options.x * position + this.originalLeft).round() + 'px', + top: (this.options.y * position + this.originalTop).round() + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function(element, toTop, toLeft) { + return new Effect.Move(element, + Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); +}; + +Effect.Scale = Class.create(Effect.Base, { + initialize: function(element, percent) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or { } with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || { }); + this.start(options); + }, + setup: function() { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = { }; + ['top','left','width','height','fontSize'].each( function(k) { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each( function(fontSizeType) { + if (fontSize.indexOf(fontSizeType)>0) { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; + + this.dims = null; + if (this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if (/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if (!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function(position) { + var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); + if (this.options.scaleContent && this.fontSize) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function(position) { + if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); + }, + setDimensions: function(height, width) { + var d = { }; + if (this.options.scaleX) d.width = width.round() + 'px'; + if (this.options.scaleY) d.height = height.round() + 'px'; + if (this.options.scaleFromCenter) { + var topd = (height - this.dims[0])/2; + var leftd = (width - this.dims[1])/2; + if (this.elementPositioning == 'absolute') { + if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; + if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; + } else { + if (this.options.scaleY) d.top = -topd + 'px'; + if (this.options.scaleX) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + // Prevent executing on elements not in the layout flow + if (this.element.getStyle('display')=='none') { this.cancel(); return; } + // Disable background image during the effect + this.oldStyle = { }; + if (!this.options.keepBackgroundImage) { + this.oldStyle.backgroundImage = this.element.getStyle('background-image'); + this.element.setStyle({backgroundImage: 'none'}); + } + if (!this.options.endcolor) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if (!this.options.restorecolor) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); + this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); + }, + update: function(position) { + this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ + return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); + }, + finish: function() { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = function(element) { + var options = arguments[1] || { }, + scrollOffsets = document.viewport.getScrollOffsets(), + elementOffsets = $(element).cumulativeOffset(); + + if (options.offset) elementOffsets[1] += options.offset; + + return new Effect.Tween(null, + scrollOffsets.top, + elementOffsets[1], + options, + function(p){ scrollTo(scrollOffsets.left, p.round()); } + ); +}; + +/* ------------- combination effects ------------- */ + +Effect.Fade = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function(effect) { + if (effect.options.to!=0) return; + effect.element.hide().setStyle({opacity: oldOpacity}); + } + }, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Appear = function(element) { + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + effect.element.forceRerendering(); + }, + beforeSetup: function(effect) { + effect.element.setOpacity(effect.options.from).show(); + }}, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Puff = function(element) { + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel( + [ new Effect.Scale(element, 200, + { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], + Object.extend({ duration: 1.0, + beforeSetupInternal: function(effect) { + Position.absolutize(effect.effects[0].element); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().setStyle(oldStyle); } + }, arguments[1] || { }) + ); +}; + +Effect.BlindUp = function(element) { + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, + Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }, arguments[1] || { }) + ); +}; + +Effect.BlindDown = function(element) { + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping(); + } + }, arguments[1] || { })); +}; + +Effect.SwitchOff = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function(effect) { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); + } + }); + } + }, arguments[1] || { })); +}; + +Effect.DropOut = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel( + [ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], + Object.extend( + { duration: 0.5, + beforeSetup: function(effect) { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); + } + }, arguments[1] || { })); +}; + +Effect.Shake = function(element) { + element = $(element); + var options = Object.extend({ + distance: 20, + duration: 0.5 + }, arguments[1] || {}); + var distance = parseFloat(options.distance); + var split = parseFloat(options.duration) / 10.0; + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, + { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { + effect.element.undoPositioned().setStyle(oldStyle); + }}); }}); }}); }}); }}); }}); +}; + +Effect.SlideDown = function(element) { + element = $(element).cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } + }, arguments[1] || { }) + ); +}; + +Effect.SlideUp = function(element) { + element = $(element).cleanWhitespace(); + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, window.opera ? 0 : 1, + Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); + } + }, arguments[1] || { }) + ); +}; + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function(element) { + return new Effect.Scale(element, window.opera ? 1 : 0, { + restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }); +}; + +Effect.Grow = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function(effect) { + effect.element.hide().makeClipping().makePositioned(); + }, + afterFinishInternal: function(effect) { + new Effect.Parallel( + [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function(effect) { + effect.effects[0].element.setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); + } + }, options) + ); + } + }); +}; + +Effect.Shrink = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel( + [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function(effect) { + effect.effects[0].element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } + }, options) + ); +}; + +Effect.Pulsate = function(element) { + element = $(element); + var options = arguments[1] || { }, + oldOpacity = element.getInlineOpacity(), + transition = options.transition || Effect.Transitions.linear, + reverser = function(pos){ + return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5); + }; + + return new Effect.Opacity(element, + Object.extend(Object.extend({ duration: 2.0, from: 0, + afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } + }, options), {transition: reverser})); +}; + +Effect.Fold = function(element) { + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + element.makeClipping(); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function(effect) { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().setStyle(oldStyle); + } }); + }}, arguments[1] || { })); +}; + +Effect.Morph = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + style: { } + }, arguments[1] || { }); + + if (!Object.isString(options.style)) this.style = $H(options.style); + else { + if (options.style.include(':')) + this.style = options.style.parseStyle(); + else { + this.element.addClassName(options.style); + this.style = $H(this.element.getStyles()); + this.element.removeClassName(options.style); + var css = this.element.getStyles(); + this.style = this.style.reject(function(style) { + return style.value == css[style.key]; + }); + options.afterFinishInternal = function(effect) { + effect.element.addClassName(effect.options.style); + effect.transforms.each(function(transform) { + effect.element.style[transform.style] = ''; + }); + }; + } + } + this.start(options); + }, + + setup: function(){ + function parseColor(color){ + if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; + color = color.parseColor(); + return $R(0,2).map(function(i){ + return parseInt( color.slice(i*2+1,i*2+3), 16 ); + }); + } + this.transforms = this.style.map(function(pair){ + var property = pair[0], value = pair[1], unit = null; + + if (value.parseColor('#zzzzzz') != '#zzzzzz') { + value = value.parseColor(); + unit = 'color'; + } else if (property == 'opacity') { + value = parseFloat(value); + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + } else if (Element.CSS_LENGTH.test(value)) { + var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); + value = parseFloat(components[1]); + unit = (components.length == 3) ? components[2] : null; + } + + var originalValue = this.element.getStyle(property); + return { + style: property.camelize(), + originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), + targetValue: unit=='color' ? parseColor(value) : value, + unit: unit + }; + }.bind(this)).reject(function(transform){ + return ( + (transform.originalValue == transform.targetValue) || + ( + transform.unit != 'color' && + (isNaN(transform.originalValue) || isNaN(transform.targetValue)) + ) + ); + }); + }, + update: function(position) { + var style = { }, transform, i = this.transforms.length; + while(i--) + style[(transform = this.transforms[i]).style] = + transform.unit=='color' ? '#'+ + (Math.round(transform.originalValue[0]+ + (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + + (Math.round(transform.originalValue[1]+ + (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + + (Math.round(transform.originalValue[2]+ + (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : + (transform.originalValue + + (transform.targetValue - transform.originalValue) * position).toFixed(3) + + (transform.unit === null ? '' : transform.unit); + this.element.setStyle(style, true); + } +}); + +Effect.Transform = Class.create({ + initialize: function(tracks){ + this.tracks = []; + this.options = arguments[1] || { }; + this.addTracks(tracks); + }, + addTracks: function(tracks){ + tracks.each(function(track){ + track = $H(track); + var data = track.values().first(); + this.tracks.push($H({ + ids: track.keys().first(), + effect: Effect.Morph, + options: { style: data } + })); + }.bind(this)); + return this; + }, + play: function(){ + return new Effect.Parallel( + this.tracks.map(function(track){ + var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); + var elements = [$(ids) || $$(ids)].flatten(); + return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); + }).flatten(), + this.options + ); + } +}); + +Element.CSS_PROPERTIES = $w( + 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + + 'fontSize fontWeight height left letterSpacing lineHeight ' + + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ + 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + + 'right textIndent top width wordSpacing zIndex'); + +Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; + +String.__parseStyleElement = document.createElement('div'); +String.prototype.parseStyle = function(){ + var style, styleRules = $H(); + if (Prototype.Browser.WebKit) + style = new Element('div',{style:this}).style; + else { + String.__parseStyleElement.innerHTML = '
    '; + style = String.__parseStyleElement.childNodes[0].style; + } + + Element.CSS_PROPERTIES.each(function(property){ + if (style[property]) styleRules.set(property, style[property]); + }); + + if (Prototype.Browser.IE && this.include('opacity')) + styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); + + return styleRules; +}; + +if (document.defaultView && document.defaultView.getComputedStyle) { + Element.getStyles = function(element) { + var css = document.defaultView.getComputedStyle($(element), null); + return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { + styles[property] = css[property]; + return styles; + }); + }; +} else { + Element.getStyles = function(element) { + element = $(element); + var css = element.currentStyle, styles; + styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { + results[property] = css[property]; + return results; + }); + if (!styles.opacity) styles.opacity = element.getOpacity(); + return styles; + }; +} + +Effect.Methods = { + morph: function(element, style) { + element = $(element); + new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); + return element; + }, + visualEffect: function(element, effect, options) { + element = $(element); + var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[klass](element, options); + return element; + }, + highlight: function(element, options) { + element = $(element); + new Effect.Highlight(element, options); + return element; + } +}; + +$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ + 'pulsate shake puff squish switchOff dropOut').each( + function(effect) { + Effect.Methods[effect] = function(element, options){ + element = $(element); + Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); + return element; + }; + } +); + +$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( + function(f) { Effect.Methods[f] = Element[f]; } +); + +Element.addMethods(Effect.Methods); \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/javascript.js.svn-base b/js/scriptaculous/.svn/text-base/javascript.js.svn-base new file mode 100644 index 0000000..8a4973e --- /dev/null +++ b/js/scriptaculous/.svn/text-base/javascript.js.svn-base @@ -0,0 +1,20 @@ +CodeHighlighter.addStyle("javascript",{ + comment : { + exp : /(\/\/[^\n]*\n?)|(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)/ + }, + brackets : { + exp : /\(|\)/ + }, + string : { + exp : /'[^']*'|"[^"]*"/ + }, + keywords : { + exp : /\b(arguments|break|case|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|typeof|var|void|while|with)\b/ + }, + global : { + exp : /\b(toString|valueOf|window|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ + }, + erb : { + exp : /<%=(.+)%>/ + } +}); \ No newline at end of file diff --git a/js/scriptaculous/.svn/text-base/prototype.js.svn-base b/js/scriptaculous/.svn/text-base/prototype.js.svn-base new file mode 100644 index 0000000..dfe8ab4 --- /dev/null +++ b/js/scriptaculous/.svn/text-base/prototype.js.svn-base @@ -0,0 +1,4320 @@ +/* Prototype JavaScript framework, version 1.6.0.3 + * (c) 2005-2008 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * + *--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.6.0.3', + + Browser: { + IE: !!(window.attachEvent && + navigator.userAgent.indexOf('Opera') === -1), + Opera: navigator.userAgent.indexOf('Opera') > -1, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && + navigator.userAgent.indexOf('KHTML') === -1, + MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + SelectorsAPI: !!document.querySelector, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + document.createElement('div')['__proto__'] && + document.createElement('div')['__proto__'] !== + document.createElement('form')['__proto__'] + }, + + ScriptFragment: ']*>([\\S\\s]*?)<\/script>', + JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +}; + +if (Prototype.Browser.MobileSafari) + Prototype.BrowserFeatures.SpecificElementExtensions = false; + + +/* Based on Alex Arnell's inheritance implementation. */ +var Class = { + create: function() { + var parent = null, properties = $A(arguments); + if (Object.isFunction(properties[0])) + parent = properties.shift(); + + function klass() { + this.initialize.apply(this, arguments); + } + + Object.extend(klass, Class.Methods); + klass.superclass = parent; + klass.subclasses = []; + + if (parent) { + var subclass = function() { }; + subclass.prototype = parent.prototype; + klass.prototype = new subclass; + parent.subclasses.push(klass); + } + + for (var i = 0; i < properties.length; i++) + klass.addMethods(properties[i]); + + if (!klass.prototype.initialize) + klass.prototype.initialize = Prototype.emptyFunction; + + klass.prototype.constructor = klass; + + return klass; + } +}; + +Class.Methods = { + addMethods: function(source) { + var ancestor = this.superclass && this.superclass.prototype; + var properties = Object.keys(source); + + if (!Object.keys({ toString: true }).length) + properties.push("toString", "valueOf"); + + for (var i = 0, length = properties.length; i < length; i++) { + var property = properties[i], value = source[property]; + if (ancestor && Object.isFunction(value) && + value.argumentNames().first() == "$super") { + var method = value; + value = (function(m) { + return function() { return ancestor[m].apply(this, arguments) }; + })(property).wrap(method); + + value.valueOf = method.valueOf.bind(method); + value.toString = method.toString.bind(method); + } + this.prototype[property] = value; + } + + return this; + } +}; + +var Abstract = { }; + +Object.extend = function(destination, source) { + for (var property in source) + destination[property] = source[property]; + return destination; +}; + +Object.extend(Object, { + inspect: function(object) { + try { + if (Object.isUndefined(object)) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : String(object); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + toJSON: function(object) { + var type = typeof object; + switch (type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } + + if (object === null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (Object.isElement(object)) return; + + var results = []; + for (var property in object) { + var value = Object.toJSON(object[property]); + if (!Object.isUndefined(value)) + results.push(property.toJSON() + ': ' + value); + } + + return '{' + results.join(', ') + '}'; + }, + + toQueryString: function(object) { + return $H(object).toQueryString(); + }, + + toHTML: function(object) { + return object && object.toHTML ? object.toHTML() : String.interpret(object); + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({ }, object); + }, + + isElement: function(object) { + return !!(object && object.nodeType == 1); + }, + + isArray: function(object) { + return object != null && typeof object == "object" && + 'splice' in object && 'join' in object; + }, + + isHash: function(object) { + return object instanceof Hash; + }, + + isFunction: function(object) { + return typeof object == "function"; + }, + + isString: function(object) { + return typeof object == "string"; + }, + + isNumber: function(object) { + return typeof object == "number"; + }, + + isUndefined: function(object) { + return typeof object == "undefined"; + } +}); + +Object.extend(Function.prototype, { + argumentNames: function() { + var names = this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1] + .replace(/\s+/g, '').split(','); + return names.length == 1 && !names[0] ? [] : names; + }, + + bind: function() { + if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } + }, + + bindAsEventListener: function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } + }, + + curry: function() { + if (!arguments.length) return this; + var __method = this, args = $A(arguments); + return function() { + return __method.apply(this, args.concat($A(arguments))); + } + }, + + delay: function() { + var __method = this, args = $A(arguments), timeout = args.shift() * 1000; + return window.setTimeout(function() { + return __method.apply(__method, args); + }, timeout); + }, + + defer: function() { + var args = [0.01].concat($A(arguments)); + return this.delay.apply(this, args); + }, + + wrap: function(wrapper) { + var __method = this; + return function() { + return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); + } + }, + + methodize: function() { + if (this._methodized) return this._methodized; + var __method = this; + return this._methodized = function() { + return __method.apply(null, [this].concat($A(arguments))); + }; + } +}); + +Date.prototype.toJSON = function() { + return '"' + this.getUTCFullYear() + '-' + + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + + this.getUTCDate().toPaddedString(2) + 'T' + + this.getUTCHours().toPaddedString(2) + ':' + + this.getUTCMinutes().toPaddedString(2) + ':' + + this.getUTCSeconds().toPaddedString(2) + 'Z"'; +}; + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) { } + } + + return returnValue; + } +}; + +RegExp.prototype.match = RegExp.prototype.test; + +RegExp.escape = function(str) { + return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); +}; + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create({ + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + execute: function() { + this.callback(this); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.execute(); + } finally { + this.currentlyExecuting = false; + } + } + } +}); +Object.extend(String, { + interpret: function(value) { + return value == null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = Object.isUndefined(count) ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return String(this); + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = Object.isUndefined(truncation) ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : String(this); + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var self = arguments.callee; + self.text.data = this; + return self.div.innerHTML; + }, + + unescapeHTML: function() { + var div = new Element('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return { }; + + return match[1].split(separator || '&').inject({ }, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var key = decodeURIComponent(pair.shift()); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + if (value != undefined) value = decodeURIComponent(value); + + if (key in hash) { + if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; + hash[key].push(value); + } + else hash[key] = value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + return count < 1 ? '' : new Array(count + 1).join(this); + }, + + camelize: function() { + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; + + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); + + return camelized; + }, + + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { + var character = String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + isJSON: function() { + var str = this; + if (str.blank()) return false; + str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + evalJSON: function(sanitize) { + var json = this.unfilterJSON(); + try { + if (!sanitize || json.isJSON()) return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) === 0; + }, + + endsWith: function(pattern) { + var d = this.length - pattern.length; + return d >= 0 && this.lastIndexOf(pattern) === d; + }, + + empty: function() { + return this == ''; + }, + + blank: function() { + return /^\s*$/.test(this); + }, + + interpolate: function(object, pattern) { + return new Template(this, pattern).evaluate(object); + } +}); + +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(//g,'>'); + }, + unescapeHTML: function() { + return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (Object.isFunction(replacement)) return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +}; + +String.prototype.parseQuery = String.prototype.toQueryParams; + +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); + +String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text); + +var Template = Class.create({ + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + if (Object.isFunction(object.toTemplateReplacements)) + object = object.toTemplateReplacements(); + + return this.template.gsub(this.pattern, function(match) { + if (object == null) return ''; + + var before = match[1] || ''; + if (before == '\\') return match[2]; + + var ctx = object, expr = match[3]; + var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; + match = pattern.exec(expr); + if (match == null) return before; + + while (match != null) { + var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; + ctx = ctx[comp]; + if (null == ctx || '' == match[3]) break; + expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); + match = pattern.exec(expr); + } + + return before + String.interpret(ctx); + }); + } +}); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; + +var $break = { }; + +var Enumerable = { + each: function(iterator, context) { + var index = 0; + try { + this._each(function(value) { + iterator.call(context, value, index++); + }); + } catch (e) { + if (e != $break) throw e; + } + return this; + }, + + eachSlice: function(number, iterator, context) { + var index = -number, slices = [], array = this.toArray(); + if (number < 1) return array; + while ((index += number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.collect(iterator, context); + }, + + all: function(iterator, context) { + iterator = iterator || Prototype.K; + var result = true; + this.each(function(value, index) { + result = result && !!iterator.call(context, value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator, context) { + iterator = iterator || Prototype.K; + var result = false; + this.each(function(value, index) { + if (result = !!iterator.call(context, value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator, context) { + iterator = iterator || Prototype.K; + var results = []; + this.each(function(value, index) { + results.push(iterator.call(context, value, index)); + }); + return results; + }, + + detect: function(iterator, context) { + var result; + this.each(function(value, index) { + if (iterator.call(context, value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator, context) { + var results = []; + this.each(function(value, index) { + if (iterator.call(context, value, index)) + results.push(value); + }); + return results; + }, + + grep: function(filter, iterator, context) { + iterator = iterator || Prototype.K; + var results = []; + + if (Object.isString(filter)) + filter = new RegExp(filter); + + this.each(function(value, index) { + if (filter.match(value)) + results.push(iterator.call(context, value, index)); + }); + return results; + }, + + include: function(object) { + if (Object.isFunction(this.indexOf)) + if (this.indexOf(object) != -1) return true; + + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inGroupsOf: function(number, fillWith) { + fillWith = Object.isUndefined(fillWith) ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator, context) { + this.each(function(value, index) { + memo = iterator.call(context, memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator, context) { + iterator = iterator || Prototype.K; + var result; + this.each(function(value, index) { + value = iterator.call(context, value, index); + if (result == null || value >= result) + result = value; + }); + return result; + }, + + min: function(iterator, context) { + iterator = iterator || Prototype.K; + var result; + this.each(function(value, index) { + value = iterator.call(context, value, index); + if (result == null || value < result) + result = value; + }); + return result; + }, + + partition: function(iterator, context) { + iterator = iterator || Prototype.K; + var trues = [], falses = []; + this.each(function(value, index) { + (iterator.call(context, value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator, context) { + var results = []; + this.each(function(value, index) { + if (!iterator.call(context, value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator, context) { + return this.map(function(value, index) { + return { + value: value, + criteria: iterator.call(context, value, index) + }; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.map(); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (Object.isFunction(args.last())) + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + size: function() { + return this.toArray().length; + }, + + inspect: function() { + return '#'; + } +}; + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + filter: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray, + every: Enumerable.all, + some: Enumerable.any +}); +function $A(iterable) { + if (!iterable) return []; + if (iterable.toArray) return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; +} + +if (Prototype.Browser.WebKit) { + $A = function(iterable) { + if (!iterable) return []; + // In Safari, only use the `toArray` method if it's not a NodeList. + // A NodeList is a function, has an function `item` property, and a numeric + // `length` property. Adapted from Google Doctype. + if (!(typeof iterable === 'function' && typeof iterable.length === + 'number' && typeof iterable.item === 'function') && iterable.toArray) + return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; + }; +} + +Array.from = $A; + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(Object.isArray(value) ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + reduce: function() { + return this.length > 1 ? this : this[0]; + }, + + uniq: function(sorted) { + return this.inject([], function(array, value, index) { + if (0 == index || (sorted ? array.last() != value : !array.include(value))) + array.push(value); + return array; + }); + }, + + intersect: function(array) { + return this.uniq().findAll(function(item) { + return array.detect(function(value) { return item === value }); + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + }, + + toJSON: function() { + var results = []; + this.each(function(object) { + var value = Object.toJSON(object); + if (!Object.isUndefined(value)) results.push(value); + }); + return '[' + results.join(', ') + ']'; + } +}); + +// use native browser JS 1.6 implementation if available +if (Object.isFunction(Array.prototype.forEach)) + Array.prototype._each = Array.prototype.forEach; + +if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { + i || (i = 0); + var length = this.length; + if (i < 0) i = length + i; + for (; i < length; i++) + if (this[i] === item) return i; + return -1; +}; + +if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { + i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; + var n = this.slice(0, i).reverse().indexOf(item); + return (n < 0) ? n : i - n - 1; +}; + +Array.prototype.toArray = Array.prototype.clone; + +function $w(string) { + if (!Object.isString(string)) return []; + string = string.strip(); + return string ? string.split(/\s+/) : []; +} + +if (Prototype.Browser.Opera){ + Array.prototype.concat = function() { + var array = []; + for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for (var i = 0, length = arguments.length; i < length; i++) { + if (Object.isArray(arguments[i])) { + for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + }; +} +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator, context) { + $R(0, this, true).each(iterator, context); + return this; + }, + + toPaddedString: function(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; + }, + + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); + +$w('abs round ceil floor').each(function(method){ + Number.prototype[method] = Math[method].methodize(); +}); +function $H(object) { + return new Hash(object); +}; + +var Hash = Class.create(Enumerable, (function() { + + function toQueryPair(key, value) { + if (Object.isUndefined(value)) return key; + return key + '=' + encodeURIComponent(String.interpret(value)); + } + + return { + initialize: function(object) { + this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); + }, + + _each: function(iterator) { + for (var key in this._object) { + var value = this._object[key], pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + set: function(key, value) { + return this._object[key] = value; + }, + + get: function(key) { + // simulating poorly supported hasOwnProperty + if (this._object[key] !== Object.prototype[key]) + return this._object[key]; + }, + + unset: function(key) { + var value = this._object[key]; + delete this._object[key]; + return value; + }, + + toObject: function() { + return Object.clone(this._object); + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + index: function(value) { + var match = this.detect(function(pair) { + return pair.value === value; + }); + return match && match.key; + }, + + merge: function(object) { + return this.clone().update(object); + }, + + update: function(object) { + return new Hash(object).inject(this, function(result, pair) { + result.set(pair.key, pair.value); + return result; + }); + }, + + toQueryString: function() { + return this.inject([], function(results, pair) { + var key = encodeURIComponent(pair.key), values = pair.value; + + if (values && typeof values == 'object') { + if (Object.isArray(values)) + return results.concat(values.map(toQueryPair.curry(key))); + } else results.push(toQueryPair(key, values)); + return results; + }).join('&'); + }, + + inspect: function() { + return '#'; + }, + + toJSON: function() { + return Object.toJSON(this.toObject()); + }, + + clone: function() { + return new Hash(this); + } + } +})()); + +Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; +Hash.from = $H; +var ObjectRange = Class.create(Enumerable, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + while (this.include(value)) { + iterator(value); + value = value.succ(); + } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +}; + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +}; + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); + }, + + unregister: function(responder) { + this.responders = this.responders.without(responder); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (Object.isFunction(responder[callback])) { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) { } + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { Ajax.activeRequestCount++ }, + onComplete: function() { Ajax.activeRequestCount-- } +}); + +Ajax.Base = Class.create({ + initialize: function(options) { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '', + evalJSON: true, + evalJS: true + }; + Object.extend(this.options, options || { }); + + this.options.method = this.options.method.toLowerCase(); + + if (Object.isString(this.options.parameters)) + this.options.parameters = this.options.parameters.toQueryParams(); + else if (Object.isHash(this.options.parameters)) + this.options.parameters = this.options.parameters.toObject(); + } +}); + +Ajax.Request = Class.create(Ajax.Base, { + _complete: false, + + initialize: function($super, url, options) { + $super(options); + this.transport = Ajax.getTransport(); + this.request(url); + }, + + request: function(url) { + this.url = url; + this.method = this.options.method; + var params = Object.clone(this.options.parameters); + + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] = this.method; + this.method = 'post'; + } + + this.parameters = params; + + if (params = Object.toQueryString(params)) { + // when GET, append parameters to URL + if (this.method == 'get') + this.url += (this.url.include('?') ? '&' : '?') + params; + else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + params += '&_='; + } + + try { + var response = new Ajax.Response(this); + if (this.options.onCreate) this.options.onCreate(response); + Ajax.Responders.dispatch('onCreate', this, response); + + this.transport.open(this.method.toUpperCase(), this.url, + this.options.asynchronous); + + if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); + + this.transport.onreadystatechange = this.onStateChange.bind(this); + this.setRequestHeaders(); + + this.body = this.method == 'post' ? (this.options.postBody || params) : null; + this.transport.send(this.body); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { + this.dispatchException(e); + } + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState > 1 && !((readyState == 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + + setRequestHeaders: function() { + var headers = { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }; + + if (this.method == 'post') { + headers['Content-type'] = this.options.contentType + + (this.options.encoding ? '; charset=' + this.options.encoding : ''); + + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) + headers['Connection'] = 'close'; + } + + // user-defined headers + if (typeof this.options.requestHeaders == 'object') { + var extras = this.options.requestHeaders; + + if (Object.isFunction(extras.push)) + for (var i = 0, length = extras.length; i < length; i += 2) + headers[extras[i]] = extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] = pair.value }); + } + + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); + }, + + success: function() { + var status = this.getStatus(); + return !status || (status >= 200 && status < 300); + }, + + getStatus: function() { + try { + return this.transport.status || 0; + } catch (e) { return 0 } + }, + + respondToReadyState: function(readyState) { + var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); + + if (state == 'Complete') { + try { + this._complete = true; + (this.options['on' + response.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + var contentType = response.getHeader('Content-type'); + if (this.options.evalJS == 'force' + || (this.options.evalJS && this.isSameOrigin() && contentType + && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) + this.evalResponse(); + } + + try { + (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); + Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + if (state == 'Complete') { + // avoid memory leak in MSIE: clean up + this.transport.onreadystatechange = Prototype.emptyFunction; + } + }, + + isSameOrigin: function() { + var m = this.url.match(/^\s*https?:\/\/[^\/]*/); + return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ + protocol: location.protocol, + domain: document.domain, + port: location.port ? ':' + location.port : '' + })); + }, + + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name) || null; + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval((this.transport.responseText || '').unfilterJSON()); + } catch (e) { + this.dispatchException(e); + } + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Response = Class.create({ + initialize: function(request){ + this.request = request; + var transport = this.transport = request.transport, + readyState = this.readyState = transport.readyState; + + if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { + this.status = this.getStatus(); + this.statusText = this.getStatusText(); + this.responseText = String.interpret(transport.responseText); + this.headerJSON = this._getHeaderJSON(); + } + + if(readyState == 4) { + var xml = transport.responseXML; + this.responseXML = Object.isUndefined(xml) ? null : xml; + this.responseJSON = this._getResponseJSON(); + } + }, + + status: 0, + statusText: '', + + getStatus: Ajax.Request.prototype.getStatus, + + getStatusText: function() { + try { + return this.transport.statusText || ''; + } catch (e) { return '' } + }, + + getHeader: Ajax.Request.prototype.getHeader, + + getAllHeaders: function() { + try { + return this.getAllResponseHeaders(); + } catch (e) { return null } + }, + + getResponseHeader: function(name) { + return this.transport.getResponseHeader(name); + }, + + getAllResponseHeaders: function() { + return this.transport.getAllResponseHeaders(); + }, + + _getHeaderJSON: function() { + var json = this.getHeader('X-JSON'); + if (!json) return null; + json = decodeURIComponent(escape(json)); + try { + return json.evalJSON(this.request.options.sanitizeJSON || + !this.request.isSameOrigin()); + } catch (e) { + this.request.dispatchException(e); + } + }, + + _getResponseJSON: function() { + var options = this.request.options; + if (!options.evalJSON || (options.evalJSON != 'force' && + !(this.getHeader('Content-type') || '').include('application/json')) || + this.responseText.blank()) + return null; + try { + return this.responseText.evalJSON(options.sanitizeJSON || + !this.request.isSameOrigin()); + } catch (e) { + this.request.dispatchException(e); + } + } +}); + +Ajax.Updater = Class.create(Ajax.Request, { + initialize: function($super, container, url, options) { + this.container = { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container)) + }; + + options = Object.clone(options); + var onComplete = options.onComplete; + options.onComplete = (function(response, json) { + this.updateContent(response.responseText); + if (Object.isFunction(onComplete)) onComplete(response, json); + }).bind(this); + + $super(url, options); + }, + + updateContent: function(responseText) { + var receiver = this.container[this.success() ? 'success' : 'failure'], + options = this.options; + + if (!options.evalScripts) responseText = responseText.stripScripts(); + + if (receiver = $(receiver)) { + if (options.insertion) { + if (Object.isString(options.insertion)) { + var insertion = { }; insertion[options.insertion] = responseText; + receiver.insert(insertion); + } + else options.insertion(receiver, responseText); + } + else receiver.update(responseText); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { + initialize: function($super, container, url, options) { + $super(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = { }; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.options.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(response) { + if (this.options.decay) { + this.decay = (response.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = response.responseText; + } + this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $(element) { + if (arguments.length > 1) { + for (var i = 0, elements = [], length = arguments.length; i < length; i++) + elements.push($(arguments[i])); + return elements; + } + if (Object.isString(element)) + element = document.getElementById(element); + return Element.extend(element); +} + +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath = function(expression, parentElement) { + var results = []; + var query = document.evaluate(expression, $(parentElement) || document, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0, length = query.snapshotLength; i < length; i++) + results.push(Element.extend(query.snapshotItem(i))); + return results; + }; +} + +/*--------------------------------------------------------------------------*/ + +if (!window.Node) var Node = { }; + +if (!Node.ELEMENT_NODE) { + // DOM level 2 ECMAScript Language Binding + Object.extend(Node, { + ELEMENT_NODE: 1, + ATTRIBUTE_NODE: 2, + TEXT_NODE: 3, + CDATA_SECTION_NODE: 4, + ENTITY_REFERENCE_NODE: 5, + ENTITY_NODE: 6, + PROCESSING_INSTRUCTION_NODE: 7, + COMMENT_NODE: 8, + DOCUMENT_NODE: 9, + DOCUMENT_TYPE_NODE: 10, + DOCUMENT_FRAGMENT_NODE: 11, + NOTATION_NODE: 12 + }); +} + +(function() { + var element = this.Element; + this.Element = function(tagName, attributes) { + attributes = attributes || { }; + tagName = tagName.toLowerCase(); + var cache = Element.cache; + if (Prototype.Browser.IE && attributes.name) { + tagName = '<' + tagName + ' name="' + attributes.name + '">'; + delete attributes.name; + return Element.writeAttribute(document.createElement(tagName), attributes); + } + if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); + return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); + }; + Object.extend(this.Element, element || { }); + if (element) this.Element.prototype = element.prototype; +}).call(window); + +Element.cache = { }; + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function(element) { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function(element) { + element = $(element); + element.style.display = 'none'; + return element; + }, + + show: function(element) { + element = $(element); + element.style.display = ''; + return element; + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + content = Object.toHTML(content); + element.innerHTML = content.stripScripts(); + content.evalScripts.bind(content).defer(); + return element; + }, + + replace: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + else if (!Object.isElement(content)) { + content = Object.toHTML(content); + var range = element.ownerDocument.createRange(); + range.selectNode(element); + content.evalScripts.bind(content).defer(); + content = range.createContextualFragment(content.stripScripts()); + } + element.parentNode.replaceChild(content, element); + return element; + }, + + insert: function(element, insertions) { + element = $(element); + + if (Object.isString(insertions) || Object.isNumber(insertions) || + Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) + insertions = {bottom:insertions}; + + var content, insert, tagName, childNodes; + + for (var position in insertions) { + content = insertions[position]; + position = position.toLowerCase(); + insert = Element._insertionTranslations[position]; + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + insert(element, content); + continue; + } + + content = Object.toHTML(content); + + tagName = ((position == 'before' || position == 'after') + ? element.parentNode : element).tagName.toUpperCase(); + + childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + + if (position == 'top' || position == 'after') childNodes.reverse(); + childNodes.each(insert.curry(element)); + + content.evalScripts.bind(content).defer(); + } + + return element; + }, + + wrap: function(element, wrapper, attributes) { + element = $(element); + if (Object.isElement(wrapper)) + $(wrapper).writeAttribute(attributes || { }); + else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); + else wrapper = new Element('div', wrapper); + if (element.parentNode) + element.parentNode.replaceChild(wrapper, element); + wrapper.appendChild(element); + return wrapper; + }, + + inspect: function(element) { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if (value) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element = $(element); + var elements = []; + while (element = element[property]) + if (element.nodeType == 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $(element).select("*"); + }, + + firstDescendant: function(element) { + element = $(element).firstChild; + while (element && element.nodeType != 1) element = element.nextSibling; + return $(element); + }, + + immediateDescendants: function(element) { + if (!(element = $(element).firstChild)) return []; + while (element && element.nodeType != 1) element = element.nextSibling; + if (element) return [element].concat($(element).nextSiblings()); + return []; + }, + + previousSiblings: function(element) { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function(element) { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function(element) { + element = $(element); + return element.previousSiblings().reverse().concat(element.nextSiblings()); + }, + + match: function(element, selector) { + if (Object.isString(selector)) + selector = new Selector(selector); + return selector.match($(element)); + }, + + up: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(element.parentNode); + var ancestors = element.ancestors(); + return Object.isNumber(expression) ? ancestors[expression] : + Selector.findElement(ancestors, expression, index); + }, + + down: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return element.firstDescendant(); + return Object.isNumber(expression) ? element.descendants()[expression] : + Element.select(element, expression)[index || 0]; + }, + + previous: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); + var previousSiblings = element.previousSiblings(); + return Object.isNumber(expression) ? previousSiblings[expression] : + Selector.findElement(previousSiblings, expression, index); + }, + + next: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); + var nextSiblings = element.nextSiblings(); + return Object.isNumber(expression) ? nextSiblings[expression] : + Selector.findElement(nextSiblings, expression, index); + }, + + select: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element, args); + }, + + adjacent: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element.parentNode, args).without(element); + }, + + identify: function(element) { + element = $(element); + var id = element.readAttribute('id'), self = arguments.callee; + if (id) return id; + do { id = 'anonymous_element_' + self.counter++ } while ($(id)); + element.writeAttribute('id', id); + return id; + }, + + readAttribute: function(element, name) { + element = $(element); + if (Prototype.Browser.IE) { + var t = Element._attributeTranslations.read; + if (t.values[name]) return t.values[name](element, name); + if (t.names[name]) name = t.names[name]; + if (name.include(':')) { + return (!element.attributes || !element.attributes[name]) ? null : + element.attributes[name].value; + } + } + return element.getAttribute(name); + }, + + writeAttribute: function(element, name, value) { + element = $(element); + var attributes = { }, t = Element._attributeTranslations.write; + + if (typeof name == 'object') attributes = name; + else attributes[name] = Object.isUndefined(value) ? true : value; + + for (var attr in attributes) { + name = t.names[attr] || attr; + value = attributes[attr]; + if (t.values[attr]) name = t.values[attr](element, value); + if (value === false || value === null) + element.removeAttribute(name); + else if (value === true) + element.setAttribute(name, name); + else element.setAttribute(name, value); + } + return element; + }, + + getHeight: function(element) { + return $(element).getDimensions().height; + }, + + getWidth: function(element) { + return $(element).getDimensions().width; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + var elementClassName = element.className; + return (elementClassName.length > 0 && (elementClassName == className || + new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + if (!element.hasClassName(className)) + element.className += (element.className ? ' ' : '') + className; + return element; + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + element.className = element.className.replace( + new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); + return element; + }, + + toggleClassName: function(element, className) { + if (!(element = $(element))) return; + return element[element.hasClassName(className) ? + 'removeClassName' : 'addClassName'](className); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + var node = element.firstChild; + while (node) { + var nextNode = node.nextSibling; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + element.removeChild(node); + node = nextNode; + } + return element; + }, + + empty: function(element) { + return $(element).innerHTML.blank(); + }, + + descendantOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + + if (element.compareDocumentPosition) + return (element.compareDocumentPosition(ancestor) & 8) === 8; + + if (ancestor.contains) + return ancestor.contains(element) && ancestor !== element; + + while (element = element.parentNode) + if (element == ancestor) return true; + + return false; + }, + + scrollTo: function(element) { + element = $(element); + var pos = element.cumulativeOffset(); + window.scrollTo(pos[0], pos[1]); + return element; + }, + + getStyle: function(element, style) { + element = $(element); + style = style == 'float' ? 'cssFloat' : style.camelize(); + var value = element.style[style]; + if (!value || value == 'auto') { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css[style] : null; + } + if (style == 'opacity') return value ? parseFloat(value) : 1.0; + return value == 'auto' ? null : value; + }, + + getOpacity: function(element) { + return $(element).getStyle('opacity'); + }, + + setStyle: function(element, styles) { + element = $(element); + var elementStyle = element.style, match; + if (Object.isString(styles)) { + element.style.cssText += ';' + styles; + return styles.include('opacity') ? + element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; + } + for (var property in styles) + if (property == 'opacity') element.setOpacity(styles[property]); + else + elementStyle[(property == 'float' || property == 'cssFloat') ? + (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : + property] = styles[property]; + + return element; + }, + + setOpacity: function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + return element; + }, + + getDimensions: function(element) { + element = $(element); + var display = element.getStyle('display'); + if (display != 'none' && display != null) // Safari bug + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + var originalDisplay = els.display; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = 'block'; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = originalDisplay; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (Prototype.Browser.Opera) { + element.style.top = 0; + element.style.left = 0; + } + } + return element; + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + return element; + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return element; + element._overflow = Element.getStyle(element, 'overflow') || 'auto'; + if (element._overflow !== 'hidden') + element.style.overflow = 'hidden'; + return element; + }, + + undoClipping: function(element) { + element = $(element); + if (!element._overflow) return element; + element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; + element._overflow = null; + return element; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + if (element.tagName.toUpperCase() == 'BODY') break; + var p = Element.getStyle(element, 'position'); + if (p !== 'static') break; + } + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + absolutize: function(element) { + element = $(element); + if (element.getStyle('position') == 'absolute') return element; + // Position.prepare(); // To be done manually by Scripty when it needs it. + + var offsets = element.positionedOffset(); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.width = width + 'px'; + element.style.height = height + 'px'; + return element; + }, + + relativize: function(element) { + element = $(element); + if (element.getStyle('position') == 'relative') return element; + // Position.prepare(); // To be done manually by Scripty when it needs it. + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + return element; + }, + + cumulativeScrollOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + getOffsetParent: function(element) { + if (element.offsetParent) return $(element.offsetParent); + if (element == document.body) return $(element); + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return $(element); + + return $(document.body); + }, + + viewportOffset: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent == document.body && + Element.getStyle(element, 'position') == 'absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } + } while (element = element.parentNode); + + return Element._returnOffset(valueL, valueT); + }, + + clonePosition: function(element, source) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || { }); + + // find page position of source + source = $(source); + var p = source.viewportOffset(); + + // find coordinate system to use + element = $(element); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(element, 'position') == 'absolute') { + parent = element.getOffsetParent(); + delta = parent.viewportOffset(); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if (options.setWidth) element.style.width = source.offsetWidth + 'px'; + if (options.setHeight) element.style.height = source.offsetHeight + 'px'; + return element; + } +}; + +Element.Methods.identify.counter = 1; + +Object.extend(Element.Methods, { + getElementsBySelector: Element.Methods.select, + childElements: Element.Methods.immediateDescendants +}); + +Element._attributeTranslations = { + write: { + names: { + className: 'class', + htmlFor: 'for' + }, + values: { } + } +}; + +if (Prototype.Browser.Opera) { + Element.Methods.getStyle = Element.Methods.getStyle.wrap( + function(proceed, element, style) { + switch (style) { + case 'left': case 'top': case 'right': case 'bottom': + if (proceed(element, 'position') === 'static') return null; + case 'height': case 'width': + // returns '0px' for hidden elements; we want it to return null + if (!Element.visible(element)) return null; + + // returns the border-box dimensions rather than the content-box + // dimensions, so we subtract padding and borders from the value + var dim = parseInt(proceed(element, style), 10); + + if (dim !== element['offset' + style.capitalize()]) + return dim + 'px'; + + var properties; + if (style === 'height') { + properties = ['border-top-width', 'padding-top', + 'padding-bottom', 'border-bottom-width']; + } + else { + properties = ['border-left-width', 'padding-left', + 'padding-right', 'border-right-width']; + } + return properties.inject(dim, function(memo, property) { + var val = proceed(element, property); + return val === null ? memo : memo - parseInt(val, 10); + }) + 'px'; + default: return proceed(element, style); + } + } + ); + + Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( + function(proceed, element, attribute) { + if (attribute === 'title') return element.title; + return proceed(element, attribute); + } + ); +} + +else if (Prototype.Browser.IE) { + // IE doesn't report offsets correctly for static elements, so we change them + // to "relative" to get the values, then change them back. + Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( + function(proceed, element) { + element = $(element); + // IE throws an error if element is not in document + try { element.offsetParent } + catch(e) { return $(document.body) } + var position = element.getStyle('position'); + if (position !== 'static') return proceed(element); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + + $w('positionedOffset viewportOffset').each(function(method) { + Element.Methods[method] = Element.Methods[method].wrap( + function(proceed, element) { + element = $(element); + try { element.offsetParent } + catch(e) { return Element._returnOffset(0,0) } + var position = element.getStyle('position'); + if (position !== 'static') return proceed(element); + // Trigger hasLayout on the offset parent so that IE6 reports + // accurate offsetTop and offsetLeft values for position: fixed. + var offsetParent = element.getOffsetParent(); + if (offsetParent && offsetParent.getStyle('position') === 'fixed') + offsetParent.setStyle({ zoom: 1 }); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + }); + + Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap( + function(proceed, element) { + try { element.offsetParent } + catch(e) { return Element._returnOffset(0,0) } + return proceed(element); + } + ); + + Element.Methods.getStyle = function(element, style) { + element = $(element); + style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); + var value = element.style[style]; + if (!value && element.currentStyle) value = element.currentStyle[style]; + + if (style == 'opacity') { + if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) + if (value[1]) return parseFloat(value[1]) / 100; + return 1.0; + } + + if (value == 'auto') { + if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) + return element['offset' + style.capitalize()] + 'px'; + return null; + } + return value; + }; + + Element.Methods.setOpacity = function(element, value) { + function stripAlpha(filter){ + return filter.replace(/alpha\([^\)]*\)/gi,''); + } + element = $(element); + var currentStyle = element.currentStyle; + if ((currentStyle && !currentStyle.hasLayout) || + (!currentStyle && element.style.zoom == 'normal')) + element.style.zoom = 1; + + var filter = element.getStyle('filter'), style = element.style; + if (value == 1 || value === '') { + (filter = stripAlpha(filter)) ? + style.filter = filter : style.removeAttribute('filter'); + return element; + } else if (value < 0.00001) value = 0; + style.filter = stripAlpha(filter) + + 'alpha(opacity=' + (value * 100) + ')'; + return element; + }; + + Element._attributeTranslations = { + read: { + names: { + 'class': 'className', + 'for': 'htmlFor' + }, + values: { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + _getAttrNode: function(element, attribute) { + var node = element.getAttributeNode(attribute); + return node ? node.value : ""; + }, + _getEv: function(element, attribute) { + attribute = element.getAttribute(attribute); + return attribute ? attribute.toString().slice(23, -2) : null; + }, + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + title: function(element) { + return element.title; + } + } + } + }; + + Element._attributeTranslations.write = { + names: Object.extend({ + cellpadding: 'cellPadding', + cellspacing: 'cellSpacing' + }, Element._attributeTranslations.read.names), + values: { + checked: function(element, value) { + element.checked = !!value; + }, + + style: function(element, value) { + element.style.cssText = value ? value : ''; + } + } + }; + + Element._attributeTranslations.has = {}; + + $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + + 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { + Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; + Element._attributeTranslations.has[attr.toLowerCase()] = attr; + }); + + (function(v) { + Object.extend(v, { + href: v._getAttr, + src: v._getAttr, + type: v._getAttr, + action: v._getAttrNode, + disabled: v._flag, + checked: v._flag, + readonly: v._flag, + multiple: v._flag, + onload: v._getEv, + onunload: v._getEv, + onclick: v._getEv, + ondblclick: v._getEv, + onmousedown: v._getEv, + onmouseup: v._getEv, + onmouseover: v._getEv, + onmousemove: v._getEv, + onmouseout: v._getEv, + onfocus: v._getEv, + onblur: v._getEv, + onkeypress: v._getEv, + onkeydown: v._getEv, + onkeyup: v._getEv, + onsubmit: v._getEv, + onreset: v._getEv, + onselect: v._getEv, + onchange: v._getEv + }); + })(Element._attributeTranslations.read.values); +} + +else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1) ? 0.999999 : + (value === '') ? '' : (value < 0.00001) ? 0 : value; + return element; + }; +} + +else if (Prototype.Browser.WebKit) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + + if (value == 1) + if(element.tagName.toUpperCase() == 'IMG' && element.width) { + element.width++; element.width--; + } else try { + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch (e) { } + + return element; + }; + + // Safari returns margins on body which is incorrect if the child is absolutely + // positioned. For performance reasons, redefine Element#cumulativeOffset for + // KHTML/WebKit only. + Element.Methods.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return Element._returnOffset(valueL, valueT); + }; +} + +if (Prototype.Browser.IE || Prototype.Browser.Opera) { + // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements + Element.Methods.update = function(element, content) { + element = $(element); + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + + content = Object.toHTML(content); + var tagName = element.tagName.toUpperCase(); + + if (tagName in Element._insertionTranslations.tags) { + $A(element.childNodes).each(function(node) { element.removeChild(node) }); + Element._getContentFromAnonymousElement(tagName, content.stripScripts()) + .each(function(node) { element.appendChild(node) }); + } + else element.innerHTML = content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +if ('outerHTML' in document.createElement('div')) { + Element.Methods.replace = function(element, content) { + element = $(element); + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + element.parentNode.replaceChild(content, element); + return element; + } + + content = Object.toHTML(content); + var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); + + if (Element._insertionTranslations.tags[tagName]) { + var nextSibling = element.next(); + var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + parent.removeChild(element); + if (nextSibling) + fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); + else + fragments.each(function(node) { parent.appendChild(node) }); + } + else element.outerHTML = content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +Element._returnOffset = function(l, t) { + var result = [l, t]; + result.left = l; + result.top = t; + return result; +}; + +Element._getContentFromAnonymousElement = function(tagName, html) { + var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; + if (t) { + div.innerHTML = t[0] + html + t[1]; + t[2].times(function() { div = div.firstChild }); + } else div.innerHTML = html; + return $A(div.childNodes); +}; + +Element._insertionTranslations = { + before: function(element, node) { + element.parentNode.insertBefore(node, element); + }, + top: function(element, node) { + element.insertBefore(node, element.firstChild); + }, + bottom: function(element, node) { + element.appendChild(node); + }, + after: function(element, node) { + element.parentNode.insertBefore(node, element.nextSibling); + }, + tags: { + TABLE: ['', '
    ', 1], + TBODY: ['', '
    ', 2], + TR: ['', '
    ', 3], + TD: ['
    ', '
    ', 4], + SELECT: ['', 1] + } +}; + +(function() { + Object.extend(this.tags, { + THEAD: this.tags.TBODY, + TFOOT: this.tags.TBODY, + TH: this.tags.TD + }); +}).call(Element._insertionTranslations); + +Element.Methods.Simulated = { + hasAttribute: function(element, attribute) { + attribute = Element._attributeTranslations.has[attribute] || attribute; + var node = $(element).getAttributeNode(attribute); + return !!(node && node.specified); + } +}; + +Element.Methods.ByTag = { }; + +Object.extend(Element, Element.Methods); + +if (!Prototype.BrowserFeatures.ElementExtensions && + document.createElement('div')['__proto__']) { + window.HTMLElement = { }; + window.HTMLElement.prototype = document.createElement('div')['__proto__']; + Prototype.BrowserFeatures.ElementExtensions = true; +} + +Element.extend = (function() { + if (Prototype.BrowserFeatures.SpecificElementExtensions) + return Prototype.K; + + var Methods = { }, ByTag = Element.Methods.ByTag; + + var extend = Object.extend(function(element) { + if (!element || element._extendedByPrototype || + element.nodeType != 1 || element == window) return element; + + var methods = Object.clone(Methods), + tagName = element.tagName.toUpperCase(), property, value; + + // extend methods for specific tags + if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); + + for (property in methods) { + value = methods[property]; + if (Object.isFunction(value) && !(property in element)) + element[property] = value.methodize(); + } + + element._extendedByPrototype = Prototype.emptyFunction; + return element; + + }, { + refresh: function() { + // extend methods for all tags (Safari doesn't need this) + if (!Prototype.BrowserFeatures.ElementExtensions) { + Object.extend(Methods, Element.Methods); + Object.extend(Methods, Element.Methods.Simulated); + } + } + }); + + extend.refresh(); + return extend; +})(); + +Element.hasAttribute = function(element, attribute) { + if (element.hasAttribute) return element.hasAttribute(attribute); + return Element.Methods.Simulated.hasAttribute(element, attribute); +}; + +Element.addMethods = function(methods) { + var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; + + if (!methods) { + Object.extend(Form, Form.Methods); + Object.extend(Form.Element, Form.Element.Methods); + Object.extend(Element.Methods.ByTag, { + "FORM": Object.clone(Form.Methods), + "INPUT": Object.clone(Form.Element.Methods), + "SELECT": Object.clone(Form.Element.Methods), + "TEXTAREA": Object.clone(Form.Element.Methods) + }); + } + + if (arguments.length == 2) { + var tagName = methods; + methods = arguments[1]; + } + + if (!tagName) Object.extend(Element.Methods, methods || { }); + else { + if (Object.isArray(tagName)) tagName.each(extend); + else extend(tagName); + } + + function extend(tagName) { + tagName = tagName.toUpperCase(); + if (!Element.Methods.ByTag[tagName]) + Element.Methods.ByTag[tagName] = { }; + Object.extend(Element.Methods.ByTag[tagName], methods); + } + + function copy(methods, destination, onlyIfAbsent) { + onlyIfAbsent = onlyIfAbsent || false; + for (var property in methods) { + var value = methods[property]; + if (!Object.isFunction(value)) continue; + if (!onlyIfAbsent || !(property in destination)) + destination[property] = value.methodize(); + } + } + + function findDOMClass(tagName) { + var klass; + var trans = { + "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", + "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", + "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", + "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", + "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": + "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": + "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": + "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": + "FrameSet", "IFRAME": "IFrame" + }; + if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName.capitalize() + 'Element'; + if (window[klass]) return window[klass]; + + window[klass] = { }; + window[klass].prototype = document.createElement(tagName)['__proto__']; + return window[klass]; + } + + if (F.ElementExtensions) { + copy(Element.Methods, HTMLElement.prototype); + copy(Element.Methods.Simulated, HTMLElement.prototype, true); + } + + if (F.SpecificElementExtensions) { + for (var tag in Element.Methods.ByTag) { + var klass = findDOMClass(tag); + if (Object.isUndefined(klass)) continue; + copy(T[tag], klass.prototype); + } + } + + Object.extend(Element, Element.Methods); + delete Element.ByTag; + + if (Element.extend.refresh) Element.extend.refresh(); + Element.cache = { }; +}; + +document.viewport = { + getDimensions: function() { + var dimensions = { }, B = Prototype.Browser; + $w('width height').each(function(d) { + var D = d.capitalize(); + if (B.WebKit && !document.evaluate) { + // Safari <3.0 needs self.innerWidth/Height + dimensions[d] = self['inner' + D]; + } else if (B.Opera && parseFloat(window.opera.version()) < 9.5) { + // Opera <9.5 needs document.body.clientWidth/Height + dimensions[d] = document.body['client' + D] + } else { + dimensions[d] = document.documentElement['client' + D]; + } + }); + return dimensions; + }, + + getWidth: function() { + return this.getDimensions().width; + }, + + getHeight: function() { + return this.getDimensions().height; + }, + + getScrollOffsets: function() { + return Element._returnOffset( + window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, + window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + } +}; +/* Portions of the Selector class are derived from Jack Slocum's DomQuery, + * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style + * license. Please see http://www.yui-ext.com/ for more information. */ + +var Selector = Class.create({ + initialize: function(expression) { + this.expression = expression.strip(); + + if (this.shouldUseSelectorsAPI()) { + this.mode = 'selectorsAPI'; + } else if (this.shouldUseXPath()) { + this.mode = 'xpath'; + this.compileXPathMatcher(); + } else { + this.mode = "normal"; + this.compileMatcher(); + } + + }, + + shouldUseXPath: function() { + if (!Prototype.BrowserFeatures.XPath) return false; + + var e = this.expression; + + // Safari 3 chokes on :*-of-type and :empty + if (Prototype.Browser.WebKit && + (e.include("-of-type") || e.include(":empty"))) + return false; + + // XPath can't do namespaced attributes, nor can it read + // the "checked" property from DOM nodes + if ((/(\[[\w-]*?:|:checked)/).test(e)) + return false; + + return true; + }, + + shouldUseSelectorsAPI: function() { + if (!Prototype.BrowserFeatures.SelectorsAPI) return false; + + if (!Selector._div) Selector._div = new Element('div'); + + // Make sure the browser treats the selector as valid. Test on an + // isolated element to minimize cost of this check. + try { + Selector._div.querySelector(this.expression); + } catch(e) { + return false; + } + + return true; + }, + + compileMatcher: function() { + var e = this.expression, ps = Selector.patterns, h = Selector.handlers, + c = Selector.criteria, le, p, m; + + if (Selector._cache[e]) { + this.matcher = Selector._cache[e]; + return; + } + + this.matcher = ["this.matcher = function(root) {", + "var r = root, h = Selector.handlers, c = false, n;"]; + + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : + new Template(c[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.matcher.push("return h.unique(n);\n}"); + eval(this.matcher.join('\n')); + Selector._cache[this.expression] = this.matcher; + }, + + compileXPathMatcher: function() { + var e = this.expression, ps = Selector.patterns, + x = Selector.xpath, le, m; + + if (Selector._cache[e]) { + this.xpath = Selector._cache[e]; return; + } + + this.matcher = ['.//*']; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + if (m = e.match(ps[i])) { + this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : + new Template(x[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.xpath = this.matcher.join(''); + Selector._cache[this.expression] = this.xpath; + }, + + findElements: function(root) { + root = root || document; + var e = this.expression, results; + + switch (this.mode) { + case 'selectorsAPI': + // querySelectorAll queries document-wide, then filters to descendants + // of the context element. That's not what we want. + // Add an explicit context to the selector if necessary. + if (root !== document) { + var oldId = root.id, id = $(root).identify(); + e = "#" + id + " " + e; + } + + results = $A(root.querySelectorAll(e)).map(Element.extend); + root.id = oldId; + + return results; + case 'xpath': + return document._getElementsByXPath(this.xpath, root); + default: + return this.matcher(root); + } + }, + + match: function(element) { + this.tokens = []; + + var e = this.expression, ps = Selector.patterns, as = Selector.assertions; + var le, p, m; + + while (e && le !== e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + // use the Selector.assertions methods unless the selector + // is too complex. + if (as[i]) { + this.tokens.push([i, Object.clone(m)]); + e = e.replace(m[0], ''); + } else { + // reluctantly do a document-wide search + // and look for a match in the array + return this.findElements(document).include(element); + } + } + } + } + + var match = true, name, matches; + for (var i = 0, token; token = this.tokens[i]; i++) { + name = token[0], matches = token[1]; + if (!Selector.assertions[name](element, matches)) { + match = false; break; + } + } + + return match; + }, + + toString: function() { + return this.expression; + }, + + inspect: function() { + return "#"; + } +}); + +Object.extend(Selector, { + _cache: { }, + + xpath: { + descendant: "//*", + child: "/*", + adjacent: "/following-sibling::*[1]", + laterSibling: '/following-sibling::*', + tagName: function(m) { + if (m[1] == '*') return ''; + return "[local-name()='" + m[1].toLowerCase() + + "' or local-name()='" + m[1].toUpperCase() + "']"; + }, + className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", + id: "[@id='#{1}']", + attrPresence: function(m) { + m[1] = m[1].toLowerCase(); + return new Template("[@#{1}]").evaluate(m); + }, + attr: function(m) { + m[1] = m[1].toLowerCase(); + m[3] = m[5] || m[6]; + return new Template(Selector.xpath.operators[m[2]]).evaluate(m); + }, + pseudo: function(m) { + var h = Selector.xpath.pseudos[m[1]]; + if (!h) return ''; + if (Object.isFunction(h)) return h(m); + return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); + }, + operators: { + '=': "[@#{1}='#{3}']", + '!=': "[@#{1}!='#{3}']", + '^=': "[starts-with(@#{1}, '#{3}')]", + '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", + '*=': "[contains(@#{1}, '#{3}')]", + '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", + '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" + }, + pseudos: { + 'first-child': '[not(preceding-sibling::*)]', + 'last-child': '[not(following-sibling::*)]', + 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', + 'empty': "[count(*) = 0 and (count(text()) = 0)]", + 'checked': "[@checked]", + 'disabled': "[(@disabled) and (@type!='hidden')]", + 'enabled': "[not(@disabled) and (@type!='hidden')]", + 'not': function(m) { + var e = m[6], p = Selector.patterns, + x = Selector.xpath, le, v; + + var exclusion = []; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in p) { + if (m = e.match(p[i])) { + v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); + exclusion.push("(" + v.substring(1, v.length - 1) + ")"); + e = e.replace(m[0], ''); + break; + } + } + } + return "[not(" + exclusion.join(" and ") + ")]"; + }, + 'nth-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); + }, + 'nth-last-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); + }, + 'nth-of-type': function(m) { + return Selector.xpath.pseudos.nth("position() ", m); + }, + 'nth-last-of-type': function(m) { + return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); + }, + 'first-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); + }, + 'last-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); + }, + 'only-of-type': function(m) { + var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); + }, + nth: function(fragment, m) { + var mm, formula = m[6], predicate; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + if (mm = formula.match(/^(\d+)$/)) // digit only + return '[' + fragment + "= " + mm[1] + ']'; + if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (mm[1] == "-") mm[1] = -1; + var a = mm[1] ? Number(mm[1]) : 1; + var b = mm[2] ? Number(mm[2]) : 0; + predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + + "((#{fragment} - #{b}) div #{a} >= 0)]"; + return new Template(predicate).evaluate({ + fragment: fragment, a: a, b: b }); + } + } + } + }, + + criteria: { + tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', + className: 'n = h.className(n, r, "#{1}", c); c = false;', + id: 'n = h.id(n, r, "#{1}", c); c = false;', + attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', + attr: function(m) { + m[3] = (m[5] || m[6]); + return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); + }, + pseudo: function(m) { + if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); + return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); + }, + descendant: 'c = "descendant";', + child: 'c = "child";', + adjacent: 'c = "adjacent";', + laterSibling: 'c = "laterSibling";' + }, + + patterns: { + // combinators must be listed first + // (and descendant needs to be last combinator) + laterSibling: /^\s*~\s*/, + child: /^\s*>\s*/, + adjacent: /^\s*\+\s*/, + descendant: /^\s/, + + // selectors follow + tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, + id: /^#([\w\-\*]+)(\b|$)/, + className: /^\.([\w\-\*]+)(\b|$)/, + pseudo: +/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/, + attrPresence: /^\[((?:[\w]+:)?[\w]+)\]/, + attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ + }, + + // for Selector.match and Element#match + assertions: { + tagName: function(element, matches) { + return matches[1].toUpperCase() == element.tagName.toUpperCase(); + }, + + className: function(element, matches) { + return Element.hasClassName(element, matches[1]); + }, + + id: function(element, matches) { + return element.id === matches[1]; + }, + + attrPresence: function(element, matches) { + return Element.hasAttribute(element, matches[1]); + }, + + attr: function(element, matches) { + var nodeValue = Element.readAttribute(element, matches[1]); + return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); + } + }, + + handlers: { + // UTILITY FUNCTIONS + // joins two collections + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + a.push(node); + return a; + }, + + // marks an array of nodes for counting + mark: function(nodes) { + var _true = Prototype.emptyFunction; + for (var i = 0, node; node = nodes[i]; i++) + node._countedByPrototype = _true; + return nodes; + }, + + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._countedByPrototype = undefined; + return nodes; + }, + + // mark each child node with its position (for nth calls) + // "ofType" flag indicates whether we're indexing for nth-of-type + // rather than nth-child + index: function(parentNode, reverse, ofType) { + parentNode._countedByPrototype = Prototype.emptyFunction; + if (reverse) { + for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { + var node = nodes[i]; + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; + } + } else { + for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; + } + }, + + // filters out duplicates and extends all nodes + unique: function(nodes) { + if (nodes.length == 0) return nodes; + var results = [], n; + for (var i = 0, l = nodes.length; i < l; i++) + if (!(n = nodes[i])._countedByPrototype) { + n._countedByPrototype = Prototype.emptyFunction; + results.push(Element.extend(n)); + } + return Selector.handlers.unmark(results); + }, + + // COMBINATOR FUNCTIONS + descendant: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName('*')); + return results; + }, + + child: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) { + for (var j = 0, child; child = node.childNodes[j]; j++) + if (child.nodeType == 1 && child.tagName != '!') results.push(child); + } + return results; + }, + + adjacent: function(nodes) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + var next = this.nextElementSibling(node); + if (next) results.push(next); + } + return results; + }, + + laterSibling: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, Element.nextSiblings(node)); + return results; + }, + + nextElementSibling: function(node) { + while (node = node.nextSibling) + if (node.nodeType == 1) return node; + return null; + }, + + previousElementSibling: function(node) { + while (node = node.previousSibling) + if (node.nodeType == 1) return node; + return null; + }, + + // TOKEN FUNCTIONS + tagName: function(nodes, root, tagName, combinator) { + var uTagName = tagName.toUpperCase(); + var results = [], h = Selector.handlers; + if (nodes) { + if (combinator) { + // fastlane for ordinary descendant combinators + if (combinator == "descendant") { + for (var i = 0, node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName(tagName)); + return results; + } else nodes = this[combinator](nodes); + if (tagName == "*") return nodes; + } + for (var i = 0, node; node = nodes[i]; i++) + if (node.tagName.toUpperCase() === uTagName) results.push(node); + return results; + } else return root.getElementsByTagName(tagName); + }, + + id: function(nodes, root, id, combinator) { + var targetNode = $(id), h = Selector.handlers; + if (!targetNode) return []; + if (!nodes && root == document) return [targetNode]; + if (nodes) { + if (combinator) { + if (combinator == 'child') { + for (var i = 0, node; node = nodes[i]; i++) + if (targetNode.parentNode == node) return [targetNode]; + } else if (combinator == 'descendant') { + for (var i = 0, node; node = nodes[i]; i++) + if (Element.descendantOf(targetNode, node)) return [targetNode]; + } else if (combinator == 'adjacent') { + for (var i = 0, node; node = nodes[i]; i++) + if (Selector.handlers.previousElementSibling(targetNode) == node) + return [targetNode]; + } else nodes = h[combinator](nodes); + } + for (var i = 0, node; node = nodes[i]; i++) + if (node == targetNode) return [targetNode]; + return []; + } + return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; + }, + + className: function(nodes, root, className, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + return Selector.handlers.byClassName(nodes, root, className); + }, + + byClassName: function(nodes, root, className) { + if (!nodes) nodes = Selector.handlers.descendant([root]); + var needle = ' ' + className + ' '; + for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { + nodeClassName = node.className; + if (nodeClassName.length == 0) continue; + if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) + results.push(node); + } + return results; + }, + + attrPresence: function(nodes, root, attr, combinator) { + if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); + var results = []; + for (var i = 0, node; node = nodes[i]; i++) + if (Element.hasAttribute(node, attr)) results.push(node); + return results; + }, + + attr: function(nodes, root, attr, value, operator, combinator) { + if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); + var handler = Selector.operators[operator], results = []; + for (var i = 0, node; node = nodes[i]; i++) { + var nodeValue = Element.readAttribute(node, attr); + if (nodeValue === null) continue; + if (handler(nodeValue, value)) results.push(node); + } + return results; + }, + + pseudo: function(nodes, name, value, root, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + if (!nodes) nodes = root.getElementsByTagName("*"); + return Selector.pseudos[name](nodes, value, root); + } + }, + + pseudos: { + 'first-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.previousElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'last-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.nextElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'only-child': function(nodes, value, root) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) + results.push(node); + return results; + }, + 'nth-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root); + }, + 'nth-last-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true); + }, + 'nth-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, false, true); + }, + 'nth-last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true, true); + }, + 'first-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, false, true); + }, + 'last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, true, true); + }, + 'only-of-type': function(nodes, formula, root) { + var p = Selector.pseudos; + return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); + }, + + // handles the an+b logic + getIndices: function(a, b, total) { + if (a == 0) return b > 0 ? [b] : []; + return $R(1, total).inject([], function(memo, i) { + if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); + return memo; + }); + }, + + // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type + nth: function(nodes, formula, root, reverse, ofType) { + if (nodes.length == 0) return []; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + var h = Selector.handlers, results = [], indexed = [], m; + h.mark(nodes); + for (var i = 0, node; node = nodes[i]; i++) { + if (!node.parentNode._countedByPrototype) { + h.index(node.parentNode, reverse, ofType); + indexed.push(node.parentNode); + } + } + if (formula.match(/^\d+$/)) { // just a number + formula = Number(formula); + for (var i = 0, node; node = nodes[i]; i++) + if (node.nodeIndex == formula) results.push(node); + } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (m[1] == "-") m[1] = -1; + var a = m[1] ? Number(m[1]) : 1; + var b = m[2] ? Number(m[2]) : 0; + var indices = Selector.pseudos.getIndices(a, b, nodes.length); + for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { + for (var j = 0; j < l; j++) + if (node.nodeIndex == indices[j]) results.push(node); + } + } + h.unmark(nodes); + h.unmark(indexed); + return results; + }, + + 'empty': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + // IE treats comments as element nodes + if (node.tagName == '!' || node.firstChild) continue; + results.push(node); + } + return results; + }, + + 'not': function(nodes, selector, root) { + var h = Selector.handlers, selectorType, m; + var exclusions = new Selector(selector).findElements(root); + h.mark(exclusions); + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node._countedByPrototype) results.push(node); + h.unmark(exclusions); + return results; + }, + + 'enabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node.disabled && (!node.type || node.type !== 'hidden')) + results.push(node); + return results; + }, + + 'disabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.disabled) results.push(node); + return results; + }, + + 'checked': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.checked) results.push(node); + return results; + } + }, + + operators: { + '=': function(nv, v) { return nv == v; }, + '!=': function(nv, v) { return nv != v; }, + '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); }, + '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); }, + '*=': function(nv, v) { return nv == v || nv && nv.include(v); }, + '$=': function(nv, v) { return nv.endsWith(v); }, + '*=': function(nv, v) { return nv.include(v); }, + '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, + '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() + + '-').include('-' + (v || "").toUpperCase() + '-'); } + }, + + split: function(expression) { + var expressions = []; + expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { + expressions.push(m[1].strip()); + }); + return expressions; + }, + + matchElements: function(elements, expression) { + var matches = $$(expression), h = Selector.handlers; + h.mark(matches); + for (var i = 0, results = [], element; element = elements[i]; i++) + if (element._countedByPrototype) results.push(element); + h.unmark(matches); + return results; + }, + + findElement: function(elements, expression, index) { + if (Object.isNumber(expression)) { + index = expression; expression = false; + } + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function(element, expressions) { + expressions = Selector.split(expressions.join(',')); + var results = [], h = Selector.handlers; + for (var i = 0, l = expressions.length, selector; i < l; i++) { + selector = new Selector(expressions[i].strip()); + h.concat(results, selector.findElements(element)); + } + return (l > 1) ? h.unique(results) : results; + } +}); + +if (Prototype.Browser.IE) { + Object.extend(Selector.handlers, { + // IE returns comment nodes on getElementsByTagName("*"). + // Filter them out. + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + if (node.tagName !== "!") a.push(node); + return a; + }, + + // IE improperly serializes _countedByPrototype in (inner|outer)HTML. + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node.removeAttribute('_countedByPrototype'); + return nodes; + } + }); +} + +function $$() { + return Selector.findChildElements(document, $A(arguments)); +} +var Form = { + reset: function(form) { + $(form).reset(); + return form; + }, + + serializeElements: function(elements, options) { + if (typeof options != 'object') options = { hash: !!options }; + else if (Object.isUndefined(options.hash)) options.hash = true; + var key, value, submitted = false, submit = options.submit; + + var data = elements.inject({ }, function(result, element) { + if (!element.disabled && element.name) { + key = element.name; value = $(element).getValue(); + if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && + submit !== false && (!submit || key == submit) && (submitted = true)))) { + if (key in result) { + // a key is already present; construct an array of values + if (!Object.isArray(result[key])) result[key] = [result[key]]; + result[key].push(value); + } + else result[key] = value; + } + } + return result; + }); + + return options.hash ? data : Object.toQueryString(data); + } +}; + +Form.Methods = { + serialize: function(form, options) { + return Form.serializeElements(Form.getElements(form), options); + }, + + getElements: function(form) { + return $A($(form).getElementsByTagName('*')).inject([], + function(elements, child) { + if (Form.Element.Serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + } + ); + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) return $A(inputs).map(Element.extend); + + for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || (name && input.name != name)) + continue; + matchingInputs.push(Element.extend(input)); + } + + return matchingInputs; + }, + + disable: function(form) { + form = $(form); + Form.getElements(form).invoke('disable'); + return form; + }, + + enable: function(form) { + form = $(form); + Form.getElements(form).invoke('enable'); + return form; + }, + + findFirstElement: function(form) { + var elements = $(form).getElements().findAll(function(element) { + return 'hidden' != element.type && !element.disabled; + }); + var firstByIndex = elements.findAll(function(element) { + return element.hasAttribute('tabIndex') && element.tabIndex >= 0; + }).sortBy(function(element) { return element.tabIndex }).first(); + + return firstByIndex ? firstByIndex : elements.find(function(element) { + return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + form = $(form); + form.findFirstElement().activate(); + return form; + }, + + request: function(form, options) { + form = $(form), options = Object.clone(options || { }); + + var params = options.parameters, action = form.readAttribute('action') || ''; + if (action.blank()) action = window.location.href; + options.parameters = form.serialize(true); + + if (params) { + if (Object.isString(params)) params = params.toQueryParams(); + Object.extend(options.parameters, params); + } + + if (form.hasAttribute('method') && !options.method) + options.method = form.method; + + return new Ajax.Request(action, options); + } +}; + +/*--------------------------------------------------------------------------*/ + +Form.Element = { + focus: function(element) { + $(element).focus(); + return element; + }, + + select: function(element) { + $(element).select(); + return element; + } +}; + +Form.Element.Methods = { + serialize: function(element) { + element = $(element); + if (!element.disabled && element.name) { + var value = element.getValue(); + if (value != undefined) { + var pair = { }; + pair[element.name] = value; + return Object.toQueryString(pair); + } + } + return ''; + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + return Form.Element.Serializers[method](element); + }, + + setValue: function(element, value) { + element = $(element); + var method = element.tagName.toLowerCase(); + Form.Element.Serializers[method](element, value); + return element; + }, + + clear: function(element) { + $(element).value = ''; + return element; + }, + + present: function(element) { + return $(element).value != ''; + }, + + activate: function(element) { + element = $(element); + try { + element.focus(); + if (element.select && (element.tagName.toLowerCase() != 'input' || + !['button', 'reset', 'submit'].include(element.type))) + element.select(); + } catch (e) { } + return element; + }, + + disable: function(element) { + element = $(element); + element.disabled = true; + return element; + }, + + enable: function(element) { + element = $(element); + element.disabled = false; + return element; + } +}; + +/*--------------------------------------------------------------------------*/ + +var Field = Form.Element; +var $F = Form.Element.Methods.getValue; + +/*--------------------------------------------------------------------------*/ + +Form.Element.Serializers = { + input: function(element, value) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element, value); + default: + return Form.Element.Serializers.textarea(element, value); + } + }, + + inputSelector: function(element, value) { + if (Object.isUndefined(value)) return element.checked ? element.value : null; + else element.checked = !!value; + }, + + textarea: function(element, value) { + if (Object.isUndefined(value)) return element.value; + else element.value = value; + }, + + select: function(element, value) { + if (Object.isUndefined(value)) + return this[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + else { + var opt, currentValue, single = !Object.isArray(value); + for (var i = 0, length = element.length; i < length; i++) { + opt = element.options[i]; + currentValue = this.optionValue(opt); + if (single) { + if (currentValue == value) { + opt.selected = true; + return; + } + } + else opt.selected = value.include(currentValue); + } + } + }, + + selectOne: function(element) { + var index = element.selectedIndex; + return index >= 0 ? this.optionValue(element.options[index]) : null; + }, + + selectMany: function(element) { + var values, length = element.length; + if (!length) return null; + + for (var i = 0, values = []; i < length; i++) { + var opt = element.options[i]; + if (opt.selected) values.push(this.optionValue(opt)); + } + return values; + }, + + optionValue: function(opt) { + // extend element because hasAttribute may not be native + return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; + } +}; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = Class.create(PeriodicalExecuter, { + initialize: function($super, element, frequency, callback) { + $super(callback, frequency); + this.element = $(element); + this.lastValue = this.getValue(); + }, + + execute: function() { + var value = this.getValue(); + if (Object.isString(this.lastValue) && Object.isString(value) ? + this.lastValue != value : String(this.lastValue) != String(value)) { + this.callback(this.element, value); + this.lastValue = value; + } + } +}); + +Form.Element.Observer = Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = Class.create({ + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + Form.getElements(this.element).each(this.registerCallback, this); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +}); + +Form.Element.EventObserver = Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) var Event = { }; + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + KEY_INSERT: 45, + + cache: { }, + + relatedTarget: function(event) { + var element; + switch(event.type) { + case 'mouseover': element = event.fromElement; break; + case 'mouseout': element = event.toElement; break; + default: return null; + } + return Element.extend(element); + } +}); + +Event.Methods = (function() { + var isButton; + + if (Prototype.Browser.IE) { + var buttonMap = { 0: 1, 1: 4, 2: 2 }; + isButton = function(event, code) { + return event.button == buttonMap[code]; + }; + + } else if (Prototype.Browser.WebKit) { + isButton = function(event, code) { + switch (code) { + case 0: return event.which == 1 && !event.metaKey; + case 1: return event.which == 1 && event.metaKey; + default: return false; + } + }; + + } else { + isButton = function(event, code) { + return event.which ? (event.which === code + 1) : (event.button === code); + }; + } + + return { + isLeftClick: function(event) { return isButton(event, 0) }, + isMiddleClick: function(event) { return isButton(event, 1) }, + isRightClick: function(event) { return isButton(event, 2) }, + + element: function(event) { + event = Event.extend(event); + + var node = event.target, + type = event.type, + currentTarget = event.currentTarget; + + if (currentTarget && currentTarget.tagName) { + // Firefox screws up the "click" event when moving between radio buttons + // via arrow keys. It also screws up the "load" and "error" events on images, + // reporting the document as the target instead of the original image. + if (type === 'load' || type === 'error' || + (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' + && currentTarget.type === 'radio')) + node = currentTarget; + } + if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; + return Element.extend(node); + }, + + findElement: function(event, expression) { + var element = Event.element(event); + if (!expression) return element; + var elements = [element].concat(element.ancestors()); + return Selector.findElement(elements, expression, 0); + }, + + pointer: function(event) { + var docElement = document.documentElement, + body = document.body || { scrollLeft: 0, scrollTop: 0 }; + return { + x: event.pageX || (event.clientX + + (docElement.scrollLeft || body.scrollLeft) - + (docElement.clientLeft || 0)), + y: event.pageY || (event.clientY + + (docElement.scrollTop || body.scrollTop) - + (docElement.clientTop || 0)) + }; + }, + + pointerX: function(event) { return Event.pointer(event).x }, + pointerY: function(event) { return Event.pointer(event).y }, + + stop: function(event) { + Event.extend(event); + event.preventDefault(); + event.stopPropagation(); + event.stopped = true; + } + }; +})(); + +Event.extend = (function() { + var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { + m[name] = Event.Methods[name].methodize(); + return m; + }); + + if (Prototype.Browser.IE) { + Object.extend(methods, { + stopPropagation: function() { this.cancelBubble = true }, + preventDefault: function() { this.returnValue = false }, + inspect: function() { return "[object Event]" } + }); + + return function(event) { + if (!event) return false; + if (event._extendedByPrototype) return event; + + event._extendedByPrototype = Prototype.emptyFunction; + var pointer = Event.pointer(event); + Object.extend(event, { + target: event.srcElement, + relatedTarget: Event.relatedTarget(event), + pageX: pointer.x, + pageY: pointer.y + }); + return Object.extend(event, methods); + }; + + } else { + Event.prototype = Event.prototype || document.createEvent("HTMLEvents")['__proto__']; + Object.extend(Event.prototype, methods); + return Prototype.K; + } +})(); + +Object.extend(Event, (function() { + var cache = Event.cache; + + function getEventID(element) { + if (element._prototypeEventID) return element._prototypeEventID[0]; + arguments.callee.id = arguments.callee.id || 1; + return element._prototypeEventID = [++arguments.callee.id]; + } + + function getDOMEventName(eventName) { + if (eventName && eventName.include(':')) return "dataavailable"; + return eventName; + } + + function getCacheForID(id) { + return cache[id] = cache[id] || { }; + } + + function getWrappersForEventName(id, eventName) { + var c = getCacheForID(id); + return c[eventName] = c[eventName] || []; + } + + function createWrapper(element, eventName, handler) { + var id = getEventID(element); + var c = getWrappersForEventName(id, eventName); + if (c.pluck("handler").include(handler)) return false; + + var wrapper = function(event) { + if (!Event || !Event.extend || + (event.eventName && event.eventName != eventName)) + return false; + + Event.extend(event); + handler.call(element, event); + }; + + wrapper.handler = handler; + c.push(wrapper); + return wrapper; + } + + function findWrapper(id, eventName, handler) { + var c = getWrappersForEventName(id, eventName); + return c.find(function(wrapper) { return wrapper.handler == handler }); + } + + function destroyWrapper(id, eventName, handler) { + var c = getCacheForID(id); + if (!c[eventName]) return false; + c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); + } + + function destroyCache() { + for (var id in cache) + for (var eventName in cache[id]) + cache[id][eventName] = null; + } + + + // Internet Explorer needs to remove event handlers on page unload + // in order to avoid memory leaks. + if (window.attachEvent) { + window.attachEvent("onunload", destroyCache); + } + + // Safari has a dummy event handler on page unload so that it won't + // use its bfcache. Safari <= 3.1 has an issue with restoring the "document" + // object when page is returned to via the back button using its bfcache. + if (Prototype.Browser.WebKit) { + window.addEventListener('unload', Prototype.emptyFunction, false); + } + + return { + observe: function(element, eventName, handler) { + element = $(element); + var name = getDOMEventName(eventName); + + var wrapper = createWrapper(element, eventName, handler); + if (!wrapper) return element; + + if (element.addEventListener) { + element.addEventListener(name, wrapper, false); + } else { + element.attachEvent("on" + name, wrapper); + } + + return element; + }, + + stopObserving: function(element, eventName, handler) { + element = $(element); + var id = getEventID(element), name = getDOMEventName(eventName); + + if (!handler && eventName) { + getWrappersForEventName(id, eventName).each(function(wrapper) { + element.stopObserving(eventName, wrapper.handler); + }); + return element; + + } else if (!eventName) { + Object.keys(getCacheForID(id)).each(function(eventName) { + element.stopObserving(eventName); + }); + return element; + } + + var wrapper = findWrapper(id, eventName, handler); + if (!wrapper) return element; + + if (element.removeEventListener) { + element.removeEventListener(name, wrapper, false); + } else { + element.detachEvent("on" + name, wrapper); + } + + destroyWrapper(id, eventName, handler); + + return element; + }, + + fire: function(element, eventName, memo) { + element = $(element); + if (element == document && document.createEvent && !element.dispatchEvent) + element = document.documentElement; + + var event; + if (document.createEvent) { + event = document.createEvent("HTMLEvents"); + event.initEvent("dataavailable", true, true); + } else { + event = document.createEventObject(); + event.eventType = "ondataavailable"; + } + + event.eventName = eventName; + event.memo = memo || { }; + + if (document.createEvent) { + element.dispatchEvent(event); + } else { + element.fireEvent(event.eventType, event); + } + + return Event.extend(event); + } + }; +})()); + +Object.extend(Event, Event.Methods); + +Element.addMethods({ + fire: Event.fire, + observe: Event.observe, + stopObserving: Event.stopObserving +}); + +Object.extend(document, { + fire: Element.Methods.fire.methodize(), + observe: Element.Methods.observe.methodize(), + stopObserving: Element.Methods.stopObserving.methodize(), + loaded: false +}); + +(function() { + /* Support for the DOMContentLoaded event is based on work by Dan Webb, + Matthias Miller, Dean Edwards and John Resig. */ + + var timer; + + function fireContentLoadedEvent() { + if (document.loaded) return; + if (timer) window.clearInterval(timer); + document.fire("dom:loaded"); + document.loaded = true; + } + + if (document.addEventListener) { + if (Prototype.Browser.WebKit) { + timer = window.setInterval(function() { + if (/loaded|complete/.test(document.readyState)) + fireContentLoadedEvent(); + }, 0); + + Event.observe(window, "load", fireContentLoadedEvent); + + } else { + document.addEventListener("DOMContentLoaded", + fireContentLoadedEvent, false); + } + + } else { + document.write(" + + + in the HEAD section of an HTML file is now all that's needed to include all of the script.aculo.us libraries, + given that they all can be accessed by the same path as scriptaculous.js is. + +* Fixed possible problem with greedy Droppables when using the dropOnEmpty option on Sortable.create + +* Added new CSS/background color features to Ajax.InPlaceEditor [Jon Tirsen] + +* Added unit test for Autocompleter, first Version + +* Added Event.simulateKey/s to unittest.js. Note that due to a bug in Firefox this will only work with Firefox up to v1.0.4 (see https://bugzilla.mozilla.org/show_bug.cgi?id=289940) + +* Fixed a condition where standard a href=xxx links wouldn't work in autocomplete results. These do now, the onclick event is not cancelled. [thx to Jasper Slits] + +* Fix showing ghosting marker only on ghosting Sortables + +* Some more Builder stuff, expanded builder unit tests + +* Moved stuff that didn't belong into specific libs into util.js; util.js is now required for all script.aculo.us libs + +* Corrected weirdness in unittest.js + +* Added dropOnEmpty option to Sortables to allow dropping on empty lists (see test/functional/sortable3_test.html) + +* Changed algoritm for drag/drop position setting + +* Changed workaround for class attributes (fixes a Firefox 1.0 error) from klass to className to be more Javascriptesque [thx to Martin Bialasinski] + +* Fixed a typo in ajax_inplaceeditor_test.html + +* Updated Rakefile to add unittest.js and util.js to the package + +* Added util.js which contains various utlity functions and extensions to Prototype + +* Major restructuring + +* Added TEXTAREA support to Ajax.InPlaceEditor [Sanford Barr] + +* Added Ghost Train alpha 0.1.0. See ghosttrain/test.html. + +* More features for Ajax.InPlaceEditor [Jon Tirsen] + +* Tweaks to unittest.css [Thomas Fuchs] + +* Refactoring and new features in unittest.js [Thomas Fuchs] [Jon Tirsen] + +* Fixed a wrong variable reference in Effect.Scale + +* Fix Element.makePositioned to recognize the 'static' position + +* Allow to choose the parameter name for Ajax.Autocompleter [Cameron Braid] + +* Changed resolving indicator DOM element more flexibility [Cameron Braid] + +* Fixed a reference in Ajax.InPlaceEditor + +* Added contributors to unittest.js + +* Souped-up Ajax.InPlaceEditor, added support for a form id and specifying all the texts through options [Jon Tirsen] + +* Make unit testing look good [Michael Schuerig] + +* Changed default revert duration for Draggables to distance-dependent algorithm [suggested by San] + +* Fix double unescaping in Autocompleter + +* Refactoring auf Autocompleter classes to use camelCase (note: changes the syntax of some of the options) + +* Add updateElement option to Autocompleter [Rob Sharp] + +* Updated Ajax.InPlaceEditor, refactoring of unit testing [Jon Tirsen] + +* Added preliminary version of Ajax.InPlaceEditor to controls.js; added experimental Firefox only functional testing for it (inplaceeditor_result.html) [Jon Tirsen] + +* Added some addtional test files. + +* Fixes a bug with Droppables not recognizing a drop if no hoverclass is given [thanks drewie] + +* Fixes to ghosting marker, allow a predefined marker (element with id "dropmarker"). + +* Changed Effect.Opacity to better handle 100% opacity + +* Various fixes to ghosting, improves compatiblity with Safari and IE. [thanks to David Zülke] + +* Added experimental ghosting option to Sortables. See sortable_functional_ghosting.html for usage. + +* Renamed the clone option on Draggables to "ghosting". + +* Added experimental "clone" option to Draggable to so that a "clone" stays in place while dragging a translucent version of the draggable element. Currently, this requires relatively positioned elements, and doesn't work with sortable lists (but should after some tweaking). See dragdrop_function_4.html test file for details. + +* Added Element.getStyle to find computed CSS styles of an element. Note: doesn't work in all cases in Safari, see my bug report at http://bugzilla.opendarwin.org/show_bug.cgi?id=4125 + +*1.1beta1* + +* Fixed rendering of last frame of animation when from/to is not 0.0/1.0. [thanks to David Zülke] + +* Updated internal Prototype JavaScript framework to version 1.4.0_pre2 (patched w/ workaround for Ajax.Updater init bug) + +* Some refactoring of controls.js to get rid of "dirty" implementation detail (dont' ask) + +* Added returning the generated combined effects to allow for .cancel() on all effects + +* Updated internal Prototype JavaScript framework to version 1.4.0_pre2 + +*Rails 0.13.1* + +* Updated Ajax.Autocompleter to deal with parameters options correctly [Martin Marinschek] + +* Updated controls.js to allow multple matches in local localcompletion [Ivan Krstic] + +* Make version of prototype.js in lib have a nicer Event object [David Zülke] + +* Added incremental and local autocompleting and loads of documentation to controls.js [Ivan Krstic] + +* Experimental: make version of prototype.js in lib destroy events on page unload to prevent browser memory leaks + +* Fixed a possible memory leak in dragdrop.js + +* Make version of prototype.js in lib compatible with some 3rd-party JavaScript libraries (like IE7) by refactoring to use Object.extend() for testing [David Zülke] + +* Make effects.js, dragdrop.js and controls.js compatible with some 3rd-party JavaScript libraries (like IE7) by refactoring to use Object.extend() [David Zülke] + +* Changed some tests to work better + +* Always reset background color on Effect.Highlight; this make change backwards-compatibility, to be sure include style="background-color:(target-color)" on your elements or else elements will fall back to their CSS rules (which is a good thing in most circumstances) + +* Removed a possible memory leaks with IE with sortables and droppables (removed references from elements) + +* Changes to class extension in effects.js + +* Make Effect.Highlight restore any previously set background color when finishing (makes effect work with set CSS classes) + +* Added capability to remove draggables/droppables and redeclare sortables in dragdrop.js + +* Added Effect.ScrollTo to smoothly scroll the page to an element + +* Better Firefox flickering handling on SlideUp/SlideDown + +* Some cleaning up in effects.js + +* Removed a possible memory leak in IE with draggables + +* Added support for cancelling dragging my hitting ESC + +* Changed logic of drag-and-drop to only include the last referenced droppable when firing a drop event. This change also offers slight performance gains. [Dominik Wagner] + +* Added addtional effects test page, added tests for scriptfragment matching + +*1.0.0* + +* Changed auto-hiding update div in Ajax.Autocompleter + +* Changed default serialization on Ajax.Autocompleter to use Form.Element.serialize + +* Added test file for drag/drop inside scrolled elements + +* Fixed dragging of unpositioned elements in Internet Explorer + +* Change default behaviour of Ajax.Autocompleter to do automatic overlapping, sizing and appear/fade effects + +* Fixed Internet Explorer hide-windowed-controls iframe handling + +* Changed Ajax.Autocompleter event handling + +* Added onShow/onHide callbacks to Ajax.Autocompleter to allow for customized handling/effects + +* Fixed SlideUp/SlideDown to restore the overflow CSS property (note: Firefox 1.0.X is buggy, set overflow:hidden as a workaround) + +* Fixed BlindUp/BlindDown to restore the overflow CSS property (note: Firefox 1.0.X is buggy, set overflow:hidden as a workaround) + +* Fixed draggables with revert:false on repeated drags behaving badly + +* Expanded the revert option on draggables to optionally take a function and revert only if it returns true + +* Added the dragged element as a parameter to the Draggables.notify callbacks [Michael Sokolov] + +* Removed a deprecated reference to Effect2 om Effect.Fold + +* Make the percentage on Element.setContentZoom absolute + +* Corrected rendering of Ajax.AutoCompleter when focus is lost while updating + +* Added (crude) functional tests + +* Some slight refactoring in controls.js + +* Changed dragdrop.js to use the Effect namespace for its effects + +* Updated to Prototype 1.3.0: removal of prototype-ext.js; refactoring. + +* Fixed behaviour of cursor keys in Safari on autocomplete script + +* Fixed Position.within_including_scrolloffsets + +* Fixed sortables that are absolutely positioned + +* Fixed unhandled whitespace in Ajax.Autocompleter + +* Updated prototype-ext.js to include additions for Ajax.Autocompleter + +* Added controls.js, contains AJAX autocompleting text fields from #960 + +* Refactored Event object + +* Renamed effects2.js to effects.js + +* Fixed draggables on pages with no droppables + +* Moved Event, Position and Element.Class to prototype-ext.js in preparation to Rails 0.13 + +* Added Effect.Transitions.pulse + +* Added Effect.Pulsate and Effect.Fold effect by Justin Palmer + +* Added transitions by Mark Pilgrim: .full, .none + +* Added effects by Mark Pilgrim: Effect.Grow, Effect.Shrink + +* Changed effects namespace to Effect. (Effect2 is deprecated, but works too) + +* Changed old Effect.ContentZoom class to Element.setContentZoom() function + +* Greatly expanded Effect.Highlight to have user-defined colors and autodetecting the background color + +* Converted remaining effects (Squish, Highlight) to new format + +* Sortable.create now passes the zindex, starteffect, reverteffect and endeffect options to the underlying Draggables + +* Sortable.serialize now honors the only option on Sortable.create + +* New overridable options on Draggables: zindex, starteffect, reverteffect, endeffect + +* Fix a Gecko engine flicker on Sortables in dragdrop.js + +* Fixed event.isLeftClick + +* Some small changes in effects2.js + +* Refactoring of dragdrop.js + +* Added an Object.prototype.inspect() and more verbose messages for js unit testing + +* Added test/unittest.js and initial tests in test/html. + +* Cleaning up of effects2.js (convert tabs to spaces) + +* Added Rakefile for distribution packaging (default task = make distribution, rake clean for cleaning up) + +* Initial check-in and directory layout for the script.aculo.us JavaScripts diff --git a/js/scriptaculous/README.rdoc b/js/scriptaculous/README.rdoc new file mode 100644 index 0000000..21f8c8c --- /dev/null +++ b/js/scriptaculous/README.rdoc @@ -0,0 +1,59 @@ +== script.aculo.us web 2.0 javascript + +The Web is changing. The 30-year-old terminal-like technology it was originally +is gradually giving way to new ways of doing things. The power of AJAX allows +for rich user interaction without the trouble that has bugged traditional +web applications. + +Building upon the wonderful Prototype JavaScript library, script.aculo.us +provides you with some great additional ingredients to mix in. + +For more information, see http://script.aculo.us/ + +== What's new in this release? + +See the CHANGELOG file for information on what's new. + +You can follow http://twitter.com/scriptaculous if you want +to be updated as we fix bugs and add new features. + +== Installation/Usage + +script.aculo.us includes the Prototype JavaScript Framework +V1.6.0. You can use later versions, as they become available +(see http://prototypejs.org/). + +Put prototype.js, and the six files scriptaculous.js, +builder.js, effects.js, dragdrop.js, controls.js and slider.js +in a directory of your website, e.g. /javascripts. + +(The sound.js and unittest.js files are optional) + +Now, you can include the scripts by adding the following +tags to the HEAD section of your HTML pages: + + + + +scriptaculous.js will automatically load the other files of the +script.aculo.us distribution in, provided they are accessible +via the same path. + +See http://wiki.script.aculo.us/scriptaculous/show/Usage for detailed +usage instructions. + +== The distribution + +Besides the script.aculo.us files in src, there's a complete +test tree included which holds functional and unit tests for +script.aculo.us. + +If you need examples on how to implement things, the best place to +start is by opening test/run_functional_tests.html or +test/run_unit_tests.html in your browser, and looking at +the sources of the examples provided. + +== License + +script.aculo.us is licensed under the terms of the MIT License, +see the included MIT-LICENSE file. \ No newline at end of file diff --git a/js/scriptaculous/accordion.js b/js/scriptaculous/accordion.js new file mode 100644 index 0000000..3bb2211 --- /dev/null +++ b/js/scriptaculous/accordion.js @@ -0,0 +1,243 @@ +// accordion.js v2.0 +// +// Copyright (c) 2007 stickmanlabs +// Author: Kevin P Miller | http://www.stickmanlabs.com +// +// Accordion is freely distributable under the terms of an MIT-style license. +// +// I don't care what you think about the file size... +// Be a pro: +// http://www.thinkvitamin.com/features/webapps/serving-javascript-fast +// http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files +// +/* +2-2-2008 Trey Aughenbaugh +made a few updates based on the comments from here. +http://stickmanlabs.com/2007/07/12/accordion-v10-released/#comments + +-Updated it to work with new version of Prototype 1.6 and scriptaculous 1.8 +-Updated to remove flicker +Added ability to have a callback function. +Useful for making AJAX calls. +Also Added the ability to specifiy which call will get executed each time. +Use the ID sttribute of the DIV for reference. REQUIRED for callback. + +/* +/*-----------------------------------------------------------------------------------------------*/ + +if (typeof Effect == 'undefined') + throw("accordion.js requires including script.aculo.us' effects.js library!"); + +var accordion = Class.create(); +accordion.prototype = { + + // + // Setup the Variables + // + showAccordion : null, + currentAccordion : null, + duration : null, + effects : [], + animating : false, + AlreadyActivated: [], //Added by Trey + // + // Initialize the accordions + // + initialize: function(container, options) { + if (!$(container)) { + throw(container+" doesn't exist!"); + return false; + } + + this.options = Object.extend({ + resizeSpeed : 8, + classNames : { + toggle : 'accordion_toggle', + toggleActive : 'accordion_toggle_active', + content : 'accordion_content' + }, + defaultSize : { + height : null, + width : null + }, + direction : 'vertical', + onEvent : 'click', + onActivate: null, //Added by Trey: CallBack Function called when Tab is activated, sends elemet. + RepeatActivate: {} //Added by Trey + }, options || {}); + + this.duration = ((11-this.options.resizeSpeed)*0.15); + this.AlreadyActivated =[]; //Added by Trey + var accordions = $$('#'+container+' .'+this.options.classNames.toggle); + accordions.each(function(accordion) { + Event.observe(accordion, this.options.onEvent, this.activate.bind(this, accordion), false); + if (this.options.onEvent == 'click') { + accordion.onclick = function() {return false;}; + } + + if (this.options.direction == 'horizontal') { + var options = {width: '0px'}; + } else { + var options = {height: '0px'}; + } + //options.merge({display: 'none'}); + Object.extend(options, {display: 'none'}); + + this.currentAccordion = $(accordion.next(0)).setStyle(options); + }.bind(this)); + }, + + // + // Activate an accordion + // + activate : function(accordion) { + if (this.animating) { + return false; + } + + this.effects = []; + + this.currentAccordion = $(accordion.next(0)); + this.currentAccordion.setStyle({ + display: 'block' + }); + + this.currentAccordion.previous(0).addClassName(this.options.classNames.toggleActive); + + if (this.options.direction == 'horizontal') { + this.scaling = { + scaleX: true, + scaleY: false + }; + } else { + this.scaling = { + scaleX: false, + scaleY: true + }; + } + + if (this.currentAccordion == this.showAccordion) { + this.deactivate(); + } else { + +//This was added by Trey Aughenbaugh +//Allows calling a function before activating a new Menu + var bolCall = true; + var elementid = $(this.currentAccordion).id + var AA = this.AlreadyActivated.indexOf(elementid); + var RA = this.options.RepeatActivate[elementid]; + if (RA != undefined) + { + if ( AA != -1 ) + { + if ( RA != undefined ) + bolCall = RA; + } + else + { + this.AlreadyActivated.push(elementid); + } + } + + if (this.options.onActivate && bolCall) + this.options.onActivate(this.currentAccordion) ; + +//My Code Updates End Here.......................Orig Call Below. + this._handleAccordion(); + } + }, + // + // Deactivate an active accordion + // + deactivate : function() { + var options = { + duration: this.duration, + scaleContent: false, + transition: Effect.Transitions.sinoidal, + queue: { + position: 'end', + scope: 'accordionAnimation' + }, + scaleMode: { + originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : this.currentAccordion.scrollHeight, + originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : this.currentAccordion.scrollWidth + }, + afterFinish: function() { + this.showAccordion.setStyle({ + height: '0px', + display: 'none' + }); + this.showAccordion = null; + this.animating = false; + }.bind(this) + }; + //options.merge(this.scaling); + Object.extend(options, this.scaling); + + this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive); + + new Effect.Scale(this.showAccordion, 0, options); + }, + + // + // Handle the open/close actions of the accordion + // + _handleAccordion : function() { + var options = { + sync: true, + scaleFrom: 0, + scaleContent: false, + transition: Effect.Transitions.sinoidal, + scaleMode: { + originalHeight: this.options.defaultSize.height ? this.options.defaultSize.height : this.currentAccordion.scrollHeight, + originalWidth: this.options.defaultSize.width ? this.options.defaultSize.width : this.currentAccordion.scrollWidth + } + }; + //options.merge(this.scaling); + Object.extend(options, this.scaling); + + this.effects.push( + new Effect.Scale(this.currentAccordion, 100, options) + ); + + if (this.showAccordion) { + this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive); + + options = { + sync: true, + scaleContent: false, + transition: Effect.Transitions.sinoidal + }; + //options.merge(this.scaling); + Object.extend(options, this.scaling); + + this.effects.push( + new Effect.Scale(this.showAccordion, 0, options) + ); + } + + new Effect.Parallel(this.effects, { + duration: this.duration, + queue: { + position: 'end', + scope: 'accordionAnimation' + }, + beforeStart: function() { + this.animating = true; + }.bind(this), + afterFinish: function() { + if (this.showAccordion) { + this.showAccordion.setStyle({ + display: 'none' + }); + } + $(this.currentAccordion).setStyle({ + height: 'auto' + }); + this.showAccordion = this.currentAccordion; + this.animating = false; + }.bind(this) + }); + } +} + \ No newline at end of file diff --git a/js/scriptaculous/builder.js b/js/scriptaculous/builder.js new file mode 100644 index 0000000..dba8bec --- /dev/null +++ b/js/scriptaculous/builder.js @@ -0,0 +1,136 @@ +// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +var Builder = { + NODEMAP: { + AREA: 'map', + CAPTION: 'table', + COL: 'table', + COLGROUP: 'table', + LEGEND: 'fieldset', + OPTGROUP: 'select', + OPTION: 'select', + PARAM: 'object', + TBODY: 'table', + TD: 'table', + TFOOT: 'table', + TH: 'table', + THEAD: 'table', + TR: 'table' + }, + // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, + // due to a Firefox bug + node: function(elementName) { + elementName = elementName.toUpperCase(); + + // try innerHTML approach + var parentTag = this.NODEMAP[elementName] || 'div'; + var parentElement = document.createElement(parentTag); + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + ">"; + } catch(e) {} + var element = parentElement.firstChild || null; + + // see if browser added wrapping tags + if(element && (element.tagName.toUpperCase() != elementName)) + element = element.getElementsByTagName(elementName)[0]; + + // fallback to createElement approach + if(!element) element = document.createElement(elementName); + + // abort if nothing could be created + if(!element) return; + + // attributes (or text) + if(arguments[1]) + if(this._isStringOrNumber(arguments[1]) || + (arguments[1] instanceof Array) || + arguments[1].tagName) { + this._children(element, arguments[1]); + } else { + var attrs = this._attributes(arguments[1]); + if(attrs.length) { + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" +elementName + " " + + attrs + ">"; + } catch(e) {} + element = parentElement.firstChild || null; + // workaround firefox 1.0.X bug + if(!element) { + element = document.createElement(elementName); + for(attr in arguments[1]) + element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; + } + if(element.tagName.toUpperCase() != elementName) + element = parentElement.getElementsByTagName(elementName)[0]; + } + } + + // text, or array of children + if(arguments[2]) + this._children(element, arguments[2]); + + return $(element); + }, + _text: function(text) { + return document.createTextNode(text); + }, + + ATTR_MAP: { + 'className': 'class', + 'htmlFor': 'for' + }, + + _attributes: function(attributes) { + var attrs = []; + for(attribute in attributes) + attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + + '="' + attributes[attribute].toString().escapeHTML().gsub(/"/,'"') + '"'); + return attrs.join(" "); + }, + _children: function(element, children) { + if(children.tagName) { + element.appendChild(children); + return; + } + if(typeof children=='object') { // array can hold nodes and text + children.flatten().each( function(e) { + if(typeof e=='object') + element.appendChild(e); + else + if(Builder._isStringOrNumber(e)) + element.appendChild(Builder._text(e)); + }); + } else + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); + }, + _isStringOrNumber: function(param) { + return(typeof param=='string' || typeof param=='number'); + }, + build: function(html) { + var element = this.node('div'); + $(element).update(html.strip()); + return element.down(); + }, + dump: function(scope) { + if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope + + var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ + "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ + "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ + "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); + + tags.each( function(tag){ + scope[tag] = function() { + return Builder.node.apply(Builder, [tag].concat($A(arguments))); + }; + }); + } +}; \ No newline at end of file diff --git a/js/scriptaculous/controls.js b/js/scriptaculous/controls.js new file mode 100644 index 0000000..c56ccb7 --- /dev/null +++ b/js/scriptaculous/controls.js @@ -0,0 +1,965 @@ +// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com) +// Contributors: +// Richard Livsey +// Rahul Bhargava +// Rob Wills +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// Autocompleter.Base handles all the autocompletion functionality +// that's independent of the data source for autocompletion. This +// includes drawing the autocompletion menu, observing keyboard +// and mouse events, and similar. +// +// Specific autocompleters need to provide, at the very least, +// a getUpdatedChoices function that will be invoked every time +// the text inside the monitored textbox changes. This method +// should get the text for which to provide autocompletion by +// invoking this.getToken(), NOT by directly accessing +// this.element.value. This is to allow incremental tokenized +// autocompletion. Specific auto-completion logic (AJAX, etc) +// belongs in getUpdatedChoices. +// +// Tokenized incremental autocompletion is enabled automatically +// when an autocompleter is instantiated with the 'tokens' option +// in the options parameter, e.g.: +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); +// will incrementally autocomplete with a comma as the token. +// Additionally, ',' in the above example can be replaced with +// a token array, e.g. { tokens: [',', '\n'] } which +// enables autocompletion on multiple tokens. This is most +// useful when one of the tokens is \n (a newline), as it +// allows smart autocompletion after linebreaks. + +if(typeof Effect == 'undefined') + throw("controls.js requires including script.aculo.us' effects.js library"); + +var Autocompleter = { }; +Autocompleter.Base = Class.create({ + baseInitialize: function(element, update, options) { + element = $(element); + this.element = element; + this.update = $(update); + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + this.oldElementValue = this.element.value; + + if(this.setOptions) + this.setOptions(options); + else + this.options = options || { }; + + this.options.paramName = this.options.paramName || this.element.name; + this.options.tokens = this.options.tokens || []; + this.options.frequency = this.options.frequency || 0.4; + this.options.minChars = this.options.minChars || 1; + this.options.onShow = this.options.onShow || + function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, { + setHeight: false, + offsetTop: element.offsetHeight + }); + } + Effect.Appear(update,{duration:0.15}); + }; + this.options.onHide = this.options.onHide || + function(element, update){ new Effect.Fade(update,{duration:0.15}) }; + + if(typeof(this.options.tokens) == 'string') + this.options.tokens = new Array(this.options.tokens); + // Force carriage returns as token delimiters anyway + if (!this.options.tokens.include('\n')) + this.options.tokens.push('\n'); + + this.observer = null; + + this.element.setAttribute('autocomplete','off'); + + Element.hide(this.update); + + Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this)); + }, + + show: function() { + if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); + if(!this.iefix && + (Prototype.Browser.IE) && + (Element.getStyle(this.update, 'position')=='absolute')) { + new Insertion.After(this.update, + ''); + this.iefix = $(this.update.id+'_iefix'); + } + if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); + }, + + fixIEOverlapping: function() { + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); + this.iefix.style.zIndex = 1; + this.update.style.zIndex = 2; + Element.show(this.iefix); + }, + + hide: function() { + this.stopIndicator(); + if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); + if(this.iefix) Element.hide(this.iefix); + }, + + startIndicator: function() { + if(this.options.indicator) Element.show(this.options.indicator); + }, + + stopIndicator: function() { + if(this.options.indicator) Element.hide(this.options.indicator); + }, + + onKeyPress: function(event) { + if(this.active) + switch(event.keyCode) { + case Event.KEY_TAB: + case Event.KEY_RETURN: + this.selectEntry(); + Event.stop(event); + case Event.KEY_ESC: + this.hide(); + this.active = false; + Event.stop(event); + return; + case Event.KEY_LEFT: + case Event.KEY_RIGHT: + return; + case Event.KEY_UP: + this.markPrevious(); + this.render(); + Event.stop(event); + return; + case Event.KEY_DOWN: + this.markNext(); + this.render(); + Event.stop(event); + return; + } + else + if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || + (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; + + this.changed = true; + this.hasFocus = true; + + if(this.observer) clearTimeout(this.observer); + this.observer = + setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); + }, + + activate: function() { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + + onHover: function(event) { + var element = Event.findElement(event, 'LI'); + if(this.index != element.autocompleteIndex) + { + this.index = element.autocompleteIndex; + this.render(); + } + Event.stop(event); + }, + + onClick: function(event) { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + + onBlur: function(event) { + // needed to make click events working + setTimeout(this.hide.bind(this), 250); + this.hasFocus = false; + this.active = false; + }, + + render: function() { + if(this.entryCount > 0) { + for (var i = 0; i < this.entryCount; i++) + this.index==i ? + Element.addClassName(this.getEntry(i),"selected") : + Element.removeClassName(this.getEntry(i),"selected"); + if(this.hasFocus) { + this.show(); + this.active = true; + } + } else { + this.active = false; + this.hide(); + } + }, + + markPrevious: function() { + if(this.index > 0) this.index--; + else this.index = this.entryCount-1; + this.getEntry(this.index).scrollIntoView(true); + }, + + markNext: function() { + if(this.index < this.entryCount-1) this.index++; + else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); + }, + + getEntry: function(index) { + return this.update.firstChild.childNodes[index]; + }, + + getCurrentEntry: function() { + return this.getEntry(this.index); + }, + + selectEntry: function() { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + + updateElement: function(selectedElement) { + if (this.options.updateElement) { + this.options.updateElement(selectedElement); + return; + } + var value = ''; + if (this.options.select) { + var nodes = $(selectedElement).select('.' + this.options.select) || []; + if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); + } else + value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); + + var bounds = this.getTokenBounds(); + if (bounds[0] != -1) { + var newValue = this.element.value.substr(0, bounds[0]); + var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); + if (whitespace) + newValue += whitespace[0]; + this.element.value = newValue + value + this.element.value.substr(bounds[1]); + } else { + this.element.value = value; + } + this.oldElementValue = this.element.value; + this.element.focus(); + + if (this.options.afterUpdateElement) + this.options.afterUpdateElement(this.element, selectedElement); + }, + + updateChoices: function(choices) { + if(!this.changed && this.hasFocus) { + this.update.innerHTML = choices; + Element.cleanWhitespace(this.update); + Element.cleanWhitespace(this.update.down()); + + if(this.update.firstChild && this.update.down().childNodes) { + this.entryCount = + this.update.down().childNodes.length; + for (var i = 0; i < this.entryCount; i++) { + var entry = this.getEntry(i); + entry.autocompleteIndex = i; + this.addObservers(entry); + } + } else { + this.entryCount = 0; + } + + this.stopIndicator(); + this.index = 0; + + if(this.entryCount==1 && this.options.autoSelect) { + this.selectEntry(); + this.hide(); + } else { + this.render(); + } + } + }, + + addObservers: function(element) { + Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); + Event.observe(element, "click", this.onClick.bindAsEventListener(this)); + }, + + onObserverEvent: function() { + this.changed = false; + this.tokenBounds = null; + if(this.getToken().length>=this.options.minChars) { + this.getUpdatedChoices(); + } else { + this.active = false; + this.hide(); + } + this.oldElementValue = this.element.value; + }, + + getToken: function() { + var bounds = this.getTokenBounds(); + return this.element.value.substring(bounds[0], bounds[1]).strip(); + }, + + getTokenBounds: function() { + if (null != this.tokenBounds) return this.tokenBounds; + var value = this.element.value; + if (value.strip().empty()) return [-1, 0]; + var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); + var offset = (diff == this.oldElementValue.length ? 1 : 0); + var prevTokenPos = -1, nextTokenPos = value.length; + var tp; + for (var index = 0, l = this.options.tokens.length; index < l; ++index) { + tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); + if (tp > prevTokenPos) prevTokenPos = tp; + tp = value.indexOf(this.options.tokens[index], diff + offset); + if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; + } + return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); + } +}); + +Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { + var boundary = Math.min(newS.length, oldS.length); + for (var index = 0; index < boundary; ++index) + if (newS[index] != oldS[index]) + return index; + return boundary; +}; + +Ajax.Autocompleter = Class.create(Autocompleter.Base, { + initialize: function(element, update, url, options) { + this.baseInitialize(element, update, options); + this.options.asynchronous = true; + this.options.onComplete = this.onComplete.bind(this); + this.options.defaultParams = this.options.parameters || null; + this.url = url; + }, + + getUpdatedChoices: function() { + this.startIndicator(); + + var entry = encodeURIComponent(this.options.paramName) + '=' + + encodeURIComponent(this.getToken()); + + this.options.parameters = this.options.callback ? + this.options.callback(this.element, entry) : entry; + + if(this.options.defaultParams) + this.options.parameters += '&' + this.options.defaultParams; + + new Ajax.Request(this.url, this.options); + }, + + onComplete: function(request) { + this.updateChoices(request.responseText); + } +}); + +// The local array autocompleter. Used when you'd prefer to +// inject an array of autocompletion options into the page, rather +// than sending out Ajax queries, which can be quite slow sometimes. +// +// The constructor takes four parameters. The first two are, as usual, +// the id of the monitored textbox, and id of the autocompletion menu. +// The third is the array you want to autocomplete from, and the fourth +// is the options block. +// +// Extra local autocompletion options: +// - choices - How many autocompletion choices to offer +// +// - partialSearch - If false, the autocompleter will match entered +// text only at the beginning of strings in the +// autocomplete array. Defaults to true, which will +// match text at the beginning of any *word* in the +// strings in the autocomplete array. If you want to +// search anywhere in the string, additionally set +// the option fullSearch to true (default: off). +// +// - fullSsearch - Search anywhere in autocomplete array strings. +// +// - partialChars - How many characters to enter before triggering +// a partial match (unlike minChars, which defines +// how many characters are required to do any match +// at all). Defaults to 2. +// +// - ignoreCase - Whether to ignore case when autocompleting. +// Defaults to true. +// +// It's possible to pass in a custom function as the 'selector' +// option, if you prefer to write your own autocompletion logic. +// In that case, the other options above will not apply unless +// you support them. + +Autocompleter.Local = Class.create(Autocompleter.Base, { + initialize: function(element, update, array, options) { + this.baseInitialize(element, update, options); + this.options.array = array; + }, + + getUpdatedChoices: function() { + this.updateChoices(this.options.selector(this)); + }, + + setOptions: function(options) { + this.options = Object.extend({ + choices: 10, + partialSearch: true, + partialChars: 2, + ignoreCase: true, + fullSearch: false, + selector: function(instance) { + var ret = []; // Beginning matches + var partial = []; // Inside matches + var entry = instance.getToken(); + var count = 0; + + for (var i = 0; i < instance.options.array.length && + ret.length < instance.options.choices ; i++) { + + var elem = instance.options.array[i]; + var foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase()) : + elem.indexOf(entry); + + while (foundPos != -1) { + if (foundPos == 0 && elem.length != entry.length) { + ret.push("
  • " + elem.substr(0, entry.length) + "" + + elem.substr(entry.length) + "
  • "); + break; + } else if (entry.length >= instance.options.partialChars && + instance.options.partialSearch && foundPos != -1) { + if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { + partial.push("
  • " + elem.substr(0, foundPos) + "" + + elem.substr(foundPos, entry.length) + "" + elem.substr( + foundPos + entry.length) + "
  • "); + break; + } + } + + foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : + elem.indexOf(entry, foundPos + 1); + + } + } + if (partial.length) + ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)); + return "
      " + ret.join('') + "
    "; + } + }, options || { }); + } +}); + +// AJAX in-place editor and collection editor +// Full rewrite by Christophe Porteneuve (April 2007). + +// Use this if you notice weird scrolling problems on some browsers, +// the DOM might be a bit confused when this gets called so do this +// waits 1 ms (with setTimeout) until it does the activation +Field.scrollFreeActivate = function(field) { + setTimeout(function() { + Field.activate(field); + }, 1); +}; + +Ajax.InPlaceEditor = Class.create({ + initialize: function(element, url, options) { + this.url = url; + this.element = element = $(element); + this.prepareOptions(); + this._controls = { }; + arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! + Object.extend(this.options, options || { }); + if (!this.options.formId && this.element.id) { + this.options.formId = this.element.id + '-inplaceeditor'; + if ($(this.options.formId)) + this.options.formId = ''; + } + if (this.options.externalControl) + this.options.externalControl = $(this.options.externalControl); + if (!this.options.externalControl) + this.options.externalControlOnly = false; + this._originalBackground = this.element.getStyle('background-color') || 'transparent'; + this.element.title = this.options.clickToEditText; + this._boundCancelHandler = this.handleFormCancellation.bind(this); + this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); + this._boundFailureHandler = this.handleAJAXFailure.bind(this); + this._boundSubmitHandler = this.handleFormSubmission.bind(this); + this._boundWrapperHandler = this.wrapUp.bind(this); + this.registerListeners(); + }, + checkForEscapeOrReturn: function(e) { + if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; + if (Event.KEY_ESC == e.keyCode) + this.handleFormCancellation(e); + else if (Event.KEY_RETURN == e.keyCode) + this.handleFormSubmission(e); + }, + createControl: function(mode, handler, extraClasses) { + var control = this.options[mode + 'Control']; + var text = this.options[mode + 'Text']; + if ('button' == control) { + var btn = document.createElement('input'); + btn.type = 'submit'; + btn.value = text; + btn.className = 'editor_' + mode + '_button'; + if ('cancel' == mode) + btn.onclick = this._boundCancelHandler; + this._form.appendChild(btn); + this._controls[mode] = btn; + } else if ('link' == control) { + var link = document.createElement('a'); + link.href = '#'; + link.appendChild(document.createTextNode(text)); + link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; + link.className = 'editor_' + mode + '_link'; + if (extraClasses) + link.className += ' ' + extraClasses; + this._form.appendChild(link); + this._controls[mode] = link; + } + }, + createEditField: function() { + var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); + var fld; + if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { + fld = document.createElement('input'); + fld.type = 'text'; + var size = this.options.size || this.options.cols || 0; + if (0 < size) fld.size = size; + } else { + fld = document.createElement('textarea'); + fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); + fld.cols = this.options.cols || 40; + } + fld.name = this.options.paramName; + fld.value = text; // No HTML breaks conversion anymore + fld.className = 'editor_field'; + if (this.options.submitOnBlur) + fld.onblur = this._boundSubmitHandler; + this._controls.editor = fld; + if (this.options.loadTextURL) + this.loadExternalText(); + this._form.appendChild(this._controls.editor); + }, + createForm: function() { + var ipe = this; + function addText(mode, condition) { + var text = ipe.options['text' + mode + 'Controls']; + if (!text || condition === false) return; + ipe._form.appendChild(document.createTextNode(text)); + }; + this._form = $(document.createElement('form')); + this._form.id = this.options.formId; + this._form.addClassName(this.options.formClassName); + this._form.onsubmit = this._boundSubmitHandler; + this.createEditField(); + if ('textarea' == this._controls.editor.tagName.toLowerCase()) + this._form.appendChild(document.createElement('br')); + if (this.options.onFormCustomization) + this.options.onFormCustomization(this, this._form); + addText('Before', this.options.okControl || this.options.cancelControl); + this.createControl('ok', this._boundSubmitHandler); + addText('Between', this.options.okControl && this.options.cancelControl); + this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); + addText('After', this.options.okControl || this.options.cancelControl); + }, + destroy: function() { + if (this._oldInnerHTML) + this.element.innerHTML = this._oldInnerHTML; + this.leaveEditMode(); + this.unregisterListeners(); + }, + enterEditMode: function(e) { + if (this._saving || this._editing) return; + this._editing = true; + this.triggerCallback('onEnterEditMode'); + if (this.options.externalControl) + this.options.externalControl.hide(); + this.element.hide(); + this.createForm(); + this.element.parentNode.insertBefore(this._form, this.element); + if (!this.options.loadTextURL) + this.postProcessEditField(); + if (e) Event.stop(e); + }, + enterHover: function(e) { + if (this.options.hoverClassName) + this.element.addClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onEnterHover'); + }, + getText: function() { + return this.element.innerHTML.unescapeHTML(); + }, + handleAJAXFailure: function(transport) { + this.triggerCallback('onFailure', transport); + if (this._oldInnerHTML) { + this.element.innerHTML = this._oldInnerHTML; + this._oldInnerHTML = null; + } + }, + handleFormCancellation: function(e) { + this.wrapUp(); + if (e) Event.stop(e); + }, + handleFormSubmission: function(e) { + var form = this._form; + var value = $F(this._controls.editor); + this.prepareSubmission(); + var params = this.options.callback(form, value) || ''; + if (Object.isString(params)) + params = params.toQueryParams(); + params.editorId = this.element.id; + if (this.options.htmlResponse) { + var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Updater({ success: this.element }, this.url, options); + } else { + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: params, + onComplete: this._boundWrapperHandler, + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.url, options); + } + if (e) Event.stop(e); + }, + leaveEditMode: function() { + this.element.removeClassName(this.options.savingClassName); + this.removeForm(); + this.leaveHover(); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + if (this.options.externalControl) + this.options.externalControl.show(); + this._saving = false; + this._editing = false; + this._oldInnerHTML = null; + this.triggerCallback('onLeaveEditMode'); + }, + leaveHover: function(e) { + if (this.options.hoverClassName) + this.element.removeClassName(this.options.hoverClassName); + if (this._saving) return; + this.triggerCallback('onLeaveHover'); + }, + loadExternalText: function() { + this._form.addClassName(this.options.loadingClassName); + this._controls.editor.disabled = true; + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._form.removeClassName(this.options.loadingClassName); + var text = transport.responseText; + if (this.options.stripLoadedTextTags) + text = text.stripTags(); + this._controls.editor.value = text; + this._controls.editor.disabled = false; + this.postProcessEditField(); + }.bind(this), + onFailure: this._boundFailureHandler + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + postProcessEditField: function() { + var fpc = this.options.fieldPostCreation; + if (fpc) + $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); + }, + prepareOptions: function() { + this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); + Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); + [this._extraDefaultOptions].flatten().compact().each(function(defs) { + Object.extend(this.options, defs); + }.bind(this)); + }, + prepareSubmission: function() { + this._saving = true; + this.removeForm(); + this.leaveHover(); + this.showSaving(); + }, + registerListeners: function() { + this._listeners = { }; + var listener; + $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { + listener = this[pair.value].bind(this); + this._listeners[pair.key] = listener; + if (!this.options.externalControlOnly) + this.element.observe(pair.key, listener); + if (this.options.externalControl) + this.options.externalControl.observe(pair.key, listener); + }.bind(this)); + }, + removeForm: function() { + if (!this._form) return; + this._form.remove(); + this._form = null; + this._controls = { }; + }, + showSaving: function() { + this._oldInnerHTML = this.element.innerHTML; + this.element.innerHTML = this.options.savingText; + this.element.addClassName(this.options.savingClassName); + this.element.style.backgroundColor = this._originalBackground; + this.element.show(); + }, + triggerCallback: function(cbName, arg) { + if ('function' == typeof this.options[cbName]) { + this.options[cbName](this, arg); + } + }, + unregisterListeners: function() { + $H(this._listeners).each(function(pair) { + if (!this.options.externalControlOnly) + this.element.stopObserving(pair.key, pair.value); + if (this.options.externalControl) + this.options.externalControl.stopObserving(pair.key, pair.value); + }.bind(this)); + }, + wrapUp: function(transport) { + this.leaveEditMode(); + // Can't use triggerCallback due to backward compatibility: requires + // binding + direct element + this._boundComplete(transport, this.element); + } +}); + +Object.extend(Ajax.InPlaceEditor.prototype, { + dispose: Ajax.InPlaceEditor.prototype.destroy +}); + +Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { + initialize: function($super, element, url, options) { + this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; + $super(element, url, options); + }, + + createEditField: function() { + var list = document.createElement('select'); + list.name = this.options.paramName; + list.size = 1; + this._controls.editor = list; + this._collection = this.options.collection || []; + if (this.options.loadCollectionURL) + this.loadCollection(); + else + this.checkForExternalText(); + this._form.appendChild(this._controls.editor); + }, + + loadCollection: function() { + this._form.addClassName(this.options.loadingClassName); + this.showLoadingText(this.options.loadingCollectionText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + var js = transport.responseText.strip(); + if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check + throw('Server returned an invalid collection representation.'); + this._collection = eval(js); + this.checkForExternalText(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadCollectionURL, options); + }, + + showLoadingText: function(text) { + this._controls.editor.disabled = true; + var tempOption = this._controls.editor.firstChild; + if (!tempOption) { + tempOption = document.createElement('option'); + tempOption.value = ''; + this._controls.editor.appendChild(tempOption); + tempOption.selected = true; + } + tempOption.update((text || '').stripScripts().stripTags()); + }, + + checkForExternalText: function() { + this._text = this.getText(); + if (this.options.loadTextURL) + this.loadExternalText(); + else + this.buildOptionList(); + }, + + loadExternalText: function() { + this.showLoadingText(this.options.loadingText); + var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); + Object.extend(options, { + parameters: 'editorId=' + encodeURIComponent(this.element.id), + onComplete: Prototype.emptyFunction, + onSuccess: function(transport) { + this._text = transport.responseText.strip(); + this.buildOptionList(); + }.bind(this), + onFailure: this.onFailure + }); + new Ajax.Request(this.options.loadTextURL, options); + }, + + buildOptionList: function() { + this._form.removeClassName(this.options.loadingClassName); + this._collection = this._collection.map(function(entry) { + return 2 === entry.length ? entry : [entry, entry].flatten(); + }); + var marker = ('value' in this.options) ? this.options.value : this._text; + var textFound = this._collection.any(function(entry) { + return entry[0] == marker; + }.bind(this)); + this._controls.editor.update(''); + var option; + this._collection.each(function(entry, index) { + option = document.createElement('option'); + option.value = entry[0]; + option.selected = textFound ? entry[0] == marker : 0 == index; + option.appendChild(document.createTextNode(entry[1])); + this._controls.editor.appendChild(option); + }.bind(this)); + this._controls.editor.disabled = false; + Field.scrollFreeActivate(this._controls.editor); + } +}); + +//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** +//**** This only exists for a while, in order to let **** +//**** users adapt to the new API. Read up on the new **** +//**** API and convert your code to it ASAP! **** + +Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { + if (!options) return; + function fallback(name, expr) { + if (name in options || expr === undefined) return; + options[name] = expr; + }; + fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : + options.cancelLink == options.cancelButton == false ? false : undefined))); + fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : + options.okLink == options.okButton == false ? false : undefined))); + fallback('highlightColor', options.highlightcolor); + fallback('highlightEndColor', options.highlightendcolor); +}; + +Object.extend(Ajax.InPlaceEditor, { + DefaultOptions: { + ajaxOptions: { }, + autoRows: 3, // Use when multi-line w/ rows == 1 + cancelControl: 'link', // 'link'|'button'|false + cancelText: 'cancel', + clickToEditText: 'Click to edit', + externalControl: null, // id|elt + externalControlOnly: false, + fieldPostCreation: 'activate', // 'activate'|'focus'|false + formClassName: 'inplaceeditor-form', + formId: null, // id|elt + highlightColor: '#ffff99', + highlightEndColor: '#ffffff', + hoverClassName: '', + htmlResponse: true, + loadingClassName: 'inplaceeditor-loading', + loadingText: 'Loading...', + okControl: 'button', // 'link'|'button'|false + okText: 'ok', + paramName: 'value', + rows: 1, // If 1 and multi-line, uses autoRows + savingClassName: 'inplaceeditor-saving', + savingText: 'Saving...', + size: 0, + stripLoadedTextTags: false, + submitOnBlur: false, + textAfterControls: '', + textBeforeControls: '', + textBetweenControls: '' + }, + DefaultCallbacks: { + callback: function(form) { + return Form.serialize(form); + }, + onComplete: function(transport, element) { + // For backward compatibility, this one is bound to the IPE, and passes + // the element directly. It was too often customized, so we don't break it. + new Effect.Highlight(element, { + startcolor: this.options.highlightColor, keepBackgroundImage: true }); + }, + onEnterEditMode: null, + onEnterHover: function(ipe) { + ipe.element.style.backgroundColor = ipe.options.highlightColor; + if (ipe._effect) + ipe._effect.cancel(); + }, + onFailure: function(transport, ipe) { + alert('Error communication with the server: ' + transport.responseText.stripTags()); + }, + onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. + onLeaveEditMode: null, + onLeaveHover: function(ipe) { + ipe._effect = new Effect.Highlight(ipe.element, { + startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, + restorecolor: ipe._originalBackground, keepBackgroundImage: true + }); + } + }, + Listeners: { + click: 'enterEditMode', + keydown: 'checkForEscapeOrReturn', + mouseover: 'enterHover', + mouseout: 'leaveHover' + } +}); + +Ajax.InPlaceCollectionEditor.DefaultOptions = { + loadingCollectionText: 'Loading options...' +}; + +// Delayed observer, like Form.Element.Observer, +// but waits for delay after last key input +// Ideal for live-search fields + +Form.Element.DelayedObserver = Class.create({ + initialize: function(element, delay, callback) { + this.delay = delay || 0.5; + this.element = $(element); + this.callback = callback; + this.timer = null; + this.lastValue = $F(this.element); + Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); + }, + delayedListener: function(event) { + if(this.lastValue == $F(this.element)) return; + if(this.timer) clearTimeout(this.timer); + this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); + this.lastValue = $F(this.element); + }, + onTimerEvent: function() { + this.timer = null; + this.callback(this.element, $F(this.element)); + } +}); \ No newline at end of file diff --git a/js/scriptaculous/dragdrop.js b/js/scriptaculous/dragdrop.js new file mode 100644 index 0000000..07c98e2 --- /dev/null +++ b/js/scriptaculous/dragdrop.js @@ -0,0 +1,975 @@ +// script.aculo.us dragdrop.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +if(Object.isUndefined(Effect)) + throw("dragdrop.js requires including script.aculo.us' effects.js library"); + +var Droppables = { + drops: [], + + remove: function(element) { + this.drops = this.drops.reject(function(d) { return d.element==$(element) }); + }, + + add: function(element) { + element = $(element); + var options = Object.extend({ + greedy: true, + hoverclass: null, + tree: false + }, arguments[1] || { }); + + // cache containers + if(options.containment) { + options._containers = []; + var containment = options.containment; + if(Object.isArray(containment)) { + containment.each( function(c) { options._containers.push($(c)) }); + } else { + options._containers.push($(containment)); + } + } + + if(options.accept) options.accept = [options.accept].flatten(); + + Element.makePositioned(element); // fix IE + options.element = element; + + this.drops.push(options); + }, + + findDeepestChild: function(drops) { + deepest = drops[0]; + + for (i = 1; i < drops.length; ++i) + if (Element.isParent(drops[i].element, deepest.element)) + deepest = drops[i]; + + return deepest; + }, + + isContained: function(element, drop) { + var containmentNode; + if(drop.tree) { + containmentNode = element.treeNode; + } else { + containmentNode = element.parentNode; + } + return drop._containers.detect(function(c) { return containmentNode == c }); + }, + + isAffected: function(point, element, drop) { + return ( + (drop.element!=element) && + ((!drop._containers) || + this.isContained(element, drop)) && + ((!drop.accept) || + (Element.classNames(element).detect( + function(v) { return drop.accept.include(v) } ) )) && + Position.within(drop.element, point[0], point[1]) ); + }, + + deactivate: function(drop) { + if(drop.hoverclass) + Element.removeClassName(drop.element, drop.hoverclass); + this.last_active = null; + }, + + activate: function(drop) { + if(drop.hoverclass) + Element.addClassName(drop.element, drop.hoverclass); + this.last_active = drop; + }, + + show: function(point, element) { + if(!this.drops.length) return; + var drop, affected = []; + + this.drops.each( function(drop) { + if(Droppables.isAffected(point, element, drop)) + affected.push(drop); + }); + + if(affected.length>0) + drop = Droppables.findDeepestChild(affected); + + if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); + if (drop) { + Position.within(drop.element, point[0], point[1]); + if(drop.onHover) + drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); + + if (drop != this.last_active) Droppables.activate(drop); + } + }, + + fire: function(event, element) { + if(!this.last_active) return; + Position.prepare(); + + if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) + if (this.last_active.onDrop) { + this.last_active.onDrop(element, this.last_active.element, event); + return true; + } + }, + + reset: function() { + if(this.last_active) + this.deactivate(this.last_active); + } +}; + +var Draggables = { + drags: [], + observers: [], + + register: function(draggable) { + if(this.drags.length == 0) { + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.updateDrag.bindAsEventListener(this); + this.eventKeypress = this.keyPress.bindAsEventListener(this); + + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + Event.observe(document, "keypress", this.eventKeypress); + } + this.drags.push(draggable); + }, + + unregister: function(draggable) { + this.drags = this.drags.reject(function(d) { return d==draggable }); + if(this.drags.length == 0) { + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + Event.stopObserving(document, "keypress", this.eventKeypress); + } + }, + + activate: function(draggable) { + if(draggable.options.delay) { + this._timeout = setTimeout(function() { + Draggables._timeout = null; + window.focus(); + Draggables.activeDraggable = draggable; + }.bind(this), draggable.options.delay); + } else { + window.focus(); // allows keypress events if window isn't currently focused, fails for Safari + this.activeDraggable = draggable; + } + }, + + deactivate: function() { + this.activeDraggable = null; + }, + + updateDrag: function(event) { + if(!this.activeDraggable) return; + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + // Mozilla-based browsers fire successive mousemove events with + // the same coordinates, prevent needless redrawing (moz bug?) + if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; + this._lastPointer = pointer; + + this.activeDraggable.updateDrag(event, pointer); + }, + + endDrag: function(event) { + if(this._timeout) { + clearTimeout(this._timeout); + this._timeout = null; + } + if(!this.activeDraggable) return; + this._lastPointer = null; + this.activeDraggable.endDrag(event); + this.activeDraggable = null; + }, + + keyPress: function(event) { + if(this.activeDraggable) + this.activeDraggable.keyPress(event); + }, + + addObserver: function(observer) { + this.observers.push(observer); + this._cacheObserverCallbacks(); + }, + + removeObserver: function(element) { // element instead of observer fixes mem leaks + this.observers = this.observers.reject( function(o) { return o.element==element }); + this._cacheObserverCallbacks(); + }, + + notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' + if(this[eventName+'Count'] > 0) + this.observers.each( function(o) { + if(o[eventName]) o[eventName](eventName, draggable, event); + }); + if(draggable.options[eventName]) draggable.options[eventName](draggable, event); + }, + + _cacheObserverCallbacks: function() { + ['onStart','onEnd','onDrag'].each( function(eventName) { + Draggables[eventName+'Count'] = Draggables.observers.select( + function(o) { return o[eventName]; } + ).length; + }); + } +}; + +/*--------------------------------------------------------------------------*/ + +var Draggable = Class.create({ + initialize: function(element) { + var defaults = { + handle: false, + reverteffect: function(element, top_offset, left_offset) { + var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; + new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, + queue: {scope:'_draggable', position:'end'} + }); + }, + endeffect: function(element) { + var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; + new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, + queue: {scope:'_draggable', position:'end'}, + afterFinish: function(){ + Draggable._dragging[element] = false + } + }); + }, + zindex: 1000, + revert: false, + quiet: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } + delay: 0 + }; + + if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) + Object.extend(defaults, { + starteffect: function(element) { + element._opacity = Element.getOpacity(element); + Draggable._dragging[element] = true; + new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); + } + }); + + var options = Object.extend(defaults, arguments[1] || { }); + + this.element = $(element); + + if(options.handle && Object.isString(options.handle)) + this.handle = this.element.down('.'+options.handle, 0); + + if(!this.handle) this.handle = $(options.handle); + if(!this.handle) this.handle = this.element; + + if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { + options.scroll = $(options.scroll); + this._isScrollChild = Element.childOf(this.element, options.scroll); + } + + Element.makePositioned(this.element); // fix IE + + this.options = options; + this.dragging = false; + + this.eventMouseDown = this.initDrag.bindAsEventListener(this); + Event.observe(this.handle, "mousedown", this.eventMouseDown); + + Draggables.register(this); + }, + + destroy: function() { + Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); + Draggables.unregister(this); + }, + + currentDelta: function() { + return([ + parseInt(Element.getStyle(this.element,'left') || '0'), + parseInt(Element.getStyle(this.element,'top') || '0')]); + }, + + initDrag: function(event) { + if(!Object.isUndefined(Draggable._dragging[this.element]) && + Draggable._dragging[this.element]) return; + if(Event.isLeftClick(event)) { + // abort on form elements, fixes a Firefox issue + var src = Event.element(event); + if((tag_name = src.tagName.toUpperCase()) && ( + tag_name=='INPUT' || + tag_name=='SELECT' || + tag_name=='OPTION' || + tag_name=='BUTTON' || + tag_name=='TEXTAREA')) return; + + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var pos = Position.cumulativeOffset(this.element); + this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); + + Draggables.activate(this); + Event.stop(event); + } + }, + + startDrag: function(event) { + this.dragging = true; + if(!this.delta) + this.delta = this.currentDelta(); + + if(this.options.zindex) { + this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); + this.element.style.zIndex = this.options.zindex; + } + + if(this.options.ghosting) { + this._clone = this.element.cloneNode(true); + this._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); + if (!this._originallyAbsolute) + Position.absolutize(this.element); + this.element.parentNode.insertBefore(this._clone, this.element); + } + + if(this.options.scroll) { + if (this.options.scroll == window) { + var where = this._getWindowScroll(this.options.scroll); + this.originalScrollLeft = where.left; + this.originalScrollTop = where.top; + } else { + this.originalScrollLeft = this.options.scroll.scrollLeft; + this.originalScrollTop = this.options.scroll.scrollTop; + } + } + + Draggables.notify('onStart', this, event); + + if(this.options.starteffect) this.options.starteffect(this.element); + }, + + updateDrag: function(event, pointer) { + if(!this.dragging) this.startDrag(event); + + if(!this.options.quiet){ + Position.prepare(); + Droppables.show(pointer, this.element); + } + + Draggables.notify('onDrag', this, event); + + this.draw(pointer); + if(this.options.change) this.options.change(this); + + if(this.options.scroll) { + this.stopScrolling(); + + var p; + if (this.options.scroll == window) { + with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } + } else { + p = Position.page(this.options.scroll); + p[0] += this.options.scroll.scrollLeft + Position.deltaX; + p[1] += this.options.scroll.scrollTop + Position.deltaY; + p.push(p[0]+this.options.scroll.offsetWidth); + p.push(p[1]+this.options.scroll.offsetHeight); + } + var speed = [0,0]; + if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); + if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); + if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); + if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); + this.startScrolling(speed); + } + + // fix AppleWebKit rendering + if(Prototype.Browser.WebKit) window.scrollBy(0,0); + + Event.stop(event); + }, + + finishDrag: function(event, success) { + this.dragging = false; + + if(this.options.quiet){ + Position.prepare(); + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + Droppables.show(pointer, this.element); + } + + if(this.options.ghosting) { + if (!this._originallyAbsolute) + Position.relativize(this.element); + delete this._originallyAbsolute; + Element.remove(this._clone); + this._clone = null; + } + + var dropped = false; + if(success) { + dropped = Droppables.fire(event, this.element); + if (!dropped) dropped = false; + } + if(dropped && this.options.onDropped) this.options.onDropped(this.element); + Draggables.notify('onEnd', this, event); + + var revert = this.options.revert; + if(revert && Object.isFunction(revert)) revert = revert(this.element); + + var d = this.currentDelta(); + if(revert && this.options.reverteffect) { + if (dropped == 0 || revert != 'failure') + this.options.reverteffect(this.element, + d[1]-this.delta[1], d[0]-this.delta[0]); + } else { + this.delta = d; + } + + if(this.options.zindex) + this.element.style.zIndex = this.originalZ; + + if(this.options.endeffect) + this.options.endeffect(this.element); + + Draggables.deactivate(this); + Droppables.reset(); + }, + + keyPress: function(event) { + if(event.keyCode!=Event.KEY_ESC) return; + this.finishDrag(event, false); + Event.stop(event); + }, + + endDrag: function(event) { + if(!this.dragging) return; + this.stopScrolling(); + this.finishDrag(event, true); + Event.stop(event); + }, + + draw: function(point) { + var pos = Position.cumulativeOffset(this.element); + if(this.options.ghosting) { + var r = Position.realOffset(this.element); + pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; + } + + var d = this.currentDelta(); + pos[0] -= d[0]; pos[1] -= d[1]; + + if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { + pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; + pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; + } + + var p = [0,1].map(function(i){ + return (point[i]-pos[i]-this.offset[i]) + }.bind(this)); + + if(this.options.snap) { + if(Object.isFunction(this.options.snap)) { + p = this.options.snap(p[0],p[1],this); + } else { + if(Object.isArray(this.options.snap)) { + p = p.map( function(v, i) { + return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)); + } else { + p = p.map( function(v) { + return (v/this.options.snap).round()*this.options.snap }.bind(this)); + } + }} + + var style = this.element.style; + if((!this.options.constraint) || (this.options.constraint=='horizontal')) + style.left = p[0] + "px"; + if((!this.options.constraint) || (this.options.constraint=='vertical')) + style.top = p[1] + "px"; + + if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering + }, + + stopScrolling: function() { + if(this.scrollInterval) { + clearInterval(this.scrollInterval); + this.scrollInterval = null; + Draggables._lastScrollPointer = null; + } + }, + + startScrolling: function(speed) { + if(!(speed[0] || speed[1])) return; + this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; + this.lastScrolled = new Date(); + this.scrollInterval = setInterval(this.scroll.bind(this), 10); + }, + + scroll: function() { + var current = new Date(); + var delta = current - this.lastScrolled; + this.lastScrolled = current; + if(this.options.scroll == window) { + with (this._getWindowScroll(this.options.scroll)) { + if (this.scrollSpeed[0] || this.scrollSpeed[1]) { + var d = delta / 1000; + this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); + } + } + } else { + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; + } + + Position.prepare(); + Droppables.show(Draggables._lastPointer, this.element); + Draggables.notify('onDrag', this); + if (this._isScrollChild) { + Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); + Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; + Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; + if (Draggables._lastScrollPointer[0] < 0) + Draggables._lastScrollPointer[0] = 0; + if (Draggables._lastScrollPointer[1] < 0) + Draggables._lastScrollPointer[1] = 0; + this.draw(Draggables._lastScrollPointer); + } + + if(this.options.change) this.options.change(this); + }, + + _getWindowScroll: function(w) { + var T, L, W, H; + with (w.document) { + if (w.document.documentElement && documentElement.scrollTop) { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } else if (w.document.body) { + T = body.scrollTop; + L = body.scrollLeft; + } + if (w.innerWidth) { + W = w.innerWidth; + H = w.innerHeight; + } else if (w.document.documentElement && documentElement.clientWidth) { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } else { + W = body.offsetWidth; + H = body.offsetHeight; + } + } + return { top: T, left: L, width: W, height: H }; + } +}); + +Draggable._dragging = { }; + +/*--------------------------------------------------------------------------*/ + +var SortableObserver = Class.create({ + initialize: function(element, observer) { + this.element = $(element); + this.observer = observer; + this.lastValue = Sortable.serialize(this.element); + }, + + onStart: function() { + this.lastValue = Sortable.serialize(this.element); + }, + + onEnd: function() { + Sortable.unmark(); + if(this.lastValue != Sortable.serialize(this.element)) + this.observer(this.element) + } +}); + +var Sortable = { + SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, + + sortables: { }, + + _findRootElement: function(element) { + while (element.tagName.toUpperCase() != "BODY") { + if(element.id && Sortable.sortables[element.id]) return element; + element = element.parentNode; + } + }, + + options: function(element) { + element = Sortable._findRootElement($(element)); + if(!element) return; + return Sortable.sortables[element.id]; + }, + + destroy: function(element){ + element = $(element); + var s = Sortable.sortables[element.id]; + + if(s) { + Draggables.removeObserver(s.element); + s.droppables.each(function(d){ Droppables.remove(d) }); + s.draggables.invoke('destroy'); + + delete Sortable.sortables[s.element.id]; + } + }, + + create: function(element) { + element = $(element); + var options = Object.extend({ + element: element, + tag: 'li', // assumes li children, override with tag: 'tagname' + dropOnEmpty: false, + tree: false, + treeTag: 'ul', + overlap: 'vertical', // one of 'vertical', 'horizontal' + constraint: 'vertical', // one of 'vertical', 'horizontal', false + containment: element, // also takes array of elements (or id's); or false + handle: false, // or a CSS class + only: false, + delay: 0, + hoverclass: null, + ghosting: false, + quiet: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + format: this.SERIALIZE_RULE, + + // these take arrays of elements or ids and can be + // used for better initialization performance + elements: false, + handles: false, + + onChange: Prototype.emptyFunction, + onUpdate: Prototype.emptyFunction + }, arguments[1] || { }); + + // clear any old sortable with same element + this.destroy(element); + + // build options for the draggables + var options_for_draggable = { + revert: true, + quiet: options.quiet, + scroll: options.scroll, + scrollSpeed: options.scrollSpeed, + scrollSensitivity: options.scrollSensitivity, + delay: options.delay, + ghosting: options.ghosting, + constraint: options.constraint, + handle: options.handle }; + + if(options.starteffect) + options_for_draggable.starteffect = options.starteffect; + + if(options.reverteffect) + options_for_draggable.reverteffect = options.reverteffect; + else + if(options.ghosting) options_for_draggable.reverteffect = function(element) { + element.style.top = 0; + element.style.left = 0; + }; + + if(options.endeffect) + options_for_draggable.endeffect = options.endeffect; + + if(options.zindex) + options_for_draggable.zindex = options.zindex; + + // build options for the droppables + var options_for_droppable = { + overlap: options.overlap, + containment: options.containment, + tree: options.tree, + hoverclass: options.hoverclass, + onHover: Sortable.onHover + }; + + var options_for_tree = { + onHover: Sortable.onEmptyHover, + overlap: options.overlap, + containment: options.containment, + hoverclass: options.hoverclass + }; + + // fix for gecko engine + Element.cleanWhitespace(element); + + options.draggables = []; + options.droppables = []; + + // drop on empty handling + if(options.dropOnEmpty || options.tree) { + Droppables.add(element, options_for_tree); + options.droppables.push(element); + } + + (options.elements || this.findElements(element, options) || []).each( function(e,i) { + var handle = options.handles ? $(options.handles[i]) : + (options.handle ? $(e).select('.' + options.handle)[0] : e); + options.draggables.push( + new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); + Droppables.add(e, options_for_droppable); + if(options.tree) e.treeNode = element; + options.droppables.push(e); + }); + + if(options.tree) { + (Sortable.findTreeElements(element, options) || []).each( function(e) { + Droppables.add(e, options_for_tree); + e.treeNode = element; + options.droppables.push(e); + }); + } + + // keep reference + this.sortables[element.id] = options; + + // for onupdate + Draggables.addObserver(new SortableObserver(element, options.onUpdate)); + + }, + + // return all suitable-for-sortable elements in a guaranteed order + findElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.tag); + }, + + findTreeElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.treeTag); + }, + + onHover: function(element, dropon, overlap) { + if(Element.isParent(dropon, element)) return; + + if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { + return; + } else if(overlap>0.5) { + Sortable.mark(dropon, 'before'); + if(dropon.previousSibling != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, dropon); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } else { + Sortable.mark(dropon, 'after'); + var nextElement = dropon.nextSibling || null; + if(nextElement != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, nextElement); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + }, + + onEmptyHover: function(element, dropon, overlap) { + var oldParentNode = element.parentNode; + var droponOptions = Sortable.options(dropon); + + if(!Element.isParent(dropon, element)) { + var index; + + var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); + var child = null; + + if(children) { + var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); + + for (index = 0; index < children.length; index += 1) { + if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { + offset -= Element.offsetSize (children[index], droponOptions.overlap); + } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { + child = index + 1 < children.length ? children[index + 1] : null; + break; + } else { + child = children[index]; + break; + } + } + } + + dropon.insertBefore(element, child); + + Sortable.options(oldParentNode).onChange(element); + droponOptions.onChange(element); + } + }, + + unmark: function() { + if(Sortable._marker) Sortable._marker.hide(); + }, + + mark: function(dropon, position) { + // mark on ghosting only + var sortable = Sortable.options(dropon.parentNode); + if(sortable && !sortable.ghosting) return; + + if(!Sortable._marker) { + Sortable._marker = + ($('dropmarker') || Element.extend(document.createElement('DIV'))). + hide().addClassName('dropmarker').setStyle({position:'absolute'}); + document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); + } + var offsets = Position.cumulativeOffset(dropon); + Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); + + if(position=='after') + if(sortable.overlap == 'horizontal') + Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); + else + Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); + + Sortable._marker.show(); + }, + + _tree: function(element, options, parent) { + var children = Sortable.findElements(element, options) || []; + + for (var i = 0; i < children.length; ++i) { + var match = children[i].id.match(options.format); + + if (!match) continue; + + var child = { + id: encodeURIComponent(match ? match[1] : null), + element: element, + parent: parent, + children: [], + position: parent.children.length, + container: $(children[i]).down(options.treeTag) + }; + + /* Get the element containing the children and recurse over it */ + if (child.container) + this._tree(child.container, options, child); + + parent.children.push (child); + } + + return parent; + }, + + tree: function(element) { + element = $(element); + var sortableOptions = this.options(element); + var options = Object.extend({ + tag: sortableOptions.tag, + treeTag: sortableOptions.treeTag, + only: sortableOptions.only, + name: element.id, + format: sortableOptions.format + }, arguments[1] || { }); + + var root = { + id: null, + parent: null, + children: [], + container: element, + position: 0 + }; + + return Sortable._tree(element, options, root); + }, + + /* Construct a [i] index for a particular node */ + _constructIndex: function(node) { + var index = ''; + do { + if (node.id) index = '[' + node.position + ']' + index; + } while ((node = node.parent) != null); + return index; + }, + + sequence: function(element) { + element = $(element); + var options = Object.extend(this.options(element), arguments[1] || { }); + + return $(this.findElements(element, options) || []).map( function(item) { + return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; + }); + }, + + setSequence: function(element, new_sequence) { + element = $(element); + var options = Object.extend(this.options(element), arguments[2] || { }); + + var nodeMap = { }; + this.findElements(element, options).each( function(n) { + if (n.id.match(options.format)) + nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; + n.parentNode.removeChild(n); + }); + + new_sequence.each(function(ident) { + var n = nodeMap[ident]; + if (n) { + n[1].appendChild(n[0]); + delete nodeMap[ident]; + } + }); + }, + + serialize: function(element) { + element = $(element); + var options = Object.extend(Sortable.options(element), arguments[1] || { }); + var name = encodeURIComponent( + (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); + + if (options.tree) { + return Sortable.tree(element, arguments[1]).children.map( function (item) { + return [name + Sortable._constructIndex(item) + "[id]=" + + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); + }).flatten().join('&'); + } else { + return Sortable.sequence(element, arguments[1]).map( function(item) { + return name + "[]=" + encodeURIComponent(item); + }).join('&'); + } + } +}; + +// Returns true if child is contained within element +Element.isParent = function(child, element) { + if (!child.parentNode || child == element) return false; + if (child.parentNode == element) return true; + return Element.isParent(child.parentNode, element); +}; + +Element.findChildren = function(element, only, recursive, tagName) { + if(!element.hasChildNodes()) return null; + tagName = tagName.toUpperCase(); + if(only) only = [only].flatten(); + var elements = []; + $A(element.childNodes).each( function(e) { + if(e.tagName && e.tagName.toUpperCase()==tagName && + (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) + elements.push(e); + if(recursive) { + var grandchildren = Element.findChildren(e, only, recursive, tagName); + if(grandchildren) elements.push(grandchildren); + } + }); + + return (elements.length>0 ? elements.flatten() : []); +}; + +Element.offsetSize = function (element, type) { + return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; +}; \ No newline at end of file diff --git a/js/scriptaculous/effects.js b/js/scriptaculous/effects.js new file mode 100644 index 0000000..f31a81a --- /dev/null +++ b/js/scriptaculous/effects.js @@ -0,0 +1,1130 @@ +// script.aculo.us effects.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008 + +// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() { + var color = '#'; + if (this.slice(0,4) == 'rgb(') { + var cols = this.slice(4,this.length-1).split(','); + var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); + } else { + if (this.slice(0,1) == '#') { + if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if (this.length==7) color = this.toLowerCase(); + } + } + return (color.length==7 ? color : (arguments[0] || this)); +}; + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function(element) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +}; + +Element.collectTextNodesIgnoreClass = function(element, className) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? + Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +}; + +Element.setContentZoom = function(element, percent) { + element = $(element); + element.setStyle({fontSize: (percent/100) + 'em'}); + if (Prototype.Browser.WebKit) window.scrollBy(0,0); + return element; +}; + +Element.getInlineOpacity = function(element){ + return $(element).style.opacity || ''; +}; + +Element.forceRerendering = function(element) { + try { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch(e) { } +}; + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + Transitions: { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + .5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4; + return pos > 1 ? 1 : pos; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5; + }, + pulse: function(pos, pulses) { + return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5; + }, + spring: function(pos) { + return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } + }, + DefaultOptions: { + duration: 1.0, // seconds + fps: 100, // 100= assume 66fps max. + sync: false, // true for combining + from: 0.0, + to: 1.0, + delay: 0.0, + queue: 'parallel' + }, + tagifyText: function(element) { + var tagifyStyle = 'position:relative'; + if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; + + element = $(element); + $A(element.childNodes).each( function(child) { + if (child.nodeType==3) { + child.nodeValue.toArray().each( function(character) { + element.insertBefore( + new Element('span', {style: tagifyStyle}).update( + character == ' ' ? String.fromCharCode(160) : character), + child); + }); + Element.remove(child); + } + }); + }, + multiple: function(element, effect) { + var elements; + if (((typeof element == 'object') || + Object.isFunction(element)) && + (element.length)) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || { }); + var masterDelay = options.delay; + + $A(elements).each( function(element, index) { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function(element, effect) { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || { }); + Effect[element.visible() ? + Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(Enumerable, { + initialize: function() { + this.effects = []; + this.interval = null; + }, + _each: function(iterator) { + this.effects._each(iterator); + }, + add: function(effect) { + var timestamp = new Date().getTime(); + + var position = Object.isString(effect.options.queue) ? + effect.options.queue : effect.options.queue.position; + + switch(position) { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'with-last': + timestamp = this.effects.pluck('startOn').max() || timestamp; + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) + this.effects.push(effect); + + if (!this.interval) + this.interval = setInterval(this.loop.bind(this), 15); + }, + remove: function(effect) { + this.effects = this.effects.reject(function(e) { return e==effect }); + if (this.effects.length == 0) { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() { + var timePos = new Date().getTime(); + for(var i=0, len=this.effects.length;i= this.startOn) { + if (timePos >= this.finishOn) { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if (this.finish) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / this.totalTime, + frame = (pos * this.totalFrames).round(); + if (frame > this.currentFrame) { + this.render(pos); + this.currentFrame = frame; + } + } + }, + cancel: function() { + if (!this.options.sync) + Effect.Queues.get(Object.isString(this.options.queue) ? + 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function(eventName) { + if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); + if (this.options[eventName]) this.options[eventName](this); + }, + inspect: function() { + var data = $H(); + for(property in this) + if (!Object.isFunction(this[property])) data.set(property, this[property]); + return '#'; + } +}); + +Effect.Parallel = Class.create(Effect.Base, { + initialize: function(effects) { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function(position) { + this.effects.invoke('render', position); + }, + finish: function(position) { + this.effects.each( function(effect) { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if (effect.finish) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Tween = Class.create(Effect.Base, { + initialize: function(object, from, to) { + object = Object.isString(object) ? $(object) : object; + var args = $A(arguments), method = args.last(), + options = args.length == 5 ? args[3] : null; + this.method = Object.isFunction(method) ? method.bind(object) : + Object.isFunction(object[method]) ? object[method].bind(object) : + function(value) { object[method] = value }; + this.start(Object.extend({ from: from, to: to }, options || { })); + }, + update: function(position) { + this.method(position); + } +}); + +Effect.Event = Class.create(Effect.Base, { + initialize: function() { + this.start(Object.extend({ duration: 0 }, arguments[0] || { })); + }, + update: Prototype.emptyFunction +}); + +Effect.Opacity = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || { }); + this.start(options); + }, + update: function(position) { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if (this.options.mode == 'absolute') { + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function(position) { + this.element.setStyle({ + left: (this.options.x * position + this.originalLeft).round() + 'px', + top: (this.options.y * position + this.originalTop).round() + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function(element, toTop, toLeft) { + return new Effect.Move(element, + Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); +}; + +Effect.Scale = Class.create(Effect.Base, { + initialize: function(element, percent) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or { } with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || { }); + this.start(options); + }, + setup: function() { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = { }; + ['top','left','width','height','fontSize'].each( function(k) { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each( function(fontSizeType) { + if (fontSize.indexOf(fontSizeType)>0) { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; + + this.dims = null; + if (this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if (/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if (!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function(position) { + var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); + if (this.options.scaleContent && this.fontSize) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function(position) { + if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); + }, + setDimensions: function(height, width) { + var d = { }; + if (this.options.scaleX) d.width = width.round() + 'px'; + if (this.options.scaleY) d.height = height.round() + 'px'; + if (this.options.scaleFromCenter) { + var topd = (height - this.dims[0])/2; + var leftd = (width - this.dims[1])/2; + if (this.elementPositioning == 'absolute') { + if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; + if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; + } else { + if (this.options.scaleY) d.top = -topd + 'px'; + if (this.options.scaleX) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); + this.start(options); + }, + setup: function() { + // Prevent executing on elements not in the layout flow + if (this.element.getStyle('display')=='none') { this.cancel(); return; } + // Disable background image during the effect + this.oldStyle = { }; + if (!this.options.keepBackgroundImage) { + this.oldStyle.backgroundImage = this.element.getStyle('background-image'); + this.element.setStyle({backgroundImage: 'none'}); + } + if (!this.options.endcolor) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if (!this.options.restorecolor) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); + this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); + }, + update: function(position) { + this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ + return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); + }, + finish: function() { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = function(element) { + var options = arguments[1] || { }, + scrollOffsets = document.viewport.getScrollOffsets(), + elementOffsets = $(element).cumulativeOffset(); + + if (options.offset) elementOffsets[1] += options.offset; + + return new Effect.Tween(null, + scrollOffsets.top, + elementOffsets[1], + options, + function(p){ scrollTo(scrollOffsets.left, p.round()); } + ); +}; + +/* ------------- combination effects ------------- */ + +Effect.Fade = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function(effect) { + if (effect.options.to!=0) return; + effect.element.hide().setStyle({opacity: oldOpacity}); + } + }, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Appear = function(element) { + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + effect.element.forceRerendering(); + }, + beforeSetup: function(effect) { + effect.element.setOpacity(effect.options.from).show(); + }}, arguments[1] || { }); + return new Effect.Opacity(element,options); +}; + +Effect.Puff = function(element) { + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel( + [ new Effect.Scale(element, 200, + { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], + Object.extend({ duration: 1.0, + beforeSetupInternal: function(effect) { + Position.absolutize(effect.effects[0].element); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().setStyle(oldStyle); } + }, arguments[1] || { }) + ); +}; + +Effect.BlindUp = function(element) { + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, + Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }, arguments[1] || { }) + ); +}; + +Effect.BlindDown = function(element) { + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping(); + } + }, arguments[1] || { })); +}; + +Effect.SwitchOff = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function(effect) { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); + } + }); + } + }, arguments[1] || { })); +}; + +Effect.DropOut = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel( + [ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], + Object.extend( + { duration: 0.5, + beforeSetup: function(effect) { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); + } + }, arguments[1] || { })); +}; + +Effect.Shake = function(element) { + element = $(element); + var options = Object.extend({ + distance: 20, + duration: 0.5 + }, arguments[1] || {}); + var distance = parseFloat(options.distance); + var split = parseFloat(options.duration) / 10.0; + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, + { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { + effect.element.undoPositioned().setStyle(oldStyle); + }}); }}); }}); }}); }}); }}); +}; + +Effect.SlideDown = function(element) { + element = $(element).cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } + }, arguments[1] || { }) + ); +}; + +Effect.SlideUp = function(element) { + element = $(element).cleanWhitespace(); + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, window.opera ? 0 : 1, + Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if (window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); + } + }, arguments[1] || { }) + ); +}; + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function(element) { + return new Effect.Scale(element, window.opera ? 1 : 0, { + restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }); +}; + +Effect.Grow = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function(effect) { + effect.element.hide().makeClipping().makePositioned(); + }, + afterFinishInternal: function(effect) { + new Effect.Parallel( + [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function(effect) { + effect.effects[0].element.setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); + } + }, options) + ); + } + }); +}; + +Effect.Shrink = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || { }); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel( + [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function(effect) { + effect.effects[0].element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } + }, options) + ); +}; + +Effect.Pulsate = function(element) { + element = $(element); + var options = arguments[1] || { }, + oldOpacity = element.getInlineOpacity(), + transition = options.transition || Effect.Transitions.linear, + reverser = function(pos){ + return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5); + }; + + return new Effect.Opacity(element, + Object.extend(Object.extend({ duration: 2.0, from: 0, + afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } + }, options), {transition: reverser})); +}; + +Effect.Fold = function(element) { + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + element.makeClipping(); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function(effect) { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().setStyle(oldStyle); + } }); + }}, arguments[1] || { })); +}; + +Effect.Morph = Class.create(Effect.Base, { + initialize: function(element) { + this.element = $(element); + if (!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + style: { } + }, arguments[1] || { }); + + if (!Object.isString(options.style)) this.style = $H(options.style); + else { + if (options.style.include(':')) + this.style = options.style.parseStyle(); + else { + this.element.addClassName(options.style); + this.style = $H(this.element.getStyles()); + this.element.removeClassName(options.style); + var css = this.element.getStyles(); + this.style = this.style.reject(function(style) { + return style.value == css[style.key]; + }); + options.afterFinishInternal = function(effect) { + effect.element.addClassName(effect.options.style); + effect.transforms.each(function(transform) { + effect.element.style[transform.style] = ''; + }); + }; + } + } + this.start(options); + }, + + setup: function(){ + function parseColor(color){ + if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; + color = color.parseColor(); + return $R(0,2).map(function(i){ + return parseInt( color.slice(i*2+1,i*2+3), 16 ); + }); + } + this.transforms = this.style.map(function(pair){ + var property = pair[0], value = pair[1], unit = null; + + if (value.parseColor('#zzzzzz') != '#zzzzzz') { + value = value.parseColor(); + unit = 'color'; + } else if (property == 'opacity') { + value = parseFloat(value); + if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + } else if (Element.CSS_LENGTH.test(value)) { + var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); + value = parseFloat(components[1]); + unit = (components.length == 3) ? components[2] : null; + } + + var originalValue = this.element.getStyle(property); + return { + style: property.camelize(), + originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), + targetValue: unit=='color' ? parseColor(value) : value, + unit: unit + }; + }.bind(this)).reject(function(transform){ + return ( + (transform.originalValue == transform.targetValue) || + ( + transform.unit != 'color' && + (isNaN(transform.originalValue) || isNaN(transform.targetValue)) + ) + ); + }); + }, + update: function(position) { + var style = { }, transform, i = this.transforms.length; + while(i--) + style[(transform = this.transforms[i]).style] = + transform.unit=='color' ? '#'+ + (Math.round(transform.originalValue[0]+ + (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + + (Math.round(transform.originalValue[1]+ + (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + + (Math.round(transform.originalValue[2]+ + (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : + (transform.originalValue + + (transform.targetValue - transform.originalValue) * position).toFixed(3) + + (transform.unit === null ? '' : transform.unit); + this.element.setStyle(style, true); + } +}); + +Effect.Transform = Class.create({ + initialize: function(tracks){ + this.tracks = []; + this.options = arguments[1] || { }; + this.addTracks(tracks); + }, + addTracks: function(tracks){ + tracks.each(function(track){ + track = $H(track); + var data = track.values().first(); + this.tracks.push($H({ + ids: track.keys().first(), + effect: Effect.Morph, + options: { style: data } + })); + }.bind(this)); + return this; + }, + play: function(){ + return new Effect.Parallel( + this.tracks.map(function(track){ + var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); + var elements = [$(ids) || $$(ids)].flatten(); + return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); + }).flatten(), + this.options + ); + } +}); + +Element.CSS_PROPERTIES = $w( + 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + + 'fontSize fontWeight height left letterSpacing lineHeight ' + + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ + 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + + 'right textIndent top width wordSpacing zIndex'); + +Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; + +String.__parseStyleElement = document.createElement('div'); +String.prototype.parseStyle = function(){ + var style, styleRules = $H(); + if (Prototype.Browser.WebKit) + style = new Element('div',{style:this}).style; + else { + String.__parseStyleElement.innerHTML = '
    '; + style = String.__parseStyleElement.childNodes[0].style; + } + + Element.CSS_PROPERTIES.each(function(property){ + if (style[property]) styleRules.set(property, style[property]); + }); + + if (Prototype.Browser.IE && this.include('opacity')) + styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); + + return styleRules; +}; + +if (document.defaultView && document.defaultView.getComputedStyle) { + Element.getStyles = function(element) { + var css = document.defaultView.getComputedStyle($(element), null); + return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { + styles[property] = css[property]; + return styles; + }); + }; +} else { + Element.getStyles = function(element) { + element = $(element); + var css = element.currentStyle, styles; + styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { + results[property] = css[property]; + return results; + }); + if (!styles.opacity) styles.opacity = element.getOpacity(); + return styles; + }; +} + +Effect.Methods = { + morph: function(element, style) { + element = $(element); + new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); + return element; + }, + visualEffect: function(element, effect, options) { + element = $(element); + var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[klass](element, options); + return element; + }, + highlight: function(element, options) { + element = $(element); + new Effect.Highlight(element, options); + return element; + } +}; + +$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ + 'pulsate shake puff squish switchOff dropOut').each( + function(effect) { + Effect.Methods[effect] = function(element, options){ + element = $(element); + Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); + return element; + }; + } +); + +$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( + function(f) { Effect.Methods[f] = Element[f]; } +); + +Element.addMethods(Effect.Methods); \ No newline at end of file diff --git a/js/scriptaculous/javascript.js b/js/scriptaculous/javascript.js new file mode 100644 index 0000000..8a4973e --- /dev/null +++ b/js/scriptaculous/javascript.js @@ -0,0 +1,20 @@ +CodeHighlighter.addStyle("javascript",{ + comment : { + exp : /(\/\/[^\n]*\n?)|(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)/ + }, + brackets : { + exp : /\(|\)/ + }, + string : { + exp : /'[^']*'|"[^"]*"/ + }, + keywords : { + exp : /\b(arguments|break|case|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|typeof|var|void|while|with)\b/ + }, + global : { + exp : /\b(toString|valueOf|window|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ + }, + erb : { + exp : /<%=(.+)%>/ + } +}); \ No newline at end of file diff --git a/js/scriptaculous/prototype.js b/js/scriptaculous/prototype.js new file mode 100644 index 0000000..dfe8ab4 --- /dev/null +++ b/js/scriptaculous/prototype.js @@ -0,0 +1,4320 @@ +/* Prototype JavaScript framework, version 1.6.0.3 + * (c) 2005-2008 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://www.prototypejs.org/ + * + *--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.6.0.3', + + Browser: { + IE: !!(window.attachEvent && + navigator.userAgent.indexOf('Opera') === -1), + Opera: navigator.userAgent.indexOf('Opera') > -1, + WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && + navigator.userAgent.indexOf('KHTML') === -1, + MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) + }, + + BrowserFeatures: { + XPath: !!document.evaluate, + SelectorsAPI: !!document.querySelector, + ElementExtensions: !!window.HTMLElement, + SpecificElementExtensions: + document.createElement('div')['__proto__'] && + document.createElement('div')['__proto__'] !== + document.createElement('form')['__proto__'] + }, + + ScriptFragment: ']*>([\\S\\s]*?)<\/script>', + JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, + + emptyFunction: function() { }, + K: function(x) { return x } +}; + +if (Prototype.Browser.MobileSafari) + Prototype.BrowserFeatures.SpecificElementExtensions = false; + + +/* Based on Alex Arnell's inheritance implementation. */ +var Class = { + create: function() { + var parent = null, properties = $A(arguments); + if (Object.isFunction(properties[0])) + parent = properties.shift(); + + function klass() { + this.initialize.apply(this, arguments); + } + + Object.extend(klass, Class.Methods); + klass.superclass = parent; + klass.subclasses = []; + + if (parent) { + var subclass = function() { }; + subclass.prototype = parent.prototype; + klass.prototype = new subclass; + parent.subclasses.push(klass); + } + + for (var i = 0; i < properties.length; i++) + klass.addMethods(properties[i]); + + if (!klass.prototype.initialize) + klass.prototype.initialize = Prototype.emptyFunction; + + klass.prototype.constructor = klass; + + return klass; + } +}; + +Class.Methods = { + addMethods: function(source) { + var ancestor = this.superclass && this.superclass.prototype; + var properties = Object.keys(source); + + if (!Object.keys({ toString: true }).length) + properties.push("toString", "valueOf"); + + for (var i = 0, length = properties.length; i < length; i++) { + var property = properties[i], value = source[property]; + if (ancestor && Object.isFunction(value) && + value.argumentNames().first() == "$super") { + var method = value; + value = (function(m) { + return function() { return ancestor[m].apply(this, arguments) }; + })(property).wrap(method); + + value.valueOf = method.valueOf.bind(method); + value.toString = method.toString.bind(method); + } + this.prototype[property] = value; + } + + return this; + } +}; + +var Abstract = { }; + +Object.extend = function(destination, source) { + for (var property in source) + destination[property] = source[property]; + return destination; +}; + +Object.extend(Object, { + inspect: function(object) { + try { + if (Object.isUndefined(object)) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : String(object); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + toJSON: function(object) { + var type = typeof object; + switch (type) { + case 'undefined': + case 'function': + case 'unknown': return; + case 'boolean': return object.toString(); + } + + if (object === null) return 'null'; + if (object.toJSON) return object.toJSON(); + if (Object.isElement(object)) return; + + var results = []; + for (var property in object) { + var value = Object.toJSON(object[property]); + if (!Object.isUndefined(value)) + results.push(property.toJSON() + ': ' + value); + } + + return '{' + results.join(', ') + '}'; + }, + + toQueryString: function(object) { + return $H(object).toQueryString(); + }, + + toHTML: function(object) { + return object && object.toHTML ? object.toHTML() : String.interpret(object); + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({ }, object); + }, + + isElement: function(object) { + return !!(object && object.nodeType == 1); + }, + + isArray: function(object) { + return object != null && typeof object == "object" && + 'splice' in object && 'join' in object; + }, + + isHash: function(object) { + return object instanceof Hash; + }, + + isFunction: function(object) { + return typeof object == "function"; + }, + + isString: function(object) { + return typeof object == "string"; + }, + + isNumber: function(object) { + return typeof object == "number"; + }, + + isUndefined: function(object) { + return typeof object == "undefined"; + } +}); + +Object.extend(Function.prototype, { + argumentNames: function() { + var names = this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1] + .replace(/\s+/g, '').split(','); + return names.length == 1 && !names[0] ? [] : names; + }, + + bind: function() { + if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } + }, + + bindAsEventListener: function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [event || window.event].concat(args)); + } + }, + + curry: function() { + if (!arguments.length) return this; + var __method = this, args = $A(arguments); + return function() { + return __method.apply(this, args.concat($A(arguments))); + } + }, + + delay: function() { + var __method = this, args = $A(arguments), timeout = args.shift() * 1000; + return window.setTimeout(function() { + return __method.apply(__method, args); + }, timeout); + }, + + defer: function() { + var args = [0.01].concat($A(arguments)); + return this.delay.apply(this, args); + }, + + wrap: function(wrapper) { + var __method = this; + return function() { + return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); + } + }, + + methodize: function() { + if (this._methodized) return this._methodized; + var __method = this; + return this._methodized = function() { + return __method.apply(null, [this].concat($A(arguments))); + }; + } +}); + +Date.prototype.toJSON = function() { + return '"' + this.getUTCFullYear() + '-' + + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + + this.getUTCDate().toPaddedString(2) + 'T' + + this.getUTCHours().toPaddedString(2) + ':' + + this.getUTCMinutes().toPaddedString(2) + ':' + + this.getUTCSeconds().toPaddedString(2) + 'Z"'; +}; + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) { } + } + + return returnValue; + } +}; + +RegExp.prototype.match = RegExp.prototype.test; + +RegExp.escape = function(str) { + return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); +}; + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create({ + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + execute: function() { + this.callback(this); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.execute(); + } finally { + this.currentlyExecuting = false; + } + } + } +}); +Object.extend(String, { + interpret: function(value) { + return value == null ? '' : String(value); + }, + specialChar: { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\\': '\\\\' + } +}); + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = Object.isUndefined(count) ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return String(this); + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = Object.isUndefined(truncation) ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : String(this); + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var self = arguments.callee; + self.text.data = this; + return self.div.innerHTML; + }, + + unescapeHTML: function() { + var div = new Element('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return { }; + + return match[1].split(separator || '&').inject({ }, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var key = decodeURIComponent(pair.shift()); + var value = pair.length > 1 ? pair.join('=') : pair[0]; + if (value != undefined) value = decodeURIComponent(value); + + if (key in hash) { + if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; + hash[key].push(value); + } + else hash[key] = value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + times: function(count) { + return count < 1 ? '' : new Array(count + 1).join(this); + }, + + camelize: function() { + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; + + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); + + return camelized; + }, + + capitalize: function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { + var character = String.specialChar[match[0]]; + return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + }); + if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + }, + + toJSON: function() { + return this.inspect(true); + }, + + unfilterJSON: function(filter) { + return this.sub(filter || Prototype.JSONFilter, '#{1}'); + }, + + isJSON: function() { + var str = this; + if (str.blank()) return false; + str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); + }, + + evalJSON: function(sanitize) { + var json = this.unfilterJSON(); + try { + if (!sanitize || json.isJSON()) return eval('(' + json + ')'); + } catch (e) { } + throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); + }, + + include: function(pattern) { + return this.indexOf(pattern) > -1; + }, + + startsWith: function(pattern) { + return this.indexOf(pattern) === 0; + }, + + endsWith: function(pattern) { + var d = this.length - pattern.length; + return d >= 0 && this.lastIndexOf(pattern) === d; + }, + + empty: function() { + return this == ''; + }, + + blank: function() { + return /^\s*$/.test(this); + }, + + interpolate: function(object, pattern) { + return new Template(this, pattern).evaluate(object); + } +}); + +if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { + escapeHTML: function() { + return this.replace(/&/g,'&').replace(//g,'>'); + }, + unescapeHTML: function() { + return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (Object.isFunction(replacement)) return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +}; + +String.prototype.parseQuery = String.prototype.toQueryParams; + +Object.extend(String.prototype.escapeHTML, { + div: document.createElement('div'), + text: document.createTextNode('') +}); + +String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text); + +var Template = Class.create({ + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + if (Object.isFunction(object.toTemplateReplacements)) + object = object.toTemplateReplacements(); + + return this.template.gsub(this.pattern, function(match) { + if (object == null) return ''; + + var before = match[1] || ''; + if (before == '\\') return match[2]; + + var ctx = object, expr = match[3]; + var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; + match = pattern.exec(expr); + if (match == null) return before; + + while (match != null) { + var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; + ctx = ctx[comp]; + if (null == ctx || '' == match[3]) break; + expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); + match = pattern.exec(expr); + } + + return before + String.interpret(ctx); + }); + } +}); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; + +var $break = { }; + +var Enumerable = { + each: function(iterator, context) { + var index = 0; + try { + this._each(function(value) { + iterator.call(context, value, index++); + }); + } catch (e) { + if (e != $break) throw e; + } + return this; + }, + + eachSlice: function(number, iterator, context) { + var index = -number, slices = [], array = this.toArray(); + if (number < 1) return array; + while ((index += number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.collect(iterator, context); + }, + + all: function(iterator, context) { + iterator = iterator || Prototype.K; + var result = true; + this.each(function(value, index) { + result = result && !!iterator.call(context, value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator, context) { + iterator = iterator || Prototype.K; + var result = false; + this.each(function(value, index) { + if (result = !!iterator.call(context, value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator, context) { + iterator = iterator || Prototype.K; + var results = []; + this.each(function(value, index) { + results.push(iterator.call(context, value, index)); + }); + return results; + }, + + detect: function(iterator, context) { + var result; + this.each(function(value, index) { + if (iterator.call(context, value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator, context) { + var results = []; + this.each(function(value, index) { + if (iterator.call(context, value, index)) + results.push(value); + }); + return results; + }, + + grep: function(filter, iterator, context) { + iterator = iterator || Prototype.K; + var results = []; + + if (Object.isString(filter)) + filter = new RegExp(filter); + + this.each(function(value, index) { + if (filter.match(value)) + results.push(iterator.call(context, value, index)); + }); + return results; + }, + + include: function(object) { + if (Object.isFunction(this.indexOf)) + if (this.indexOf(object) != -1) return true; + + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inGroupsOf: function(number, fillWith) { + fillWith = Object.isUndefined(fillWith) ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator, context) { + this.each(function(value, index) { + memo = iterator.call(context, memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator, context) { + iterator = iterator || Prototype.K; + var result; + this.each(function(value, index) { + value = iterator.call(context, value, index); + if (result == null || value >= result) + result = value; + }); + return result; + }, + + min: function(iterator, context) { + iterator = iterator || Prototype.K; + var result; + this.each(function(value, index) { + value = iterator.call(context, value, index); + if (result == null || value < result) + result = value; + }); + return result; + }, + + partition: function(iterator, context) { + iterator = iterator || Prototype.K; + var trues = [], falses = []; + this.each(function(value, index) { + (iterator.call(context, value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator, context) { + var results = []; + this.each(function(value, index) { + if (!iterator.call(context, value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator, context) { + return this.map(function(value, index) { + return { + value: value, + criteria: iterator.call(context, value, index) + }; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.map(); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (Object.isFunction(args.last())) + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + size: function() { + return this.toArray().length; + }, + + inspect: function() { + return '#'; + } +}; + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + filter: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray, + every: Enumerable.all, + some: Enumerable.any +}); +function $A(iterable) { + if (!iterable) return []; + if (iterable.toArray) return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; +} + +if (Prototype.Browser.WebKit) { + $A = function(iterable) { + if (!iterable) return []; + // In Safari, only use the `toArray` method if it's not a NodeList. + // A NodeList is a function, has an function `item` property, and a numeric + // `length` property. Adapted from Google Doctype. + if (!(typeof iterable === 'function' && typeof iterable.length === + 'number' && typeof iterable.item === 'function') && iterable.toArray) + return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); + while (length--) results[length] = iterable[length]; + return results; + }; +} + +Array.from = $A; + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(Object.isArray(value) ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + reduce: function() { + return this.length > 1 ? this : this[0]; + }, + + uniq: function(sorted) { + return this.inject([], function(array, value, index) { + if (0 == index || (sorted ? array.last() != value : !array.include(value))) + array.push(value); + return array; + }); + }, + + intersect: function(array) { + return this.uniq().findAll(function(item) { + return array.detect(function(value) { return item === value }); + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + }, + + toJSON: function() { + var results = []; + this.each(function(object) { + var value = Object.toJSON(object); + if (!Object.isUndefined(value)) results.push(value); + }); + return '[' + results.join(', ') + ']'; + } +}); + +// use native browser JS 1.6 implementation if available +if (Object.isFunction(Array.prototype.forEach)) + Array.prototype._each = Array.prototype.forEach; + +if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { + i || (i = 0); + var length = this.length; + if (i < 0) i = length + i; + for (; i < length; i++) + if (this[i] === item) return i; + return -1; +}; + +if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { + i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; + var n = this.slice(0, i).reverse().indexOf(item); + return (n < 0) ? n : i - n - 1; +}; + +Array.prototype.toArray = Array.prototype.clone; + +function $w(string) { + if (!Object.isString(string)) return []; + string = string.strip(); + return string ? string.split(/\s+/) : []; +} + +if (Prototype.Browser.Opera){ + Array.prototype.concat = function() { + var array = []; + for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for (var i = 0, length = arguments.length; i < length; i++) { + if (Object.isArray(arguments[i])) { + for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + }; +} +Object.extend(Number.prototype, { + toColorPart: function() { + return this.toPaddedString(2, 16); + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator, context) { + $R(0, this, true).each(iterator, context); + return this; + }, + + toPaddedString: function(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; + }, + + toJSON: function() { + return isFinite(this) ? this.toString() : 'null'; + } +}); + +$w('abs round ceil floor').each(function(method){ + Number.prototype[method] = Math[method].methodize(); +}); +function $H(object) { + return new Hash(object); +}; + +var Hash = Class.create(Enumerable, (function() { + + function toQueryPair(key, value) { + if (Object.isUndefined(value)) return key; + return key + '=' + encodeURIComponent(String.interpret(value)); + } + + return { + initialize: function(object) { + this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); + }, + + _each: function(iterator) { + for (var key in this._object) { + var value = this._object[key], pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + set: function(key, value) { + return this._object[key] = value; + }, + + get: function(key) { + // simulating poorly supported hasOwnProperty + if (this._object[key] !== Object.prototype[key]) + return this._object[key]; + }, + + unset: function(key) { + var value = this._object[key]; + delete this._object[key]; + return value; + }, + + toObject: function() { + return Object.clone(this._object); + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + index: function(value) { + var match = this.detect(function(pair) { + return pair.value === value; + }); + return match && match.key; + }, + + merge: function(object) { + return this.clone().update(object); + }, + + update: function(object) { + return new Hash(object).inject(this, function(result, pair) { + result.set(pair.key, pair.value); + return result; + }); + }, + + toQueryString: function() { + return this.inject([], function(results, pair) { + var key = encodeURIComponent(pair.key), values = pair.value; + + if (values && typeof values == 'object') { + if (Object.isArray(values)) + return results.concat(values.map(toQueryPair.curry(key))); + } else results.push(toQueryPair(key, values)); + return results; + }).join('&'); + }, + + inspect: function() { + return '#'; + }, + + toJSON: function() { + return Object.toJSON(this.toObject()); + }, + + clone: function() { + return new Hash(this); + } + } +})()); + +Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; +Hash.from = $H; +var ObjectRange = Class.create(Enumerable, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + while (this.include(value)) { + iterator(value); + value = value.succ(); + } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +}; + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +}; + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); + }, + + unregister: function(responder) { + this.responders = this.responders.without(responder); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (Object.isFunction(responder[callback])) { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) { } + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { Ajax.activeRequestCount++ }, + onComplete: function() { Ajax.activeRequestCount-- } +}); + +Ajax.Base = Class.create({ + initialize: function(options) { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '', + evalJSON: true, + evalJS: true + }; + Object.extend(this.options, options || { }); + + this.options.method = this.options.method.toLowerCase(); + + if (Object.isString(this.options.parameters)) + this.options.parameters = this.options.parameters.toQueryParams(); + else if (Object.isHash(this.options.parameters)) + this.options.parameters = this.options.parameters.toObject(); + } +}); + +Ajax.Request = Class.create(Ajax.Base, { + _complete: false, + + initialize: function($super, url, options) { + $super(options); + this.transport = Ajax.getTransport(); + this.request(url); + }, + + request: function(url) { + this.url = url; + this.method = this.options.method; + var params = Object.clone(this.options.parameters); + + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] = this.method; + this.method = 'post'; + } + + this.parameters = params; + + if (params = Object.toQueryString(params)) { + // when GET, append parameters to URL + if (this.method == 'get') + this.url += (this.url.include('?') ? '&' : '?') + params; + else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + params += '&_='; + } + + try { + var response = new Ajax.Response(this); + if (this.options.onCreate) this.options.onCreate(response); + Ajax.Responders.dispatch('onCreate', this, response); + + this.transport.open(this.method.toUpperCase(), this.url, + this.options.asynchronous); + + if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); + + this.transport.onreadystatechange = this.onStateChange.bind(this); + this.setRequestHeaders(); + + this.body = this.method == 'post' ? (this.options.postBody || params) : null; + this.transport.send(this.body); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { + this.dispatchException(e); + } + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState > 1 && !((readyState == 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + + setRequestHeaders: function() { + var headers = { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }; + + if (this.method == 'post') { + headers['Content-type'] = this.options.contentType + + (this.options.encoding ? '; charset=' + this.options.encoding : ''); + + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) + headers['Connection'] = 'close'; + } + + // user-defined headers + if (typeof this.options.requestHeaders == 'object') { + var extras = this.options.requestHeaders; + + if (Object.isFunction(extras.push)) + for (var i = 0, length = extras.length; i < length; i += 2) + headers[extras[i]] = extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] = pair.value }); + } + + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); + }, + + success: function() { + var status = this.getStatus(); + return !status || (status >= 200 && status < 300); + }, + + getStatus: function() { + try { + return this.transport.status || 0; + } catch (e) { return 0 } + }, + + respondToReadyState: function(readyState) { + var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); + + if (state == 'Complete') { + try { + this._complete = true; + (this.options['on' + response.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + var contentType = response.getHeader('Content-type'); + if (this.options.evalJS == 'force' + || (this.options.evalJS && this.isSameOrigin() && contentType + && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) + this.evalResponse(); + } + + try { + (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); + Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); + } catch (e) { + this.dispatchException(e); + } + + if (state == 'Complete') { + // avoid memory leak in MSIE: clean up + this.transport.onreadystatechange = Prototype.emptyFunction; + } + }, + + isSameOrigin: function() { + var m = this.url.match(/^\s*https?:\/\/[^\/]*/); + return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ + protocol: location.protocol, + domain: document.domain, + port: location.port ? ':' + location.port : '' + })); + }, + + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name) || null; + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval((this.transport.responseText || '').unfilterJSON()); + } catch (e) { + this.dispatchException(e); + } + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Response = Class.create({ + initialize: function(request){ + this.request = request; + var transport = this.transport = request.transport, + readyState = this.readyState = transport.readyState; + + if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { + this.status = this.getStatus(); + this.statusText = this.getStatusText(); + this.responseText = String.interpret(transport.responseText); + this.headerJSON = this._getHeaderJSON(); + } + + if(readyState == 4) { + var xml = transport.responseXML; + this.responseXML = Object.isUndefined(xml) ? null : xml; + this.responseJSON = this._getResponseJSON(); + } + }, + + status: 0, + statusText: '', + + getStatus: Ajax.Request.prototype.getStatus, + + getStatusText: function() { + try { + return this.transport.statusText || ''; + } catch (e) { return '' } + }, + + getHeader: Ajax.Request.prototype.getHeader, + + getAllHeaders: function() { + try { + return this.getAllResponseHeaders(); + } catch (e) { return null } + }, + + getResponseHeader: function(name) { + return this.transport.getResponseHeader(name); + }, + + getAllResponseHeaders: function() { + return this.transport.getAllResponseHeaders(); + }, + + _getHeaderJSON: function() { + var json = this.getHeader('X-JSON'); + if (!json) return null; + json = decodeURIComponent(escape(json)); + try { + return json.evalJSON(this.request.options.sanitizeJSON || + !this.request.isSameOrigin()); + } catch (e) { + this.request.dispatchException(e); + } + }, + + _getResponseJSON: function() { + var options = this.request.options; + if (!options.evalJSON || (options.evalJSON != 'force' && + !(this.getHeader('Content-type') || '').include('application/json')) || + this.responseText.blank()) + return null; + try { + return this.responseText.evalJSON(options.sanitizeJSON || + !this.request.isSameOrigin()); + } catch (e) { + this.request.dispatchException(e); + } + } +}); + +Ajax.Updater = Class.create(Ajax.Request, { + initialize: function($super, container, url, options) { + this.container = { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container)) + }; + + options = Object.clone(options); + var onComplete = options.onComplete; + options.onComplete = (function(response, json) { + this.updateContent(response.responseText); + if (Object.isFunction(onComplete)) onComplete(response, json); + }).bind(this); + + $super(url, options); + }, + + updateContent: function(responseText) { + var receiver = this.container[this.success() ? 'success' : 'failure'], + options = this.options; + + if (!options.evalScripts) responseText = responseText.stripScripts(); + + if (receiver = $(receiver)) { + if (options.insertion) { + if (Object.isString(options.insertion)) { + var insertion = { }; insertion[options.insertion] = responseText; + receiver.insert(insertion); + } + else options.insertion(receiver, responseText); + } + else receiver.update(responseText); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { + initialize: function($super, container, url, options) { + $super(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = { }; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.options.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(response) { + if (this.options.decay) { + this.decay = (response.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = response.responseText; + } + this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $(element) { + if (arguments.length > 1) { + for (var i = 0, elements = [], length = arguments.length; i < length; i++) + elements.push($(arguments[i])); + return elements; + } + if (Object.isString(element)) + element = document.getElementById(element); + return Element.extend(element); +} + +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath = function(expression, parentElement) { + var results = []; + var query = document.evaluate(expression, $(parentElement) || document, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0, length = query.snapshotLength; i < length; i++) + results.push(Element.extend(query.snapshotItem(i))); + return results; + }; +} + +/*--------------------------------------------------------------------------*/ + +if (!window.Node) var Node = { }; + +if (!Node.ELEMENT_NODE) { + // DOM level 2 ECMAScript Language Binding + Object.extend(Node, { + ELEMENT_NODE: 1, + ATTRIBUTE_NODE: 2, + TEXT_NODE: 3, + CDATA_SECTION_NODE: 4, + ENTITY_REFERENCE_NODE: 5, + ENTITY_NODE: 6, + PROCESSING_INSTRUCTION_NODE: 7, + COMMENT_NODE: 8, + DOCUMENT_NODE: 9, + DOCUMENT_TYPE_NODE: 10, + DOCUMENT_FRAGMENT_NODE: 11, + NOTATION_NODE: 12 + }); +} + +(function() { + var element = this.Element; + this.Element = function(tagName, attributes) { + attributes = attributes || { }; + tagName = tagName.toLowerCase(); + var cache = Element.cache; + if (Prototype.Browser.IE && attributes.name) { + tagName = '<' + tagName + ' name="' + attributes.name + '">'; + delete attributes.name; + return Element.writeAttribute(document.createElement(tagName), attributes); + } + if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); + return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); + }; + Object.extend(this.Element, element || { }); + if (element) this.Element.prototype = element.prototype; +}).call(window); + +Element.cache = { }; + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function(element) { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function(element) { + element = $(element); + element.style.display = 'none'; + return element; + }, + + show: function(element) { + element = $(element); + element.style.display = ''; + return element; + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + content = Object.toHTML(content); + element.innerHTML = content.stripScripts(); + content.evalScripts.bind(content).defer(); + return element; + }, + + replace: function(element, content) { + element = $(element); + if (content && content.toElement) content = content.toElement(); + else if (!Object.isElement(content)) { + content = Object.toHTML(content); + var range = element.ownerDocument.createRange(); + range.selectNode(element); + content.evalScripts.bind(content).defer(); + content = range.createContextualFragment(content.stripScripts()); + } + element.parentNode.replaceChild(content, element); + return element; + }, + + insert: function(element, insertions) { + element = $(element); + + if (Object.isString(insertions) || Object.isNumber(insertions) || + Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) + insertions = {bottom:insertions}; + + var content, insert, tagName, childNodes; + + for (var position in insertions) { + content = insertions[position]; + position = position.toLowerCase(); + insert = Element._insertionTranslations[position]; + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + insert(element, content); + continue; + } + + content = Object.toHTML(content); + + tagName = ((position == 'before' || position == 'after') + ? element.parentNode : element).tagName.toUpperCase(); + + childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + + if (position == 'top' || position == 'after') childNodes.reverse(); + childNodes.each(insert.curry(element)); + + content.evalScripts.bind(content).defer(); + } + + return element; + }, + + wrap: function(element, wrapper, attributes) { + element = $(element); + if (Object.isElement(wrapper)) + $(wrapper).writeAttribute(attributes || { }); + else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); + else wrapper = new Element('div', wrapper); + if (element.parentNode) + element.parentNode.replaceChild(wrapper, element); + wrapper.appendChild(element); + return wrapper; + }, + + inspect: function(element) { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if (value) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element = $(element); + var elements = []; + while (element = element[property]) + if (element.nodeType == 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $(element).select("*"); + }, + + firstDescendant: function(element) { + element = $(element).firstChild; + while (element && element.nodeType != 1) element = element.nextSibling; + return $(element); + }, + + immediateDescendants: function(element) { + if (!(element = $(element).firstChild)) return []; + while (element && element.nodeType != 1) element = element.nextSibling; + if (element) return [element].concat($(element).nextSiblings()); + return []; + }, + + previousSiblings: function(element) { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function(element) { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function(element) { + element = $(element); + return element.previousSiblings().reverse().concat(element.nextSiblings()); + }, + + match: function(element, selector) { + if (Object.isString(selector)) + selector = new Selector(selector); + return selector.match($(element)); + }, + + up: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(element.parentNode); + var ancestors = element.ancestors(); + return Object.isNumber(expression) ? ancestors[expression] : + Selector.findElement(ancestors, expression, index); + }, + + down: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return element.firstDescendant(); + return Object.isNumber(expression) ? element.descendants()[expression] : + Element.select(element, expression)[index || 0]; + }, + + previous: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); + var previousSiblings = element.previousSiblings(); + return Object.isNumber(expression) ? previousSiblings[expression] : + Selector.findElement(previousSiblings, expression, index); + }, + + next: function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); + var nextSiblings = element.nextSiblings(); + return Object.isNumber(expression) ? nextSiblings[expression] : + Selector.findElement(nextSiblings, expression, index); + }, + + select: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element, args); + }, + + adjacent: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element.parentNode, args).without(element); + }, + + identify: function(element) { + element = $(element); + var id = element.readAttribute('id'), self = arguments.callee; + if (id) return id; + do { id = 'anonymous_element_' + self.counter++ } while ($(id)); + element.writeAttribute('id', id); + return id; + }, + + readAttribute: function(element, name) { + element = $(element); + if (Prototype.Browser.IE) { + var t = Element._attributeTranslations.read; + if (t.values[name]) return t.values[name](element, name); + if (t.names[name]) name = t.names[name]; + if (name.include(':')) { + return (!element.attributes || !element.attributes[name]) ? null : + element.attributes[name].value; + } + } + return element.getAttribute(name); + }, + + writeAttribute: function(element, name, value) { + element = $(element); + var attributes = { }, t = Element._attributeTranslations.write; + + if (typeof name == 'object') attributes = name; + else attributes[name] = Object.isUndefined(value) ? true : value; + + for (var attr in attributes) { + name = t.names[attr] || attr; + value = attributes[attr]; + if (t.values[attr]) name = t.values[attr](element, value); + if (value === false || value === null) + element.removeAttribute(name); + else if (value === true) + element.setAttribute(name, name); + else element.setAttribute(name, value); + } + return element; + }, + + getHeight: function(element) { + return $(element).getDimensions().height; + }, + + getWidth: function(element) { + return $(element).getDimensions().width; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + var elementClassName = element.className; + return (elementClassName.length > 0 && (elementClassName == className || + new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + if (!element.hasClassName(className)) + element.className += (element.className ? ' ' : '') + className; + return element; + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + element.className = element.className.replace( + new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); + return element; + }, + + toggleClassName: function(element, className) { + if (!(element = $(element))) return; + return element[element.hasClassName(className) ? + 'removeClassName' : 'addClassName'](className); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + var node = element.firstChild; + while (node) { + var nextNode = node.nextSibling; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + element.removeChild(node); + node = nextNode; + } + return element; + }, + + empty: function(element) { + return $(element).innerHTML.blank(); + }, + + descendantOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + + if (element.compareDocumentPosition) + return (element.compareDocumentPosition(ancestor) & 8) === 8; + + if (ancestor.contains) + return ancestor.contains(element) && ancestor !== element; + + while (element = element.parentNode) + if (element == ancestor) return true; + + return false; + }, + + scrollTo: function(element) { + element = $(element); + var pos = element.cumulativeOffset(); + window.scrollTo(pos[0], pos[1]); + return element; + }, + + getStyle: function(element, style) { + element = $(element); + style = style == 'float' ? 'cssFloat' : style.camelize(); + var value = element.style[style]; + if (!value || value == 'auto') { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css[style] : null; + } + if (style == 'opacity') return value ? parseFloat(value) : 1.0; + return value == 'auto' ? null : value; + }, + + getOpacity: function(element) { + return $(element).getStyle('opacity'); + }, + + setStyle: function(element, styles) { + element = $(element); + var elementStyle = element.style, match; + if (Object.isString(styles)) { + element.style.cssText += ';' + styles; + return styles.include('opacity') ? + element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; + } + for (var property in styles) + if (property == 'opacity') element.setOpacity(styles[property]); + else + elementStyle[(property == 'float' || property == 'cssFloat') ? + (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : + property] = styles[property]; + + return element; + }, + + setOpacity: function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + return element; + }, + + getDimensions: function(element) { + element = $(element); + var display = element.getStyle('display'); + if (display != 'none' && display != null) // Safari bug + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + var originalDisplay = els.display; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = 'block'; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = originalDisplay; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (Prototype.Browser.Opera) { + element.style.top = 0; + element.style.left = 0; + } + } + return element; + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + return element; + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return element; + element._overflow = Element.getStyle(element, 'overflow') || 'auto'; + if (element._overflow !== 'hidden') + element.style.overflow = 'hidden'; + return element; + }, + + undoClipping: function(element) { + element = $(element); + if (!element._overflow) return element; + element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; + element._overflow = null; + return element; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + if (element.tagName.toUpperCase() == 'BODY') break; + var p = Element.getStyle(element, 'position'); + if (p !== 'static') break; + } + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + absolutize: function(element) { + element = $(element); + if (element.getStyle('position') == 'absolute') return element; + // Position.prepare(); // To be done manually by Scripty when it needs it. + + var offsets = element.positionedOffset(); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.width = width + 'px'; + element.style.height = height + 'px'; + return element; + }, + + relativize: function(element) { + element = $(element); + if (element.getStyle('position') == 'relative') return element; + // Position.prepare(); // To be done manually by Scripty when it needs it. + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + return element; + }, + + cumulativeScrollOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return Element._returnOffset(valueL, valueT); + }, + + getOffsetParent: function(element) { + if (element.offsetParent) return $(element.offsetParent); + if (element == document.body) return $(element); + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return $(element); + + return $(document.body); + }, + + viewportOffset: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent == document.body && + Element.getStyle(element, 'position') == 'absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } + } while (element = element.parentNode); + + return Element._returnOffset(valueL, valueT); + }, + + clonePosition: function(element, source) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || { }); + + // find page position of source + source = $(source); + var p = source.viewportOffset(); + + // find coordinate system to use + element = $(element); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(element, 'position') == 'absolute') { + parent = element.getOffsetParent(); + delta = parent.viewportOffset(); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if (options.setWidth) element.style.width = source.offsetWidth + 'px'; + if (options.setHeight) element.style.height = source.offsetHeight + 'px'; + return element; + } +}; + +Element.Methods.identify.counter = 1; + +Object.extend(Element.Methods, { + getElementsBySelector: Element.Methods.select, + childElements: Element.Methods.immediateDescendants +}); + +Element._attributeTranslations = { + write: { + names: { + className: 'class', + htmlFor: 'for' + }, + values: { } + } +}; + +if (Prototype.Browser.Opera) { + Element.Methods.getStyle = Element.Methods.getStyle.wrap( + function(proceed, element, style) { + switch (style) { + case 'left': case 'top': case 'right': case 'bottom': + if (proceed(element, 'position') === 'static') return null; + case 'height': case 'width': + // returns '0px' for hidden elements; we want it to return null + if (!Element.visible(element)) return null; + + // returns the border-box dimensions rather than the content-box + // dimensions, so we subtract padding and borders from the value + var dim = parseInt(proceed(element, style), 10); + + if (dim !== element['offset' + style.capitalize()]) + return dim + 'px'; + + var properties; + if (style === 'height') { + properties = ['border-top-width', 'padding-top', + 'padding-bottom', 'border-bottom-width']; + } + else { + properties = ['border-left-width', 'padding-left', + 'padding-right', 'border-right-width']; + } + return properties.inject(dim, function(memo, property) { + var val = proceed(element, property); + return val === null ? memo : memo - parseInt(val, 10); + }) + 'px'; + default: return proceed(element, style); + } + } + ); + + Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( + function(proceed, element, attribute) { + if (attribute === 'title') return element.title; + return proceed(element, attribute); + } + ); +} + +else if (Prototype.Browser.IE) { + // IE doesn't report offsets correctly for static elements, so we change them + // to "relative" to get the values, then change them back. + Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( + function(proceed, element) { + element = $(element); + // IE throws an error if element is not in document + try { element.offsetParent } + catch(e) { return $(document.body) } + var position = element.getStyle('position'); + if (position !== 'static') return proceed(element); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + + $w('positionedOffset viewportOffset').each(function(method) { + Element.Methods[method] = Element.Methods[method].wrap( + function(proceed, element) { + element = $(element); + try { element.offsetParent } + catch(e) { return Element._returnOffset(0,0) } + var position = element.getStyle('position'); + if (position !== 'static') return proceed(element); + // Trigger hasLayout on the offset parent so that IE6 reports + // accurate offsetTop and offsetLeft values for position: fixed. + var offsetParent = element.getOffsetParent(); + if (offsetParent && offsetParent.getStyle('position') === 'fixed') + offsetParent.setStyle({ zoom: 1 }); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + }); + + Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap( + function(proceed, element) { + try { element.offsetParent } + catch(e) { return Element._returnOffset(0,0) } + return proceed(element); + } + ); + + Element.Methods.getStyle = function(element, style) { + element = $(element); + style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); + var value = element.style[style]; + if (!value && element.currentStyle) value = element.currentStyle[style]; + + if (style == 'opacity') { + if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) + if (value[1]) return parseFloat(value[1]) / 100; + return 1.0; + } + + if (value == 'auto') { + if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) + return element['offset' + style.capitalize()] + 'px'; + return null; + } + return value; + }; + + Element.Methods.setOpacity = function(element, value) { + function stripAlpha(filter){ + return filter.replace(/alpha\([^\)]*\)/gi,''); + } + element = $(element); + var currentStyle = element.currentStyle; + if ((currentStyle && !currentStyle.hasLayout) || + (!currentStyle && element.style.zoom == 'normal')) + element.style.zoom = 1; + + var filter = element.getStyle('filter'), style = element.style; + if (value == 1 || value === '') { + (filter = stripAlpha(filter)) ? + style.filter = filter : style.removeAttribute('filter'); + return element; + } else if (value < 0.00001) value = 0; + style.filter = stripAlpha(filter) + + 'alpha(opacity=' + (value * 100) + ')'; + return element; + }; + + Element._attributeTranslations = { + read: { + names: { + 'class': 'className', + 'for': 'htmlFor' + }, + values: { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + _getAttrNode: function(element, attribute) { + var node = element.getAttributeNode(attribute); + return node ? node.value : ""; + }, + _getEv: function(element, attribute) { + attribute = element.getAttribute(attribute); + return attribute ? attribute.toString().slice(23, -2) : null; + }, + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + title: function(element) { + return element.title; + } + } + } + }; + + Element._attributeTranslations.write = { + names: Object.extend({ + cellpadding: 'cellPadding', + cellspacing: 'cellSpacing' + }, Element._attributeTranslations.read.names), + values: { + checked: function(element, value) { + element.checked = !!value; + }, + + style: function(element, value) { + element.style.cssText = value ? value : ''; + } + } + }; + + Element._attributeTranslations.has = {}; + + $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + + 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { + Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; + Element._attributeTranslations.has[attr.toLowerCase()] = attr; + }); + + (function(v) { + Object.extend(v, { + href: v._getAttr, + src: v._getAttr, + type: v._getAttr, + action: v._getAttrNode, + disabled: v._flag, + checked: v._flag, + readonly: v._flag, + multiple: v._flag, + onload: v._getEv, + onunload: v._getEv, + onclick: v._getEv, + ondblclick: v._getEv, + onmousedown: v._getEv, + onmouseup: v._getEv, + onmouseover: v._getEv, + onmousemove: v._getEv, + onmouseout: v._getEv, + onfocus: v._getEv, + onblur: v._getEv, + onkeypress: v._getEv, + onkeydown: v._getEv, + onkeyup: v._getEv, + onsubmit: v._getEv, + onreset: v._getEv, + onselect: v._getEv, + onchange: v._getEv + }); + })(Element._attributeTranslations.read.values); +} + +else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1) ? 0.999999 : + (value === '') ? '' : (value < 0.00001) ? 0 : value; + return element; + }; +} + +else if (Prototype.Browser.WebKit) { + Element.Methods.setOpacity = function(element, value) { + element = $(element); + element.style.opacity = (value == 1 || value === '') ? '' : + (value < 0.00001) ? 0 : value; + + if (value == 1) + if(element.tagName.toUpperCase() == 'IMG' && element.width) { + element.width++; element.width--; + } else try { + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch (e) { } + + return element; + }; + + // Safari returns margins on body which is incorrect if the child is absolutely + // positioned. For performance reasons, redefine Element#cumulativeOffset for + // KHTML/WebKit only. + Element.Methods.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return Element._returnOffset(valueL, valueT); + }; +} + +if (Prototype.Browser.IE || Prototype.Browser.Opera) { + // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements + Element.Methods.update = function(element, content) { + element = $(element); + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) return element.update().insert(content); + + content = Object.toHTML(content); + var tagName = element.tagName.toUpperCase(); + + if (tagName in Element._insertionTranslations.tags) { + $A(element.childNodes).each(function(node) { element.removeChild(node) }); + Element._getContentFromAnonymousElement(tagName, content.stripScripts()) + .each(function(node) { element.appendChild(node) }); + } + else element.innerHTML = content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +if ('outerHTML' in document.createElement('div')) { + Element.Methods.replace = function(element, content) { + element = $(element); + + if (content && content.toElement) content = content.toElement(); + if (Object.isElement(content)) { + element.parentNode.replaceChild(content, element); + return element; + } + + content = Object.toHTML(content); + var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); + + if (Element._insertionTranslations.tags[tagName]) { + var nextSibling = element.next(); + var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + parent.removeChild(element); + if (nextSibling) + fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); + else + fragments.each(function(node) { parent.appendChild(node) }); + } + else element.outerHTML = content.stripScripts(); + + content.evalScripts.bind(content).defer(); + return element; + }; +} + +Element._returnOffset = function(l, t) { + var result = [l, t]; + result.left = l; + result.top = t; + return result; +}; + +Element._getContentFromAnonymousElement = function(tagName, html) { + var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; + if (t) { + div.innerHTML = t[0] + html + t[1]; + t[2].times(function() { div = div.firstChild }); + } else div.innerHTML = html; + return $A(div.childNodes); +}; + +Element._insertionTranslations = { + before: function(element, node) { + element.parentNode.insertBefore(node, element); + }, + top: function(element, node) { + element.insertBefore(node, element.firstChild); + }, + bottom: function(element, node) { + element.appendChild(node); + }, + after: function(element, node) { + element.parentNode.insertBefore(node, element.nextSibling); + }, + tags: { + TABLE: ['', '
    ', 1], + TBODY: ['', '
    ', 2], + TR: ['', '
    ', 3], + TD: ['
    ', '
    ', 4], + SELECT: ['', 1] + } +}; + +(function() { + Object.extend(this.tags, { + THEAD: this.tags.TBODY, + TFOOT: this.tags.TBODY, + TH: this.tags.TD + }); +}).call(Element._insertionTranslations); + +Element.Methods.Simulated = { + hasAttribute: function(element, attribute) { + attribute = Element._attributeTranslations.has[attribute] || attribute; + var node = $(element).getAttributeNode(attribute); + return !!(node && node.specified); + } +}; + +Element.Methods.ByTag = { }; + +Object.extend(Element, Element.Methods); + +if (!Prototype.BrowserFeatures.ElementExtensions && + document.createElement('div')['__proto__']) { + window.HTMLElement = { }; + window.HTMLElement.prototype = document.createElement('div')['__proto__']; + Prototype.BrowserFeatures.ElementExtensions = true; +} + +Element.extend = (function() { + if (Prototype.BrowserFeatures.SpecificElementExtensions) + return Prototype.K; + + var Methods = { }, ByTag = Element.Methods.ByTag; + + var extend = Object.extend(function(element) { + if (!element || element._extendedByPrototype || + element.nodeType != 1 || element == window) return element; + + var methods = Object.clone(Methods), + tagName = element.tagName.toUpperCase(), property, value; + + // extend methods for specific tags + if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); + + for (property in methods) { + value = methods[property]; + if (Object.isFunction(value) && !(property in element)) + element[property] = value.methodize(); + } + + element._extendedByPrototype = Prototype.emptyFunction; + return element; + + }, { + refresh: function() { + // extend methods for all tags (Safari doesn't need this) + if (!Prototype.BrowserFeatures.ElementExtensions) { + Object.extend(Methods, Element.Methods); + Object.extend(Methods, Element.Methods.Simulated); + } + } + }); + + extend.refresh(); + return extend; +})(); + +Element.hasAttribute = function(element, attribute) { + if (element.hasAttribute) return element.hasAttribute(attribute); + return Element.Methods.Simulated.hasAttribute(element, attribute); +}; + +Element.addMethods = function(methods) { + var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; + + if (!methods) { + Object.extend(Form, Form.Methods); + Object.extend(Form.Element, Form.Element.Methods); + Object.extend(Element.Methods.ByTag, { + "FORM": Object.clone(Form.Methods), + "INPUT": Object.clone(Form.Element.Methods), + "SELECT": Object.clone(Form.Element.Methods), + "TEXTAREA": Object.clone(Form.Element.Methods) + }); + } + + if (arguments.length == 2) { + var tagName = methods; + methods = arguments[1]; + } + + if (!tagName) Object.extend(Element.Methods, methods || { }); + else { + if (Object.isArray(tagName)) tagName.each(extend); + else extend(tagName); + } + + function extend(tagName) { + tagName = tagName.toUpperCase(); + if (!Element.Methods.ByTag[tagName]) + Element.Methods.ByTag[tagName] = { }; + Object.extend(Element.Methods.ByTag[tagName], methods); + } + + function copy(methods, destination, onlyIfAbsent) { + onlyIfAbsent = onlyIfAbsent || false; + for (var property in methods) { + var value = methods[property]; + if (!Object.isFunction(value)) continue; + if (!onlyIfAbsent || !(property in destination)) + destination[property] = value.methodize(); + } + } + + function findDOMClass(tagName) { + var klass; + var trans = { + "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", + "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", + "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", + "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", + "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": + "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": + "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": + "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": + "FrameSet", "IFRAME": "IFrame" + }; + if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName + 'Element'; + if (window[klass]) return window[klass]; + klass = 'HTML' + tagName.capitalize() + 'Element'; + if (window[klass]) return window[klass]; + + window[klass] = { }; + window[klass].prototype = document.createElement(tagName)['__proto__']; + return window[klass]; + } + + if (F.ElementExtensions) { + copy(Element.Methods, HTMLElement.prototype); + copy(Element.Methods.Simulated, HTMLElement.prototype, true); + } + + if (F.SpecificElementExtensions) { + for (var tag in Element.Methods.ByTag) { + var klass = findDOMClass(tag); + if (Object.isUndefined(klass)) continue; + copy(T[tag], klass.prototype); + } + } + + Object.extend(Element, Element.Methods); + delete Element.ByTag; + + if (Element.extend.refresh) Element.extend.refresh(); + Element.cache = { }; +}; + +document.viewport = { + getDimensions: function() { + var dimensions = { }, B = Prototype.Browser; + $w('width height').each(function(d) { + var D = d.capitalize(); + if (B.WebKit && !document.evaluate) { + // Safari <3.0 needs self.innerWidth/Height + dimensions[d] = self['inner' + D]; + } else if (B.Opera && parseFloat(window.opera.version()) < 9.5) { + // Opera <9.5 needs document.body.clientWidth/Height + dimensions[d] = document.body['client' + D] + } else { + dimensions[d] = document.documentElement['client' + D]; + } + }); + return dimensions; + }, + + getWidth: function() { + return this.getDimensions().width; + }, + + getHeight: function() { + return this.getDimensions().height; + }, + + getScrollOffsets: function() { + return Element._returnOffset( + window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, + window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + } +}; +/* Portions of the Selector class are derived from Jack Slocum's DomQuery, + * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style + * license. Please see http://www.yui-ext.com/ for more information. */ + +var Selector = Class.create({ + initialize: function(expression) { + this.expression = expression.strip(); + + if (this.shouldUseSelectorsAPI()) { + this.mode = 'selectorsAPI'; + } else if (this.shouldUseXPath()) { + this.mode = 'xpath'; + this.compileXPathMatcher(); + } else { + this.mode = "normal"; + this.compileMatcher(); + } + + }, + + shouldUseXPath: function() { + if (!Prototype.BrowserFeatures.XPath) return false; + + var e = this.expression; + + // Safari 3 chokes on :*-of-type and :empty + if (Prototype.Browser.WebKit && + (e.include("-of-type") || e.include(":empty"))) + return false; + + // XPath can't do namespaced attributes, nor can it read + // the "checked" property from DOM nodes + if ((/(\[[\w-]*?:|:checked)/).test(e)) + return false; + + return true; + }, + + shouldUseSelectorsAPI: function() { + if (!Prototype.BrowserFeatures.SelectorsAPI) return false; + + if (!Selector._div) Selector._div = new Element('div'); + + // Make sure the browser treats the selector as valid. Test on an + // isolated element to minimize cost of this check. + try { + Selector._div.querySelector(this.expression); + } catch(e) { + return false; + } + + return true; + }, + + compileMatcher: function() { + var e = this.expression, ps = Selector.patterns, h = Selector.handlers, + c = Selector.criteria, le, p, m; + + if (Selector._cache[e]) { + this.matcher = Selector._cache[e]; + return; + } + + this.matcher = ["this.matcher = function(root) {", + "var r = root, h = Selector.handlers, c = false, n;"]; + + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : + new Template(c[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.matcher.push("return h.unique(n);\n}"); + eval(this.matcher.join('\n')); + Selector._cache[this.expression] = this.matcher; + }, + + compileXPathMatcher: function() { + var e = this.expression, ps = Selector.patterns, + x = Selector.xpath, le, m; + + if (Selector._cache[e]) { + this.xpath = Selector._cache[e]; return; + } + + this.matcher = ['.//*']; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + if (m = e.match(ps[i])) { + this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : + new Template(x[i]).evaluate(m)); + e = e.replace(m[0], ''); + break; + } + } + } + + this.xpath = this.matcher.join(''); + Selector._cache[this.expression] = this.xpath; + }, + + findElements: function(root) { + root = root || document; + var e = this.expression, results; + + switch (this.mode) { + case 'selectorsAPI': + // querySelectorAll queries document-wide, then filters to descendants + // of the context element. That's not what we want. + // Add an explicit context to the selector if necessary. + if (root !== document) { + var oldId = root.id, id = $(root).identify(); + e = "#" + id + " " + e; + } + + results = $A(root.querySelectorAll(e)).map(Element.extend); + root.id = oldId; + + return results; + case 'xpath': + return document._getElementsByXPath(this.xpath, root); + default: + return this.matcher(root); + } + }, + + match: function(element) { + this.tokens = []; + + var e = this.expression, ps = Selector.patterns, as = Selector.assertions; + var le, p, m; + + while (e && le !== e && (/\S/).test(e)) { + le = e; + for (var i in ps) { + p = ps[i]; + if (m = e.match(p)) { + // use the Selector.assertions methods unless the selector + // is too complex. + if (as[i]) { + this.tokens.push([i, Object.clone(m)]); + e = e.replace(m[0], ''); + } else { + // reluctantly do a document-wide search + // and look for a match in the array + return this.findElements(document).include(element); + } + } + } + } + + var match = true, name, matches; + for (var i = 0, token; token = this.tokens[i]; i++) { + name = token[0], matches = token[1]; + if (!Selector.assertions[name](element, matches)) { + match = false; break; + } + } + + return match; + }, + + toString: function() { + return this.expression; + }, + + inspect: function() { + return "#"; + } +}); + +Object.extend(Selector, { + _cache: { }, + + xpath: { + descendant: "//*", + child: "/*", + adjacent: "/following-sibling::*[1]", + laterSibling: '/following-sibling::*', + tagName: function(m) { + if (m[1] == '*') return ''; + return "[local-name()='" + m[1].toLowerCase() + + "' or local-name()='" + m[1].toUpperCase() + "']"; + }, + className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", + id: "[@id='#{1}']", + attrPresence: function(m) { + m[1] = m[1].toLowerCase(); + return new Template("[@#{1}]").evaluate(m); + }, + attr: function(m) { + m[1] = m[1].toLowerCase(); + m[3] = m[5] || m[6]; + return new Template(Selector.xpath.operators[m[2]]).evaluate(m); + }, + pseudo: function(m) { + var h = Selector.xpath.pseudos[m[1]]; + if (!h) return ''; + if (Object.isFunction(h)) return h(m); + return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); + }, + operators: { + '=': "[@#{1}='#{3}']", + '!=': "[@#{1}!='#{3}']", + '^=': "[starts-with(@#{1}, '#{3}')]", + '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", + '*=': "[contains(@#{1}, '#{3}')]", + '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", + '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" + }, + pseudos: { + 'first-child': '[not(preceding-sibling::*)]', + 'last-child': '[not(following-sibling::*)]', + 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', + 'empty': "[count(*) = 0 and (count(text()) = 0)]", + 'checked': "[@checked]", + 'disabled': "[(@disabled) and (@type!='hidden')]", + 'enabled': "[not(@disabled) and (@type!='hidden')]", + 'not': function(m) { + var e = m[6], p = Selector.patterns, + x = Selector.xpath, le, v; + + var exclusion = []; + while (e && le != e && (/\S/).test(e)) { + le = e; + for (var i in p) { + if (m = e.match(p[i])) { + v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); + exclusion.push("(" + v.substring(1, v.length - 1) + ")"); + e = e.replace(m[0], ''); + break; + } + } + } + return "[not(" + exclusion.join(" and ") + ")]"; + }, + 'nth-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); + }, + 'nth-last-child': function(m) { + return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); + }, + 'nth-of-type': function(m) { + return Selector.xpath.pseudos.nth("position() ", m); + }, + 'nth-last-of-type': function(m) { + return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); + }, + 'first-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); + }, + 'last-of-type': function(m) { + m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); + }, + 'only-of-type': function(m) { + var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); + }, + nth: function(fragment, m) { + var mm, formula = m[6], predicate; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + if (mm = formula.match(/^(\d+)$/)) // digit only + return '[' + fragment + "= " + mm[1] + ']'; + if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (mm[1] == "-") mm[1] = -1; + var a = mm[1] ? Number(mm[1]) : 1; + var b = mm[2] ? Number(mm[2]) : 0; + predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + + "((#{fragment} - #{b}) div #{a} >= 0)]"; + return new Template(predicate).evaluate({ + fragment: fragment, a: a, b: b }); + } + } + } + }, + + criteria: { + tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', + className: 'n = h.className(n, r, "#{1}", c); c = false;', + id: 'n = h.id(n, r, "#{1}", c); c = false;', + attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', + attr: function(m) { + m[3] = (m[5] || m[6]); + return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); + }, + pseudo: function(m) { + if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); + return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); + }, + descendant: 'c = "descendant";', + child: 'c = "child";', + adjacent: 'c = "adjacent";', + laterSibling: 'c = "laterSibling";' + }, + + patterns: { + // combinators must be listed first + // (and descendant needs to be last combinator) + laterSibling: /^\s*~\s*/, + child: /^\s*>\s*/, + adjacent: /^\s*\+\s*/, + descendant: /^\s/, + + // selectors follow + tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, + id: /^#([\w\-\*]+)(\b|$)/, + className: /^\.([\w\-\*]+)(\b|$)/, + pseudo: +/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/, + attrPresence: /^\[((?:[\w]+:)?[\w]+)\]/, + attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ + }, + + // for Selector.match and Element#match + assertions: { + tagName: function(element, matches) { + return matches[1].toUpperCase() == element.tagName.toUpperCase(); + }, + + className: function(element, matches) { + return Element.hasClassName(element, matches[1]); + }, + + id: function(element, matches) { + return element.id === matches[1]; + }, + + attrPresence: function(element, matches) { + return Element.hasAttribute(element, matches[1]); + }, + + attr: function(element, matches) { + var nodeValue = Element.readAttribute(element, matches[1]); + return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); + } + }, + + handlers: { + // UTILITY FUNCTIONS + // joins two collections + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + a.push(node); + return a; + }, + + // marks an array of nodes for counting + mark: function(nodes) { + var _true = Prototype.emptyFunction; + for (var i = 0, node; node = nodes[i]; i++) + node._countedByPrototype = _true; + return nodes; + }, + + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._countedByPrototype = undefined; + return nodes; + }, + + // mark each child node with its position (for nth calls) + // "ofType" flag indicates whether we're indexing for nth-of-type + // rather than nth-child + index: function(parentNode, reverse, ofType) { + parentNode._countedByPrototype = Prototype.emptyFunction; + if (reverse) { + for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { + var node = nodes[i]; + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; + } + } else { + for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; + } + }, + + // filters out duplicates and extends all nodes + unique: function(nodes) { + if (nodes.length == 0) return nodes; + var results = [], n; + for (var i = 0, l = nodes.length; i < l; i++) + if (!(n = nodes[i])._countedByPrototype) { + n._countedByPrototype = Prototype.emptyFunction; + results.push(Element.extend(n)); + } + return Selector.handlers.unmark(results); + }, + + // COMBINATOR FUNCTIONS + descendant: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName('*')); + return results; + }, + + child: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) { + for (var j = 0, child; child = node.childNodes[j]; j++) + if (child.nodeType == 1 && child.tagName != '!') results.push(child); + } + return results; + }, + + adjacent: function(nodes) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + var next = this.nextElementSibling(node); + if (next) results.push(next); + } + return results; + }, + + laterSibling: function(nodes) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + h.concat(results, Element.nextSiblings(node)); + return results; + }, + + nextElementSibling: function(node) { + while (node = node.nextSibling) + if (node.nodeType == 1) return node; + return null; + }, + + previousElementSibling: function(node) { + while (node = node.previousSibling) + if (node.nodeType == 1) return node; + return null; + }, + + // TOKEN FUNCTIONS + tagName: function(nodes, root, tagName, combinator) { + var uTagName = tagName.toUpperCase(); + var results = [], h = Selector.handlers; + if (nodes) { + if (combinator) { + // fastlane for ordinary descendant combinators + if (combinator == "descendant") { + for (var i = 0, node; node = nodes[i]; i++) + h.concat(results, node.getElementsByTagName(tagName)); + return results; + } else nodes = this[combinator](nodes); + if (tagName == "*") return nodes; + } + for (var i = 0, node; node = nodes[i]; i++) + if (node.tagName.toUpperCase() === uTagName) results.push(node); + return results; + } else return root.getElementsByTagName(tagName); + }, + + id: function(nodes, root, id, combinator) { + var targetNode = $(id), h = Selector.handlers; + if (!targetNode) return []; + if (!nodes && root == document) return [targetNode]; + if (nodes) { + if (combinator) { + if (combinator == 'child') { + for (var i = 0, node; node = nodes[i]; i++) + if (targetNode.parentNode == node) return [targetNode]; + } else if (combinator == 'descendant') { + for (var i = 0, node; node = nodes[i]; i++) + if (Element.descendantOf(targetNode, node)) return [targetNode]; + } else if (combinator == 'adjacent') { + for (var i = 0, node; node = nodes[i]; i++) + if (Selector.handlers.previousElementSibling(targetNode) == node) + return [targetNode]; + } else nodes = h[combinator](nodes); + } + for (var i = 0, node; node = nodes[i]; i++) + if (node == targetNode) return [targetNode]; + return []; + } + return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; + }, + + className: function(nodes, root, className, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + return Selector.handlers.byClassName(nodes, root, className); + }, + + byClassName: function(nodes, root, className) { + if (!nodes) nodes = Selector.handlers.descendant([root]); + var needle = ' ' + className + ' '; + for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { + nodeClassName = node.className; + if (nodeClassName.length == 0) continue; + if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) + results.push(node); + } + return results; + }, + + attrPresence: function(nodes, root, attr, combinator) { + if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); + var results = []; + for (var i = 0, node; node = nodes[i]; i++) + if (Element.hasAttribute(node, attr)) results.push(node); + return results; + }, + + attr: function(nodes, root, attr, value, operator, combinator) { + if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); + var handler = Selector.operators[operator], results = []; + for (var i = 0, node; node = nodes[i]; i++) { + var nodeValue = Element.readAttribute(node, attr); + if (nodeValue === null) continue; + if (handler(nodeValue, value)) results.push(node); + } + return results; + }, + + pseudo: function(nodes, name, value, root, combinator) { + if (nodes && combinator) nodes = this[combinator](nodes); + if (!nodes) nodes = root.getElementsByTagName("*"); + return Selector.pseudos[name](nodes, value, root); + } + }, + + pseudos: { + 'first-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.previousElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'last-child': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + if (Selector.handlers.nextElementSibling(node)) continue; + results.push(node); + } + return results; + }, + 'only-child': function(nodes, value, root) { + var h = Selector.handlers; + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) + results.push(node); + return results; + }, + 'nth-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root); + }, + 'nth-last-child': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true); + }, + 'nth-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, false, true); + }, + 'nth-last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, formula, root, true, true); + }, + 'first-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, false, true); + }, + 'last-of-type': function(nodes, formula, root) { + return Selector.pseudos.nth(nodes, "1", root, true, true); + }, + 'only-of-type': function(nodes, formula, root) { + var p = Selector.pseudos; + return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); + }, + + // handles the an+b logic + getIndices: function(a, b, total) { + if (a == 0) return b > 0 ? [b] : []; + return $R(1, total).inject([], function(memo, i) { + if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); + return memo; + }); + }, + + // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type + nth: function(nodes, formula, root, reverse, ofType) { + if (nodes.length == 0) return []; + if (formula == 'even') formula = '2n+0'; + if (formula == 'odd') formula = '2n+1'; + var h = Selector.handlers, results = [], indexed = [], m; + h.mark(nodes); + for (var i = 0, node; node = nodes[i]; i++) { + if (!node.parentNode._countedByPrototype) { + h.index(node.parentNode, reverse, ofType); + indexed.push(node.parentNode); + } + } + if (formula.match(/^\d+$/)) { // just a number + formula = Number(formula); + for (var i = 0, node; node = nodes[i]; i++) + if (node.nodeIndex == formula) results.push(node); + } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b + if (m[1] == "-") m[1] = -1; + var a = m[1] ? Number(m[1]) : 1; + var b = m[2] ? Number(m[2]) : 0; + var indices = Selector.pseudos.getIndices(a, b, nodes.length); + for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { + for (var j = 0; j < l; j++) + if (node.nodeIndex == indices[j]) results.push(node); + } + } + h.unmark(nodes); + h.unmark(indexed); + return results; + }, + + 'empty': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) { + // IE treats comments as element nodes + if (node.tagName == '!' || node.firstChild) continue; + results.push(node); + } + return results; + }, + + 'not': function(nodes, selector, root) { + var h = Selector.handlers, selectorType, m; + var exclusions = new Selector(selector).findElements(root); + h.mark(exclusions); + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node._countedByPrototype) results.push(node); + h.unmark(exclusions); + return results; + }, + + 'enabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (!node.disabled && (!node.type || node.type !== 'hidden')) + results.push(node); + return results; + }, + + 'disabled': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.disabled) results.push(node); + return results; + }, + + 'checked': function(nodes, value, root) { + for (var i = 0, results = [], node; node = nodes[i]; i++) + if (node.checked) results.push(node); + return results; + } + }, + + operators: { + '=': function(nv, v) { return nv == v; }, + '!=': function(nv, v) { return nv != v; }, + '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); }, + '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); }, + '*=': function(nv, v) { return nv == v || nv && nv.include(v); }, + '$=': function(nv, v) { return nv.endsWith(v); }, + '*=': function(nv, v) { return nv.include(v); }, + '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, + '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() + + '-').include('-' + (v || "").toUpperCase() + '-'); } + }, + + split: function(expression) { + var expressions = []; + expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { + expressions.push(m[1].strip()); + }); + return expressions; + }, + + matchElements: function(elements, expression) { + var matches = $$(expression), h = Selector.handlers; + h.mark(matches); + for (var i = 0, results = [], element; element = elements[i]; i++) + if (element._countedByPrototype) results.push(element); + h.unmark(matches); + return results; + }, + + findElement: function(elements, expression, index) { + if (Object.isNumber(expression)) { + index = expression; expression = false; + } + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function(element, expressions) { + expressions = Selector.split(expressions.join(',')); + var results = [], h = Selector.handlers; + for (var i = 0, l = expressions.length, selector; i < l; i++) { + selector = new Selector(expressions[i].strip()); + h.concat(results, selector.findElements(element)); + } + return (l > 1) ? h.unique(results) : results; + } +}); + +if (Prototype.Browser.IE) { + Object.extend(Selector.handlers, { + // IE returns comment nodes on getElementsByTagName("*"). + // Filter them out. + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + if (node.tagName !== "!") a.push(node); + return a; + }, + + // IE improperly serializes _countedByPrototype in (inner|outer)HTML. + unmark: function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node.removeAttribute('_countedByPrototype'); + return nodes; + } + }); +} + +function $$() { + return Selector.findChildElements(document, $A(arguments)); +} +var Form = { + reset: function(form) { + $(form).reset(); + return form; + }, + + serializeElements: function(elements, options) { + if (typeof options != 'object') options = { hash: !!options }; + else if (Object.isUndefined(options.hash)) options.hash = true; + var key, value, submitted = false, submit = options.submit; + + var data = elements.inject({ }, function(result, element) { + if (!element.disabled && element.name) { + key = element.name; value = $(element).getValue(); + if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && + submit !== false && (!submit || key == submit) && (submitted = true)))) { + if (key in result) { + // a key is already present; construct an array of values + if (!Object.isArray(result[key])) result[key] = [result[key]]; + result[key].push(value); + } + else result[key] = value; + } + } + return result; + }); + + return options.hash ? data : Object.toQueryString(data); + } +}; + +Form.Methods = { + serialize: function(form, options) { + return Form.serializeElements(Form.getElements(form), options); + }, + + getElements: function(form) { + return $A($(form).getElementsByTagName('*')).inject([], + function(elements, child) { + if (Form.Element.Serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + } + ); + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) return $A(inputs).map(Element.extend); + + for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || (name && input.name != name)) + continue; + matchingInputs.push(Element.extend(input)); + } + + return matchingInputs; + }, + + disable: function(form) { + form = $(form); + Form.getElements(form).invoke('disable'); + return form; + }, + + enable: function(form) { + form = $(form); + Form.getElements(form).invoke('enable'); + return form; + }, + + findFirstElement: function(form) { + var elements = $(form).getElements().findAll(function(element) { + return 'hidden' != element.type && !element.disabled; + }); + var firstByIndex = elements.findAll(function(element) { + return element.hasAttribute('tabIndex') && element.tabIndex >= 0; + }).sortBy(function(element) { return element.tabIndex }).first(); + + return firstByIndex ? firstByIndex : elements.find(function(element) { + return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + form = $(form); + form.findFirstElement().activate(); + return form; + }, + + request: function(form, options) { + form = $(form), options = Object.clone(options || { }); + + var params = options.parameters, action = form.readAttribute('action') || ''; + if (action.blank()) action = window.location.href; + options.parameters = form.serialize(true); + + if (params) { + if (Object.isString(params)) params = params.toQueryParams(); + Object.extend(options.parameters, params); + } + + if (form.hasAttribute('method') && !options.method) + options.method = form.method; + + return new Ajax.Request(action, options); + } +}; + +/*--------------------------------------------------------------------------*/ + +Form.Element = { + focus: function(element) { + $(element).focus(); + return element; + }, + + select: function(element) { + $(element).select(); + return element; + } +}; + +Form.Element.Methods = { + serialize: function(element) { + element = $(element); + if (!element.disabled && element.name) { + var value = element.getValue(); + if (value != undefined) { + var pair = { }; + pair[element.name] = value; + return Object.toQueryString(pair); + } + } + return ''; + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + return Form.Element.Serializers[method](element); + }, + + setValue: function(element, value) { + element = $(element); + var method = element.tagName.toLowerCase(); + Form.Element.Serializers[method](element, value); + return element; + }, + + clear: function(element) { + $(element).value = ''; + return element; + }, + + present: function(element) { + return $(element).value != ''; + }, + + activate: function(element) { + element = $(element); + try { + element.focus(); + if (element.select && (element.tagName.toLowerCase() != 'input' || + !['button', 'reset', 'submit'].include(element.type))) + element.select(); + } catch (e) { } + return element; + }, + + disable: function(element) { + element = $(element); + element.disabled = true; + return element; + }, + + enable: function(element) { + element = $(element); + element.disabled = false; + return element; + } +}; + +/*--------------------------------------------------------------------------*/ + +var Field = Form.Element; +var $F = Form.Element.Methods.getValue; + +/*--------------------------------------------------------------------------*/ + +Form.Element.Serializers = { + input: function(element, value) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element, value); + default: + return Form.Element.Serializers.textarea(element, value); + } + }, + + inputSelector: function(element, value) { + if (Object.isUndefined(value)) return element.checked ? element.value : null; + else element.checked = !!value; + }, + + textarea: function(element, value) { + if (Object.isUndefined(value)) return element.value; + else element.value = value; + }, + + select: function(element, value) { + if (Object.isUndefined(value)) + return this[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + else { + var opt, currentValue, single = !Object.isArray(value); + for (var i = 0, length = element.length; i < length; i++) { + opt = element.options[i]; + currentValue = this.optionValue(opt); + if (single) { + if (currentValue == value) { + opt.selected = true; + return; + } + } + else opt.selected = value.include(currentValue); + } + } + }, + + selectOne: function(element) { + var index = element.selectedIndex; + return index >= 0 ? this.optionValue(element.options[index]) : null; + }, + + selectMany: function(element) { + var values, length = element.length; + if (!length) return null; + + for (var i = 0, values = []; i < length; i++) { + var opt = element.options[i]; + if (opt.selected) values.push(this.optionValue(opt)); + } + return values; + }, + + optionValue: function(opt) { + // extend element because hasAttribute may not be native + return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; + } +}; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = Class.create(PeriodicalExecuter, { + initialize: function($super, element, frequency, callback) { + $super(callback, frequency); + this.element = $(element); + this.lastValue = this.getValue(); + }, + + execute: function() { + var value = this.getValue(); + if (Object.isString(this.lastValue) && Object.isString(value) ? + this.lastValue != value : String(this.lastValue) != String(value)) { + this.callback(this.element, value); + this.lastValue = value; + } + } +}); + +Form.Element.Observer = Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(Abstract.TimedObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = Class.create({ + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + Form.getElements(this.element).each(this.registerCallback, this); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +}); + +Form.Element.EventObserver = Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(Abstract.EventObserver, { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) var Event = { }; + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + KEY_INSERT: 45, + + cache: { }, + + relatedTarget: function(event) { + var element; + switch(event.type) { + case 'mouseover': element = event.fromElement; break; + case 'mouseout': element = event.toElement; break; + default: return null; + } + return Element.extend(element); + } +}); + +Event.Methods = (function() { + var isButton; + + if (Prototype.Browser.IE) { + var buttonMap = { 0: 1, 1: 4, 2: 2 }; + isButton = function(event, code) { + return event.button == buttonMap[code]; + }; + + } else if (Prototype.Browser.WebKit) { + isButton = function(event, code) { + switch (code) { + case 0: return event.which == 1 && !event.metaKey; + case 1: return event.which == 1 && event.metaKey; + default: return false; + } + }; + + } else { + isButton = function(event, code) { + return event.which ? (event.which === code + 1) : (event.button === code); + }; + } + + return { + isLeftClick: function(event) { return isButton(event, 0) }, + isMiddleClick: function(event) { return isButton(event, 1) }, + isRightClick: function(event) { return isButton(event, 2) }, + + element: function(event) { + event = Event.extend(event); + + var node = event.target, + type = event.type, + currentTarget = event.currentTarget; + + if (currentTarget && currentTarget.tagName) { + // Firefox screws up the "click" event when moving between radio buttons + // via arrow keys. It also screws up the "load" and "error" events on images, + // reporting the document as the target instead of the original image. + if (type === 'load' || type === 'error' || + (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' + && currentTarget.type === 'radio')) + node = currentTarget; + } + if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; + return Element.extend(node); + }, + + findElement: function(event, expression) { + var element = Event.element(event); + if (!expression) return element; + var elements = [element].concat(element.ancestors()); + return Selector.findElement(elements, expression, 0); + }, + + pointer: function(event) { + var docElement = document.documentElement, + body = document.body || { scrollLeft: 0, scrollTop: 0 }; + return { + x: event.pageX || (event.clientX + + (docElement.scrollLeft || body.scrollLeft) - + (docElement.clientLeft || 0)), + y: event.pageY || (event.clientY + + (docElement.scrollTop || body.scrollTop) - + (docElement.clientTop || 0)) + }; + }, + + pointerX: function(event) { return Event.pointer(event).x }, + pointerY: function(event) { return Event.pointer(event).y }, + + stop: function(event) { + Event.extend(event); + event.preventDefault(); + event.stopPropagation(); + event.stopped = true; + } + }; +})(); + +Event.extend = (function() { + var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { + m[name] = Event.Methods[name].methodize(); + return m; + }); + + if (Prototype.Browser.IE) { + Object.extend(methods, { + stopPropagation: function() { this.cancelBubble = true }, + preventDefault: function() { this.returnValue = false }, + inspect: function() { return "[object Event]" } + }); + + return function(event) { + if (!event) return false; + if (event._extendedByPrototype) return event; + + event._extendedByPrototype = Prototype.emptyFunction; + var pointer = Event.pointer(event); + Object.extend(event, { + target: event.srcElement, + relatedTarget: Event.relatedTarget(event), + pageX: pointer.x, + pageY: pointer.y + }); + return Object.extend(event, methods); + }; + + } else { + Event.prototype = Event.prototype || document.createEvent("HTMLEvents")['__proto__']; + Object.extend(Event.prototype, methods); + return Prototype.K; + } +})(); + +Object.extend(Event, (function() { + var cache = Event.cache; + + function getEventID(element) { + if (element._prototypeEventID) return element._prototypeEventID[0]; + arguments.callee.id = arguments.callee.id || 1; + return element._prototypeEventID = [++arguments.callee.id]; + } + + function getDOMEventName(eventName) { + if (eventName && eventName.include(':')) return "dataavailable"; + return eventName; + } + + function getCacheForID(id) { + return cache[id] = cache[id] || { }; + } + + function getWrappersForEventName(id, eventName) { + var c = getCacheForID(id); + return c[eventName] = c[eventName] || []; + } + + function createWrapper(element, eventName, handler) { + var id = getEventID(element); + var c = getWrappersForEventName(id, eventName); + if (c.pluck("handler").include(handler)) return false; + + var wrapper = function(event) { + if (!Event || !Event.extend || + (event.eventName && event.eventName != eventName)) + return false; + + Event.extend(event); + handler.call(element, event); + }; + + wrapper.handler = handler; + c.push(wrapper); + return wrapper; + } + + function findWrapper(id, eventName, handler) { + var c = getWrappersForEventName(id, eventName); + return c.find(function(wrapper) { return wrapper.handler == handler }); + } + + function destroyWrapper(id, eventName, handler) { + var c = getCacheForID(id); + if (!c[eventName]) return false; + c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); + } + + function destroyCache() { + for (var id in cache) + for (var eventName in cache[id]) + cache[id][eventName] = null; + } + + + // Internet Explorer needs to remove event handlers on page unload + // in order to avoid memory leaks. + if (window.attachEvent) { + window.attachEvent("onunload", destroyCache); + } + + // Safari has a dummy event handler on page unload so that it won't + // use its bfcache. Safari <= 3.1 has an issue with restoring the "document" + // object when page is returned to via the back button using its bfcache. + if (Prototype.Browser.WebKit) { + window.addEventListener('unload', Prototype.emptyFunction, false); + } + + return { + observe: function(element, eventName, handler) { + element = $(element); + var name = getDOMEventName(eventName); + + var wrapper = createWrapper(element, eventName, handler); + if (!wrapper) return element; + + if (element.addEventListener) { + element.addEventListener(name, wrapper, false); + } else { + element.attachEvent("on" + name, wrapper); + } + + return element; + }, + + stopObserving: function(element, eventName, handler) { + element = $(element); + var id = getEventID(element), name = getDOMEventName(eventName); + + if (!handler && eventName) { + getWrappersForEventName(id, eventName).each(function(wrapper) { + element.stopObserving(eventName, wrapper.handler); + }); + return element; + + } else if (!eventName) { + Object.keys(getCacheForID(id)).each(function(eventName) { + element.stopObserving(eventName); + }); + return element; + } + + var wrapper = findWrapper(id, eventName, handler); + if (!wrapper) return element; + + if (element.removeEventListener) { + element.removeEventListener(name, wrapper, false); + } else { + element.detachEvent("on" + name, wrapper); + } + + destroyWrapper(id, eventName, handler); + + return element; + }, + + fire: function(element, eventName, memo) { + element = $(element); + if (element == document && document.createEvent && !element.dispatchEvent) + element = document.documentElement; + + var event; + if (document.createEvent) { + event = document.createEvent("HTMLEvents"); + event.initEvent("dataavailable", true, true); + } else { + event = document.createEventObject(); + event.eventType = "ondataavailable"; + } + + event.eventName = eventName; + event.memo = memo || { }; + + if (document.createEvent) { + element.dispatchEvent(event); + } else { + element.fireEvent(event.eventType, event); + } + + return Event.extend(event); + } + }; +})()); + +Object.extend(Event, Event.Methods); + +Element.addMethods({ + fire: Event.fire, + observe: Event.observe, + stopObserving: Event.stopObserving +}); + +Object.extend(document, { + fire: Element.Methods.fire.methodize(), + observe: Element.Methods.observe.methodize(), + stopObserving: Element.Methods.stopObserving.methodize(), + loaded: false +}); + +(function() { + /* Support for the DOMContentLoaded event is based on work by Dan Webb, + Matthias Miller, Dean Edwards and John Resig. */ + + var timer; + + function fireContentLoadedEvent() { + if (document.loaded) return; + if (timer) window.clearInterval(timer); + document.fire("dom:loaded"); + document.loaded = true; + } + + if (document.addEventListener) { + if (Prototype.Browser.WebKit) { + timer = window.setInterval(function() { + if (/loaded|complete/.test(document.readyState)) + fireContentLoadedEvent(); + }, 0); + + Event.observe(window, "load", fireContentLoadedEvent); + + } else { + document.addEventListener("DOMContentLoaded", + fireContentLoadedEvent, false); + } + + } else { + document.write(" + + + + + + + + + + + + + + + + +

    UFD aria

    + + +
    + + +

    jquery UI test

    + This is a dummy test to see if/how to use the jQuery UI; still not as nice as I'd like, and you will need + to select a skin at the top right for this to render OK. + + + code inspired from http://jquery-ui.googlecode.com/svn/branches/labs/autocomplete/tests/static/autocomplete/autocomplete.html + + + + + +
    +
    + + + + +
    + +
    +
      + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    + + + + diff --git a/js/ufd/examples/autosnippet/css/SyntaxHighlighter.css b/js/ufd/examples/autosnippet/css/SyntaxHighlighter.css new file mode 100644 index 0000000..a1da307 --- /dev/null +++ b/js/ufd/examples/autosnippet/css/SyntaxHighlighter.css @@ -0,0 +1,185 @@ +.dp-highlighter +{ + font-family: "Consolas", "Courier New", Courier, mono, serif; + font-size: 12px; + background-color: #E7E5DC; + width: 99%; + overflow: auto; + margin: 18px 0 18px 0 !important; + padding-top: 1px; /* adds a little border on top when controls are hidden */ +} + +/* clear styles */ +.dp-highlighter ol, +.dp-highlighter ol li, +.dp-highlighter ol li span +{ + margin: 0; + padding: 0; + border: none; +} + +.dp-highlighter a, +.dp-highlighter a:hover +{ + background: none; + border: none; + padding: 0; + margin: 0; +} + +.dp-highlighter .bar +{ + padding-left: 45px; +} + +.dp-highlighter.collapsed .bar, +.dp-highlighter.nogutter .bar +{ + padding-left: 0px; +} + +.dp-highlighter ol +{ + list-style: decimal; /* for ie */ + background-color: #fff; + margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */ + padding: 0px; + color: #5C5C5C; +} + +.dp-highlighter.nogutter ol, +.dp-highlighter.nogutter ol li +{ + list-style: none !important; + margin-left: 0px !important; +} + +.dp-highlighter ol li, +.dp-highlighter .columns div +{ + list-style: decimal-leading-zero; /* better look for others, override cascade from OL */ + list-style-position: outside !important; + border-left: 3px solid #6CE26C; + background-color: #F8F8F8; + color: #5C5C5C; + padding: 0 3px 0 10px !important; + margin: 0 !important; + line-height: 14px; +} + +.dp-highlighter.nogutter ol li, +.dp-highlighter.nogutter .columns div +{ + border: 0; +} + +.dp-highlighter .columns +{ + background-color: #F8F8F8; + color: gray; + overflow: hidden; + width: 100%; +} + +.dp-highlighter .columns div +{ + padding-bottom: 5px; +} + +.dp-highlighter ol li.alt +{ + background-color: #FFF; + color: inherit; +} + +.dp-highlighter ol li span +{ + color: black; + background-color: inherit; +} + +/* Adjust some properties when collapsed */ + +.dp-highlighter.collapsed ol +{ + margin: 0px; +} + +.dp-highlighter.collapsed ol li +{ + display: none; +} + +/* Additional modifications when in print-view */ + +.dp-highlighter.printing +{ + border: none; +} + +.dp-highlighter.printing .tools +{ + display: none !important; +} + +.dp-highlighter.printing li +{ + display: list-item !important; +} + +/* Styles for the tools */ + +.dp-highlighter .tools +{ + padding: 3px 8px 3px 10px; + font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif; + color: silver; + background-color: #f8f8f8; + padding-bottom: 10px; + border-left: 3px solid #6CE26C; +} + +.dp-highlighter.nogutter .tools +{ + border-left: 0; +} + +.dp-highlighter.collapsed .tools +{ + border-bottom: 0; +} + +.dp-highlighter .tools a +{ + font-size: 9px; + color: #a0a0a0; + background-color: inherit; + text-decoration: none; + margin-right: 10px; +} + +.dp-highlighter .tools a:hover +{ + color: red; + background-color: inherit; + text-decoration: underline; +} + +/* About dialog styles */ + +.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; } +.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; } +.dp-about td { padding: 10px; vertical-align: top; } +.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; } +.dp-about .title { color: red; background-color: inherit; font-weight: bold; } +.dp-about .para { margin: 0 0 4px 0; } +.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; } +.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; } + +/* Language specific styles */ + +.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; } +.dp-highlighter .string { color: blue; background-color: inherit; } +.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; } +.dp-highlighter .preprocessor { color: gray; background-color: inherit; } diff --git a/js/ufd/examples/autosnippet/index.html b/js/ufd/examples/autosnippet/index.html new file mode 100644 index 0000000..4a11cf8 --- /dev/null +++ b/js/ufd/examples/autosnippet/index.html @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + +

    AutoSnippet JavaScript Library v1.0

    + + + Dependencies – jquery http://jquery.com/ Optionally SyntaxHighlighter (both provided in this release) + +
    +

    Simple Example - the following code snippet is automatically generated:

    +
    + + usage:
    + + + <div name='autosnippet:name_of_target:[yes/no -use Syntax Highlighter(default=no) ]'></div> + + <div name='name_of_target'></div> + +
    +

    Simple Example - the following code snippet is automatically generated:

    +
    +
    +
    + + + + + + + + + + + + +
    Justwritethe Example
    and thesnippetis automaticlly generated
    + +
    + +
    +
    +
    +
    +

    Here is how it is done:

    +
    +
    + +
    + +
    +

    Example with Syntax Highlighter - the following code snippet is automatically generated with SyntaxHighlighter:

    +
    +
    +
    + + + + + + + + + + + + + + + + +
    Justwrite anotherthe Example
    and thesnippetis automaticlly generated
    and thesnippetis automaticlly generated
    + +
    + +
    +
    +
    +
    +

    Here is how it is done:

    +
    +
    + +
    + + +
    +

    Example with Syntax Highlighter - snippet only:

    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + +
    Justwrite anotherthe Example
    and thesnippetis automaticlly generated
    and thesnippetis automaticlly generated
    + +
    + +
    +
    +
    + +

    Here is how it is done:

    +
    +The key is to wrap the source div with the target div: +
    + +
    + + +for more information contact Amir@spacebug.com + + + + + \ No newline at end of file diff --git a/js/ufd/examples/autosnippet/jquery-1.3.2.min.js b/js/ufd/examples/autosnippet/jquery-1.3.2.min.js new file mode 100644 index 0000000..b1ae21d --- /dev/null +++ b/js/ufd/examples/autosnippet/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/js/ufd/examples/autosnippet/jquery.autosnippet-1.0.js b/js/ufd/examples/autosnippet/jquery.autosnippet-1.0.js new file mode 100644 index 0000000..68ec144 --- /dev/null +++ b/js/ufd/examples/autosnippet/jquery.autosnippet-1.0.js @@ -0,0 +1,46 @@ + /* + * AutoSnippet JavaScript Library v1.0 + * http://spacebug.com + * + * Copyright (c) 2009 Amir Shevat + * Dual licensed under the MIT and GPL licenses. + * + * Dependencies – jquery http://jquery.com/ Optionally SyntaxHighlighter + */ + + $(document).ready(function(){ + + $("div[name^='autosnippet']").each(function () { + $this = $(this); + $this.snippet();; + }); + + }); + + + $.fn.snippet = function(options) { + $this = $(this); + + var params = $this.attr('name'); + params = params.toString(); + params= params.substr( params.indexOf(':')+1); + var target; + var SyntaxHighlighter; + if(params.indexOf(':')>-1){ + target = params.substr(0, params.indexOf(':')); + params= params.substr( params.indexOf(':')+1); + SyntaxHighlighter =params; + }else{ + target = params; + } + + + var cleanHTML = '
    ';
    +                    cleanHTML += $this.html().replace(/)','gm'),'cdata');this.GetMatches(new RegExp('(\<|<)!--\\s*.*?\\s*--(\>|>)','gm'),'comments');regex=new RegExp('([:\\w-\.]+)\\s*=\\s*(".*?"|\'.*?\'|\\w+)*|(\\w+)','gm');while((match=regex.exec(this.code))!=null)
    +{if(match[1]==null)
    +{continue;}
    +push(this.matches,new dp.sh.Match(match[1],match.index,'attribute'));if(match[2]!=undefined)
    +{push(this.matches,new dp.sh.Match(match[2],match.index+match[0].indexOf(match[2]),'attribute-value'));}}
    +this.GetMatches(new RegExp('(\<|<)/*\\?*(?!\\!)|/*\\?*(\>|>)','gm'),'tag');regex=new RegExp('(?:\<|<)/*\\?*\\s*([:\\w-\.]+)','gm');while((match=regex.exec(this.code))!=null)
    +{push(this.matches,new dp.sh.Match(match[1],match.index+match[0].indexOf(match[1]),'tag-name'));}}
    diff --git a/js/ufd/examples/autosnippet/js/shCore.js b/js/ufd/examples/autosnippet/js/shCore.js
    new file mode 100644
    index 0000000..e9ec53a
    --- /dev/null
    +++ b/js/ufd/examples/autosnippet/js/shCore.js
    @@ -0,0 +1,161 @@
    +/*
    + * JsMin
    + * Javascript Compressor
    + * http://www.crockford.com/
    + * http://www.smallsharptools.com/
    +*/
    +
    +var dp={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:'About...

    dp.SyntaxHighlighter

    Version: {V}

    http://www.dreamprojections.com/syntaxhighlighter

    ©2004-2007 Alex Gorbatchev.
    '},ClipboardSwf:null,Version:'1.5.1'}};dp.SyntaxHighlighter=dp.sh;dp.sh.Toolbar.Commands={ExpandSource:{label:'+ expand source',check:function(highlighter){return highlighter.collapse;},func:function(sender,highlighter) +{sender.parentNode.removeChild(sender);highlighter.div.className=highlighter.div.className.replace('collapsed','');}},ViewSource:{label:'view plain',func:function(sender,highlighter) +{var code=dp.sh.Utils.FixForBlogger(highlighter.originalCode).replace(/'+code+'');wnd.document.close();}},CopyToClipboard:{label:'copy to clipboard',check:function(){return window.clipboardData!=null||dp.sh.ClipboardSwf!=null;},func:function(sender,highlighter) +{var code=dp.sh.Utils.FixForBlogger(highlighter.originalCode).replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');if(window.clipboardData) +{window.clipboardData.setData('text',code);} +else if(dp.sh.ClipboardSwf!=null) +{var flashcopier=highlighter.flashCopier;if(flashcopier==null) +{flashcopier=document.createElement('div');highlighter.flashCopier=flashcopier;highlighter.div.appendChild(flashcopier);} +flashcopier.innerHTML='';} +alert('The code is in your clipboard now');}},PrintSource:{label:'print',func:function(sender,highlighter) +{var iframe=document.createElement('IFRAME');var doc=null;iframe.style.cssText='position:absolute;width:0px;height:0px;left:-500px;top:-500px;';document.body.appendChild(iframe);doc=iframe.contentWindow.document;dp.sh.Utils.CopyStyles(doc,window.document);doc.write('
    '+highlighter.div.innerHTML+'
    ');doc.close();iframe.contentWindow.focus();iframe.contentWindow.print();alert('Printing...');document.body.removeChild(iframe);}},About:{label:'?',func:function(highlighter) +{var wnd=window.open('','_blank','dialog,width=300,height=150,scrollbars=0');var doc=wnd.document;dp.sh.Utils.CopyStyles(doc,window.document);doc.write(dp.sh.Strings.AboutDialog.replace('{V}',dp.sh.Version));doc.close();wnd.focus();}}};dp.sh.Toolbar.Create=function(highlighter) +{var div=document.createElement('DIV');div.className='tools';for(var name in dp.sh.Toolbar.Commands) +{var cmd=dp.sh.Toolbar.Commands[name];if(cmd.check!=null&&!cmd.check(highlighter)) +continue;div.innerHTML+=''+cmd.label+'';} +return div;} +dp.sh.Toolbar.Command=function(name,sender) +{var n=sender;while(n!=null&&n.className.indexOf('dp-highlighter')==-1) +n=n.parentNode;if(n!=null) +dp.sh.Toolbar.Commands[name].func(sender,n.highlighter);} +dp.sh.Utils.CopyStyles=function(destDoc,sourceDoc) +{var links=sourceDoc.getElementsByTagName('link');for(var i=0;i');} +dp.sh.Utils.FixForBlogger=function(str) +{return(dp.sh.isBloggerMode==true)?str.replace(/|<br\s*\/?>/gi,'\n'):str;} +dp.sh.RegexLib={MultiLineCComments:new RegExp('/\\*[\\s\\S]*?\\*/','gm'),SingleLineCComments:new RegExp('//.*$','gm'),SingleLinePerlComments:new RegExp('#.*$','gm'),DoubleQuotedString:new RegExp('"(?:\\.|(\\\\\\")|[^\\""\\n])*"','g'),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'",'g')};dp.sh.Match=function(value,index,css) +{this.value=value;this.index=index;this.length=value.length;this.css=css;} +dp.sh.Highlighter=function() +{this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true;} +dp.sh.Highlighter.SortCallback=function(m1,m2) +{if(m1.indexm2.index) +return 1;else +{if(m1.lengthm2.length) +return 1;} +return 0;} +dp.sh.Highlighter.prototype.CreateElement=function(name) +{var result=document.createElement(name);result.highlighter=this;return result;} +dp.sh.Highlighter.prototype.GetMatches=function(regex,css) +{var index=0;var match=null;while((match=regex.exec(this.code))!=null) +this.matches[this.matches.length]=new dp.sh.Match(match[0],match.index,css);} +dp.sh.Highlighter.prototype.AddBit=function(str,css) +{if(str==null||str.length==0) +return;var span=this.CreateElement('SPAN');str=str.replace(/ /g,' ');str=str.replace(/');if(css!=null) +{if((/br/gi).test(str)) +{var lines=str.split(' 
    ');for(var i=0;ic.index)&&(match.index/gi,'\n');var lines=html.split('\n');if(this.addControls==true) +this.bar.appendChild(dp.sh.Toolbar.Create(this));if(this.showColumns) +{var div=this.CreateElement('div');var columns=this.CreateElement('div');var showEvery=10;var i=1;while(i<=150) +{if(i%showEvery==0) +{div.innerHTML+=i;i+=(i+'').length;} +else +{div.innerHTML+='·';i++;}} +columns.className='columns';columns.appendChild(div);this.bar.appendChild(columns);} +for(var i=0,lineIndex=this.firstLine;i0;i++) +{if(Trim(lines[i]).length==0) +continue;var matches=regex.exec(lines[i]);if(matches!=null&&matches.length>0) +min=Math.min(matches[0].length,min);} +if(min>0) +for(var i=0;i + + + + UFD 0.6 demonstration index + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Drip test

    + + + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    + + +
    + + + + + + diff --git a/js/ufd/examples/eventEg.html b/js/ufd/examples/eventEg.html new file mode 100644 index 0000000..10ff6b8 --- /dev/null +++ b/js/ufd/examples/eventEg.html @@ -0,0 +1,47 @@ + + + + + + + + +

    1.3.2

    + + + + + + + + diff --git a/js/ufd/examples/events.html b/js/ufd/examples/events.html new file mode 100644 index 0000000..5c9edcf --- /dev/null +++ b/js/ufd/examples/events.html @@ -0,0 +1,141 @@ + + + + + UFD 0.6 demonstration index + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    UFD event propagation demonstration page

    + + +
    +

    the master select tag: inside UFD

    + + + +

    + This is a normal select-dropdown. The log to the right shows events when fired. Try changing the value ... +

    +

    + The UFD widget can be initialized and destroyed without disturbing these event handlers, and + events can be bound and removed independant to UFD. When a select is wrapped, UFD triggers some but not all, + events on the original: namely the focus, change and blur events. Initialize the UFD, then try changing the value again.

    + +
    +

    + +
    + +

    +

    + +

    +

    + +

    + +
    +
    +
    +
    + + + diff --git a/js/ufd/examples/example.css b/js/ufd/examples/example.css new file mode 100644 index 0000000..9253a28 --- /dev/null +++ b/js/ufd/examples/example.css @@ -0,0 +1,20 @@ +body { + font-family: arial, helvetica, sans-serif; +} + +h1,h2,h3,h4,h5,h6 { + color: #00a; +} + +hr { + color: red; +} + +em { + font-weight: bold; +} + +#log { + height: 100px; + overflow: scroll; +} diff --git a/js/ufd/examples/index.html b/js/ufd/examples/index.html new file mode 100644 index 0000000..2b9ab23 --- /dev/null +++ b/js/ufd/examples/index.html @@ -0,0 +1,76 @@ + + + + UFD 0.6 demonstration index + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    UFD demonstration index

    + + +

    Welcome to the Unobtrusive Fast-filter Dropdown demonstration index. + These example pages demonstrate UFD features, and how to get them on your site. + UFD is pronounced EWE-EFF-D, or OOF-D if you are feeling onomatopaeic.

    + +

    First, try a vanilla (no-options) UFD. It works like a normal dropdown, but you can start typing to filter:

    + +
    + + + +
    + + +
    +
    + + +

    What are you interested in seeing?

    + + + + + diff --git a/js/ufd/examples/js/jquery-1.3.2.min.js b/js/ufd/examples/js/jquery-1.3.2.min.js new file mode 100644 index 0000000..b1ae21d --- /dev/null +++ b/js/ufd/examples/js/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/js/ufd/examples/js/jquery-1.4.2.js b/js/ufd/examples/js/jquery-1.4.2.js new file mode 100644 index 0000000..fff6776 --- /dev/null +++ b/js/ufd/examples/js/jquery-1.4.2.js @@ -0,0 +1,6240 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function( window, undefined ) { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwnProperty = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + indexOf = Array.prototype.indexOf; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + if ( elem ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && /^\w+$/.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging object literal values or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { + var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src + : jQuery.isArray(copy) ? [] : {}; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // Handle when the DOM is ready + ready: function() { + // Make sure that the DOM is not already loaded + if ( !jQuery.isReady ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 13 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, i = 0; + while ( (fn = readyList[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Reset the list of functions + readyList = null; + } + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + return jQuery.ready(); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor + && !hasOwnProperty.call(obj, "constructor") + && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwnProperty.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") + .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + trim: function( text ) { + return (text || "").replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = []; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + if ( !inv !== !callback( elems[ i ], i ) ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch( error ) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +function evalScript( i, elem ) { + if ( elem.src ) { + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + } else { + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } +} + +// Mutifunctional method to get and set values to a collection +// The value/s can be optionally by executed if its a function +function access( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; +} + +function now() { + return (new Date).getTime(); +} +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + now(); + + div.style.display = "none"; + div.innerHTML = "
    a"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected, + + parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null, + + // Will be defined later + deleteExpando: true, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null + }; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = ""; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + document.body.removeChild( div ).style.display = 'none'; + + div = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; +var expando = "jQuery" + now(), uuid = 0, windowData = {}; + +jQuery.extend({ + cache: {}, + + expando:expando, + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + "object": true, + "applet": true + }, + + data: function( elem, name, data ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache; + + if ( !id && typeof name === "string" && data === undefined ) { + return null; + } + + // Compute a unique ID for the element + if ( !id ) { + id = ++uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + elem[ expando ] = id; + thisCache = cache[ id ] = jQuery.extend(true, {}, name); + + } else if ( !cache[ id ] ) { + elem[ expando ] = id; + cache[ id ] = {}; + } + + thisCache = cache[ id ]; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } + + // Completely remove the data cache + delete cache[ id ]; + } + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + if ( typeof key === "undefined" && this.length ) { + return jQuery.data( this[0] ); + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + } + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } else { + return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { + jQuery.data( this, key, value ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i, elem ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); +var rclass = /[\n\t]/g, + rspace = /\s+/, + rreturn = /\r/g, + rspecialurl = /href|src|style/, + rtype = /(button|input)/i, + rfocusable = /(button|input|object|select|textarea)/i, + rclickable = /^(a|area)$/i, + rradiocheck = /radio|checkbox/; + +jQuery.fn.extend({ + attr: function( name, value ) { + return access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", setClass = elem.className; + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split(rspace); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, i = 0, self = jQuery(this), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Typecast each time if the value is a Function and the appended + // value is therefore different each time. + if ( typeof val === "number" ) { + val += ""; + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // Only do all the following if this is a node (faster for style) + if ( elem.nodeType === 1 ) { + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + if ( name in elem && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + elem[ name ] = value; + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } + + // elem is actually elem.style ... set the style + // Using attr for specific style information is now deprecated. Use style instead. + return jQuery.style( elem, name, value ); + } +}); +var rnamespaces = /\.(.*)$/, + fcleanup = function( nm ) { + return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { + return "\\" + ch; + }); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events = elemData.events || {}, + eventHandle = elemData.handle, eventHandle; + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + handleObj.guid = handler.guid; + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( var j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( var j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[expando] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = jQuery.data( elem, "handle" ); + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var target = event.target, old, + isClick = jQuery.nodeName(target, "a") && type === "click", + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ type ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + type ]; + + if ( old ) { + target[ "on" + type ] = null; + } + + jQuery.event.triggered = true; + target[ type ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (e) {} + + if ( old ) { + target[ "on" + type ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace, events; + + event = arguments[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + var events = jQuery.data(this, "events"), handlers = events[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, arguments ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.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 originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, body = document.body; + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { + event.which = event.charCode || event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); + }, + + remove: function( handleObj ) { + var remove = true, + type = handleObj.origType.replace(rnamespaces, ""); + + jQuery.each( jQuery.data(this, "events").live || [], function() { + if ( type === this.origType.replace(rnamespaces, "") ) { + remove = false; + return false; + } + }); + + if ( remove ) { + jQuery.event.remove( this, handleObj.origType, liveHandler ); + } + } + + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( this.setInterval ) { + this.onbeforeunload = eventHandle; + } + + return false; + }, + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +var removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + elem.removeEventListener( type, handle, false ); + } : + function( elem, type, handle ) { + elem.detachEvent( "on" + type, handle ); + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = now(); + + // Mark it as fixed + this[ expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + } + // otherwise set the returnValue property of the original event to false (IE) + e.returnValue = false; + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var formElems = /textarea|input|select/i, + + changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information/focus[in] is not needed anymore + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return formElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return formElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + this.addEventListener( orig, handler, true ); + }, + teardown: function() { + this.removeEventListener( orig, handler, true ); + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.handle.call( this, e ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + context.each(function(){ + jQuery.event.add( this, liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + }); + + } else { + // unbind live handler + context.unbind( liveConvert( type, selector ), fn ); + } + } + + return this; + } +}); + +function liveHandler( event ) { + var stop, elems = [], selectors = [], args = arguments, + related, match, handleObj, elem, j, i, l, data, + events = jQuery.data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( match[i].selector === handleObj.selector ) { + elem = match[i].elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) { + stop = false; + break; + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); +} + +jQuery.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( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( fn ) { + return fn ? this.bind( name, fn ) : this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + window.attachEvent("onunload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function(){ + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function(selector, context, results, seed) { + results = results || []; + var origContext = context = context || document; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + var ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; + } + + if ( context ) { + var ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } + + while ( parts.length ) { + var cur = parts.pop(), pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context && context.nodeType === 1 ) { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function(results){ + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort(sortOrder); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[i-1] ) { + results.splice(i--, 1); + } + } + } + } + + return results; +}; + +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); +}; + +Sizzle.find = function(expr, context, isXML){ + var set, match; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice(1,1); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; +}; + +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound, + isXMLFilter = set && set[0] && isXML(set[0]); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var filter = Expr.filter[ type ], found, item, left = match[1]; + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.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(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test(part), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part){ + var isPartStr = typeof part === "string"; + + if ( isPartStr && !/\W/.test(part) ) { + part = part.toLowerCase(); + + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + } else { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + "": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + }, + "~": function(checkSet, part, isXML){ + var doneName = done++, checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + var nodeCheck = part = part.toLowerCase(); + checkFn = dirNodeCheck; + } + + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], results = context.getElementsByName(match[1]); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not, isXML){ + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + return match[1].toLowerCase(); + }, + CHILD: function(match){ + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + ATTR: function(match, curLoop, inplace, result, not, isXML){ + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return /h\d/i.test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + input: function(elem){ + return /input|select|textarea|button/i.test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; + }, + even: function(elem, i){ + return i % 2 === 0; + }, + odd: function(elem, i){ + return i % 2 === 1; + }, + lt: function(elem, i, match){ + return i < match[3] - 0; + }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 === i; + }, + eq: function(elem, i, match){ + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; + + for ( var i = 0, l = not.length; i < l; i++ ) { + if ( not[i] === elem ) { + return false; + } + } + + return true; + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + CHILD: function(elem, match){ + var type = match[1], node = elem; + switch (type) { + case 'only': + case 'first': + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + if ( type === "first" ) { + return true; + } + node = elem; + case 'last': + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + return true; + case 'nth': + var first = match[2], last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + if ( first === 0 ) { + return diff === 0; + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + CLASS: function(elem, match){ + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + ATTR: function(elem, match){ + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ + return "\\" + (num - 0 + 1); + })); +} + +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var i = 0, l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( var i = 0; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.compareDocumentPosition ? -1 : 1; + } + + var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( "sourceIndex" in document.documentElement ) { + sortOrder = function( a, b ) { + if ( !a.sourceIndex || !b.sourceIndex ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.sourceIndex ? -1 : 1; + } + + var ret = a.sourceIndex - b.sourceIndex; + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} else if ( document.createRange ) { + sortOrder = function( a, b ) { + if ( !a.ownerDocument || !b.ownerDocument ) { + if ( a == b ) { + hasDuplicate = true; + } + return a.ownerDocument ? -1 : 1; + } + + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + if ( ret === 0 ) { + hasDuplicate = true; + } + return ret; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +function getText( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date).getTime(); + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function(match, context, isXML){ + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; + + Expr.filter.ID = function(elem, match){ + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + root = form = null; // release memory in IE +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } + + div = null; // release memory in IE +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, div = document.createElement("div"); + div.innerHTML = "

    "; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function(query, context, extra, seed){ + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && context.nodeType === 9 && !isXML(context) ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(e){} + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + div = null; // release memory in IE + })(); +} + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
    "; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function(match, context, isXML) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + div = null; // release memory in IE +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +var contains = document.compareDocumentPosition ? function(a, b){ + return !!(a.compareDocumentPosition(b) & 16); +} : function(a, b){ + return a !== b && (a.contains ? a.contains(b) : true); +}; + +var isXML = function(elem){ + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function(selector, context){ + var tmpSet = [], later = "", match, + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = getText; +jQuery.isXMLDoc = isXML; +jQuery.contains = contains; + +return; + +window.Sizzle = Sizzle; + +})(); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + slice = Array.prototype.slice; + +// Implement the identical functionality for filter and not +var winnow = function( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +}; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + if ( jQuery.isArray( selectors ) ) { + var ret = [], cur = this[0], match, matches = {}, selector; + + if ( cur && selectors.length ) { + for ( var i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur }); + delete matches[selector]; + } + } + cur = cur.parentNode; + } + } + + return ret; + } + + var pos = jQuery.expr.match.POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + return this.map(function( i, cur ) { + while ( cur && cur.ownerDocument && cur !== context ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) { + return cur; + } + cur = cur.parentNode; + } + return null; + }); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], cur = elem[dir]; + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, + rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, + rtagName = /<([\w:]+)/, + rtbody = /"; + }, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
    ", "
    " ], + thead: [ 1, "", "
    " ], + tr: [ 2, "", "
    " ], + td: [ 3, "", "
    " ], + col: [ 2, "", "
    " ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + + + + + + + + + + + + + + + + + + + + + + +

    Performance Comparsions

    + +

    + Lots of thought has been put into initialization and filter speed for UFD. This demonstrates the initialisation time of UFD. Type in a number of items to generate, and click the button. + The UFD will be destroyed, a new select node with random string items will be inserted, and a new UFD will be initialized. +

    + Timing is only the actual initialization of the new UFD, and excludes random string and select construction times. +

    + You can put any number, but keep it sane (<: 5,000) as initialization is proportional to list length, and CSS work on that many items isn't fast. In Firefox 3.5, one + developer has noted his initialization is roughly: 20msec + (itemCount/4)msec. +

    + + + + + + + + + +
    +
    +
    + + +
    + + + +
    + +

    There are a handful of other filtering implementations for you to compare.

    + +
    + + +

    Dojo: Dijit.form.FilteringSelect

    +

    + Dijit.form.FilteringSelect is a comparable tool. +

    + + + + + + +
    +
    +
    + + +
    + + +
    + + +

    +

    + + + + + + + + + +
    +
    +
    + + +
    + + + + + + diff --git a/js/ufd/examples/testCases.html b/js/ufd/examples/testCases.html new file mode 100644 index 0000000..7154eb4 --- /dev/null +++ b/js/ufd/examples/testCases.html @@ -0,0 +1,438 @@ + + + + + UFD 0.6 demonstration index + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    UFD base demonstration page

    + + + +
    + +
    +

    uiCss combo

    + + +

    This show the jQuery UI CSS (themeroller) support. You will need to pick a skin above to see it properly.

    + + +
    + + + +
    +
    + +
    +

    basic combo

    + +

    Try this basic example usecase for UFD. It works like a normal dropdown, but you can start typing to filter.

    + +
    + + + +
    + + +
    + + +
    +
    + + + +
    +

    width control

    + + +

    + Sizing defaults to autosize. + UFD sets the exact same width as the master select, unless the original is below the "minWidth" option, + or manualWidth is set. +

    + + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    +

    +
    + +
    +

    Free text

    + + + + +

    This combobox below allows freetext, submitting text back using the original selects' name. + All change, focus, blur events are still propagated back to the (renamed) master. Exact text matches, + cursor and mouse selection will update the master also. Note that the ENTER key has slightly different + behavior; it doesn select the first matched item, enabling free-text to work. Cursor or mouse to select partial matches.

    + +
    + +
    +
    + +
    +

    Functions

    + + +

    + This shows the useful functions you can call on widgets. There are duplicate labels, + so you can't filter to a single value. The original order is preserved, and you can create and + destroy multiple times to confirm that the correct instance is selected in each case. +

    + +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    + + +
    +
    + +
    +

    Skins, emphasis and homeEndForCursor

    + + +

    the 3 skins bundled with UFD. Each has the (experimental) addEmphasis option. + The last one is a CSS only template to help you markup your own needs.

    +

    These dropdowns have the option "homeEndForCursor: true" set, making the home and end key work on the cursor location, not the list selection.

    + +
    + +
    +
    + +
    +
    + +
    + +
    +
    + + +
    +

    Special characters and emphasis

    + + +
    + +
    + +
    + +
    + +
    + +
    + + +
    +
    + + +
    +

    Empty select

    + + +

    + +
    + +
    + + +
    +
    + + +
    +

    zIndex correction on iE6

    + + +

    The combobox works over select input, working around the iE6 zindex problem using bgiframe.

    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + example + +
    + +
    + +
    + +
    + +
    + +
    +
    +
    + +

    Log

    +
    +
    + + + + + + diff --git a/js/ufd/jquery.ui.ufd.js b/js/ufd/jquery.ui.ufd.js new file mode 100644 index 0000000..e56fccd --- /dev/null +++ b/js/ufd/jquery.ui.ufd.js @@ -0,0 +1,1320 @@ +/* + ufd 0.6 : Unobtrusive Fast-filter Drop-down jQuery plugin. + + Authors: + thetoolman@gmail.com + Kadalashvili.Vladimir@gmail.com + + Version: 0.6 + + Website: http://code.google.com/p/ufd/ + */ + +(function($) { + +var widgetName = "ui.ufd"; + +$.widget(widgetName, { + + // options: provided by framework + // element: provided by framework + + _init: function() { //1.7 init + // in 1.8 this method is "default functionality" which we dont have; here for 1.7 support + if(!this.created) this._create(); + }, + + _create: function() { //1.8 init + if(this.created) return; + this.created = true; + + if (this.element[0].tagName.toLowerCase() != "select") { + this.destroy(); + return false; + } + + // this._timingMeasure(true, "init"); + + this.options = $.extend(true, {}, this.options); //deep copy: http://dev.jqueryui.com/ticket/4366 + + this.visibleCount = 0; + this.selectbox = this.element; + this.logNode = $(this.options.logSelector); + this.overflowCSS = this.options.allowLR ? "overflow" : "overflowY"; + var selectName = this.selectbox.attr("name"); + var prefixName = this.options.prefix + selectName; + var inputName = this.options.submitFreeText ? selectName : prefixName; + var inputId = ""; // none unless master select has one + + var sbId = this.selectbox.attr("id"); + + if(sbId) { + inputId = this.options.prefix + sbId ; + this.labels = $("label[for='" + sbId + "']").attr("for", inputId); + } + + if(this.options.submitFreeText) this.selectbox.attr("name", prefixName); + if(this.options.calculateZIndex) this.options.zIndexPopup = this._calculateZIndex(); + + var css = this.options.css; + this.css = this.options.css; + if(this.options.useUiCss) $.extend(this.css, this.options.uiCss); + if(!css.skin) css.skin = this.options.skin; // use option skin if not specified in CSS + + this.wrapper = $([ + '', + '', + '', + // '].join(""));this.dropdown=g(['
    '].join(""));this.selectbox.after(this.wrapper);this.getDropdownContainer().append(this.dropdown);this.input=this.wrapper.find("input");this.button=this.wrapper.find("button");this.listWrapper=this.dropdown.children(":first").css("z-index",this.options.zIndexPopup); +this.listScroll=this.listWrapper.children(":first");g.fn.bgiframe&&this.listWrapper.bgiframe();if(!this.options.listWidthFixed){this.listWrapper.css({width:50,"min-width":100});this.options.listWidthFixed=this.listWrapper.width()<100;this.listWrapper.css({width:null,"min-width":null})}this._populateFromMaster();this._initEvents()}},_initEvents:function(){var a=this,b=g.ui.keyCode,c,d,e,h=this.options.css;this.input.bind("keydown keypress keyup",function(f){d=f.type=="keypress";e=f.type=="keyup";c= +null;if(undefined===f.which)c=f.keyCode;else if(!d&&f.which!=0)c=f.keyCode;else return;switch(c){case b.HOME:case b.END:if(a.options.homeEndForCursor)return;case b.DOWN:case b.PAGE_DOWN:case b.UP:case b.PAGE_UP:case b.ENTER:a.stopEvent(f);default:}if(!e!=(c!=b.TAB&&c!=b.ENTER)){a.lastKey=c;switch(c){case b.SHIFT:case b.CONTROL:break;case b.DOWN:a.selectNext(false);break;case b.PAGE_DOWN:a.selectNext(true);break;case b.END:a.selectLast();break;case b.UP:a.selectPrev(false);break;case b.PAGE_UP:a.selectPrev(true); +break;case b.HOME:a.selectFirst();break;case b.ENTER:a.hideList();a.tryToSetMaster();a.inputFocus();break;case b.TAB:a.realLooseFocusEvent();break;case b.ESCAPE:a.hideList();a.revertSelected();break;default:a.showList();a.filter(false,true);break}}});this.input.bind("click",function(f){if(a.isDisabled)a.stopEvent(f);else if(!a.listVisible()){a.filter(true);a.inputFocus();a.showList()}});this.input.bind("focus",function(f){if(a.isDisabled)a.stopEvent(f);else a.internalFocus||a.realFocusEvent()});this.button.bind("mouseover", +function(){a.button.addClass(h.buttonHover)});this.button.bind("mouseout",function(){a.button.removeClass(h.buttonHover)});this.button.bind("mousedown",function(){a.button.addClass(h.buttonMouseDown)});this.button.bind("mouseup",function(){a.button.removeClass(h.buttonMouseDown)});this.button.bind("click",function(f){if(a.isDisabled)a.stopEvent(f);else if(a.listVisible()){a.hideList();a.inputFocus()}else{a.filter(true);a.inputFocus();a.showList()}});this.listScroll.bind("DOMMouseScroll mousewheel", +function(f){a.stopEvent(f);f=f?f:window.event;f=f.detail?f.detail*-1:f.wheelDelta/40;f=a.listScroll.scrollTop()+(f>0?-1*a.itemHeight:1*a.itemHeight);a.listScroll.scrollTop(f)});this.listScroll.bind("mouseover mouseout click",function(f){if("LI"==f.target.nodeName.toUpperCase()){a.setActiveTimeout&&clearTimeout(a.setActiveTimeout);if("mouseout"==f.type){g(f.target).removeClass(h.liActive);a.setActiveTimeout=setTimeout(function(){g(a.selectedLi).addClass(h.liActive)},a.options.delayYield)}else if("mouseover"== +f.type){a.selectedLi!=f.target&&g(a.selectedLi).removeClass(h.liActive);g(f.target).addClass(h.liActive)}else{a.stopEvent(f);var j=g.trim(g(f.target).text());a.input.val(j);a.setActive(f.target);if(a.tryToSetMaster()){a.hideList();a.filter(true)}a.inputFocus()}}return true});this.selectbox.bind("change.ui.ufd",function(){if(a.isUpdatingMaster){a.isUpdatingMaster=false;return true}a.revertSelected()});this._myDocClickHandler=function(f){a.button.get(0)==f.target||a.input.get(0)==f.target||a.internalFocus&& +a.realLooseFocusEvent()};g(document).bind("click.ui.ufd",this._myDocClickHandler);if(this.options.polling){a=this;this._myPollId=setInterval(function(){a.dimensioned||a.setDimensions();if(a.selectbox[0].disabled!=a.isDisabled)a.selectbox[0].disabled?a.disable():a.enable()},a.options.polling)}},realFocusEvent:function(){this.internalFocus=true;this._triggerEventOnMaster("focus");this.wrapper.addClass(this.options.css.skin+"-"+this.options.css.inputFocus);this.input.addClass(this.options.css.inputFocus); +this.button.addClass(this.options.css.inputFocus);this.filter(true);this.inputFocus();this.showList()},realLooseFocusEvent:function(){this.internalFocus=false;this.hideList();this.wrapper.removeClass(this.options.css.skin+"-"+this.options.css.inputFocus);this.input.removeClass(this.options.css.inputFocus);this.button.removeClass(this.options.css.inputFocus);this.tryToSetMaster();this._triggerEventOnMaster("blur")},_triggerEventOnMaster:function(a){if(document.createEvent){var b=document.createEvent("HTMLEvents"); +b.initEvent(a,true,true);this.selectbox.get(0).dispatchEvent(b)}else document.createEventObject&&this.selectbox.get(0).fireEvent("on"+a)},inputFocus:function(){this.input.focus();this.getCurrentTextValue().length&&this.selectAll()},inputBlur:function(){this.input.blur()},showList:function(){if(!this.listVisible()){this.listWrapper.removeClass(this.css.hidden);this.setListDisplay()}},hideList:function(){if(this.listVisible()){this.listWrapper.addClass(this.css.hidden);this.listItems.removeClass(this.css.hidden)}}, +filter:function(a,b){var c=this;this.updateOnTimeout&&clearTimeout(this.updateOnTimeout);this.filterOnTimeout&&clearTimeout(this.filterOnTimeout);this.filterOnTimeout=this.updateOnTimeout=null;var d=c.getCurrentTextValue(),e=function(){var f=c.trie.find(d);c.trie.matches=f.matches;c.trie.misses=f.misses;c.updateOnTimeout=setTimeout(function(){h()},c.options.delayYield)},h=function(){var f=c.getActive();c.options.addEmphasis&&c.emphasis(c.trie.matches,true,d);c.visibleCount=c.overwriteClass(c.trie.matches, +"");if(a||!c.trie.matches.length){c.visibleCount+=c.overwriteClass(c.trie.misses,"");c.options.addEmphasis&&c.emphasis(c.trie.misses,false,d)}else c.overwriteClass(c.trie.misses,c.css.hidden);if(!f.hasClass(c.css.hidden)&&f.length&&c.trie.matches.length)c.setActive(f.get(0));else{f=c.listItems.filter(":visible:first");c.setActive(f.get(0))}c.setListDisplay()};if(b)this.filterOnTimeout=setTimeout(function(){e()},this.options.delayFilter);else e()},_encodeDom:g("
    "),_encodeString:function(a){return g.trim(this._encodeDom.text(a).html())}, +emphasis:function(a,b,c){var d,e,h,f,j;e=c.length||0;var k=this.selectbox.get(0).options;d=a.length;if(b=b&&e>0){j=this._encodeString(c).replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1");j=new RegExp("("+j+")","gi");this.hasEmphasis=true}for(;d--;){c=a[d];for(e=c.length;e--;){h=c[e];f=g.trim(k[h.getAttribute("name")].innerHTML);h.innerHTML=b?f.replace(j,"$1"):f}}},_timingMeasure_firebug:function(a,b){a?console.time(b):console.timeEnd(b)},_timingMeasure:function(a,b){this._timingMeasure_firebug(a, +b)},removeEmphasis:function(){if(this.hasEmphasis){this.hasEmphasis=false;for(var a=this.selectbox.get(0).options,b=this.list.get(0).getElementsByTagName("LI"),c=b.length,d;c--;){d=b[c];d.innerHTML=g.trim(a[d.getAttribute("name")].innerHTML)}}},tryToSetMaster:function(){var a=null,b=this.getActive();if(b.length)a=b.attr("name");if(a==null||a==""||a<0){this.options.submitFreeText||this.revertSelected();return false}b=this.selectbox.get(0);var c=b.selectedIndex,d=b.options[a];if(!this.options.submitFreeText|| +this.input.val()==d.text){this.input.val(d.text);if(a!=c){this.isUpdatingMaster=true;b.selectedIndex=a;this._triggerEventOnMaster("change")}return true}return false},_populateFromMaster:function(){var a=!this.selectbox.filter("[disabled]").length;this.disable();this.trie=new i(this.options.infix,this.options.caseSensitive);this.trie.matches=[];this.trie.misses=[];var b=this,c=[];c.push("
      ");var d=this.selectbox.get(0).options,e,h,f;h=d.length;for(f=0;h--;){e=d[f++];c.push('
    • ');c.push(g.trim(e.innerHTML));c.push("
    • ")}c.push("
    ");this.listScroll.html(c.join(""));this.list=this.listScroll.find("ul:first");c=this.list.get(0).getElementsByTagName("LI");this.listItems=g(c);h=c.length;for(f=0;h--;){e=d[f];b.trie.add(g.trim(e.text),c[f++])}this.visibleCount=c.length;this.setInputFromMaster();this.selectedLi=null;this.dimensioned=false;this.setDimensions();a&&this.enable();this._moveAttrs(this.selectbox,this.input,this.options.moveAttrs)},_moveAttrs:function(a, +b,c){for(var d=0;dthis.options.maxWidth)a=this.options.maxWidth}var b=this.options.mimicCSS;for(propPtr in b){var c=b[propPtr];!b.hasOwnProperty(propPtr)||typeof c==="function"||this.wrapper.css(c,this.selectbox.css(c))}if(!this.selectIsWrapped){this.wrapper.get(0).appendChild(this.selectbox.get(0));this.selectIsWrapped=true}this.wrapper.removeClass(this.css.hidden);this.listWrapper.removeClass(this.css.hidden); +var d=this.button.outerWidth(true);b=this.wrapper.outerWidth()-this.wrapper.width();var e=this.input.outerWidth(true)-this.input.width();c=this.listScroll.outerWidth()-this.listScroll.width();this.input.width(a-d-e);this.wrapper.width(a);d=this.options.listWidthFixed?"width":"min-width";this.listWrapper.css(d,a+b);this.listScroll.css(d,a+b-c);this.listWrapper.addClass(this.css.hidden);this.dimensioned=true}},setInputFromMaster:function(){var a=this.selectbox.get(0),b="";try{b=a.options[a.selectedIndex].text}catch(c){}this.input.val(b)}, +revertSelected:function(){this.setInputFromMaster();this.filter(true)},setListDisplay:function(){if(!this.itemHeight)this.itemHeight=this.listItems.filter("li:first").outerHeight(true);var a;if(this.visibleCount>this.options.listMaxVisible){a=this.options.listMaxVisible*this.itemHeight;this.listScroll.css(this.overflowCSS,"scroll")}else{a=this.visibleCount*this.itemHeight;this.listScroll.css(this.overflowCSS,"hidden")}this.listScroll.height(a);var b=this.listScroll.outerHeight();this.listWrapper.height(b); +var c=this.wrapper.offset(),d=this.wrapper.outerHeight(),e=c.top+d+b,h=g(window).height()+g(document).scrollTop(),f=c.left;if(e>h){this.listWrapper.addClass(this.css.listWrapperUp);b=c.top-b}else{this.listWrapper.removeClass(this.css.listWrapperUp);b=c.top+d}this.listWrapper.css("left",f);this.listWrapper.css("top",b);this.scrollTo();return a},getActive:function(){if(this.selectedLi==null)return g([]);return g(this.selectedLi)},setActive:function(a){g(this.selectedLi).removeClass(this.css.liActive); +this.selectedLi=a;g(this.selectedLi).addClass(this.css.liActive)},selectFirst:function(){this.afterSelect(this.listItems.filter(":not(.invisible):first"))},selectLast:function(){this.afterSelect(this.listItems.filter(":not(.invisible):last"))},selectPrev:function(a){this.afterSelect(this.searchRelativeVisible(false,a?this.options.pageLength:1))},selectNext:function(a){this.afterSelect(this.searchRelativeVisible(true,a?this.options.pageLength:1))},afterSelect:function(a){if(a!=null){this.setActive(a); +this.input.val(a.text());this.scrollTo();this.tryToSetMaster();this.inputFocus();this.removeEmphasis()}},searchRelativeVisible:function(a,b){var c=this.getActive();if(!c.length){this.selectFirst();return null}var d;do{d=c;do d=a?d.next():d.prev();while(d.length&&d.hasClass(this.css.hidden));if(d.length)c=d}while(--b);return c},scrollTo:function(){if("scroll"!=this.listScroll.css(this.overflowCSS))return false;var a=this.getActive();if(!a.length)return false;var b=Math.floor(a.position().top);a=a.outerHeight(true); +var c=this.listWrapper.height(),d=this.listScroll.scrollTop(),e=this.options.viewAhead*a;if(b=c-e)b=d+b-c+a+e;else return false;this.listScroll.scrollTop(b);return true},getCurrentTextValue:function(){return g.trim(this.input.val())},stopEvent:function(a){a=a?a:window.event;a.cancel=true;a.cancelBubble=true;a.returnValue=false;a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault()},overwriteClass:function(a,b){var c,d,e,h=0;for(d=a.length;d--;){c=a[d];e= +c.length;for(h+=e;e--;)c[e].setAttribute(g.ui.ufd.classAttr,b)}return h},listVisible:function(){return!this.listWrapper.hasClass(this.css.hidden)},disable:function(){this.hideList();this.isDisabled=true;this.button.addClass(this.css.buttonDisabled);this.input.addClass(this.css.inputDisabled);this.input.attr("disabled","disabled");this.selectbox.attr("disabled","disabled")},enable:function(){this.isDisabled=false;this.button.removeClass(this.css.buttonDisabled);this.input.removeClass(this.css.inputDisabled); +this.input.removeAttr("disabled");this.selectbox.removeAttr("disabled")},selectAll:function(){this.input.get(0).select()},getDropdownContainer:function(){var a=g("#"+this.options.dropDownID);a.length||(a=g("
    ").appendTo("body").css("height",0).attr("id",this.options.dropDownID));return a},log:function(a){if(this.options.log){window.console&&window.console.log&&console.log(a);this.logNode&&this.logNode.length&&this.logNode.prepend("
    "+a+"
    ")}},_calculateZIndex:function(){var a,b= +this.options.zIndexPopup;this.selectbox.parents().each(function(){a=parseInt(g(this).css("zIndex"),10);if(a>b)b=a});return b+1},changeOptions:function(){this._populateFromMaster()},destroy:function(){this.selectIsWrapped&&this.wrapper.before(this.selectbox);this._moveAttrs(this.input,this.selectbox,this.options.moveAttrs);this.labels.attr("for",this.selectbox.attr("id"));this.labels=null;this.selectbox.unbind("change.ui.ufd");g(document).unbind("click.ui.ufd",this._myDocClickHandler);this._myPollId&& +clearInterval(this._myPollId);this.wrapper.remove();this.listWrapper.remove();if(g.ui.version<"1.8"){this.selectbox.unbind("setData.ui.ufd");this.selectbox.unbind("getData.ui.ufd");this.selectbox.unbind("remove");g.widget.prototype.destroy.apply(this,arguments)}else g.Widget.prototype.destroy.apply(this,arguments);this._encodeDom=this.selectbox=null},dimensioned:false,selectIsWrapped:false,internalFocus:false,lastKey:null,selectedLi:null,isUpdatingMaster:false,created:false,hasEmphasis:false,isDisabled:false}); +var i=function(a,b){this.isInfix=!!a;this.isCaseSensitive=!!b;this.root=[null,{},false];this.infixRoots=a?{}:null};i.prototype.add=function(a,b){a=this.cleanString(a);for(var c=a.length,d=this.root,e,h=0;h0;){var d=b.pop();if(d[2]!=c){d[2]=c;d[0]&&a.unshift(d[0]);for(chr in d[1])d[1].hasOwnProperty(chr)&&b.push(d[1][chr])}}};i.prototype.cleanString=function(a){this.isCaseSensitive||(a=a.toLowerCase());return a};g.ui.ufd.getNewTrie=function(a,b){return new i(a,b)};g.extend(g.ui.ufd,{version:"0.6",getter:"", +classAttr:g.support.style?"class":"className",defaults:{skin:"plain",prefix:"ufd-",dropDownID:"ufd-container",logSelector:"#log",mimicCSS:["float","tabindex","marginLeft","marginTop","marginRight","marginBottom"],moveAttrs:["tabindex","title"],infix:true,addEmphasis:false,caseSensitive:false,submitFreeText:false,homeEndForCursor:false,allowLR:false,calculateZIndex:false,useUiCss:false,log:false,unwrapForCSS:false,listWidthFixed:true,polling:250,listMaxVisible:10,minWidth:50,maxWidth:null,manualWidth:null, +viewAhead:1,pageLength:10,delayFilter:g.support.style?1:150,delayYield:1,zIndexPopup:101,css:{input:"",inputDisabled:"disabled",inputFocus:"focus",button:"",buttonIcon:"icon",buttonDisabled:"disabled",buttonHover:"hover",buttonMouseDown:"mouseDown",li:"",liActive:"active",hidden:"invisible",wrapper:"ufd",listWrapper:"list-wrapper",listWrapperUp:"list-wrapper-up",listScroll:"list-scroll"},uiCss:{skin:"uiCss",input:"ui-widget-content",inputDisabled:"disabled",button:"ui-button",buttonIcon:"ui-icon ui-icon-triangle-1-s", +buttonDisabled:"disabled",buttonHover:"ui-state-focus",buttonMouseDown:"ui-state-active",li:"ui-menu-item",liActive:"ui-state-hover",hidden:"invisible",wrapper:"ufd ui-widget ui-widget-content",listWrapper:"list-wrapper ui-widget ui-widget",listWrapperUp:"list-wrapper-up",listScroll:"list-scroll ui-widget-content"}}});g.ui.ufd.prototype.options=g.ui.ufd.defaults})(jQuery); diff --git a/languages/de.lang.php b/languages/de.lang.php new file mode 100644 index 0000000..5ee5443 --- /dev/null +++ b/languages/de.lang.php @@ -0,0 +1,129 @@ +Es wurde folgender Grund angegeben'; + $lf['YOUHAVEBEENBANNED']='Du wurdest von der Seite verbannt.'; + $lf['REASON']='Grund:'; + $lf['LOGGEDIN']='Eingeloggt'; + $lf['YOUHAVEBEENLOGGEDIN']='Sie wurden erfolgreich eingeloggt und werden gleich weitergeleitet.'; + $lf['ERROR']='Fehler!'; + $lf['WRONGUSERORPASS']='Diese User/Passwortkombination ist nicht bekannt!'; + $lf['AUTHENTIFICATIONFAILURE']='Die Authentifizierung ist fehlgeschlagen. Bitte überprüfe die Angaben!'; + $lf['SUCCSESSFULLYLOGGEDOUT']='Du wurdest erfolgreich ausgeloggt.'; + $lf['LOGGEDOUT']='Ausgeloggt!'; + $lf['LOGOUTFAIL']='Du konntest nicht ausgeloggt werden. Möglicherweise hat ein böswilliges Javascript versucht dich auszuloggen.'; + $lf['YES']='Ja'; + $lf['NO']='Nein'; + +## ADMINCENTER + $lf['ADMINCENTER']='Admincenter'; + $lf['STARTTEXT']='Dies ist das Gehirn deiner ASTAT Installation.'; + $lf['ADDUSERTEXT']='Hier kann man Benutzer anlegen.'; + $lf['BACKTOPAGE']='Zurück zur Seite'; + $lf['ADMININDEX']='Admin-Hauptseite'; + $lf['NAVIGATION']='Navigation'; + $lf['NAVIGATIONADMIN']='Navigationsverwaltung'; + $lf['USERADMIN']='Benutzerverwaltung'; + $lf['ADDUSER']='Benutzer anlegen'; + $lf['EDITUSER']='Benutzer bearbeiten'; + $lf['GROUPADMIN']='Gruppenverwaltung'; + $lf['ADDGROUP']='Gruppe anlegen'; + $lf['EDITGROUP']='Gruppe bearbeiten'; + $lf['CONFIG']='Konfiguration'; + $lf['MODULES']='Module'; + $lf['VERSION']='Versionen/Updates'; + $lf['ADMINMENU']='Adminmenü'; + $lf['INDEXSIZE']='Indexgrösse'; + $lf['DATABASE']='Datenbank'; + $lf['TABLE']='Tabelle'; + $lf['ROWCOUNT']='Anzahl Zeilen'; + $lf['DATASIZE']='Datengrösse'; + $lf['SUMSIZE']='Gesamtgrösse'; + $lf['STATUS']='Status'; + $lf['ACTIVE']='Aktiv'; + $lf['INACTIVE']='Inaktiv'; + $lf['BANNED']='Gebannt'; + $lf['USERS']='Benutzer'; + $lf['ID']='ID'; + $lf['ACTION']='Aktion'; + $lf['DELWARNING']='Willst du wirklich den User %s löschen? Alle Daten diese Users werden gelöscht!'; + $lf['BANNEDIPS']='IP Bannen'; + $lf['IPBAN']='IP-Bannen'; + $lf['IP']='IP'; + $lf['DATE']='Datum'; + $lf['NOBANNEDIPS']='Keine gebannten IPs'; + +## LOST PASSWORD + + $lf['NEEDUSERNAME']='Du musst einen Usernamen eingeben!'; + $lf['NOVALIDCOMBO']='Diese Kombination aus Username und E-Mailadresse existiert nicht!'; + $lf['LOSTPASS']='Passwort vergessen'; + $lf['MAILSENT']='Es wurde eine E-Mail wurde an die angegebene Adresse versendet.
    Bitte folge den Anweisungen in der E-Mail um ein neues Passwort zu erhalten.'; + $lf['DATAINVAILD']='Diese Daten sind ungültig!'; + $lf['NEWPASS']='Dein neues Passwort'; + $lf['NEWPASSSENT']='Das Passwort wurde erzeugt.
    Eine Mail mit dem Passwort ist unterwegs.'; + $lf['GETPASS']='Passwort anfordern'; + $lf['FINGLONGTEXT']='

    Passwort weg?

    +

    Kein Problem. Hier kannst du einfach ein neues anfordern.
    +Gib dazu einfach deinen Usernamen und die Mailadresse deines Accounts ein.

    '; + $lf['HELLO']='Hallo'; + $lf['TXTLOSTPASS1']='Wir haben mitbekommen das du dein Passwort verloren hast. + +Keine Panik. +Benutze einfach folgenden Link um dir dein neues Passwort zusenden zu lassen:'; + $lf['TXTLOSTPASS2']=' +Solltest du kein neues Passwort angefordert haben, ignoriere diese Mail ganz einfach. + +Liebe GrĂĽsse + +Dein'; + $lf['TXTLOSTPASS3']='Hier dein neues Passwort:'; + $lf['TXTLOSTPASS4']='Du kannst dich nun ganz normal in deinen Account einloggen. + +Bitte denk daran sofort ein neues Passwort festzulegen. + +Liebe GrĂĽsse + +Dein'; +?> diff --git a/languages/en.lang.php b/languages/en.lang.php new file mode 100644 index 0000000..12475de --- /dev/null +++ b/languages/en.lang.php @@ -0,0 +1,129 @@ +The following reason has been added'; + $lf['YOUHAVEBEENBANNED']='You have been banned from the site.'; + $lf['REASON']='Reason:'; + $lf['LOGGEDIN']='Logged in'; + $lf['YOUHAVEBEENLOGGEDIN']='You are now logged in and you will be redirected'; + $lf['ERROR']='Error!'; + $lf['WRONGUSERORPASS']='Either your username or password was wrong!'; + $lf['AUTHENTIFICATIONFAILURE']='We could not authenticate you with the given credentials!'; + $lf['SUCCSESSFULLYLOGGEDOUT']='You have logged out successfully.'; + $lf['LOGGEDOUT']='Logged out!'; + $lf['LOGOUTFAIL']='We could not log you out. Maybe a malicious Javascript tried to log you out.'; + $lf['YES']='Yes'; + $lf['NO']='No'; + +## ADMINCENTER + $lf['ADMINCENTER']='Admin Control Panel'; + $lf['STARTTEXT']='This is the brain of your ASTAT installation.'; + $lf['ADDUSERTEXT']='Here you can add a user'; + $lf['BACKTOPAGE']='Back to your Page'; + $lf['ADMININDEX']='ACP-Index'; + $lf['NAVIGATION']='Navigation'; + $lf['NAVIGATIONADMIN']='Navigation-Setup'; + $lf['USERADMIN']='Users'; + $lf['ADDUSER']='Add User'; + $lf['EDITUSER']='Edit User'; + $lf['GROUPADMIN']='Groups'; + $lf['ADDGROUP']='Add Group'; + $lf['EDITGROUP']='Edit Group'; + $lf['CONFIG']='Configuration'; + $lf['MODULES']='Modules'; + $lf['VERSION']='Versions/Updates'; + $lf['ADMINMENU']='Adminmenu'; + $lf['INDEXSIZE']='Index-Size'; + $lf['DATABASE']='Database'; + $lf['TABLE']='Table'; + $lf['ROWCOUNT']='Rowcount'; + $lf['DATASIZE']='Data size'; + $lf['SUMSIZE']='Overall size'; + $lf['STATUS']='Status'; + $lf['ACTIVE']='Active'; + $lf['INACTIVE']='Inactive'; + $lf['BANNED']='Banned'; + $lf['USERS']='Users'; + $lf['ID']='ID'; + $lf['ACTION']='Action'; + $lf['DELWARNING']='Do you really want to delete User %s? All data of this user is deleted instantly!'; + $lf['BANNEDIPS']='Banned IPs'; + $lf['IPBAN']='IP-Bans'; + $lf['IP']='IP'; + $lf['DATE']='Date'; + $lf['NOBANNEDIPS']='No Banned IPs'; + +## LOST PASSWORD + + $lf['NEEDUSERNAME']='You need to provide a Username!'; + $lf['NOVALIDCOMBO']='This combination of Username and Mail does not exist!'; + $lf['LOSTPASS']='Lost Password'; + $lf['MAILSENT']='An E-Mail has been sent to you.
    Please follow the instructions in the mail to reset your Password.'; + $lf['DATAINVAILD']='Data invalid.'; + $lf['NEWPASS']='Your new Password'; + $lf['NEWPASSSENT']='A new Password was created and has been mailed to you.'; + $lf['GETPASS']='Request Password'; + $lf['FINGLONGTEXT']='

    Lost your pass?

    +

    Don\'t panic. Here you can get yourself a shiny new one.
    +Just enter your Username and Mail that belong to your account.

    '; + $lf['HELLO']='Hello'; + $lf['TXTLOSTPASS1']='You lost your Password?. + +Don\'t panic. +Just click the following link to generate a new one:'; + $lf['TXTLOSTPASS2']=' +If you didn\'t reqest a new Password, please ignore this mail. + +Best regards + +Your'; + $lf['TXTLOSTPASS3']='Here is your new Password:'; + $lf['TXTLOSTPASS4']='You can now login in your Account. + +Please remember to change this password right away. + +Best regards + +Your'; +?> diff --git a/login.php b/login.php new file mode 100644 index 0000000..447d85f --- /dev/null +++ b/login.php @@ -0,0 +1,78 @@ +run_hook('login_begin'); +$lang->setlang($session->userdata['lang']); +if($_POST['username']!='' && $_POST['password']!=''){ + $login=$session->check_login($_POST['username'],$_POST['password']); + if($login=='BANNED'){ + $core->message($lang->_('BANNED'),$lang->_('YOUHAVEBEENBANNED')); + }elseif($login){ + $pdata=array('remember'=>$_POST['remember'],'uid'=>$login,'domain'=>$config['domain']); + $plugin->run_hook('login_end',array('pdata'=>$pdata)); + // Login done. + if(isset($_POST['url']) && $_POST['url']!==''){ + $core->message($lang->_('LOGGEDIN'),$lang->_('YOUHAVEBEENLOGGEDIN'),TRUE,$_POST['url'],3); + }else{ + $core->message($lang->_('LOGGEDIN'),$lang->_('YOUHAVEBEENLOGGEDIN'),TRUE,$config['path'].'/index.php',3); + } + }else{ + $core->message($lang->_('ERROR'),$lang->_('WRONGUSERORPASS'),TRUE,$config['path'].'/index.php',3); + } +}elseif($config['use_openid']==1 && $_POST['openid_identifier']!=''){ + $openid = new SimpleOpenID; + $openid->SetIdentity($_POST['openid_identifier']); + $openid->SetApprovedURL('https://'.$config['domain'].$config['path'].'/login.php'); // Script which handles a response from OpenID Server + $openid->SetTrustRoot('https://'.$config['domain']); + $openid->SetRequiredFields(array('email','nickname','fullname','dob','gender')); + $open_id_server=$openid->GetOpenIDServer(); // Returns false if server is not found + if($open_id_server){ + $openid->Redirect(); + }else{ + $core->message($lang->_('ERROR'),$lang->_('AUTHENTIFICATIONFAILURE'),TRUE,$config['path'].'/index.php',3); + } +}elseif($config['use_openid']==1 && isset($_GET['openid_identity']) && $_GET['openid_identity']!=''){ + $openid = new SimpleOpenID; + $identity = $_GET['openid_identity']; + $openid->SetIdentity($identity); + $ok = $openid->ValidateWithServer(); + if ($ok) { + $login=$session->check_login('','',$identity); + if($login){ + $pdata=array('remember'=>$_POST['remember'],'uid'=>$login,'domain'=>$config['domain']); + $plugin->run_hook('login_end',array('pdata'=>$pdata)); + // Login done. + if(isset($_POST['url']) && $_POST['url']!==''){ + $core->message($lang->_('LOGGEDIN'),$lang->_('YOUHAVEBEENLOGGEDIN'),TRUE,$_POST['url'],3); + }else{ + $core->message($lang->_('LOGGEDIN'),$lang->_('YOUHAVEBEENLOGGEDIN'),TRUE,$config['path'].'/index.php',3); + } + }else{ + $data['username']=$_GET['openid_sreg_nickname']; + $birth=explode('-',$_GET['openid_sreg_dob']); + $data['birthday']=$birth[2].".".$birth[1].".".$birth[0]; + $gender[$_GET['openid_sreg_gender']]='selected="selected"'; + $data['realname']=$_GET['openid_sreg_fullname']; + $data['email']=$_GET['openid_sreg_email']; + $tpl->assign('openid',1); + $tpl->assign('data',$data); + $tpl->assign('gender',$gender); + $tpl->assign('identity',$_GET['openid_identity']); + $tpl->assign('captcha',$config['captcha']); + $tpl->assign('config',$config); + $content=$tpl->fetch('register.tpl'); + $core->make_page($content); + } + }else{ + $core->message($lang->_('ERROR'),$lang->_('AUTHENTIFICATIONFAILURE'),TRUE,$config['path'].'/index.php',3); + } +}else{ + $tpl->assign('config',$config); + $content=$tpl->fetch('login.tpl'); + $core->make_page($content, FALSE); +} +?> diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..5103a4c --- /dev/null +++ b/logout.php @@ -0,0 +1,20 @@ +run_hook('logout_begin'); +$session->page_begin('Logout', TRUE); +if($_GET['sid'] === $session->sid){ + $ldata=array('domain'=>$config['domain'],'uid'=>$session->uid); + $plugin->run_hook('logout_end',array($ldata)); + $session->destroy_session($session->sid); + $session->setcookie($config['cookiename'] . '_base', 0, time()-3600, $config['path'],$config['domain']); + if(isset($_GET['url']) && $_GET['url']!==''){ + $core->message($lang->_('LOGGEDOUT'),$lang->_('SUCCSESSFULLYLOGGEDOUT'),TRUE,$_GET['url'],3,FALSE,FALSE); + }else{ + $core->message($lang->_('LOGGEDOUT'),$lang->_('SUCCSESSFULLYLOGGEDOUT'),TRUE,$config['path'].'/index.php',3,FALSE,FALSE); + } +}else{ + $core->message($lang->_('ERROR'),$lang->_('LOGOUTFAIL'),FALSE,$config['path'].'/index.php'); +} +?> diff --git a/logs/index.html b/logs/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/logs/index.html @@ -0,0 +1 @@ + diff --git a/lostpw.php b/lostpw.php new file mode 100644 index 0000000..6a13d54 --- /dev/null +++ b/lostpw.php @@ -0,0 +1,72 @@ +run_hook("lostpass_begin"); +$session->page_begin("lostpass", FALSE); +if($session->userdata["uid"]!=0){ + header("Location:https://".$config["domain"]."/".$config["path"]."usercp.php"); +} +$emsg=false; +If(isset($_POST["submit"])){ + if(!isset($_POST['username']) || $_POST['username']==""){ + $emsg.=''.$lang->_('NEEDUSERNAME').'
    '; + } + if(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/",$_POST['email'])){ + $emsg.=''.$lang->_('EMAILINVALID').'
    '; + } + $result = $db->query("SELECT `uid`,`username`,`email` FROM `" . $config["prefix"] . "users` WHERE `username` LIKE '".$db->escape($_POST['username'])."' AND `email` LIKE '".$db->escape($_POST['email'])."' AND `active`=1 LIMIT 1"); + if ($db->num_rows ($result) <= 0){ + $emsg.=''.$lang->_('NOVALIDCOMBO').'
    '; + } + $u=$db->fetch_array($result); + if(!$emsg){ + // Secure Posted Data + $mail=new mail(); + $key=$session->generate_Key(10); + $mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">"); + $tpl->assign("username",$u["username"]); + $tpl->assign("sitename",$config["sitetitle"]); + $tpl->assign("url","https://".$config["domain"]."/".$config["path"]."lostpw.php?u=".$u["uid"]."&key=".$key); + $mailbody=$tpl->fetch('lostpw_mail.tpl'); + $mail->bodytext($mailbody); + + $mail->sendmail($u["username"]." <".$u["email"].">", $lang->_('LOSTPASS')); + $result = $db->query("UPDATE `" . $config["prefix"] . "users` SET `loginkey`='".$key."' WHERE `uid`='".$u["uid"]."'"); + $sdata=array("uid"=>$u["uid"],"email"=>$db->escape($u['email'])); + $plugin->run_hook("lostpass_mail",array("sdata"=>$sdata)); + $core->message($lang->_('SUCCESS'),$lang->_('MAILSENT'),TRUE,$config["path"]."/index.php",3); + + } +}elseif($_GET['u']!="" && $_GET['key']!=""){ + $result = $db->query("SELECT `uid`,`username`,`email` FROM `" . $config["prefix"] . "users` WHERE `uid`='".intval($_GET['u'])."' AND `loginkey` ='".$db->escape($_GET['key'])."' AND `active`=1 LIMIT 1"); + if ($db->num_rows ($result) <= 0){ + $emsg.=''.$lang->_('DATAINVALID').'
    '; + } + if(!$emsg){ + $u=$db->fetch_array($result); + $password=$session->generate_Key(8); + $salt = $session->generate_Key(6); + $pass =hash('sha256',$db->escape($salt.$password)); + $key=$session->generate_Key(10); + $mail=new mail(); + $mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">"); + $tpl->assign("username",$u["username"]); + $tpl->assign("sitename",$config["sitetitle"]); + $tpl->assign("passwort",$password); + $mailbody=$tpl->fetch('lostpw_mail_pw.tpl'); + $mail->bodytext($mailbody); + $mail->sendmail($u["username"]." <".$u["email"].">",$lang->_('NEWPASS')); + $result = $db->query("UPDATE `" . $config["prefix"] . "users` SET `password`='".$pass."',`loginkey`='".$key."',`salt`='".$salt."' WHERE `uid`='".$u["uid"]."'"); + $sdata=array("uid"=>$u["uid"],"pwd_md5"=>hash("md5",$password),"pwd_sha2"=>$pass,'salt'=>$salt,"email"=>$db->escape($u['email'])); + $plugin->run_hook("lostpass_mail_pw",array("sdata"=>$sdata)); + $core->message($lang->_('SUCCESS'),$lang->_('NEWPASSSENT'),TRUE,$config["path"]."/index.php",3); + } +} +$tpl->assign("emsg",$emsg); +$tpl->assign("data",$_POST); +$content=$tpl->fetch('lostpw.tpl'); +$core->make_page($content); + +?> diff --git a/modules/contact/.svn/all-wcprops b/modules/contact/.svn/all-wcprops new file mode 100644 index 0000000..7297f0c --- /dev/null +++ b/modules/contact/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 40 +/astat/!svn/ver/69/trunk/modules/contact +END +contact.output.php +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/69/trunk/modules/contact/contact.output.php +END +contact.module.php +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/69/trunk/modules/contact/contact.module.php +END diff --git a/modules/contact/.svn/entries b/modules/contact/.svn/entries new file mode 100644 index 0000000..47640eb --- /dev/null +++ b/modules/contact/.svn/entries @@ -0,0 +1,106 @@ +9 + +dir +69 +http://svn.astat.org/astat/trunk/modules/contact +http://svn.astat.org/astat + + + +2009-10-10T17:35:03.895480Z +69 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + + + + + + + + +0 + +contact.output.php +file + + + + +2009-10-10T17:32:51.000000Z +4e9c64ab0cff2c58d91082a33ac83851 +2009-10-10T17:35:03.895480Z +69 +genuineparts + + + + + + + + + + + + + + + + + + + + + +3382 + +contact.module.php +file + + + + +2009-10-10T17:14:15.000000Z +cd8f1c2ddfb4b2ccd79c0a24bca98c87 +2009-10-10T17:35:03.895480Z +69 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1585 + +templates +dir + diff --git a/modules/contact/.svn/format b/modules/contact/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/modules/contact/.svn/format @@ -0,0 +1 @@ +9 diff --git a/modules/contact/.svn/text-base/contact.module.php.svn-base b/modules/contact/.svn/text-base/contact.module.php.svn-base new file mode 100644 index 0000000..df50f8c --- /dev/null +++ b/modules/contact/.svn/text-base/contact.module.php.svn-base @@ -0,0 +1,44 @@ +query("INSERT INTO `" . $config["prefix"] . "config_categorys` ( + `cid` , + `categoryname` + ) + VALUES ( + NULL , 'Kontaktformular' + );"); + $cid=$db->last_id(); + $db->query("INSERT INTO `" . $config["prefix"] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES + ('contact_email', 'contact@example.com', 'E-Mailadresse', 'Die E-Mailadresse(n) an die Kontaktanfragen gesendet werden sollen (meherer Adressen mit Komma trennen).', 'text', ".$cid."), + ('contact_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");"); + return TRUE; + } + + function uninstall(){ + global $config, $db; + $db->query("DELETE FROM `" . $config["prefix"] . "config_categorys` WHERE categoryname='Kontaktformular'"); + $db->query("DELETE FROM `" . $config["prefix"] . "config` WHERE name in ('contact_email','contact_captcha')"); + return TRUE; + } + +} + +?> diff --git a/modules/contact/.svn/text-base/contact.output.php.svn-base b/modules/contact/.svn/text-base/contact.output.php.svn-base new file mode 100644 index 0000000..c38d328 --- /dev/null +++ b/modules/contact/.svn/text-base/contact.output.php.svn-base @@ -0,0 +1,76 @@ + +* @package astat core +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @version $Id$ +*/ + +If (!defined("in_astat")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("Contactform", FALSE); + +class contact extends module{ + + function output(){ + global $module,$config,$db,$log,$core,$error; + $emsg=FALSE; + if(isset($_POST['submit'])){ + if(!isset($_POST['name']) || $_POST['name']==""){ + $emsg.='Du musst deinen Namen eingeben!
    '; + }elseif(!isset($_POST['email']) || $_POST['email']==""){ + $emsg.='Du musst deine E-Mailadresse eingeben!
    '; + }elseif(!isset($_POST['subject']) || $_POST['subject']==""){ + $emsg.='Du musst einen Betreff eingeben!
    '; + }elseif(!isset($_POST['message']) || $_POST['message']==""){ + $emsg.='Du musst eine Nachricht eingeben!
    '; + } + if(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/",$_POST['email'])){ + $emsg.='Deine E-Mail ist ungültig!
    '; + } + if($config['contact_captcha']==1){ + include ('thirdparty/securimage/securimage.php'); + $img = new Securimage(); + if(!$img->check($_POST['captcha'])){ + $emsg.='Das CAPTCHA ist ungültig!
    '; + } + } + if(!$emsg){ + $mail=new mail(); + $mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">"); + $this->tpl->assign('post',$_POST); + $this->tpl->assign("sitename",$config["sitetitle"]); + $mailbody=$this->tpl->fetch('contact_mail.tpl'); + $mail->bodytext($mailbody); + $mail->sendmail($config["contact_email"],"Kontakt von ".$_POST["name"]); + $core->message("Danke","Deine Nachricht wurde versendet.
    Wir werden so schnell wie möglich Kontakt mit Dir aufnehmen.",TRUE,$config["path"]."/index.php",3); + } + } + $this->tpl->assign('post',$_POST); + $this->tpl->assign('emsg',$emsg); + $this->tpl->assign('captcha',$config['contact_captcha']); + $this->tpl->assign('sid',md5(uniqid(time()))); + return $this->tpl->fetch('contactform.tpl', 'contactform'); + } + +} +?> diff --git a/modules/contact/contact.module.php b/modules/contact/contact.module.php new file mode 100644 index 0000000..df50f8c --- /dev/null +++ b/modules/contact/contact.module.php @@ -0,0 +1,44 @@ +query("INSERT INTO `" . $config["prefix"] . "config_categorys` ( + `cid` , + `categoryname` + ) + VALUES ( + NULL , 'Kontaktformular' + );"); + $cid=$db->last_id(); + $db->query("INSERT INTO `" . $config["prefix"] . "config` (`name`, `value`, `title`, `description`, `option`, `category`) VALUES + ('contact_email', 'contact@example.com', 'E-Mailadresse', 'Die E-Mailadresse(n) an die Kontaktanfragen gesendet werden sollen (meherer Adressen mit Komma trennen).', 'text', ".$cid."), + ('contact_captcha', '1', 'Captcha verwenden?', 'Soll bei der Kontaktaufnahme ein Captcha angezeigt werden?', 'yesno', ".$cid.");"); + return TRUE; + } + + function uninstall(){ + global $config, $db; + $db->query("DELETE FROM `" . $config["prefix"] . "config_categorys` WHERE categoryname='Kontaktformular'"); + $db->query("DELETE FROM `" . $config["prefix"] . "config` WHERE name in ('contact_email','contact_captcha')"); + return TRUE; + } + +} + +?> diff --git a/modules/contact/contact.output.php b/modules/contact/contact.output.php new file mode 100644 index 0000000..c38d328 --- /dev/null +++ b/modules/contact/contact.output.php @@ -0,0 +1,76 @@ + +* @package astat core +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @version $Id$ +*/ + +If (!defined("in_astat")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("Contactform", FALSE); + +class contact extends module{ + + function output(){ + global $module,$config,$db,$log,$core,$error; + $emsg=FALSE; + if(isset($_POST['submit'])){ + if(!isset($_POST['name']) || $_POST['name']==""){ + $emsg.='Du musst deinen Namen eingeben!
    '; + }elseif(!isset($_POST['email']) || $_POST['email']==""){ + $emsg.='Du musst deine E-Mailadresse eingeben!
    '; + }elseif(!isset($_POST['subject']) || $_POST['subject']==""){ + $emsg.='Du musst einen Betreff eingeben!
    '; + }elseif(!isset($_POST['message']) || $_POST['message']==""){ + $emsg.='Du musst eine Nachricht eingeben!
    '; + } + if(!preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/",$_POST['email'])){ + $emsg.='Deine E-Mail ist ungültig!
    '; + } + if($config['contact_captcha']==1){ + include ('thirdparty/securimage/securimage.php'); + $img = new Securimage(); + if(!$img->check($_POST['captcha'])){ + $emsg.='Das CAPTCHA ist ungültig!
    '; + } + } + if(!$emsg){ + $mail=new mail(); + $mail->set_header("From",$config["sitetitle"]." <".$config["siteemail"].">"); + $this->tpl->assign('post',$_POST); + $this->tpl->assign("sitename",$config["sitetitle"]); + $mailbody=$this->tpl->fetch('contact_mail.tpl'); + $mail->bodytext($mailbody); + $mail->sendmail($config["contact_email"],"Kontakt von ".$_POST["name"]); + $core->message("Danke","Deine Nachricht wurde versendet.
    Wir werden so schnell wie möglich Kontakt mit Dir aufnehmen.",TRUE,$config["path"]."/index.php",3); + } + } + $this->tpl->assign('post',$_POST); + $this->tpl->assign('emsg',$emsg); + $this->tpl->assign('captcha',$config['contact_captcha']); + $this->tpl->assign('sid',md5(uniqid(time()))); + return $this->tpl->fetch('contactform.tpl', 'contactform'); + } + +} +?> diff --git a/modules/contact/templates/.svn/all-wcprops b/modules/contact/templates/.svn/all-wcprops new file mode 100644 index 0000000..579659e --- /dev/null +++ b/modules/contact/templates/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 50 +/astat/!svn/ver/69/trunk/modules/contact/templates +END diff --git a/modules/contact/templates/.svn/entries b/modules/contact/templates/.svn/entries new file mode 100644 index 0000000..559d097 --- /dev/null +++ b/modules/contact/templates/.svn/entries @@ -0,0 +1,38 @@ +9 + +dir +69 +http://svn.astat.org/astat/trunk/modules/contact/templates +http://svn.astat.org/astat + + + +2009-10-10T17:35:03.895480Z +69 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + + + + + + + + +0 + +default +dir + diff --git a/modules/contact/templates/.svn/format b/modules/contact/templates/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/modules/contact/templates/.svn/format @@ -0,0 +1 @@ +9 diff --git a/modules/contact/templates/default/.svn/all-wcprops b/modules/contact/templates/default/.svn/all-wcprops new file mode 100644 index 0000000..d2c0837 --- /dev/null +++ b/modules/contact/templates/default/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 58 +/astat/!svn/ver/69/trunk/modules/contact/templates/default +END +contact_mail.tpl +K 25 +svn:wc:ra_dav:version-url +V 75 +/astat/!svn/ver/69/trunk/modules/contact/templates/default/contact_mail.tpl +END +contactform.tpl +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/69/trunk/modules/contact/templates/default/contactform.tpl +END diff --git a/modules/contact/templates/default/.svn/entries b/modules/contact/templates/default/.svn/entries new file mode 100644 index 0000000..f802170 --- /dev/null +++ b/modules/contact/templates/default/.svn/entries @@ -0,0 +1,103 @@ +9 + +dir +69 +http://svn.astat.org/astat/trunk/modules/contact/templates/default +http://svn.astat.org/astat + + + +2009-10-10T17:35:03.895480Z +69 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + + + + + + + + +0 + +contact_mail.tpl +file + + + + +2009-10-10T17:29:38.000000Z +86f998db070b9b0b66eb88fe226d05fe +2009-10-10T17:35:03.895480Z +69 +genuineparts + + + + + + + + + + + + + + + + + + + + + +164 + +contactform.tpl +file + + + + +2009-10-10T17:26:12.000000Z +cfefcc99aa476b7778f8c5722d29ea4a +2009-10-10T17:35:03.895480Z +69 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2084 + diff --git a/modules/contact/templates/default/.svn/format b/modules/contact/templates/default/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/modules/contact/templates/default/.svn/format @@ -0,0 +1 @@ +9 diff --git a/modules/contact/templates/default/.svn/text-base/contact_mail.tpl.svn-base b/modules/contact/templates/default/.svn/text-base/contact_mail.tpl.svn-base new file mode 100644 index 0000000..834b92e --- /dev/null +++ b/modules/contact/templates/default/.svn/text-base/contact_mail.tpl.svn-base @@ -0,0 +1,8 @@ +Jemand hat Kontakt über das {$sitename}-Kontaktformular aufgenommen. + +Name: {$post.name} +E-Mail: {$post.email} +Betreff: {$post.subject} + +Nachricht: +{$post.message} diff --git a/modules/contact/templates/default/.svn/text-base/contactform.tpl.svn-base b/modules/contact/templates/default/.svn/text-base/contactform.tpl.svn-base new file mode 100644 index 0000000..6be6c67 --- /dev/null +++ b/modules/contact/templates/default/.svn/text-base/contactform.tpl.svn-base @@ -0,0 +1,38 @@ +

    Kontaktformular

    +{$emsg}
    + + + + + + + + + + + + + + + + + + {if $captcha==1} + + + + + + + + + {/if} + + + +
    Name:
    Email:
    Betreff:
    Nachricht:
    Captcha:
    Refresh Sound
    Captcha eingeben:
    +   +
    + Alle Felder sind Pflichtfelder! +
    +
    diff --git a/modules/contact/templates/default/contact_mail.tpl b/modules/contact/templates/default/contact_mail.tpl new file mode 100644 index 0000000..834b92e --- /dev/null +++ b/modules/contact/templates/default/contact_mail.tpl @@ -0,0 +1,8 @@ +Jemand hat Kontakt über das {$sitename}-Kontaktformular aufgenommen. + +Name: {$post.name} +E-Mail: {$post.email} +Betreff: {$post.subject} + +Nachricht: +{$post.message} diff --git a/modules/contact/templates/default/contactform.tpl b/modules/contact/templates/default/contactform.tpl new file mode 100644 index 0000000..a3eca6d --- /dev/null +++ b/modules/contact/templates/default/contactform.tpl @@ -0,0 +1,32 @@ +
    +
    +
    +

    Kontaktformular


    +
    +
    +
    +{$emsg}
    +
    +

    + +
    +

    + +
    +

    + +
    +

    + + {if $captcha==1} +
    +
    Refresh Sound

    +

    + {/if} + Alle Felder mit * sind Pflichtfelder!

    + +
    +
    +
    + + diff --git a/modules/index.html b/modules/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/modules/index.html @@ -0,0 +1 @@ + diff --git a/modules/news/admin/add.apnl.php b/modules/news/admin/add.apnl.php new file mode 100644 index 0000000..498fb7e --- /dev/null +++ b/modules/news/admin/add.apnl.php @@ -0,0 +1,142 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: add.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("add News", True); + +class add_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['text'])&& $_POST['text']!=""||isset($_POST['title'])&& $_POST['title']!=""){ + $title=$db->escape($_POST['title']); + $db->query("INSERT INTO `" . $config["prefix"] . "news` (`text`,`date`,`author`,`category`,`title`,`active`) VALUES ('".$db->escape($_POST["text"])."','".time()."','".$session->userdata["uid"]."','".intval($_POST["category"])."','".$title."','".$_POST["active"]."')"); + $panel->admin_message("Danke", "Die News wurden erfolgreich eingetragen!.",TRUE,"add_news"); + }else{ + $fail="Du musst alle Felder ausfüllen!"; + } + }elseif(!isset($_POST['send']) || $fail){ + $panel->title="News schreiben"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=add_news")); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Titel:

    "; + $panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"])); + $resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "news_category` WHERE `active`='true'"); + $karray["Keine"]=""; + while($row=$db->fetch_array($resultc)){ + $karray[$row["name"]]=$row["id"]; + } + $panel->content.="

    Kategorie:

    "; + $panel->select($karray,$_POST["category"],"category"); + $panel->content.="
    "; + $panel->content.="

    Text:

    "; + $panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\""); + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + } + } + + function meta(){ + global $config; + $meta=" + "; + $meta.=' + + + '; + return $meta; + } +} +?> \ No newline at end of file diff --git a/modules/news/admin/addcategory.apnl.php b/modules/news/admin/addcategory.apnl.php new file mode 100644 index 0000000..4e57e3e --- /dev/null +++ b/modules/news/admin/addcategory.apnl.php @@ -0,0 +1,81 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: addcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("add news Category", True); + +class addcategory_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $root, $session, $core; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['name'])&& $_POST['name']!=""){ + $userfile_name = $_FILES['picture']['name']; + $userfile_tmp = $_FILES['picture']['tmp_name']; + $userfile_size = $_FILES['picture']['size']; + $userfile_type = $_FILES['picture']['type']; + $filedir = $root.'/newsimages/'; + $size = 700; + if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ + $prod_img = $filedir.$userfile_name; + $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); + if($ret!==TRUE){ + $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"addcategory_news"); + } + } + $name=$db->escape($_POST['name']); + $active=$db->escape($_POST['active']); + $db->query("INSERT INTO `" . $config["prefix"]. "news_category` (`name`,`picture`,`active`) VALUES ('".$name."','".$userfile_name."','".$active."')"); + $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_news"); + }else{ + $fail="Der Kategoriename muss angegeben werden!"; + } + }elseif(!isset($_POST['send']) || $fail){ + $panel->title="Kategorie hinzufügen"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addcategory_news"),FALSE,"enctype=\"multipart/form-data\""); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Kategoriename:

    "; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"])); + $panel->content.="

    Kategoriebild:

    "; + $panel->field(array("name"=>"picture","typ"=>"file","value"=>$_POST["picture"])); + $panel->content.="
    "; + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + } + } +} +?> diff --git a/modules/news/admin/edit.apnl.php b/modules/news/admin/edit.apnl.php new file mode 100644 index 0000000..66b0989 --- /dev/null +++ b/modules/news/admin/edit.apnl.php @@ -0,0 +1,227 @@ + + * @package BeCast WebEngine core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: edit.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ +If (!defined('in_BL_ADMIN')) { + die('Dieses Script kann nicht ausserhalb des Frameworks laufen!'); +} +$session->page_begin('edit News', True); + +class edit_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session, $admin; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['id'])&& $_POST['id']!=''||isset($_POST['text'])&& $_POST['text']!=''||isset($_POST['title'])&& $_POST['title']!=''){ + $id=intval($_POST['id']); + $title=$db->escape($_POST['title']); + $db->query("UPDATE `" . $config['prefix'] . "news` SET `text`='".$db->escape($_POST['text'])."',`category`='".intval($_POST['category'])."',`title`='".$title."',`active`='".$_POST['active']."' WHERE `id`='".$id."'"); + $panel->admin_message('Danke', 'News erfolgreich geändert!',TRUE,'edit_news'); + }else{ + $fail='Du musst alle Felder ausfüllen!'; + } + + }elseif(isset($_GET['id'])&& $_GET['id']!=''){ + if($_GET['action']=='edit'){ + $result = $db->query("SELECT * FROM " . $config['prefix'] . "news WHERE id='".intval($_GET['id'])."'"); + $_POST=$db->fetch_array($result); + + /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); + while($rowa=$db->fetch_array($resultna)){ + $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); + if($db->num_rows($resultn) >= 1){ + $rowa["checked"]="checked=\"checked\""; + } + $navs[]=$rowa; + }*/ + + + $panel->title='News editieren'; + $panel->form(array('action'=>$config['path'].'/admin/index.php?panel=edit_news')); + if($fail){ + $panel->content.=$fail; + } + $panel->content.='

    Titel:

    '; + $panel->field(array('name'=>'title','typ'=>'text','value'=>$_POST['title'])); + $panel->content.='

    Kategorie:

    '; + $resultc=$db->query("SELECT `id`,`name` FROM `" . $config['prefix'] . "news_category` WHERE `active`='true'"); + $karray['Keine']=''; + while($row=$db->fetch_array($resultc)){ + $karray[$row['name']]=$row['id']; + } + $panel->select($karray,$_POST['category'],'category'); + $panel->content.='

    Text:

    '; + $panel->textarea(array('name'=>'text','value'=>$_POST['text'],'rows'=>'30','cols'=>'80'),'class="mceEditor"'); + $panel->content.='

    Aktiv:

    '; + $panel->select(array('Nein'=>'false','Ja'=>'true'),$_POST['active'],'active'); + $panel->content.='
    '; + $panel->field(array('name'=>'send','typ'=>'hidden','value'=>'1')); + $panel->field(array('name'=>'id','typ'=>'hidden','value'=>$_GET['id'])); + $panel->content.='
    '; + $panel->submit(); + $panel->formClose(); + }elseif($_GET['action']=='delete' && $_GET['id']){ + $db->query("DELETE FROM `" . $config['prefix'] . "news` WHERE `id`='".intval($_GET['id'])."'"); + $panel->admin_message('News gelöscht!','Die News wurden erfolgreich gelöscht.',True,'edit_news',3); + } + + }else{ + $result = $db->query("SELECT a.`title`,a.`id`,a.`active`,a.`date`,c.`name`,u.`username` FROM `" . $config['prefix'] . "news` a LEFT JOIN `" . $config['prefix'] . "news_category` c ON a.`category`=c.`id` LEFT JOIN `" . $config['prefix'] . "users` u on a.`author`=u.`uid`") or die($db->error()); + while($row=$db->fetch_array($result, $db->ASSOC)){ + $row['dates']=date('d.m.Y',$row['date']); + $news[]=$row; + } + $panel->title='Vorhandene Artikel'; + $panel->content.=' + + + + + + + + '; + if(!empty($news)){ + foreach($news as $u){ + if($u['active']=='true'){ + $u['a']='Ja'; + }else{ + $u['a']='Nein'; + } + $panel->content.=' + + + + + '; + $panel->content.=' + '; + } + }else{ + $panel->content.=' + + '; + } + $panel->content.='
    IDNameKategorienAktivUserAktionen
    '.$u['id'].''.$u['title'].''.$u['name'].''.$u['a'].''.$u['username'].'
    Keine News vorhanden.

    '; + } + } + + function meta(){ + global $config; + $meta=" + "; + $meta.=' + + '; + $meta.=''; + $meta.=' + + + '; + return $meta; + } +} +?> diff --git a/modules/news/admin/editcategory.apnl.php b/modules/news/admin/editcategory.apnl.php new file mode 100644 index 0000000..29059ce --- /dev/null +++ b/modules/news/admin/editcategory.apnl.php @@ -0,0 +1,190 @@ + + * @package BeCast WebEngine core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: editcategory.apnl.php 96 2010-02-17 21:56:41Z genuineparts $ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("edit news category", True); + +class editcategory_news_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session, $root, $core, $admin; + $fail=FALSE; + + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['name'])&& $_POST['name']!=""){ + $userfile_name = $_FILES['picture']['name']; + $userfile_tmp = $_FILES['picture']['tmp_name']; + $userfile_size = $_FILES['picture']['size']; + $userfile_type = $_FILES['picture']['type']; + $filedir = $root.'/newsimages/'; + $size = 700; + if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ + $prod_img = $filedir.$userfile_name; + $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); + if($ret!==TRUE){ + $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"editcategory_news"); + } + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $file=$db->fetch_array($result); + @unlink($filedir.$file['picture']); + $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'"); + }elseif($_POST["delimg"]==1){ + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "news_category` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $file=$db->fetch_array($result); + @unlink($filedir.$file['picture']); + $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'"); + } + + $name=$db->escape($_POST['name']); + $active=$db->escape($_POST['active']); + $db->query("UPDATE `" . $config["prefix"]. "news_category` SET `name`='".$name."', `active`='".$active."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); + $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich editiert!.",TRUE,"editcategory_news"); + }else{ + $fail="Der Kategoriename muss angegeben werden!"; + } + + }elseif(isset($_GET['id'])&& $_GET['id']!=""){ + if($_GET['action']=="edit"){ + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET['id'])."'"); + $_POST=$db->fetch_array($result); + /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); + while($rowa=$db->fetch_array($resultna)){ + $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); + if($db->num_rows($resultn) >= 1){ + $rowa["checked"]="checked=\"checked\""; + } + $navs[]=$rowa; + }*/ + + + $panel->title="Kategorie editieren"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editcategory_news"),FALSE,"enctype=\"multipart/form-data\""); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Kategoriename:

    "; + $panel->field(array("name"=>"name","typ"=>"text","value"=>$_POST["name"])); + if($_POST["picture"]!=""){ + $panel->content.="

    aktuelles Kategoriebild:

    "; + $panel->content.="\"Kategoriebild\""; + $panel->content.="
    "; + $panel->checkbox(array("name"=>"delimg","value"=>"1")); + $panel->content.=" Bild löschen?"; + $panel->content.="
    "; + } + $panel->content.="

    neues Kategoriebild:

    "; + $panel->field(array("name"=>"picture","typ"=>"file")); + $panel->content.="
    "; + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id'])); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + + }elseif($_GET["action"]=="delete" && $_GET["id"]){ + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "news_category` where `id`='".intval($_GET["id"])."'"); + $row = $db->fetch_array($result); + @unlink($root.'/catimages/'.$row["picture"]); + $db->query("DELETE FROM `" . $config["prefix"] . "news_category` WHERE `id`='".intval($_GET["id"])."'"); + $panel->admin_message("Kategorie gelöscht!","Die Kategorie wurde erfolgreich gelöscht.",True,"editcategory_news",3); + } + + }else{ + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "news_category`"); + while($row=$db->fetch_array($result, $db->ASSOC)){ + $articles[]=$row; + } + $panel->title="Vorhandene Kategorien"; + $panel->content.=" + + + + + + + "; + if(!empty($articles)){ + foreach($articles as $u){ + $panel->content.=" + + + "; + if($u["active"]=="true"){ + $panel->content.=""; + }else{ + $panel->content.=""; + } + $panel->content.=" + "; + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
    IDNameBildAktivAktionen
    ".$u["id"]."".$u["name"]."".$u["picture"]."JaNein
    Keine Kategorien vorhanden.

    "; + } + } + + function meta(){ + $meta.=' + + '; + + $meta.=''; + return $meta; + } +} +?> diff --git a/modules/news/news.module.php b/modules/news/news.module.php new file mode 100644 index 0000000..9f65751 --- /dev/null +++ b/modules/news/news.module.php @@ -0,0 +1,69 @@ +query("CREATE TABLE `" . $config['prefix'] . "news` ( + `id` int(11) NOT NULL auto_increment, + `title` varchar(60) NOT NULL default '', + `text` text NOT NULL, + `author` int(11) NOT NULL default '0', + `date` int(11) NOT NULL default '0', + `category` mediumint(9) NOT NULL default '0', + `active` enum('false','true') NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=MyISAM"); + + $db->query("CREATE TABLE `" . $config['prefix'] . "news_category` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(60) NOT NULL default '', + `picture` varchar(60) NOT NULL, + `active` enum('false','true') NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=MyISAM"); + + + mkdir ($_SERVER["DOCUMENT_ROOT"] . $config['path']."/newsimages", 0777); + return TRUE; + } + + function uninstall(){ + global $config, $db; + $db->query("DELETE FROM `" . $config["prefix"] . "navigation` WHERE file='frontpage_news'"); + $db->query("DROP TABLE `" . $config["prefix"] . "news`"); + $db->query("DROP TABLE `" . $config["prefix"] . "news_category`"); + @$this->recursive($_SERVER["DOCUMENT_ROOT"]. $config['path']."/newsimages"); + return TRUE; + } + + function recursive($dest){ + $list = array_diff(scandir($dest), array('.', '..')); + foreach ($list as $value) { + $file = $dest.'/'.$value; + if (is_dir($file)) { + recursive($file); + }else{ + unlink($file); + } + } + return rmdir($dest); + } +} + + +?> diff --git a/modules/news/news.plugins.php b/modules/news/news.plugins.php new file mode 100644 index 0000000..527b95e --- /dev/null +++ b/modules/news/news.plugins.php @@ -0,0 +1,49 @@ +use_hook('frontpage_news',array($this,"newsview")); + $plugin->use_hook('navigation_mainmodule',array($this,"frontpage_nav")); + } + + function newsview(){ + global $db, $config; + $this->tpl= new Smarty(); + $parser=new textparser(true); + $root = $_SERVER['DOCUMENT_ROOT'] . $config["path"]; + $this->tpl->compile_dir = $root . '/core/template/templates_c'; + $this->tpl->cache_dir = $root . '/core/template/cache'; + $this->tpl->config_dir = $root . '/core/template/config'; + $this->tpl->caching = $config["caching"]; + $this->tpl->assign("path",$config["path"]."/"); + if(isset($config["theme"]) && is_dir($root . '/modules/news/templates/'.$config["theme"])){ + $this->tpl-> template_dir = $root . '/modules/news/templates/'.$config["theme"]; + }else{ + $this->tpl-> template_dir = $root . '/modules/news/templates/default'; + } + $result=$db->query("SELECT u.`username`, n.`title`, n.`date`, n.`text`, c.`name`,c.`picture` FROM `" . $config["prefix"] . "news` n LEFT JOIN `" . $config["prefix"] . "news_category` c ON n.`category`=c.`id` LEFT JOIN `" . $config["prefix"] . "users` u ON u.`uid`=n.`author` WHERE n.`active`='true' ORDER BY n.`date` DESC LIMIT 10"); + while($row=$db->fetch_array($result)){ + $row["year"]=date("Y",$row["dateline"]); + $row["month"]=date("M",$row["dateline"]); + $row["day"]=date("d",$row["dateline"]); + $row["time"]=date("h:i",$row["dateline"]); + $row["date"]=date("d.m.Y",$row["dateline"]); + $row["text"]=$parser->parse($row["message"]); + $news[]=$row; + } + $this->tpl->assign('news', $news); + return $this->tpl->fetch('news.tpl',"news"); + } + + function frontpage_nav($mainmodule){ + global $db, $config,$mainmodule; + $mainmodule.="
    News
    "; + return; + } +} + + +?> diff --git a/modules/news/templates/coppertopia/news.tpl b/modules/news/templates/coppertopia/news.tpl new file mode 100644 index 0000000..2c86110 --- /dev/null +++ b/modules/news/templates/coppertopia/news.tpl @@ -0,0 +1,25 @@ +
    +

    News

    +{foreach from=$news item=n} +
    +
    +{if $n.picture!=""}{$n.name}{/if} + +
    +
    +{$n.title} +

    {$n.text}

    +
    +
    + +by {$n.username} on {$n.date} + +
    + +
    +{foreachelse} +{/foreach} +
    \ No newline at end of file diff --git a/modules/news/templates/default/news.tpl b/modules/news/templates/default/news.tpl new file mode 100644 index 0000000..882e79d --- /dev/null +++ b/modules/news/templates/default/news.tpl @@ -0,0 +1,9 @@ +

    News

    +{foreach from=$news item=n} +

    {$n.title}

    +

    Written by {$n.username} on {$n.date}

    +{if $n.picture!=""}
    {$n.name}
    {/if} +{$n.text} +{if $edituser!=""}
    (zuletzt editiert am {$editdate}, von {$edituser})
    {/if} +{foreachelse} +{/foreach} diff --git a/modules/text/admin/add.apnl.php b/modules/text/admin/add.apnl.php new file mode 100644 index 0000000..3dd6a5e --- /dev/null +++ b/modules/text/admin/add.apnl.php @@ -0,0 +1,184 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("add Text", True); + +class add_text_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['text'])&& $_POST['text']!=""||isset($_POST['url'])&& $_POST['url']!=""||isset($_POST['title'])&& $_POST['title']!=""){ + $url=$db->escape($_POST['url']); + $title=$db->escape($_POST['title']); + $mid=intval($_POST['menue']); + $result = $db->query("SELECT count(id) as count FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."'"); + $row = $db->fetch_array($result); + if($row["count"]==0){ + $db->query("BEGIN"); + $db->query("INSERT INTO `" . $config["prefix"] . "article` (`text`,`date`,`author`,`menue`,`title`,`url`,`active`) VALUES ('".$db->escape($_POST["text"])."','".time()."','".$session->userdata["uid"]."','".$mid."','".$title."','".$url."','".$_POST["active"]."')"); + $aid=$db->last_id(); + if($_POST["cats"]!=""){ + foreach($_POST["cats"] as $nid){ + $db->query("INSERT INTO `" . $config["prefix"] . "article_category` (`a_id`,`c_id`) VALUES ('".$aid."','".$nid."')"); + } + } + $db->query("COMMIT"); + $panel->admin_message("Danke", "Der Artikel wurde erfolgreich eingetragen!.",TRUE,"add_text"); + }else{ + $fail="Diese URL ist vergeben!"; + } + }else{ + $fail="Du musst alle Felder ausfüllen!"; + } + }elseif(!isset($_POST['send']) || $fail){ + $panel->title="Text hinzufügen"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=add_text")); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Titel:

    "; + $panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"])); + $panel->content.="

    Url:

    "; + $panel->field(array("name"=>"url","typ"=>"text","value"=>$_POST["url"]),"id=\"url\""); + $panel->content.=".html"; + $panel->content.="
    "; + $resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "article_menue`") or die($db->error()); + $karray["Keines"]=""; + while($row=$db->fetch_array($resultc)){ + $karray[$row["name"]]=$row["id"]; + } + $panel->content.="

    Menü:

    "; + $panel->select($karray,$_POST["menue"],"menue"); + $panel->content.="
    "; + $panel->content.="

    Kategorien:

    + + "; + $resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categorys` WHERE `active`='true'") or die($db->error()); + while($row=$db->fetch_array($resultk)){ + $navs[]=$row; + } + $i=0; + if(is_array($navs)){ + foreach($navs as $n){ + if($i % 5==0){ + $panel->content.=""; + } + $panel->checkbox(array("name"=>"cats[]","value"=>$n["id"])); + $panel->content.=$n["categoryname"]; + $i++; + } + }else{ + $panel->content.="Keine Kategorien angelegt."; + } + $panel->content.=" +

    "; + $panel->content.="

    Text:

    "; + $panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\""); + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + } + } + + function meta(){ + global $config; + $meta=" + "; + $meta.=' + + + '; + return $meta; + } +} +?> \ No newline at end of file diff --git a/modules/text/admin/addcategory.apnl.php b/modules/text/admin/addcategory.apnl.php new file mode 100644 index 0000000..bccf4f7 --- /dev/null +++ b/modules/text/admin/addcategory.apnl.php @@ -0,0 +1,81 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("add Category", True); + +class addcategory_text_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $root, $core, $session; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['categoryname'])&& $_POST['categoryname']!=""){ + $userfile_name = $_FILES['picture']['name']; + $userfile_tmp = $_FILES['picture']['tmp_name']; + $userfile_size = $_FILES['picture']['size']; + $userfile_type = $_FILES['picture']['type']; + $filedir = $root.'/catimages/'; + $size = 120; + if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ + $prod_img = $filedir.$userfile_name; + $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); + if($ret!==TRUE){ + $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"addcategory_text"); + } + } + $categoryname=$db->escape($_POST['categoryname']); + $active=$db->escape($_POST['active']); + $db->query("INSERT INTO `" . $config["prefix"]. "article_categorys` (`categoryname`,`picture`,`active`) VALUES ('".$categoryname."','".$userfile_name."','".$active."')") or die ($db->error()); + $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich eingetragen!.",TRUE,"addcategory_text"); + }else{ + $fail="Der Kategoriename muss angegeben werden!"; + } + }elseif(!isset($_POST['send']) || $fail){ + $panel->title="Kategorie hinzufügen"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=addcategory_text"),FALSE,"enctype=\"multipart/form-data\""); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Kategoriename:

    "; + $panel->field(array("name"=>"categoryname","typ"=>"text","value"=>$_POST["categoryname"])); + $panel->content.="

    Kategoriebild:

    "; + $panel->field(array("name"=>"picture","typ"=>"file","value"=>$_POST["picture"])); + $panel->content.="
    "; + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + } + } +} +?> \ No newline at end of file diff --git a/modules/text/admin/edit.apnl.php b/modules/text/admin/edit.apnl.php new file mode 100644 index 0000000..1cd0eb4 --- /dev/null +++ b/modules/text/admin/edit.apnl.php @@ -0,0 +1,278 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("edit Text", True); + +class edit_text_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session, $admin; + $fail=FALSE; + if(isset($_POST['send'])&& $_POST['send']==1){ + + if(isset($_POST['id'])&& $_POST['id']!=""||isset($_POST['text'])&& $_POST['text']!=""||isset($_POST['url'])&& $_POST['url']!=""||isset($_POST['title'])&& $_POST['title']!=""){ + $id=intval($_POST['id']); + $url=$db->escape($_POST['url']); + $title=$db->escape($_POST['title']); + $mid=intval($_POST['menue']); + $result = $db->query("SELECT count(`id`) as `count` FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."' AND `id`<>'".$id."'"); + $row = $db->fetch_array($result); + + if($row["count"]==0){ + $db->query("UPDATE `" . $config["prefix"] . "article` SET `text`='".$db->escape($_POST["text"])."',`menue`='".$mid."',`title`='".$title."',`url`='".$url."',`active`='".$_POST["active"]."',`eid`='".$session->userdata["uid"]."',`edittime`='".time()."' WHERE `id`='".$id."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "article_category` where `a_id`='".$id."'"); + if($_POST["cats"]!=""){ + foreach($_POST["cats"] as $nid){ + $db->query("INSERT INTO `" . $config["prefix"] . "article_category` (`a_id`,`c_id`) VALUES ('".$id."','".$nid."')"); + } + } + $panel->admin_message("Danke", "Artikel erfolgreich geändert!",TRUE,"edit_text"); + }else{ + $fail="Diese URL ist vergeben!"; + } + }else{ + $fail="Du musst alle Felder ausfüllen!"; + } + + }elseif(isset($_GET['id'])&& $_GET['id']!=""){ + if($_GET['action']=="edit"){ + $result = $db->query("SELECT * FROM " . $config["prefix"] . "article WHERE id='".intval($_GET['id'])."'"); + $_POST=$db->fetch_array($result); + + + $panel->title="Text editieren"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=edit_text")); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Titel:

    "; + $panel->field(array("name"=>"title","typ"=>"text","value"=>$_POST["title"])); + $panel->content.="

    Url:

    "; + $panel->field(array("name"=>"url","typ"=>"text","value"=>$_POST["url"])); + $panel->content.=".html"; + $resultc=$db->query("SELECT `id`,`name` FROM `" . $config["prefix"] . "article_menue`") or die($db->error()); + $karray["Keines"]=""; + while($row=$db->fetch_array($resultc)){ + $karray[$row["name"]]=$row["id"]; + } + $panel->content.="

    Menü:

    "; + $panel->select($karray,$_POST["menue"],"menue"); + $panel->content.="
    "; + $panel->content.="

    Kategorien:

    + + "; + $resultn = $db->query("SELECT `c_id` FROM `" . $config["prefix"] . "article_category` WHERE `a_id`='".intval($_GET['id'])."'"); + while($rowa=$db->fetch_array($resultn)){ + $cat[$rowa["c_id"]]=TRUE; + } + $resultk=$db->query("SELECT `id`,`categoryname` FROM `" . $config["prefix"] . "article_categorys` WHERE `active`='true'"); + while($row=$db->fetch_array($resultk)){ + if($cat[$row["id"]]==TRUE){ + $row["checked"]="checked=\"checked\""; + } + $navs[]=$row; + } + $i=0; + if(is_array($navs)){ + foreach($navs as $n){ + if($i % 5==0){ + $panel->content.=""; + } + $panel->checkbox(array("name"=>"cats[]","value"=>$n["id"]),$n["checked"]); + $panel->content.=$n["categoryname"]; + $i++; + } + }else{ + $panel->content.="Keine Kategorien angelegt."; + } + $panel->content.=" +

    "; + $panel->content.="

    Text:

    "; + $panel->textarea(array("name"=>"text","value"=>$_POST["text"],"rows"=>"30","cols"=>"80"),"class=\"mceEditor\""); + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id'])); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + }elseif($_GET["action"]=="delete" && $_GET["id"]){ + $db->query("DELETE FROM `" . $config["prefix"] . "article` WHERE `id`='".intval($_GET["id"])."'"); + $db->query("DELETE FROM `" . $config["prefix"] . "article_menue` where `a_id`='".$id."'"); + $panel->admin_message("Artikel gelöscht!","Der Artikel wurde erfolgreich gelöscht.",True,"edit_text",3); + } + + }else{ + $result = $db->query("SELECT a.title,a.id,a.active,a.date,a.url,u.username FROM `" . $config["prefix"] . "article` a LEFT JOIN `" . $config["prefix"] . "users` u on a.`author`=u.`uid`"); + while($row=$db->fetch_array($result, $db->ASSOC)){ + $cresult=$db->query("SELECT a.`categoryname` FROM `" . $config["prefix"] . "article_categorys` a LEFT JOIN `" . $config["prefix"] . "article_category` c on a.`id`=c.`c_id` WHERE c.`a_id`='".$row["id"]."'"); + while($crow=$db->fetch_array($cresult, $db->ASSOC)){ + if(!$row["categoryname"]){ + $row["categoryname"]=$crow["categoryname"]; + }else{ + $row["categoryname"].="
    ".$crow["categoryname"]; + } + } + $row["dates"]=date("d.m.Y",$row["date"]); + $articles[]=$row; + } + $panel->title="Vorhandene Artikel"; + $panel->content.=" + + + + + + + + + "; + if(!empty($articles)){ + foreach($articles as $u){ + if($u["active"]=="true"){ + $u["a"]="Ja"; + }else{ + $u["a"]="Nein"; + } + $panel->content.=" + + + + + + "; + $panel->content.=" + "; + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
    IDNameURLKategorienAktivUserAktionen
    ".$u["id"]."".$u["title"]."".$u["url"]."".$u["categoryname"]."".$u["a"]."".$u["username"]."
    Keine Artikel vorhanden.

    "; + } + } + + function meta(){ + global $config; + $meta=" + "; + $meta.=' + + '; + $meta.=''; + $meta.=' + + + '; + return $meta; + } +} +?> diff --git a/modules/text/admin/editcategory.apnl.php b/modules/text/admin/editcategory.apnl.php new file mode 100644 index 0000000..3b68035 --- /dev/null +++ b/modules/text/admin/editcategory.apnl.php @@ -0,0 +1,190 @@ + + * @package BeCast WebEngine core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ +*/ + +If (!defined("in_BL_ADMIN")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} +$session->page_begin("edit category", True); + +class editcategory_text_panel extends admin_module{ + + function output(){ + global $config, $db,$panel, $session, $root, $core, $admin; + $fail=FALSE; + + if(isset($_POST['send'])&& $_POST['send']==1){ + if(isset($_POST['categoryname'])&& $_POST['categoryname']!=""){ + $userfile_name = $_FILES['picture']['name']; + $userfile_tmp = $_FILES['picture']['tmp_name']; + $userfile_size = $_FILES['picture']['size']; + $userfile_type = $_FILES['picture']['type']; + $filedir = $root.'/catimages/'; + $size = 120; + if (isset($_FILES['picture']['name']) && $_FILES['picture']['name']!=""){ + $prod_img = $filedir.$userfile_name; + $ret=$core->upload_file($prod_img, $userfile_tmp, $size, $size, TRUE, TRUE); + if($ret!==TRUE){ + $panel->admin_message("Fehler", "Das Bild konnte nicht hochgeladen wrden
    Der Fehler war: ". $ret,TRUE,"editcategory_text"); + } + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categorys` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $file=$db->fetch_array($result); + @unlink($filedir.$file['picture']); + $db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='".$userfile_name."' WHERE `id`='".intval($_POST["id"])."'"); + }elseif($_POST["delimg"]==1){ + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"]. "article_categorys` WHERE `id`='".intval($_POST["id"])."' LIMIT 1"); + $file=$db->fetch_array($result); + @unlink($filedir.$file['picture']); + $db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `picture`='' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); + } + + $categoryname=$db->escape($_POST['categoryname']); + $active=$db->escape($_POST['active']); + $db->query("UPDATE `" . $config["prefix"]. "article_categorys` SET `categoryname`='".$categoryname."', `active`='".$active."' WHERE `id`='".intval($_POST["id"])."'") or die($db->error()); + $panel->admin_message("Danke", "Die Kategorie wurde erfolgreich editiert!.",TRUE,"editcategory_text"); + }else{ + $fail="Der Kategoriename muss angegeben werden!"; + } + + }elseif(isset($_GET['id'])&& $_GET['id']!=""){ + if($_GET['action']=="edit"){ + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categorys` WHERE `id`='".intval($_GET['id'])."'"); + $_POST=$db->fetch_array($result); + /*$resultna=$db->query("SELECT id,name FROM " . $config["prefix"] . "menue"); + while($rowa=$db->fetch_array($resultna)){ + $resultn = $db->query("SELECT m_id FROM " . $config["prefix"] . "article_menue WHERE a_id='".intval($_GET['id'])."' and m_id='".$rowa["id"]."'"); + if($db->num_rows($resultn) >= 1){ + $rowa["checked"]="checked=\"checked\""; + } + $navs[]=$rowa; + }*/ + + + $panel->title="Kategorie editieren"; + $panel->form(array("action"=>$config["path"]."/admin/index.php?panel=editcategory_text"),FALSE,"enctype=\"multipart/form-data\""); + if($fail){ + $panel->content.=$fail; + } + $panel->content.="

    Kategoriename:

    "; + $panel->field(array("name"=>"categoryname","typ"=>"text","value"=>$_POST["categoryname"])); + if($_POST["picture"]!=""){ + $panel->content.="

    aktuelles Kategoriebild:

    "; + $panel->content.="\"Kategoriebild\""; + $panel->content.="
    "; + $panel->checkbox(array("name"=>"delimg","value"=>"1")); + $panel->content.=" Bild löschen?"; + $panel->content.="
    "; + } + $panel->content.="

    neues Kategoriebild:

    "; + $panel->field(array("name"=>"picture","typ"=>"file")); + $panel->content.="
    "; + $panel->content.="

    Aktiv:

    "; + $panel->select(array("Nein"=>"false","Ja"=>"true"),$_POST["active"],"active"); + $panel->content.="
    "; + $panel->field(array("name"=>"send","typ"=>"hidden","value"=>"1")); + $panel->field(array("name"=>"id","typ"=>"hidden","value"=>$_GET['id'])); + $panel->content.="
    "; + $panel->submit(); + $panel->formClose(); + $panel->parse_page(); + + }elseif($_GET["action"]=="delete" && $_GET["id"]){ + $result=$db->query("SELECT `picture` FROM `" . $config["prefix"] . "article_categorys` where `id`='".intval($_GET["id"])."'"); + $row = $db->fetch_array($result); + @unlink($root.'/catimages/'.$row["picture"]); + $db->query("DELETE FROM `" . $config["prefix"] . "article_categorys` WHERE `id`='".intval($_GET["id"])."'"); + $panel->admin_message("Kategorie gelöscht!","Die Kategorie wurde erfolgreich gelöscht.",True,"editcategory_text",3); + } + + }else{ + $result = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categorys`"); + while($row=$db->fetch_array($result, $db->ASSOC)){ + $articles[]=$row; + } + $panel->title="Vorhandene Kategorien"; + $panel->content.=" + + + + + + + "; + if(!empty($articles)){ + foreach($articles as $u){ + $panel->content.=" + + + "; + if($u["active"]=="true"){ + $panel->content.=""; + }else{ + $panel->content.=""; + } + $panel->content.=" + "; + } + }else{ + $panel->content.=" + + "; + } + $panel->content.="
    IDNameBildAktivAktionen
    ".$u["id"]."".$u["categoryname"]."".$u["picture"]."JaNein
    Keine Kategorien vorhanden.

    "; + } + } + + function meta(){ + $meta.=' + + '; + + $meta.=''; + return $meta; + } +} +?> diff --git a/modules/text/templates/.svn/all-wcprops b/modules/text/templates/.svn/all-wcprops new file mode 100644 index 0000000..e8aec81 --- /dev/null +++ b/modules/text/templates/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 46 +/astat/!svn/ver/1/trunk/modules/text/templates +END diff --git a/modules/text/templates/.svn/entries b/modules/text/templates/.svn/entries new file mode 100644 index 0000000..657869f --- /dev/null +++ b/modules/text/templates/.svn/entries @@ -0,0 +1,31 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/modules/text/templates +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +default +dir + diff --git a/modules/text/templates/.svn/format b/modules/text/templates/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/modules/text/templates/.svn/format @@ -0,0 +1 @@ +9 diff --git a/modules/text/templates/default/.svn/all-wcprops b/modules/text/templates/default/.svn/all-wcprops new file mode 100644 index 0000000..d3273a5 --- /dev/null +++ b/modules/text/templates/default/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 54 +/astat/!svn/ver/1/trunk/modules/text/templates/default +END +textview.tpl +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/modules/text/templates/default/textview.tpl +END diff --git a/modules/text/templates/default/.svn/entries b/modules/text/templates/default/.svn/entries new file mode 100644 index 0000000..bc6b693 --- /dev/null +++ b/modules/text/templates/default/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/modules/text/templates/default +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +textview.tpl +file + + + + +2009-06-08T19:44:32.000000Z +c9914ec8546b33d929da6e52c51919ed +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +331 + diff --git a/modules/text/templates/default/.svn/format b/modules/text/templates/default/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/modules/text/templates/default/.svn/format @@ -0,0 +1 @@ +9 diff --git a/modules/text/templates/default/.svn/text-base/textview.tpl.svn-base b/modules/text/templates/default/.svn/text-base/textview.tpl.svn-base new file mode 100644 index 0000000..172fe60 --- /dev/null +++ b/modules/text/templates/default/.svn/text-base/textview.tpl.svn-base @@ -0,0 +1,6 @@ +

    {$article.title}

    {$article.text} +{if $article.edituser!=""}
    (zuletzt editiert am {$editdate}, von {$article.edituser})
    {/if} +

    +

    {$date} Geschrieben von {$article.username} | Abgelegt in: {if $cat!=""}{$cat}{else}nirgendwo{/if}

    + + diff --git a/modules/text/templates/default/textview.tpl b/modules/text/templates/default/textview.tpl new file mode 100644 index 0000000..8aedc28 --- /dev/null +++ b/modules/text/templates/default/textview.tpl @@ -0,0 +1,14 @@ +
    +
    +

    {$article.title}

    +

    +{$article.text} +{if $article.edituser!=""}
    (last edit at {$editdate}, by {$article.edituser})
    {/if} +

    +

    {$date} written by {$article.username}

    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/modules/text/text.ajax.php b/modules/text/text.ajax.php new file mode 100644 index 0000000..271aa5b --- /dev/null +++ b/modules/text/text.ajax.php @@ -0,0 +1,29 @@ +page_begin("Text Module", FALSE); + +$topnav_home="
  • Home
  • "; + +class text extends ajax_module{ + + function ajax(){ + global $module,$config,$db,$tpl,$log,$error; + if($_POST['call']=="url"){ + if(isset($_POST['url'])&& $_POST['url']!=""){ + $url=$db->escape($_POST['url']); + $result = $db->query("SELECT count(`id`) as `count` FROM `" . $config["prefix"] . "article` WHERE `url`='".$url."'"); + $row = $db->fetch_array($result, MYSQL_ASSOC); + if($row["count"]==0){ + echo 0; + }else{ + echo 1; + } + } + } + } + +} +?> diff --git a/modules/text/text.module.php b/modules/text/text.module.php new file mode 100644 index 0000000..e81392b --- /dev/null +++ b/modules/text/text.module.php @@ -0,0 +1,92 @@ +query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article` ( + `id` int(11) NOT NULL auto_increment, + `text` text NOT NULL, + `date` int(11) NOT NULL default '0', + `author` int(11) NOT NULL default '0', + `eid` int(11) NULL default NULL, + `edittime` int(11) NULL default NULL, + `menue` int(11) NOT NULL default '0', + `title` varchar(80) NOT NULL default '', + `url` varchar(120) NOT NULL, + `rightnavi` enum('false','true') NOT NULL, + `active` enum('true','false') NOT NULL, + PRIMARY KEY (`id`), + KEY `author` (`author`), + KEY `menue` (`menue`), + KEY `eid` (`eid`) + ) ENGINE=MyISAM"); + + $db->query("CREATE TABLE IF NOT EXISTS `" . $config["prefix"] . "article_categorys` ( + `id` int(11) NOT NULL auto_increment, + `categoryname` varchar(80) NOT NULL default '', + `picture` varchar(80) NOT NULL default '', + `active` enum('true','false') NOT NULL, + PRIMARY KEY (`id`), + KEY `active` (`active`) + ) ENGINE=MyISAM"); + + + $db->query("CREATE TABLE `" . $config["prefix"] . "article_category` ( + `a_id` int(11) NOT NULL, + `c_id` int(11) NOT NULL, + KEY `a_id` (`a_id`), + KEY `c_id` (`c_id`) + ) ENGINE=MyISAM"); + + $db->query("CREATE TABLE `" . $config["prefix"] . "article_menue` ( + `id` int(11) NOT NULL auto_increment, + `sort` int(11) NOT NULL, + `name` text NOT NULL, + PRIMARY KEY (`id`), + KEY `sort` (`sort`) + ) ENGINE=MyISAM"); + + mkdir ($_SERVER["DOCUMENT_ROOT"]."/catimages", 0777); + return TRUE; + } + + function uninstall(){ + global $config, $db; + $db->query("DROP TABLE `" . $config["prefix"] . "article`"); + $db->query("DROP TABLE `" . $config["prefix"] . "article_categorys`"); + $db->query("DROP TABLE `" . $config["prefix"] . "article_category`"); + $db->query("DROP TABLE `" . $config["prefix"] . "article_menue`"); + @$this->recursive($_SERVER["DOCUMENT_ROOT"]."/catimages"); + return TRUE; + } + + function recursive($dest){ + $list = array_diff(scandir($dest), array('.', '..')); + foreach ($list as $value) { + $file = $dest.'/'.$value; + if (is_dir($file)) { + recursive($file); + }else{ + unlink($file); + } + } + return rmdir($dest); + } +} + +?> diff --git a/modules/text/text.output.php b/modules/text/text.output.php new file mode 100644 index 0000000..27a1f5a --- /dev/null +++ b/modules/text/text.output.php @@ -0,0 +1,91 @@ + +* @package astat core +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @version $Id$ +*/ + +If (!defined("in_astat")) { + die("Dieses Script kann nicht ausserhalb des Frameworks laufen!"); +} + +$session->page_begin("Text Module", FALSE); + +class text extends module{ + + function output(){ + global $module,$config,$db,$log,$core,$error; + $textid=0; + $url=""; + if(Isset($this->get["textid"]) || Isset($this->post["textid"])){ + if(Isset($this->get["textid"])){ + $textid = intval($this->get["textid"]); + }else{ + $textid = intval($this->post["textid"]); + } + $result = $db->query("SELECT a.`id` a.`text`, a.`title`, u.`username`, eu.`username` as edituser, a.`date`, a.`edittime`, a.`eid` FROM `" . $config["prefix"] . "article` a LEFT JOIN `".$config["prefix"]."users` eu on a.`eid` = eu.`uid` LEFT JOIN `".$config["prefix"]."users` u on a.`author` = u.`uid` WHERE a.`id`='".$textid."' AND a.`active`='true'") or die($db->error()); + }elseif(Isset($this->get["url"]) || Isset($this->post["url"])){ + If(Isset($this->get["url"])){ + $url=preg_replace( '/\.html($|\?)/i', "$1", $this->get["url"] ); + }else{ + $url=preg_replace( '/\.html($|\?)/i', "$1", $db->escape_string($this->post["url"])); + } + $result = $db->query("SELECT a.`id`, a.`text`, a.`title`, u.`username`, eu.`username` as edituser, a.`date`, a.`edittime`, a.`eid` FROM `" . $config["prefix"] . "article` a LEFT JOIN `".$config["prefix"]."users` eu on a.`eid` = eu.`uid` LEFT JOIN `".$config["prefix"]."users` u on a.`author` = u.`uid` WHERE a.url='".$url."' AND a.`active`='true'"); + + + }else{ + return $error->http_error("404"); + + } + $fid=""; + $fid.=$textid; + $fid.=$url; + if($db->num_rows($result) > 0){ + if(!$this->tpl->isCached('textview.tpl',"textview".$fid)) { + $row = $db->fetch_array($result); + $cresult = $db->query("SELECT * FROM `" . $config["prefix"] . "article_categorys` c LEFT JOIN `" . $config["prefix"] . "article_category` s ON c.`id`=s.`c_id` WHERE s.`a_id`='".$row["id"]."'"); + while($c=$db->fetch_array($cresult)){ + if(!$cat){ + $cat=$c["categoryname"]; + }else{ + $cat.=", ".$c["categoryname"]; + } + } + + $editdate = date("d.m.Y, H:i", $row["edittime"]); + $date = date("d.m.Y, H:i", $row["date"]); + $this->tpl->assign('article', $row); + $this->tpl->assign('cat', $cat); + $this->tpl->assign('editdate', $editdate); + $this->tpl->assign('date', $date); + } + $this->titleaddon=$row['title'].' - '; + $core->add_navbit($row['title']); + return $this->tpl->fetch('textview.tpl',"textview".$fid); + }else{ + return $error->http_error("404"); + + } + } + +} +?> diff --git a/nav_modules/index.html b/nav_modules/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/nav_modules/index.html @@ -0,0 +1 @@ + diff --git a/nav_modules/nav_ads.php b/nav_modules/nav_ads.php new file mode 100644 index 0000000..92d88d1 --- /dev/null +++ b/nav_modules/nav_ads.php @@ -0,0 +1,8 @@ +fetch('nav_ads.tpl'); + +?> diff --git a/nav_modules/nav_lastpost.php b/nav_modules/nav_lastpost.php new file mode 100644 index 0000000..f1aa49a --- /dev/null +++ b/nav_modules/nav_lastpost.php @@ -0,0 +1,42 @@ +2"; +} + +// Themen aus Datenbank holen +$query = $db->query ("SELECT subject,username,pid,uid,tid,fid,dateline FROM ".TABLE_PREFIX."posts WHERE visible='1' $unviewwhere ORDER BY dateline DESC LIMIT 0,".$limit.""); + +while($threads = $db->fetch_array($query)) +{ +// Forum ermitteln +$query2 = $db->query ("SELECT name FROM ".TABLE_PREFIX."forums WHERE fid = '".$threads['fid']."'"); +$forums = $db->fetch_array($query2); +$threads['name']=$forums['name']; +$threads['date']=date("d.m.y H:i",$threads["dateline"]); +$threads['urlusername']=urlencode($threads['username']); +// Betreff kĂĽrzen? +if ($length != 0) +{ + if (strlen($threads['subject']) > $length) + { + $threads['subject'] = substr($threads['subject'],0,$length) . "..."; + } +} +$forum[]=$threads; +} +$tpl->assign("forum",$forum); + $navrow .= $tpl->fetch('nav_lastpost.tpl'); +?> diff --git a/nav_modules/nav_login.php b/nav_modules/nav_login.php new file mode 100644 index 0000000..256894f --- /dev/null +++ b/nav_modules/nav_login.php @@ -0,0 +1,20 @@ +userdata["uid"]) || $session->userdata["uid"]==0) { + $navtpl->assign('navtitle', $lang->_('LOGIN')); + $navrow .= $navtpl->fetch('nav_login.tpl'); +} else { + $navtpl->assign('username', $session->userdata["username"]); + $navtpl->assign('sid', $session -> sid); + $navtpl->assign('uid', $session->userdata["uid"]); + $navtpl->assign('navtitle', $lang->_('WELCOME')); + If ($session->userdata["admin_cp"] && $session->userdata["is_admin"]) { + $navtpl->assign('admincenter', 1); + } + $navrow .= $navtpl->fetch('nav_welcome.tpl'); +} + +?> diff --git a/nav_modules/nav_search.php b/nav_modules/nav_search.php new file mode 100644 index 0000000..98d64dd --- /dev/null +++ b/nav_modules/nav_search.php @@ -0,0 +1,9 @@ +assign('navtitle', "Suche"); +$navrow .= $navtpl->fetch('nav_search.tpl'); + + +?> diff --git a/nav_modules/nav_stats.php b/nav_modules/nav_stats.php new file mode 100644 index 0000000..8e5d1f0 --- /dev/null +++ b/nav_modules/nav_stats.php @@ -0,0 +1,31 @@ +query("SELECT count(uid) as users FROM `" . $config["prefix"] . "users`"); +$row = $db->fetch_array($result); +$stats['users']=$row['users']; + +$result=$db->query("SELECT username FROM `" . $config["prefix"] . "users` ORDER BY uid DESC LIMIT 1"); +$row = $db->fetch_array($result); +$stats['lastusername']=$row['username']; + +$stat=$cache->read('review_stats'); +$stats['reviewcount']=$stat['reviews']; +$stats['titlecount']=$stat['titles']; +$stats['queued']=$stat['queue']; + +$result=$db->query("SELECT count(id) as comments FROM `" . $config["prefix"] . "comments`"); +$row = $db->fetch_array($result); +$stats['comments']=$row['comments']; + +$result=$db->query("SELECT sum(chattime) as time FROM `v_yac_users`"); +$row = $db->fetch_array($result); +$stats['time']=$row['time']; +$plugin->run_hook("nav_stats",&$stats); + +$navtpl -> assign('stats', $stats); +$navrow .= $navtpl->fetch('nav_stats.tpl'); + +?> diff --git a/nav_modules/nav_twitter.php b/nav_modules/nav_twitter.php new file mode 100644 index 0000000..6f27227 --- /dev/null +++ b/nav_modules/nav_twitter.php @@ -0,0 +1,27 @@ +load(Twitter::ME,5); +foreach ($channel as $status){ + $stat['screenname'] = $status->user->screen_name; + $stat['image'] = htmlspecialchars($status->user->profile_image_url); + $stat['user'] = htmlspecialchars($status->user->name); + $stat['text'] = Twitter::clickable($status); + $stat['date'] = date("d.m.Y H:i",strtotime($status->created_at)); + $stats[]=$stat; +} + +}catch(Exception $e){ + $stats="Twitter down :,("; +} + +$navtpl-> assign("status",$stats); + +$navrow .= $navtpl->fetch('nav_twitter.tpl'); + +?> diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..996c098 --- /dev/null +++ b/readme.md @@ -0,0 +1,9 @@ +##BeCast WebEngine + +A modular CMS that has been in service commercially and privately in various roles since at least 2009. +Over it's lifetime it has had various Names BlackLamb CMS, ProjectX and Astat... and now BeCastWebengine I guess. + +This is the Master repository with the mostly clean base code. + +You can use it if you want... but I bet there are countless better Systems out there. +For me it's just a case of: If all you have is a hammer... diff --git a/register.php b/register.php new file mode 100644 index 0000000..3cbda1d --- /dev/null +++ b/register.php @@ -0,0 +1,200 @@ +run_hook('register_begin'); +$session->page_begin('Register', FALSE); +if($session->userdata['uid']!=0){ + header('Location:https://'.$config['domain'].'/'.$config['path'].'usercp.php'); +} +if($config['registring']==0){ + $core->message('Accouterstellung abgeschaltet','Zur Zeit wurde die Accounterstellung deaktiviert.',TRUE,$config['path'].'/index.php',5); +} +if (isset($_COOKIE[$config["cookiename"] . "_rid"])){ + $result = $db->query("SELECT `id` FROM `" . $config['prefix'] . "banned_ips` WHERE `ip` = '".$db->escape($session->ip)."'"); + if ($db->num_rows ($result) <= 0){ + $db->query("INSERT INTO `" . $config['prefix'] . "banned_ips` (`ip`,`date`,`reason`) VALUES ('".$session->ip."','".time()."','Autoban - Matched Cookie')"); + } + $core->message('Gebannt','Es scheint als wäre deine IP aktulle von der Accounterstellung ausgeschlossen.
    Wenn du denkst dies sei ein Fehler bitte sende uns eine E-Mail.',TRUE,$config['path'].'/index.php',5); +} +$result = $db->query("SELECT `id` FROM `" . $config['prefix'] . "banned_ips` WHERE `ip` = '".$db->escape($session->ip)."'"); +if ($db->num_rows ($result) > 0){ + $row=$db->fetch_object($result); + $id=$row->id; + $session->setcookie($config['cookiename'] . '_rid', $id , time() + 60 * 60 * 24 * 365, $config['path'],$config['domain']); + $core->message('Gebannt','Es scheint als wäre deine IP aktulle von der Accounterstellung ausgeschlossen.
    Wenn du denkst dies sei ein Fehler bitte sende uns eine E-Mail.',TRUE,$config['path'].'/index.php',5); +} +/*if($_GET['activate']!=""){ + if($_GET['regstring']!=""){ + $riresult = $db->query("SELECT r.`id` FROM `" . $config['prefix'] . "register` r WHERE r.`regstring` = '".$db->escape($_GET['regstring'])."' AND r.`ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'") or die ($db->error()); + if ($db->num_rows ($riresult) <= 0){ + //$db->query("DELETE FROM `" . $config['prefix'] . "register` WHERE `regstring` = '".$db->escape($_GET['regstring'])."' OR `ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'"); + $core->message('Sorry','The request you have made is invalid.',TRUE,$config['path'].'/index.php',5); + } + }else{ + $db->query("DELETE FROM `" . $config['prefix'] . "register` WHERE `ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'"); + $core->message('Sorry','The request you have made is invalid.',TRUE,$config['path'].'/index.php',5); + } +}*/ +if(isset($_POST['submit']) && $_POST['openid']!='' && isset($_POST['openid'])){ + $username=$session->sanitize_username($_POST['username']); + $vusername=$session->verify_username($username); + if($vusername!==TRUE){ + $emsg.=''.$vusername.'
    '; + } + if($config['captcha']!=0){ + if(!$captcha->validate($_POST)){ + $emsg.='Das Captcha is ungültig!
    '; + } + } + if(!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD',$_POST['email'])){ + $emsg.='E-Mail ungültig!
    '; + } + $result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$db->escape($username)."' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + $emsg.='Dieser Nickname ist bereits vergeben!
    '; + } + $result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `email` LIKE '".$db->escape($_POST['email'])."' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + $emsg.='Diese E-Mail ist bereits registriert!
    '; + } + if(!$emsg){ + // Secure Posted Data + $active=0; + $key=$session->generate_Key(50); + $active=1; + $result = $db->query("INSERT INTO `" . $config['prefix'] . "users` (`username`,`openid_identity`,`realname`,`loginkey`,`email`,`active`,`gender`,`from`,`since`,`birthday`) VALUES ('".$db->escape($username)."','".$db->escape($_POST['openid'])."','".$db->escape($_POST['realname'])."', '".$key."', '".$db->escape($_POST['email'])."', '".$active."','".$db->escape($_POST['gender'])."','".$db->escape($_POST['from'])."','".time()."','".strtotime($db->escape($_POST['birthday']))."')"); + $uid=$db->last_id(); + $sdata=array('uid'=>$uid,'username'=>$db->escape($username),'openid_identity'=>$db->escape($_POST['openid']),'email'=>$db->escape($_POST['email']),'realname'=>$db->escape($_POST['realname']),'gender'=>$db->escape($_POST['gender']),'from'=>$db->escape($_POST['from']),'birthday'=>strtotime($db->escape($_POST['birthday']))); + $plugin->run_hook('register_openid_end',array($sdata)); + $cookiedata['uid'] = $uid; + $cookiedata['loginkey'] = $key; + $cookiedata = base64_encode($cookiedata['uid'] .'_'. $cookiedata['loginkey']); + if(isset($_POST['remember']) && $_POST['remember']){ + $session->setcookie($config['cookiename'] . '_base', $cookiedata, time() + 60 * 60 * 24 * 365, $config['path'],$config['domain']); + }else{ + $session->setcookie($config['cookiename'] . '_base', $cookiedata, 0, $config['path'],$config['domain']); + } + $db->query("DELETE FROM `" . $config['prefix'] . "sessions` WHERE `ip`='".$db->escape($_SERVER['REMOTE_ADDR'])."'"); + $pdata=array('remember'=>$_POST['remember'],'uid'=>$data['uid'],'domain'=>$config['domain']); + $plugin->run_hook('register_openid_login',array($pdata)); + $core->redirect_message('Logged in','You have been successfully logged-in and will be redirected shortly.',TRUE,$config['path'].'/index.php',3); + }else{ + $tpl->assign('emsg',$emsg); + $tpl->assign('captcha',$captcha->getCaptcha()); + $tpl->assign('openid',$config['use_openid']); + $tpl->assign('identity',$_POST['openid']); + $tpl->assign('data',$_POST); + $content=$tpl->fetch('register.tpl'); + $core->make_page($content); + } +} +$emsg=false; +If(isset($_POST['submit'])){ + /*if($_GET['regstring']!=""){ + $riresult = $db->query("SELECT r.`id` FROM `" . $config['prefix'] . "register` r WHERE r.`regstring` = '".$db->escape($_GET['regstring'])."' AND r.`ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'") or die ($db->error()); + if ($db->num_rows ($riresult) <= 0){ + //$db->query("DELETE FROM `" . $config['prefix'] . "register` WHERE `regstring` = '".$db->escape($_GET['regstring'])."' OR `ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'"); + $core->message('Sorry','The request you have made is invalid.',TRUE,$config['path'].'/index.php',5); + } + }else{ + $db->query("DELETE FROM `" . $config['prefix'] . "register` WHERE `ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'"); + $core->message('Sorry','The request you have made is invalid.',TRUE,$config['path'].'/index.php',5); + }*/ + $username=$session->sanitize_username($_POST['username']); + $vusername=$session->verify_username($username); + if($vusername!==TRUE){ + $emsg.=''.$vusername.'
    '; + } + if(!isset($_POST['agreed']) || $_POST['agreed']==''){ + $emsg.='Du musst den Nutzungsbedingungen zustimmen!
    '; + } + if(!isset($_POST['birthday']) || $_POST['birthday']==''){ + $emsg.='Du musst dein Geburtsdatum angeben!
    '; + }else{ + $birthday = strtotime($_POST['birthday']); + + // check + // 31536000 is the number of seconds in a 365 days year. + if(time() - $birthday < 16 * 31536000) { + $emsg.='Du musst leider mindestens 16 Jahre alt sein.
    '; + } + } + if(!isset($_POST['password']) || $_POST['password']==''){ + $emsg.='Du musst ein Passwort vergeben!
    '; + }elseif($_POST['password']!=$_POST['cpassword']){ + $emsg.='Deine Passwörter stimmen nicht überein!
    '; + }elseif(strlen($_POST['password'])<6){ + $emsg.='Dein Passwort ist zu kurz, es muss mindestens 6 Zeichen lang sein.
    '; + } + if($config['captcha']!=0){ + if(!$captcha->validate($_POST)){ + $emsg.='Das Captcha is ungültig!
    '; + } + } + if(!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD',$_POST['email'])){ + $emsg.='Invalid E-Mail!
    '; + } + $result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$db->escape($username)."' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + $emsg.='Dieser Nickname ist bereits vergeben!
    '; + } + $result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `email` LIKE '".$db->escape($_POST['email'])."' LIMIT 1"); + if ($db->num_rows ($result) > 0){ + $emsg.='Diese E-Mail ist bereits registriert!
    '; + } + if(!$emsg){ + // Secure Posted Data + $salt = $session->generate_Key(6); + $pass =hash('sha256',$db->escape($salt.$_POST['password'])); + if($config['activation']=='mail'){ + $key=$session->generate_Key(10); + $mail=new mail(); + $mail->set_header('From','=?UTF-8?B?'.base64_encode($config['sitetitle']).'?='.' <'.$config['siteemail'].'>'); + $tpl->assign('username',$username); + $tpl->assign('sitename',$config['sitetitle']); + $tpl->assign('url','https://'.$config['domain'].'/'.$config['path'].'register.php?activate='.urlencode($username).'&key='.$key); + $mailbody=$tpl->fetch('register_mail.tpl'); + $mail->bodytext($mailbody); + $mail->sendmail($username.' <'.$_POST['email'].'>','Dein Account auf '.$config['sitetitle']); + $active=0; + }else{ + $key=$session->generate_Key(50); + $active=1; + } + $result = $db->query("INSERT INTO `" . $config['prefix'] . "users` (`username`,`realname`,`password`,`salt`,`loginkey`,`email`,`active`,`gender`,`from`,`since`,`birthday`) VALUES ('".$db->escape($username)."','".$db->escape($_POST['realname'])."','".$pass."','".$salt."','".$key."', '".$db->escape($_POST['email'])."', '".$active."','".$db->escape($_POST['gender'])."','".$db->escape($_POST['from'])."','".time()."','".strtotime($db->escape($_POST['birthday']))."')"); + $uid=$db->last_id(); + $sdata=array('uid'=>$uid,'username'=>$db->escape($username),'salt'=>$salt,'pwd_md5'=>hash('md5',$_POST['password']),'pwd_sha2'=>$pass,'email'=>$db->escape($_POST['email']),'realname'=>$db->escape($_POST['realname']),'gender'=>$db->escape($_POST['gender']),'from'=>$db->escape($_POST['from']),'birthday'=>strtotime($db->escape($_POST['birthday']))); + $plugin->run_hook('register_end',array($sdata)); + $db->query("DELETE FROM `" . $config['prefix'] . "register` WHERE `regstring` = '".$db->escape($_GET['regstring'])."' OR `ip` = '".$db->escape($_SERVER['REMOTE_ADDR'])."'"); + if($active==0){ + $core->message('Erfolg','Dein Account wurde erstellt und wir haben Dir eine E-Mail gesendet.
    Folge den Anweisungen in der E-Mail um deinen Account freizuschalten.',TRUE,$config['path'].'/index.php',3); + }else{ + $core->message('Erfolg','Dein Account wurde erstellt und du kannst dich nun einloggen.',TRUE,$config['path'].'/index.php',3); + } + + } +}elseif(isset($_GET['activate'])){ + $result = $db->query("SELECT `uid` FROM `" . $config['prefix'] . "users` WHERE `username` LIKE '".$db->escape($_GET['activate'])."' AND `loginkey`='".$db->escape($_GET['key'])."' AND `active`=0 LIMIT 1"); + if ($db->num_rows ($result) <= 0){ + $core->message('Fehler','Dieser Account ist entweder bereits freigeschaltet oder irgendwas ist schiefgelaufen.',TRUE,$config['path'].'/index.php',3); + }else{ + $key=$session->generate_Key(50); + $db->query("UPDATE `" . $config['prefix'] . "users` SET `loginkey`='".$key."',`active`=1 WHERE `username` LIKE '".$db->escape($_GET['activate'])."' AND `loginkey`='".$db->escape($_GET['key'])."' AND `active`=0 LIMIT 1"); + $core->message('Danke','Dein Account wurde aktiviert! Du kannst dich nun einloggen.',TRUE,$config['path'].'/index.php',3); + } +} +$meta=' +'; +$dcap = $captcha->getCaptcha(); +$tpl->assign('path','//'.$config['domain'].'/'.$config['path']); +$tpl->assign('emsg',$emsg); +$tpl->assign('regstring',$_GET['regstring']); +$tpl->assign('captcha',$dcap); +$tpl->assign('sid',md5(uniqid(time()))); +$tpl->assign('data',$_POST); +$content=$tpl->fetch('register.tpl'); +$core->make_page($content); +?> diff --git a/themes/default/footer.tpl b/themes/default/footer.tpl new file mode 100644 index 0000000..87a64c6 --- /dev/null +++ b/themes/default/footer.tpl @@ -0,0 +1,5 @@ +
    + + + + diff --git a/themes/default/general_error.tpl b/themes/default/general_error.tpl new file mode 100644 index 0000000..ee2c95d --- /dev/null +++ b/themes/default/general_error.tpl @@ -0,0 +1,16 @@ + + + +Sorry. Currently offline + + + +


    +Sorry.
    +We are expiriencing technical difficulties.
    +
    +You may wish to contact the Siteadministrator to inform him. +Please check back soon. +
    + + \ No newline at end of file diff --git a/themes/default/header.tpl b/themes/default/header.tpl new file mode 100644 index 0000000..72853b9 --- /dev/null +++ b/themes/default/header.tpl @@ -0,0 +1,28 @@ + + + + + + + + +{$meta} +{$sitetitle} + + + +{literal} +
    + +
    +
    + diff --git a/themes/default/images/background.gif b/themes/default/images/background.gif new file mode 100644 index 0000000..1d49a10 Binary files /dev/null and b/themes/default/images/background.gif differ diff --git a/themes/default/images/blue.gif b/themes/default/images/blue.gif new file mode 100644 index 0000000..08c7698 Binary files /dev/null and b/themes/default/images/blue.gif differ diff --git a/themes/default/images/chk_off.png b/themes/default/images/chk_off.png new file mode 100644 index 0000000..1514d51 Binary files /dev/null and b/themes/default/images/chk_off.png differ diff --git a/themes/default/images/chk_on.png b/themes/default/images/chk_on.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/themes/default/images/chk_on.png differ diff --git a/themes/default/images/down.gif b/themes/default/images/down.gif new file mode 100644 index 0000000..c527b4e Binary files /dev/null and b/themes/default/images/down.gif differ diff --git a/themes/default/images/green.gif b/themes/default/images/green.gif new file mode 100644 index 0000000..eb82e1a Binary files /dev/null and b/themes/default/images/green.gif differ diff --git a/themes/default/images/header.gif b/themes/default/images/header.gif new file mode 100644 index 0000000..2de9be9 Binary files /dev/null and b/themes/default/images/header.gif differ diff --git a/themes/default/images/icons/accept.png b/themes/default/images/icons/accept.png new file mode 100644 index 0000000..89c8129 Binary files /dev/null and b/themes/default/images/icons/accept.png differ diff --git a/themes/default/images/icons/add.png b/themes/default/images/icons/add.png new file mode 100644 index 0000000..6332fef Binary files /dev/null and b/themes/default/images/icons/add.png differ diff --git a/themes/default/images/icons/anchor.png b/themes/default/images/icons/anchor.png new file mode 100644 index 0000000..9b3422c Binary files /dev/null and b/themes/default/images/icons/anchor.png differ diff --git a/themes/default/images/icons/application.png b/themes/default/images/icons/application.png new file mode 100644 index 0000000..1dee9e3 Binary files /dev/null and b/themes/default/images/icons/application.png differ diff --git a/themes/default/images/icons/application_add.png b/themes/default/images/icons/application_add.png new file mode 100644 index 0000000..2e94507 Binary files /dev/null and b/themes/default/images/icons/application_add.png differ diff --git a/themes/default/images/icons/application_cascade.png b/themes/default/images/icons/application_cascade.png new file mode 100644 index 0000000..da5c622 Binary files /dev/null and b/themes/default/images/icons/application_cascade.png differ diff --git a/themes/default/images/icons/application_delete.png b/themes/default/images/icons/application_delete.png new file mode 100644 index 0000000..0a335ac Binary files /dev/null and b/themes/default/images/icons/application_delete.png differ diff --git a/themes/default/images/icons/application_double.png b/themes/default/images/icons/application_double.png new file mode 100644 index 0000000..647592f Binary files /dev/null and b/themes/default/images/icons/application_double.png differ diff --git a/themes/default/images/icons/application_edit.png b/themes/default/images/icons/application_edit.png new file mode 100644 index 0000000..fb2efb8 Binary files /dev/null and b/themes/default/images/icons/application_edit.png differ diff --git a/themes/default/images/icons/application_error.png b/themes/default/images/icons/application_error.png new file mode 100644 index 0000000..b35fa57 Binary files /dev/null and b/themes/default/images/icons/application_error.png differ diff --git a/themes/default/images/icons/application_form.png b/themes/default/images/icons/application_form.png new file mode 100644 index 0000000..807b862 Binary files /dev/null and b/themes/default/images/icons/application_form.png differ diff --git a/themes/default/images/icons/application_form_add.png b/themes/default/images/icons/application_form_add.png new file mode 100644 index 0000000..28c2175 Binary files /dev/null and b/themes/default/images/icons/application_form_add.png differ diff --git a/themes/default/images/icons/application_form_delete.png b/themes/default/images/icons/application_form_delete.png new file mode 100644 index 0000000..cd305ec Binary files /dev/null and b/themes/default/images/icons/application_form_delete.png differ diff --git a/themes/default/images/icons/application_form_edit.png b/themes/default/images/icons/application_form_edit.png new file mode 100644 index 0000000..af486c9 Binary files /dev/null and b/themes/default/images/icons/application_form_edit.png differ diff --git a/themes/default/images/icons/application_form_magnify.png b/themes/default/images/icons/application_form_magnify.png new file mode 100644 index 0000000..7b7fbd1 Binary files /dev/null and b/themes/default/images/icons/application_form_magnify.png differ diff --git a/themes/default/images/icons/application_get.png b/themes/default/images/icons/application_get.png new file mode 100644 index 0000000..28e41ea Binary files /dev/null and b/themes/default/images/icons/application_get.png differ diff --git a/themes/default/images/icons/application_go.png b/themes/default/images/icons/application_go.png new file mode 100644 index 0000000..5cc2b0d Binary files /dev/null and b/themes/default/images/icons/application_go.png differ diff --git a/themes/default/images/icons/application_home.png b/themes/default/images/icons/application_home.png new file mode 100644 index 0000000..b60d0c8 Binary files /dev/null and b/themes/default/images/icons/application_home.png differ diff --git a/themes/default/images/icons/application_key.png b/themes/default/images/icons/application_key.png new file mode 100644 index 0000000..998d65c Binary files /dev/null and b/themes/default/images/icons/application_key.png differ diff --git a/themes/default/images/icons/application_lightning.png b/themes/default/images/icons/application_lightning.png new file mode 100644 index 0000000..7e91545 Binary files /dev/null and b/themes/default/images/icons/application_lightning.png differ diff --git a/themes/default/images/icons/application_link.png b/themes/default/images/icons/application_link.png new file mode 100644 index 0000000..f8fbb3e Binary files /dev/null and b/themes/default/images/icons/application_link.png differ diff --git a/themes/default/images/icons/application_osx.png b/themes/default/images/icons/application_osx.png new file mode 100644 index 0000000..9f022ec Binary files /dev/null and b/themes/default/images/icons/application_osx.png differ diff --git a/themes/default/images/icons/application_osx_terminal.png b/themes/default/images/icons/application_osx_terminal.png new file mode 100644 index 0000000..b3d8ce0 Binary files /dev/null and b/themes/default/images/icons/application_osx_terminal.png differ diff --git a/themes/default/images/icons/application_put.png b/themes/default/images/icons/application_put.png new file mode 100644 index 0000000..c30cf59 Binary files /dev/null and b/themes/default/images/icons/application_put.png differ diff --git a/themes/default/images/icons/application_side_boxes.png b/themes/default/images/icons/application_side_boxes.png new file mode 100644 index 0000000..efbf3c4 Binary files /dev/null and b/themes/default/images/icons/application_side_boxes.png differ diff --git a/themes/default/images/icons/application_side_contract.png b/themes/default/images/icons/application_side_contract.png new file mode 100644 index 0000000..3585f94 Binary files /dev/null and b/themes/default/images/icons/application_side_contract.png differ diff --git a/themes/default/images/icons/application_side_expand.png b/themes/default/images/icons/application_side_expand.png new file mode 100644 index 0000000..030cf7c Binary files /dev/null and b/themes/default/images/icons/application_side_expand.png differ diff --git a/themes/default/images/icons/application_side_list.png b/themes/default/images/icons/application_side_list.png new file mode 100644 index 0000000..248eaf1 Binary files /dev/null and b/themes/default/images/icons/application_side_list.png differ diff --git a/themes/default/images/icons/application_side_tree.png b/themes/default/images/icons/application_side_tree.png new file mode 100644 index 0000000..f04a52b Binary files /dev/null and b/themes/default/images/icons/application_side_tree.png differ diff --git a/themes/default/images/icons/application_split.png b/themes/default/images/icons/application_split.png new file mode 100644 index 0000000..a91c78a Binary files /dev/null and b/themes/default/images/icons/application_split.png differ diff --git a/themes/default/images/icons/application_tile_horizontal.png b/themes/default/images/icons/application_tile_horizontal.png new file mode 100644 index 0000000..8a1191c Binary files /dev/null and b/themes/default/images/icons/application_tile_horizontal.png differ diff --git a/themes/default/images/icons/application_tile_vertical.png b/themes/default/images/icons/application_tile_vertical.png new file mode 100644 index 0000000..1d40383 Binary files /dev/null and b/themes/default/images/icons/application_tile_vertical.png differ diff --git a/themes/default/images/icons/application_view_columns.png b/themes/default/images/icons/application_view_columns.png new file mode 100644 index 0000000..dc2e9d5 Binary files /dev/null and b/themes/default/images/icons/application_view_columns.png differ diff --git a/themes/default/images/icons/application_view_detail.png b/themes/default/images/icons/application_view_detail.png new file mode 100644 index 0000000..aba044b Binary files /dev/null and b/themes/default/images/icons/application_view_detail.png differ diff --git a/themes/default/images/icons/application_view_gallery.png b/themes/default/images/icons/application_view_gallery.png new file mode 100644 index 0000000..851950d Binary files /dev/null and b/themes/default/images/icons/application_view_gallery.png differ diff --git a/themes/default/images/icons/application_view_icons.png b/themes/default/images/icons/application_view_icons.png new file mode 100644 index 0000000..6a93cda Binary files /dev/null and b/themes/default/images/icons/application_view_icons.png differ diff --git a/themes/default/images/icons/application_view_list.png b/themes/default/images/icons/application_view_list.png new file mode 100644 index 0000000..acc30b8 Binary files /dev/null and b/themes/default/images/icons/application_view_list.png differ diff --git a/themes/default/images/icons/application_view_tile.png b/themes/default/images/icons/application_view_tile.png new file mode 100644 index 0000000..3bc0bd3 Binary files /dev/null and b/themes/default/images/icons/application_view_tile.png differ diff --git a/themes/default/images/icons/application_xp.png b/themes/default/images/icons/application_xp.png new file mode 100644 index 0000000..d22860a Binary files /dev/null and b/themes/default/images/icons/application_xp.png differ diff --git a/themes/default/images/icons/application_xp_terminal.png b/themes/default/images/icons/application_xp_terminal.png new file mode 100644 index 0000000..c28dd63 Binary files /dev/null and b/themes/default/images/icons/application_xp_terminal.png differ diff --git a/themes/default/images/icons/arrow_branch.png b/themes/default/images/icons/arrow_branch.png new file mode 100644 index 0000000..7542db1 Binary files /dev/null and b/themes/default/images/icons/arrow_branch.png differ diff --git a/themes/default/images/icons/arrow_divide.png b/themes/default/images/icons/arrow_divide.png new file mode 100644 index 0000000..61a7b1d Binary files /dev/null and b/themes/default/images/icons/arrow_divide.png differ diff --git a/themes/default/images/icons/arrow_down.png b/themes/default/images/icons/arrow_down.png new file mode 100644 index 0000000..2c4e279 Binary files /dev/null and b/themes/default/images/icons/arrow_down.png differ diff --git a/themes/default/images/icons/arrow_in.png b/themes/default/images/icons/arrow_in.png new file mode 100644 index 0000000..745c651 Binary files /dev/null and b/themes/default/images/icons/arrow_in.png differ diff --git a/themes/default/images/icons/arrow_inout.png b/themes/default/images/icons/arrow_inout.png new file mode 100644 index 0000000..1b76367 Binary files /dev/null and b/themes/default/images/icons/arrow_inout.png differ diff --git a/themes/default/images/icons/arrow_join.png b/themes/default/images/icons/arrow_join.png new file mode 100644 index 0000000..a128413 Binary files /dev/null and b/themes/default/images/icons/arrow_join.png differ diff --git a/themes/default/images/icons/arrow_left.png b/themes/default/images/icons/arrow_left.png new file mode 100644 index 0000000..5dc6967 Binary files /dev/null and b/themes/default/images/icons/arrow_left.png differ diff --git a/themes/default/images/icons/arrow_merge.png b/themes/default/images/icons/arrow_merge.png new file mode 100644 index 0000000..7502dbb Binary files /dev/null and b/themes/default/images/icons/arrow_merge.png differ diff --git a/themes/default/images/icons/arrow_out.png b/themes/default/images/icons/arrow_out.png new file mode 100644 index 0000000..2e9bc42 Binary files /dev/null and b/themes/default/images/icons/arrow_out.png differ diff --git a/themes/default/images/icons/arrow_redo.png b/themes/default/images/icons/arrow_redo.png new file mode 100644 index 0000000..fdc394c Binary files /dev/null and b/themes/default/images/icons/arrow_redo.png differ diff --git a/themes/default/images/icons/arrow_refresh.png b/themes/default/images/icons/arrow_refresh.png new file mode 100644 index 0000000..0de2656 Binary files /dev/null and b/themes/default/images/icons/arrow_refresh.png differ diff --git a/themes/default/images/icons/arrow_refresh_small.png b/themes/default/images/icons/arrow_refresh_small.png new file mode 100644 index 0000000..d3087df Binary files /dev/null and b/themes/default/images/icons/arrow_refresh_small.png differ diff --git a/themes/default/images/icons/arrow_right.png b/themes/default/images/icons/arrow_right.png new file mode 100644 index 0000000..b1a1819 Binary files /dev/null and b/themes/default/images/icons/arrow_right.png differ diff --git a/themes/default/images/icons/arrow_rotate_anticlockwise.png b/themes/default/images/icons/arrow_rotate_anticlockwise.png new file mode 100644 index 0000000..46c75aa Binary files /dev/null and b/themes/default/images/icons/arrow_rotate_anticlockwise.png differ diff --git a/themes/default/images/icons/arrow_rotate_clockwise.png b/themes/default/images/icons/arrow_rotate_clockwise.png new file mode 100644 index 0000000..aa65210 Binary files /dev/null and b/themes/default/images/icons/arrow_rotate_clockwise.png differ diff --git a/themes/default/images/icons/arrow_switch.png b/themes/default/images/icons/arrow_switch.png new file mode 100644 index 0000000..258c16c Binary files /dev/null and b/themes/default/images/icons/arrow_switch.png differ diff --git a/themes/default/images/icons/arrow_turn_left.png b/themes/default/images/icons/arrow_turn_left.png new file mode 100644 index 0000000..a3d6c9e Binary files /dev/null and b/themes/default/images/icons/arrow_turn_left.png differ diff --git a/themes/default/images/icons/arrow_turn_right.png b/themes/default/images/icons/arrow_turn_right.png new file mode 100644 index 0000000..629f20d Binary files /dev/null and b/themes/default/images/icons/arrow_turn_right.png differ diff --git a/themes/default/images/icons/arrow_undo.png b/themes/default/images/icons/arrow_undo.png new file mode 100644 index 0000000..6972c5e Binary files /dev/null and b/themes/default/images/icons/arrow_undo.png differ diff --git a/themes/default/images/icons/arrow_up.png b/themes/default/images/icons/arrow_up.png new file mode 100644 index 0000000..1ebb193 Binary files /dev/null and b/themes/default/images/icons/arrow_up.png differ diff --git a/themes/default/images/icons/asterisk_orange.png b/themes/default/images/icons/asterisk_orange.png new file mode 100644 index 0000000..1ebebde Binary files /dev/null and b/themes/default/images/icons/asterisk_orange.png differ diff --git a/themes/default/images/icons/asterisk_yellow.png b/themes/default/images/icons/asterisk_yellow.png new file mode 100644 index 0000000..bab7cc9 Binary files /dev/null and b/themes/default/images/icons/asterisk_yellow.png differ diff --git a/themes/default/images/icons/attach.png b/themes/default/images/icons/attach.png new file mode 100644 index 0000000..ea897cc Binary files /dev/null and b/themes/default/images/icons/attach.png differ diff --git a/themes/default/images/icons/award_star_add.png b/themes/default/images/icons/award_star_add.png new file mode 100644 index 0000000..9c4be9b Binary files /dev/null and b/themes/default/images/icons/award_star_add.png differ diff --git a/themes/default/images/icons/award_star_bronze_1.png b/themes/default/images/icons/award_star_bronze_1.png new file mode 100644 index 0000000..658c711 Binary files /dev/null and b/themes/default/images/icons/award_star_bronze_1.png differ diff --git a/themes/default/images/icons/award_star_bronze_2.png b/themes/default/images/icons/award_star_bronze_2.png new file mode 100644 index 0000000..e47babd Binary files /dev/null and b/themes/default/images/icons/award_star_bronze_2.png differ diff --git a/themes/default/images/icons/award_star_bronze_3.png b/themes/default/images/icons/award_star_bronze_3.png new file mode 100644 index 0000000..396e4b3 Binary files /dev/null and b/themes/default/images/icons/award_star_bronze_3.png differ diff --git a/themes/default/images/icons/award_star_delete.png b/themes/default/images/icons/award_star_delete.png new file mode 100644 index 0000000..4721b15 Binary files /dev/null and b/themes/default/images/icons/award_star_delete.png differ diff --git a/themes/default/images/icons/award_star_gold_1.png b/themes/default/images/icons/award_star_gold_1.png new file mode 100644 index 0000000..97a22b7 Binary files /dev/null and b/themes/default/images/icons/award_star_gold_1.png differ diff --git a/themes/default/images/icons/award_star_gold_2.png b/themes/default/images/icons/award_star_gold_2.png new file mode 100644 index 0000000..0eaa571 Binary files /dev/null and b/themes/default/images/icons/award_star_gold_2.png differ diff --git a/themes/default/images/icons/award_star_gold_3.png b/themes/default/images/icons/award_star_gold_3.png new file mode 100644 index 0000000..124c991 Binary files /dev/null and b/themes/default/images/icons/award_star_gold_3.png differ diff --git a/themes/default/images/icons/award_star_silver_1.png b/themes/default/images/icons/award_star_silver_1.png new file mode 100644 index 0000000..028a546 Binary files /dev/null and b/themes/default/images/icons/award_star_silver_1.png differ diff --git a/themes/default/images/icons/award_star_silver_2.png b/themes/default/images/icons/award_star_silver_2.png new file mode 100644 index 0000000..e487c3a Binary files /dev/null and b/themes/default/images/icons/award_star_silver_2.png differ diff --git a/themes/default/images/icons/award_star_silver_3.png b/themes/default/images/icons/award_star_silver_3.png new file mode 100644 index 0000000..1d72d47 Binary files /dev/null and b/themes/default/images/icons/award_star_silver_3.png differ diff --git a/themes/default/images/icons/basket.png b/themes/default/images/icons/basket.png new file mode 100644 index 0000000..b0686d7 Binary files /dev/null and b/themes/default/images/icons/basket.png differ diff --git a/themes/default/images/icons/basket_add.png b/themes/default/images/icons/basket_add.png new file mode 100644 index 0000000..3554368 Binary files /dev/null and b/themes/default/images/icons/basket_add.png differ diff --git a/themes/default/images/icons/basket_delete.png b/themes/default/images/icons/basket_delete.png new file mode 100644 index 0000000..1349974 Binary files /dev/null and b/themes/default/images/icons/basket_delete.png differ diff --git a/themes/default/images/icons/basket_edit.png b/themes/default/images/icons/basket_edit.png new file mode 100644 index 0000000..8138bbd Binary files /dev/null and b/themes/default/images/icons/basket_edit.png differ diff --git a/themes/default/images/icons/basket_error.png b/themes/default/images/icons/basket_error.png new file mode 100644 index 0000000..3978b29 Binary files /dev/null and b/themes/default/images/icons/basket_error.png differ diff --git a/themes/default/images/icons/basket_go.png b/themes/default/images/icons/basket_go.png new file mode 100644 index 0000000..ed8b9a5 Binary files /dev/null and b/themes/default/images/icons/basket_go.png differ diff --git a/themes/default/images/icons/basket_put.png b/themes/default/images/icons/basket_put.png new file mode 100644 index 0000000..be62faa Binary files /dev/null and b/themes/default/images/icons/basket_put.png differ diff --git a/themes/default/images/icons/basket_remove.png b/themes/default/images/icons/basket_remove.png new file mode 100644 index 0000000..04dd7fd Binary files /dev/null and b/themes/default/images/icons/basket_remove.png differ diff --git a/themes/default/images/icons/bell.png b/themes/default/images/icons/bell.png new file mode 100644 index 0000000..6e0015d Binary files /dev/null and b/themes/default/images/icons/bell.png differ diff --git a/themes/default/images/icons/bell_add.png b/themes/default/images/icons/bell_add.png new file mode 100644 index 0000000..7db01d6 Binary files /dev/null and b/themes/default/images/icons/bell_add.png differ diff --git a/themes/default/images/icons/bell_delete.png b/themes/default/images/icons/bell_delete.png new file mode 100644 index 0000000..23907bb Binary files /dev/null and b/themes/default/images/icons/bell_delete.png differ diff --git a/themes/default/images/icons/bell_error.png b/themes/default/images/icons/bell_error.png new file mode 100644 index 0000000..a0ddc00 Binary files /dev/null and b/themes/default/images/icons/bell_error.png differ diff --git a/themes/default/images/icons/bell_go.png b/themes/default/images/icons/bell_go.png new file mode 100644 index 0000000..b89bb34 Binary files /dev/null and b/themes/default/images/icons/bell_go.png differ diff --git a/themes/default/images/icons/bell_link.png b/themes/default/images/icons/bell_link.png new file mode 100644 index 0000000..b8c64af Binary files /dev/null and b/themes/default/images/icons/bell_link.png differ diff --git a/themes/default/images/icons/bin.png b/themes/default/images/icons/bin.png new file mode 100644 index 0000000..ebad933 Binary files /dev/null and b/themes/default/images/icons/bin.png differ diff --git a/themes/default/images/icons/bin_closed.png b/themes/default/images/icons/bin_closed.png new file mode 100644 index 0000000..afe22ba Binary files /dev/null and b/themes/default/images/icons/bin_closed.png differ diff --git a/themes/default/images/icons/bin_empty.png b/themes/default/images/icons/bin_empty.png new file mode 100644 index 0000000..375b8bf Binary files /dev/null and b/themes/default/images/icons/bin_empty.png differ diff --git a/themes/default/images/icons/bomb.png b/themes/default/images/icons/bomb.png new file mode 100644 index 0000000..1be3797 Binary files /dev/null and b/themes/default/images/icons/bomb.png differ diff --git a/themes/default/images/icons/book.png b/themes/default/images/icons/book.png new file mode 100644 index 0000000..b0f4dd7 Binary files /dev/null and b/themes/default/images/icons/book.png differ diff --git a/themes/default/images/icons/book_add.png b/themes/default/images/icons/book_add.png new file mode 100644 index 0000000..e2f0847 Binary files /dev/null and b/themes/default/images/icons/book_add.png differ diff --git a/themes/default/images/icons/book_addresses.png b/themes/default/images/icons/book_addresses.png new file mode 100644 index 0000000..b73419b Binary files /dev/null and b/themes/default/images/icons/book_addresses.png differ diff --git a/themes/default/images/icons/book_delete.png b/themes/default/images/icons/book_delete.png new file mode 100644 index 0000000..d9a6340 Binary files /dev/null and b/themes/default/images/icons/book_delete.png differ diff --git a/themes/default/images/icons/book_edit.png b/themes/default/images/icons/book_edit.png new file mode 100644 index 0000000..6e756cc Binary files /dev/null and b/themes/default/images/icons/book_edit.png differ diff --git a/themes/default/images/icons/book_error.png b/themes/default/images/icons/book_error.png new file mode 100644 index 0000000..f3fbed0 Binary files /dev/null and b/themes/default/images/icons/book_error.png differ diff --git a/themes/default/images/icons/book_go.png b/themes/default/images/icons/book_go.png new file mode 100644 index 0000000..cd4e196 Binary files /dev/null and b/themes/default/images/icons/book_go.png differ diff --git a/themes/default/images/icons/book_key.png b/themes/default/images/icons/book_key.png new file mode 100644 index 0000000..d8e23ec Binary files /dev/null and b/themes/default/images/icons/book_key.png differ diff --git a/themes/default/images/icons/book_link.png b/themes/default/images/icons/book_link.png new file mode 100644 index 0000000..dd0820e Binary files /dev/null and b/themes/default/images/icons/book_link.png differ diff --git a/themes/default/images/icons/book_next.png b/themes/default/images/icons/book_next.png new file mode 100644 index 0000000..ff2ea1a Binary files /dev/null and b/themes/default/images/icons/book_next.png differ diff --git a/themes/default/images/icons/book_open.png b/themes/default/images/icons/book_open.png new file mode 100644 index 0000000..7d863f9 Binary files /dev/null and b/themes/default/images/icons/book_open.png differ diff --git a/themes/default/images/icons/book_previous.png b/themes/default/images/icons/book_previous.png new file mode 100644 index 0000000..2e53c69 Binary files /dev/null and b/themes/default/images/icons/book_previous.png differ diff --git a/themes/default/images/icons/box.png b/themes/default/images/icons/box.png new file mode 100644 index 0000000..8443c23 Binary files /dev/null and b/themes/default/images/icons/box.png differ diff --git a/themes/default/images/icons/brick.png b/themes/default/images/icons/brick.png new file mode 100644 index 0000000..7851cf3 Binary files /dev/null and b/themes/default/images/icons/brick.png differ diff --git a/themes/default/images/icons/brick_add.png b/themes/default/images/icons/brick_add.png new file mode 100644 index 0000000..fac186b Binary files /dev/null and b/themes/default/images/icons/brick_add.png differ diff --git a/themes/default/images/icons/brick_delete.png b/themes/default/images/icons/brick_delete.png new file mode 100644 index 0000000..3a8c373 Binary files /dev/null and b/themes/default/images/icons/brick_delete.png differ diff --git a/themes/default/images/icons/brick_edit.png b/themes/default/images/icons/brick_edit.png new file mode 100644 index 0000000..eb06df3 Binary files /dev/null and b/themes/default/images/icons/brick_edit.png differ diff --git a/themes/default/images/icons/brick_error.png b/themes/default/images/icons/brick_error.png new file mode 100644 index 0000000..18ab01e Binary files /dev/null and b/themes/default/images/icons/brick_error.png differ diff --git a/themes/default/images/icons/brick_go.png b/themes/default/images/icons/brick_go.png new file mode 100644 index 0000000..fe0d335 Binary files /dev/null and b/themes/default/images/icons/brick_go.png differ diff --git a/themes/default/images/icons/brick_link.png b/themes/default/images/icons/brick_link.png new file mode 100644 index 0000000..9ebf013 Binary files /dev/null and b/themes/default/images/icons/brick_link.png differ diff --git a/themes/default/images/icons/bricks.png b/themes/default/images/icons/bricks.png new file mode 100644 index 0000000..0905f93 Binary files /dev/null and b/themes/default/images/icons/bricks.png differ diff --git a/themes/default/images/icons/briefcase.png b/themes/default/images/icons/briefcase.png new file mode 100644 index 0000000..05c5649 Binary files /dev/null and b/themes/default/images/icons/briefcase.png differ diff --git a/themes/default/images/icons/bug.png b/themes/default/images/icons/bug.png new file mode 100644 index 0000000..2d5fb90 Binary files /dev/null and b/themes/default/images/icons/bug.png differ diff --git a/themes/default/images/icons/bug_add.png b/themes/default/images/icons/bug_add.png new file mode 100644 index 0000000..ced7817 Binary files /dev/null and b/themes/default/images/icons/bug_add.png differ diff --git a/themes/default/images/icons/bug_delete.png b/themes/default/images/icons/bug_delete.png new file mode 100644 index 0000000..e81d757 Binary files /dev/null and b/themes/default/images/icons/bug_delete.png differ diff --git a/themes/default/images/icons/bug_edit.png b/themes/default/images/icons/bug_edit.png new file mode 100644 index 0000000..e5c7dc0 Binary files /dev/null and b/themes/default/images/icons/bug_edit.png differ diff --git a/themes/default/images/icons/bug_error.png b/themes/default/images/icons/bug_error.png new file mode 100644 index 0000000..c4e8c28 Binary files /dev/null and b/themes/default/images/icons/bug_error.png differ diff --git a/themes/default/images/icons/bug_go.png b/themes/default/images/icons/bug_go.png new file mode 100644 index 0000000..4e4ae99 Binary files /dev/null and b/themes/default/images/icons/bug_go.png differ diff --git a/themes/default/images/icons/bug_link.png b/themes/default/images/icons/bug_link.png new file mode 100644 index 0000000..30e25ab Binary files /dev/null and b/themes/default/images/icons/bug_link.png differ diff --git a/themes/default/images/icons/building.png b/themes/default/images/icons/building.png new file mode 100644 index 0000000..11a017c Binary files /dev/null and b/themes/default/images/icons/building.png differ diff --git a/themes/default/images/icons/building_add.png b/themes/default/images/icons/building_add.png new file mode 100644 index 0000000..d88e2b9 Binary files /dev/null and b/themes/default/images/icons/building_add.png differ diff --git a/themes/default/images/icons/building_delete.png b/themes/default/images/icons/building_delete.png new file mode 100644 index 0000000..db6455d Binary files /dev/null and b/themes/default/images/icons/building_delete.png differ diff --git a/themes/default/images/icons/building_edit.png b/themes/default/images/icons/building_edit.png new file mode 100644 index 0000000..646db36 Binary files /dev/null and b/themes/default/images/icons/building_edit.png differ diff --git a/themes/default/images/icons/building_error.png b/themes/default/images/icons/building_error.png new file mode 100644 index 0000000..a342eef Binary files /dev/null and b/themes/default/images/icons/building_error.png differ diff --git a/themes/default/images/icons/building_go.png b/themes/default/images/icons/building_go.png new file mode 100644 index 0000000..cdcbcb3 Binary files /dev/null and b/themes/default/images/icons/building_go.png differ diff --git a/themes/default/images/icons/building_key.png b/themes/default/images/icons/building_key.png new file mode 100644 index 0000000..8b79e30 Binary files /dev/null and b/themes/default/images/icons/building_key.png differ diff --git a/themes/default/images/icons/building_link.png b/themes/default/images/icons/building_link.png new file mode 100644 index 0000000..a340629 Binary files /dev/null and b/themes/default/images/icons/building_link.png differ diff --git a/themes/default/images/icons/bullet_add.png b/themes/default/images/icons/bullet_add.png new file mode 100644 index 0000000..41ff833 Binary files /dev/null and b/themes/default/images/icons/bullet_add.png differ diff --git a/themes/default/images/icons/bullet_arrow_bottom.png b/themes/default/images/icons/bullet_arrow_bottom.png new file mode 100644 index 0000000..1a28d82 Binary files /dev/null and b/themes/default/images/icons/bullet_arrow_bottom.png differ diff --git a/themes/default/images/icons/bullet_arrow_down.png b/themes/default/images/icons/bullet_arrow_down.png new file mode 100644 index 0000000..9b23c06 Binary files /dev/null and b/themes/default/images/icons/bullet_arrow_down.png differ diff --git a/themes/default/images/icons/bullet_arrow_top.png b/themes/default/images/icons/bullet_arrow_top.png new file mode 100644 index 0000000..0ce86d2 Binary files /dev/null and b/themes/default/images/icons/bullet_arrow_top.png differ diff --git a/themes/default/images/icons/bullet_arrow_up.png b/themes/default/images/icons/bullet_arrow_up.png new file mode 100644 index 0000000..24df0f4 Binary files /dev/null and b/themes/default/images/icons/bullet_arrow_up.png differ diff --git a/themes/default/images/icons/bullet_black.png b/themes/default/images/icons/bullet_black.png new file mode 100644 index 0000000..5761970 Binary files /dev/null and b/themes/default/images/icons/bullet_black.png differ diff --git a/themes/default/images/icons/bullet_blue.png b/themes/default/images/icons/bullet_blue.png new file mode 100644 index 0000000..a7651ec Binary files /dev/null and b/themes/default/images/icons/bullet_blue.png differ diff --git a/themes/default/images/icons/bullet_delete.png b/themes/default/images/icons/bullet_delete.png new file mode 100644 index 0000000..bd6271b Binary files /dev/null and b/themes/default/images/icons/bullet_delete.png differ diff --git a/themes/default/images/icons/bullet_disk.png b/themes/default/images/icons/bullet_disk.png new file mode 100644 index 0000000..209c6a7 Binary files /dev/null and b/themes/default/images/icons/bullet_disk.png differ diff --git a/themes/default/images/icons/bullet_error.png b/themes/default/images/icons/bullet_error.png new file mode 100644 index 0000000..bca2b49 Binary files /dev/null and b/themes/default/images/icons/bullet_error.png differ diff --git a/themes/default/images/icons/bullet_feed.png b/themes/default/images/icons/bullet_feed.png new file mode 100644 index 0000000..1a0e0f1 Binary files /dev/null and b/themes/default/images/icons/bullet_feed.png differ diff --git a/themes/default/images/icons/bullet_go.png b/themes/default/images/icons/bullet_go.png new file mode 100644 index 0000000..bc4faa7 Binary files /dev/null and b/themes/default/images/icons/bullet_go.png differ diff --git a/themes/default/images/icons/bullet_green.png b/themes/default/images/icons/bullet_green.png new file mode 100644 index 0000000..058ad26 Binary files /dev/null and b/themes/default/images/icons/bullet_green.png differ diff --git a/themes/default/images/icons/bullet_key.png b/themes/default/images/icons/bullet_key.png new file mode 100644 index 0000000..3d37f2e Binary files /dev/null and b/themes/default/images/icons/bullet_key.png differ diff --git a/themes/default/images/icons/bullet_orange.png b/themes/default/images/icons/bullet_orange.png new file mode 100644 index 0000000..fa63024 Binary files /dev/null and b/themes/default/images/icons/bullet_orange.png differ diff --git a/themes/default/images/icons/bullet_picture.png b/themes/default/images/icons/bullet_picture.png new file mode 100644 index 0000000..386cb30 Binary files /dev/null and b/themes/default/images/icons/bullet_picture.png differ diff --git a/themes/default/images/icons/bullet_pink.png b/themes/default/images/icons/bullet_pink.png new file mode 100644 index 0000000..0c9f73e Binary files /dev/null and b/themes/default/images/icons/bullet_pink.png differ diff --git a/themes/default/images/icons/bullet_purple.png b/themes/default/images/icons/bullet_purple.png new file mode 100644 index 0000000..52ba503 Binary files /dev/null and b/themes/default/images/icons/bullet_purple.png differ diff --git a/themes/default/images/icons/bullet_red.png b/themes/default/images/icons/bullet_red.png new file mode 100644 index 0000000..0cd8031 Binary files /dev/null and b/themes/default/images/icons/bullet_red.png differ diff --git a/themes/default/images/icons/bullet_star.png b/themes/default/images/icons/bullet_star.png new file mode 100644 index 0000000..fab774a Binary files /dev/null and b/themes/default/images/icons/bullet_star.png differ diff --git a/themes/default/images/icons/bullet_toggle_minus.png b/themes/default/images/icons/bullet_toggle_minus.png new file mode 100644 index 0000000..b47ce55 Binary files /dev/null and b/themes/default/images/icons/bullet_toggle_minus.png differ diff --git a/themes/default/images/icons/bullet_toggle_plus.png b/themes/default/images/icons/bullet_toggle_plus.png new file mode 100644 index 0000000..9ab4a89 Binary files /dev/null and b/themes/default/images/icons/bullet_toggle_plus.png differ diff --git a/themes/default/images/icons/bullet_white.png b/themes/default/images/icons/bullet_white.png new file mode 100644 index 0000000..a9af8d4 Binary files /dev/null and b/themes/default/images/icons/bullet_white.png differ diff --git a/themes/default/images/icons/bullet_wrench.png b/themes/default/images/icons/bullet_wrench.png new file mode 100644 index 0000000..67817e6 Binary files /dev/null and b/themes/default/images/icons/bullet_wrench.png differ diff --git a/themes/default/images/icons/bullet_yellow.png b/themes/default/images/icons/bullet_yellow.png new file mode 100644 index 0000000..6469cea Binary files /dev/null and b/themes/default/images/icons/bullet_yellow.png differ diff --git a/themes/default/images/icons/cake.png b/themes/default/images/icons/cake.png new file mode 100644 index 0000000..4ef151a Binary files /dev/null and b/themes/default/images/icons/cake.png differ diff --git a/themes/default/images/icons/calculator.png b/themes/default/images/icons/calculator.png new file mode 100644 index 0000000..701a60a Binary files /dev/null and b/themes/default/images/icons/calculator.png differ diff --git a/themes/default/images/icons/calculator_add.png b/themes/default/images/icons/calculator_add.png new file mode 100644 index 0000000..fd377bd Binary files /dev/null and b/themes/default/images/icons/calculator_add.png differ diff --git a/themes/default/images/icons/calculator_delete.png b/themes/default/images/icons/calculator_delete.png new file mode 100644 index 0000000..ac96170 Binary files /dev/null and b/themes/default/images/icons/calculator_delete.png differ diff --git a/themes/default/images/icons/calculator_edit.png b/themes/default/images/icons/calculator_edit.png new file mode 100644 index 0000000..63b06b9 Binary files /dev/null and b/themes/default/images/icons/calculator_edit.png differ diff --git a/themes/default/images/icons/calculator_error.png b/themes/default/images/icons/calculator_error.png new file mode 100644 index 0000000..0bc4288 Binary files /dev/null and b/themes/default/images/icons/calculator_error.png differ diff --git a/themes/default/images/icons/calculator_link.png b/themes/default/images/icons/calculator_link.png new file mode 100644 index 0000000..a2a8fe6 Binary files /dev/null and b/themes/default/images/icons/calculator_link.png differ diff --git a/themes/default/images/icons/calendar.png b/themes/default/images/icons/calendar.png new file mode 100644 index 0000000..6589138 Binary files /dev/null and b/themes/default/images/icons/calendar.png differ diff --git a/themes/default/images/icons/calendar_add.png b/themes/default/images/icons/calendar_add.png new file mode 100644 index 0000000..17679db Binary files /dev/null and b/themes/default/images/icons/calendar_add.png differ diff --git a/themes/default/images/icons/calendar_delete.png b/themes/default/images/icons/calendar_delete.png new file mode 100644 index 0000000..69a3b10 Binary files /dev/null and b/themes/default/images/icons/calendar_delete.png differ diff --git a/themes/default/images/icons/calendar_edit.png b/themes/default/images/icons/calendar_edit.png new file mode 100644 index 0000000..d1d2d6e Binary files /dev/null and b/themes/default/images/icons/calendar_edit.png differ diff --git a/themes/default/images/icons/calendar_link.png b/themes/default/images/icons/calendar_link.png new file mode 100644 index 0000000..6b106b9 Binary files /dev/null and b/themes/default/images/icons/calendar_link.png differ diff --git a/themes/default/images/icons/calendar_view_day.png b/themes/default/images/icons/calendar_view_day.png new file mode 100644 index 0000000..9740f76 Binary files /dev/null and b/themes/default/images/icons/calendar_view_day.png differ diff --git a/themes/default/images/icons/calendar_view_month.png b/themes/default/images/icons/calendar_view_month.png new file mode 100644 index 0000000..6cff76c Binary files /dev/null and b/themes/default/images/icons/calendar_view_month.png differ diff --git a/themes/default/images/icons/calendar_view_week.png b/themes/default/images/icons/calendar_view_week.png new file mode 100644 index 0000000..8fe695f Binary files /dev/null and b/themes/default/images/icons/calendar_view_week.png differ diff --git a/themes/default/images/icons/camera.png b/themes/default/images/icons/camera.png new file mode 100644 index 0000000..8536d1a Binary files /dev/null and b/themes/default/images/icons/camera.png differ diff --git a/themes/default/images/icons/camera_add.png b/themes/default/images/icons/camera_add.png new file mode 100644 index 0000000..08b5da9 Binary files /dev/null and b/themes/default/images/icons/camera_add.png differ diff --git a/themes/default/images/icons/camera_delete.png b/themes/default/images/icons/camera_delete.png new file mode 100644 index 0000000..3846d74 Binary files /dev/null and b/themes/default/images/icons/camera_delete.png differ diff --git a/themes/default/images/icons/camera_edit.png b/themes/default/images/icons/camera_edit.png new file mode 100644 index 0000000..b5015b1 Binary files /dev/null and b/themes/default/images/icons/camera_edit.png differ diff --git a/themes/default/images/icons/camera_error.png b/themes/default/images/icons/camera_error.png new file mode 100644 index 0000000..3c1bc95 Binary files /dev/null and b/themes/default/images/icons/camera_error.png differ diff --git a/themes/default/images/icons/camera_go.png b/themes/default/images/icons/camera_go.png new file mode 100644 index 0000000..94ce2b2 Binary files /dev/null and b/themes/default/images/icons/camera_go.png differ diff --git a/themes/default/images/icons/camera_link.png b/themes/default/images/icons/camera_link.png new file mode 100644 index 0000000..d2ac9f9 Binary files /dev/null and b/themes/default/images/icons/camera_link.png differ diff --git a/themes/default/images/icons/camera_small.png b/themes/default/images/icons/camera_small.png new file mode 100644 index 0000000..454b0b0 Binary files /dev/null and b/themes/default/images/icons/camera_small.png differ diff --git a/themes/default/images/icons/cancel.png b/themes/default/images/icons/cancel.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/themes/default/images/icons/cancel.png differ diff --git a/themes/default/images/icons/car.png b/themes/default/images/icons/car.png new file mode 100644 index 0000000..4f3a770 Binary files /dev/null and b/themes/default/images/icons/car.png differ diff --git a/themes/default/images/icons/car_add.png b/themes/default/images/icons/car_add.png new file mode 100644 index 0000000..1215a51 Binary files /dev/null and b/themes/default/images/icons/car_add.png differ diff --git a/themes/default/images/icons/car_delete.png b/themes/default/images/icons/car_delete.png new file mode 100644 index 0000000..2803b56 Binary files /dev/null and b/themes/default/images/icons/car_delete.png differ diff --git a/themes/default/images/icons/cart.png b/themes/default/images/icons/cart.png new file mode 100644 index 0000000..1baf7b9 Binary files /dev/null and b/themes/default/images/icons/cart.png differ diff --git a/themes/default/images/icons/cart_add.png b/themes/default/images/icons/cart_add.png new file mode 100644 index 0000000..45c2900 Binary files /dev/null and b/themes/default/images/icons/cart_add.png differ diff --git a/themes/default/images/icons/cart_delete.png b/themes/default/images/icons/cart_delete.png new file mode 100644 index 0000000..ac5bce5 Binary files /dev/null and b/themes/default/images/icons/cart_delete.png differ diff --git a/themes/default/images/icons/cart_edit.png b/themes/default/images/icons/cart_edit.png new file mode 100644 index 0000000..b94ff88 Binary files /dev/null and b/themes/default/images/icons/cart_edit.png differ diff --git a/themes/default/images/icons/cart_error.png b/themes/default/images/icons/cart_error.png new file mode 100644 index 0000000..144c835 Binary files /dev/null and b/themes/default/images/icons/cart_error.png differ diff --git a/themes/default/images/icons/cart_go.png b/themes/default/images/icons/cart_go.png new file mode 100644 index 0000000..20ee058 Binary files /dev/null and b/themes/default/images/icons/cart_go.png differ diff --git a/themes/default/images/icons/cart_put.png b/themes/default/images/icons/cart_put.png new file mode 100644 index 0000000..3aec353 Binary files /dev/null and b/themes/default/images/icons/cart_put.png differ diff --git a/themes/default/images/icons/cart_remove.png b/themes/default/images/icons/cart_remove.png new file mode 100644 index 0000000..360217b Binary files /dev/null and b/themes/default/images/icons/cart_remove.png differ diff --git a/themes/default/images/icons/cd.png b/themes/default/images/icons/cd.png new file mode 100644 index 0000000..ef43223 Binary files /dev/null and b/themes/default/images/icons/cd.png differ diff --git a/themes/default/images/icons/cd_add.png b/themes/default/images/icons/cd_add.png new file mode 100644 index 0000000..b0254ef Binary files /dev/null and b/themes/default/images/icons/cd_add.png differ diff --git a/themes/default/images/icons/cd_burn.png b/themes/default/images/icons/cd_burn.png new file mode 100644 index 0000000..157cb0b Binary files /dev/null and b/themes/default/images/icons/cd_burn.png differ diff --git a/themes/default/images/icons/cd_delete.png b/themes/default/images/icons/cd_delete.png new file mode 100644 index 0000000..7d7b3d5 Binary files /dev/null and b/themes/default/images/icons/cd_delete.png differ diff --git a/themes/default/images/icons/cd_edit.png b/themes/default/images/icons/cd_edit.png new file mode 100644 index 0000000..b0dc194 Binary files /dev/null and b/themes/default/images/icons/cd_edit.png differ diff --git a/themes/default/images/icons/cd_eject.png b/themes/default/images/icons/cd_eject.png new file mode 100644 index 0000000..762932f Binary files /dev/null and b/themes/default/images/icons/cd_eject.png differ diff --git a/themes/default/images/icons/cd_go.png b/themes/default/images/icons/cd_go.png new file mode 100644 index 0000000..13e0499 Binary files /dev/null and b/themes/default/images/icons/cd_go.png differ diff --git a/themes/default/images/icons/chart_bar.png b/themes/default/images/icons/chart_bar.png new file mode 100644 index 0000000..9051fbc Binary files /dev/null and b/themes/default/images/icons/chart_bar.png differ diff --git a/themes/default/images/icons/chart_bar_add.png b/themes/default/images/icons/chart_bar_add.png new file mode 100644 index 0000000..d283e84 Binary files /dev/null and b/themes/default/images/icons/chart_bar_add.png differ diff --git a/themes/default/images/icons/chart_bar_delete.png b/themes/default/images/icons/chart_bar_delete.png new file mode 100644 index 0000000..259f686 Binary files /dev/null and b/themes/default/images/icons/chart_bar_delete.png differ diff --git a/themes/default/images/icons/chart_bar_edit.png b/themes/default/images/icons/chart_bar_edit.png new file mode 100644 index 0000000..df64d97 Binary files /dev/null and b/themes/default/images/icons/chart_bar_edit.png differ diff --git a/themes/default/images/icons/chart_bar_error.png b/themes/default/images/icons/chart_bar_error.png new file mode 100644 index 0000000..bdacea5 Binary files /dev/null and b/themes/default/images/icons/chart_bar_error.png differ diff --git a/themes/default/images/icons/chart_bar_link.png b/themes/default/images/icons/chart_bar_link.png new file mode 100644 index 0000000..bf18aed Binary files /dev/null and b/themes/default/images/icons/chart_bar_link.png differ diff --git a/themes/default/images/icons/chart_curve.png b/themes/default/images/icons/chart_curve.png new file mode 100644 index 0000000..01e933a Binary files /dev/null and b/themes/default/images/icons/chart_curve.png differ diff --git a/themes/default/images/icons/chart_curve_add.png b/themes/default/images/icons/chart_curve_add.png new file mode 100644 index 0000000..f9e2050 Binary files /dev/null and b/themes/default/images/icons/chart_curve_add.png differ diff --git a/themes/default/images/icons/chart_curve_delete.png b/themes/default/images/icons/chart_curve_delete.png new file mode 100644 index 0000000..b411391 Binary files /dev/null and b/themes/default/images/icons/chart_curve_delete.png differ diff --git a/themes/default/images/icons/chart_curve_edit.png b/themes/default/images/icons/chart_curve_edit.png new file mode 100644 index 0000000..bd07673 Binary files /dev/null and b/themes/default/images/icons/chart_curve_edit.png differ diff --git a/themes/default/images/icons/chart_curve_error.png b/themes/default/images/icons/chart_curve_error.png new file mode 100644 index 0000000..906dd03 Binary files /dev/null and b/themes/default/images/icons/chart_curve_error.png differ diff --git a/themes/default/images/icons/chart_curve_go.png b/themes/default/images/icons/chart_curve_go.png new file mode 100644 index 0000000..ac9eda5 Binary files /dev/null and b/themes/default/images/icons/chart_curve_go.png differ diff --git a/themes/default/images/icons/chart_curve_link.png b/themes/default/images/icons/chart_curve_link.png new file mode 100644 index 0000000..144eafe Binary files /dev/null and b/themes/default/images/icons/chart_curve_link.png differ diff --git a/themes/default/images/icons/chart_line.png b/themes/default/images/icons/chart_line.png new file mode 100644 index 0000000..85020f3 Binary files /dev/null and b/themes/default/images/icons/chart_line.png differ diff --git a/themes/default/images/icons/chart_line_add.png b/themes/default/images/icons/chart_line_add.png new file mode 100644 index 0000000..5571a5e Binary files /dev/null and b/themes/default/images/icons/chart_line_add.png differ diff --git a/themes/default/images/icons/chart_line_delete.png b/themes/default/images/icons/chart_line_delete.png new file mode 100644 index 0000000..5b0aa90 Binary files /dev/null and b/themes/default/images/icons/chart_line_delete.png differ diff --git a/themes/default/images/icons/chart_line_edit.png b/themes/default/images/icons/chart_line_edit.png new file mode 100644 index 0000000..9cf6607 Binary files /dev/null and b/themes/default/images/icons/chart_line_edit.png differ diff --git a/themes/default/images/icons/chart_line_error.png b/themes/default/images/icons/chart_line_error.png new file mode 100644 index 0000000..ff23c03 Binary files /dev/null and b/themes/default/images/icons/chart_line_error.png differ diff --git a/themes/default/images/icons/chart_line_link.png b/themes/default/images/icons/chart_line_link.png new file mode 100644 index 0000000..f3727d2 Binary files /dev/null and b/themes/default/images/icons/chart_line_link.png differ diff --git a/themes/default/images/icons/chart_organisation.png b/themes/default/images/icons/chart_organisation.png new file mode 100644 index 0000000..c32d25c Binary files /dev/null and b/themes/default/images/icons/chart_organisation.png differ diff --git a/themes/default/images/icons/chart_organisation_add.png b/themes/default/images/icons/chart_organisation_add.png new file mode 100644 index 0000000..f0dba4a Binary files /dev/null and b/themes/default/images/icons/chart_organisation_add.png differ diff --git a/themes/default/images/icons/chart_organisation_delete.png b/themes/default/images/icons/chart_organisation_delete.png new file mode 100644 index 0000000..7dc8dca Binary files /dev/null and b/themes/default/images/icons/chart_organisation_delete.png differ diff --git a/themes/default/images/icons/chart_pie.png b/themes/default/images/icons/chart_pie.png new file mode 100644 index 0000000..fe00fa0 Binary files /dev/null and b/themes/default/images/icons/chart_pie.png differ diff --git a/themes/default/images/icons/chart_pie_add.png b/themes/default/images/icons/chart_pie_add.png new file mode 100644 index 0000000..bf0822e Binary files /dev/null and b/themes/default/images/icons/chart_pie_add.png differ diff --git a/themes/default/images/icons/chart_pie_delete.png b/themes/default/images/icons/chart_pie_delete.png new file mode 100644 index 0000000..5ab9efd Binary files /dev/null and b/themes/default/images/icons/chart_pie_delete.png differ diff --git a/themes/default/images/icons/chart_pie_edit.png b/themes/default/images/icons/chart_pie_edit.png new file mode 100644 index 0000000..3debc12 Binary files /dev/null and b/themes/default/images/icons/chart_pie_edit.png differ diff --git a/themes/default/images/icons/chart_pie_error.png b/themes/default/images/icons/chart_pie_error.png new file mode 100644 index 0000000..7344174 Binary files /dev/null and b/themes/default/images/icons/chart_pie_error.png differ diff --git a/themes/default/images/icons/chart_pie_link.png b/themes/default/images/icons/chart_pie_link.png new file mode 100644 index 0000000..c072f8e Binary files /dev/null and b/themes/default/images/icons/chart_pie_link.png differ diff --git a/themes/default/images/icons/clock.png b/themes/default/images/icons/clock.png new file mode 100644 index 0000000..e2672c2 Binary files /dev/null and b/themes/default/images/icons/clock.png differ diff --git a/themes/default/images/icons/clock_add.png b/themes/default/images/icons/clock_add.png new file mode 100644 index 0000000..598b839 Binary files /dev/null and b/themes/default/images/icons/clock_add.png differ diff --git a/themes/default/images/icons/clock_delete.png b/themes/default/images/icons/clock_delete.png new file mode 100644 index 0000000..8bf9efe Binary files /dev/null and b/themes/default/images/icons/clock_delete.png differ diff --git a/themes/default/images/icons/clock_edit.png b/themes/default/images/icons/clock_edit.png new file mode 100644 index 0000000..7d35718 Binary files /dev/null and b/themes/default/images/icons/clock_edit.png differ diff --git a/themes/default/images/icons/clock_error.png b/themes/default/images/icons/clock_error.png new file mode 100644 index 0000000..a7c461b Binary files /dev/null and b/themes/default/images/icons/clock_error.png differ diff --git a/themes/default/images/icons/clock_go.png b/themes/default/images/icons/clock_go.png new file mode 100644 index 0000000..a1a24d3 Binary files /dev/null and b/themes/default/images/icons/clock_go.png differ diff --git a/themes/default/images/icons/clock_link.png b/themes/default/images/icons/clock_link.png new file mode 100644 index 0000000..481cf04 Binary files /dev/null and b/themes/default/images/icons/clock_link.png differ diff --git a/themes/default/images/icons/clock_pause.png b/themes/default/images/icons/clock_pause.png new file mode 100644 index 0000000..ba74725 Binary files /dev/null and b/themes/default/images/icons/clock_pause.png differ diff --git a/themes/default/images/icons/clock_play.png b/themes/default/images/icons/clock_play.png new file mode 100644 index 0000000..fb4ebc8 Binary files /dev/null and b/themes/default/images/icons/clock_play.png differ diff --git a/themes/default/images/icons/clock_red.png b/themes/default/images/icons/clock_red.png new file mode 100644 index 0000000..2842cc3 Binary files /dev/null and b/themes/default/images/icons/clock_red.png differ diff --git a/themes/default/images/icons/clock_stop.png b/themes/default/images/icons/clock_stop.png new file mode 100644 index 0000000..6fe8a6f Binary files /dev/null and b/themes/default/images/icons/clock_stop.png differ diff --git a/themes/default/images/icons/cog.png b/themes/default/images/icons/cog.png new file mode 100644 index 0000000..67de2c6 Binary files /dev/null and b/themes/default/images/icons/cog.png differ diff --git a/themes/default/images/icons/cog_add.png b/themes/default/images/icons/cog_add.png new file mode 100644 index 0000000..04f22ba Binary files /dev/null and b/themes/default/images/icons/cog_add.png differ diff --git a/themes/default/images/icons/cog_delete.png b/themes/default/images/icons/cog_delete.png new file mode 100644 index 0000000..8ce71c4 Binary files /dev/null and b/themes/default/images/icons/cog_delete.png differ diff --git a/themes/default/images/icons/cog_edit.png b/themes/default/images/icons/cog_edit.png new file mode 100644 index 0000000..47b75a4 Binary files /dev/null and b/themes/default/images/icons/cog_edit.png differ diff --git a/themes/default/images/icons/cog_error.png b/themes/default/images/icons/cog_error.png new file mode 100644 index 0000000..4766743 Binary files /dev/null and b/themes/default/images/icons/cog_error.png differ diff --git a/themes/default/images/icons/cog_go.png b/themes/default/images/icons/cog_go.png new file mode 100644 index 0000000..3262767 Binary files /dev/null and b/themes/default/images/icons/cog_go.png differ diff --git a/themes/default/images/icons/coins.png b/themes/default/images/icons/coins.png new file mode 100644 index 0000000..0ca9074 Binary files /dev/null and b/themes/default/images/icons/coins.png differ diff --git a/themes/default/images/icons/coins_add.png b/themes/default/images/icons/coins_add.png new file mode 100644 index 0000000..cdff5d3 Binary files /dev/null and b/themes/default/images/icons/coins_add.png differ diff --git a/themes/default/images/icons/coins_delete.png b/themes/default/images/icons/coins_delete.png new file mode 100644 index 0000000..18e0c0f Binary files /dev/null and b/themes/default/images/icons/coins_delete.png differ diff --git a/themes/default/images/icons/color_swatch.png b/themes/default/images/icons/color_swatch.png new file mode 100644 index 0000000..6e6e852 Binary files /dev/null and b/themes/default/images/icons/color_swatch.png differ diff --git a/themes/default/images/icons/color_wheel.png b/themes/default/images/icons/color_wheel.png new file mode 100644 index 0000000..809fb00 Binary files /dev/null and b/themes/default/images/icons/color_wheel.png differ diff --git a/themes/default/images/icons/comment.png b/themes/default/images/icons/comment.png new file mode 100644 index 0000000..7bc9233 Binary files /dev/null and b/themes/default/images/icons/comment.png differ diff --git a/themes/default/images/icons/comment_add.png b/themes/default/images/icons/comment_add.png new file mode 100644 index 0000000..75e78de Binary files /dev/null and b/themes/default/images/icons/comment_add.png differ diff --git a/themes/default/images/icons/comment_delete.png b/themes/default/images/icons/comment_delete.png new file mode 100644 index 0000000..643fdbe Binary files /dev/null and b/themes/default/images/icons/comment_delete.png differ diff --git a/themes/default/images/icons/comment_edit.png b/themes/default/images/icons/comment_edit.png new file mode 100644 index 0000000..73db110 Binary files /dev/null and b/themes/default/images/icons/comment_edit.png differ diff --git a/themes/default/images/icons/comments.png b/themes/default/images/icons/comments.png new file mode 100644 index 0000000..39433cf Binary files /dev/null and b/themes/default/images/icons/comments.png differ diff --git a/themes/default/images/icons/comments_add.png b/themes/default/images/icons/comments_add.png new file mode 100644 index 0000000..b325634 Binary files /dev/null and b/themes/default/images/icons/comments_add.png differ diff --git a/themes/default/images/icons/comments_delete.png b/themes/default/images/icons/comments_delete.png new file mode 100644 index 0000000..6df7376 Binary files /dev/null and b/themes/default/images/icons/comments_delete.png differ diff --git a/themes/default/images/icons/compress.png b/themes/default/images/icons/compress.png new file mode 100644 index 0000000..8606ff0 Binary files /dev/null and b/themes/default/images/icons/compress.png differ diff --git a/themes/default/images/icons/computer.png b/themes/default/images/icons/computer.png new file mode 100644 index 0000000..9bc37dc Binary files /dev/null and b/themes/default/images/icons/computer.png differ diff --git a/themes/default/images/icons/computer_add.png b/themes/default/images/icons/computer_add.png new file mode 100644 index 0000000..db604ee Binary files /dev/null and b/themes/default/images/icons/computer_add.png differ diff --git a/themes/default/images/icons/computer_delete.png b/themes/default/images/icons/computer_delete.png new file mode 100644 index 0000000..5e9b268 Binary files /dev/null and b/themes/default/images/icons/computer_delete.png differ diff --git a/themes/default/images/icons/computer_edit.png b/themes/default/images/icons/computer_edit.png new file mode 100644 index 0000000..34c72fe Binary files /dev/null and b/themes/default/images/icons/computer_edit.png differ diff --git a/themes/default/images/icons/computer_error.png b/themes/default/images/icons/computer_error.png new file mode 100644 index 0000000..b2c3ed5 Binary files /dev/null and b/themes/default/images/icons/computer_error.png differ diff --git a/themes/default/images/icons/computer_go.png b/themes/default/images/icons/computer_go.png new file mode 100644 index 0000000..0b26144 Binary files /dev/null and b/themes/default/images/icons/computer_go.png differ diff --git a/themes/default/images/icons/computer_key.png b/themes/default/images/icons/computer_key.png new file mode 100644 index 0000000..eca5430 Binary files /dev/null and b/themes/default/images/icons/computer_key.png differ diff --git a/themes/default/images/icons/computer_link.png b/themes/default/images/icons/computer_link.png new file mode 100644 index 0000000..3859db2 Binary files /dev/null and b/themes/default/images/icons/computer_link.png differ diff --git a/themes/default/images/icons/connect.png b/themes/default/images/icons/connect.png new file mode 100644 index 0000000..024138e Binary files /dev/null and b/themes/default/images/icons/connect.png differ diff --git a/themes/default/images/icons/contrast.png b/themes/default/images/icons/contrast.png new file mode 100644 index 0000000..adcc004 Binary files /dev/null and b/themes/default/images/icons/contrast.png differ diff --git a/themes/default/images/icons/contrast_decrease.png b/themes/default/images/icons/contrast_decrease.png new file mode 100644 index 0000000..0155bf5 Binary files /dev/null and b/themes/default/images/icons/contrast_decrease.png differ diff --git a/themes/default/images/icons/contrast_high.png b/themes/default/images/icons/contrast_high.png new file mode 100644 index 0000000..d87c8cb Binary files /dev/null and b/themes/default/images/icons/contrast_high.png differ diff --git a/themes/default/images/icons/contrast_increase.png b/themes/default/images/icons/contrast_increase.png new file mode 100644 index 0000000..a3e7f52 Binary files /dev/null and b/themes/default/images/icons/contrast_increase.png differ diff --git a/themes/default/images/icons/contrast_low.png b/themes/default/images/icons/contrast_low.png new file mode 100644 index 0000000..dc9f4b1 Binary files /dev/null and b/themes/default/images/icons/contrast_low.png differ diff --git a/themes/default/images/icons/control_eject.png b/themes/default/images/icons/control_eject.png new file mode 100644 index 0000000..924d817 Binary files /dev/null and b/themes/default/images/icons/control_eject.png differ diff --git a/themes/default/images/icons/control_eject_blue.png b/themes/default/images/icons/control_eject_blue.png new file mode 100644 index 0000000..2bd4963 Binary files /dev/null and b/themes/default/images/icons/control_eject_blue.png differ diff --git a/themes/default/images/icons/control_end.png b/themes/default/images/icons/control_end.png new file mode 100644 index 0000000..036e04d Binary files /dev/null and b/themes/default/images/icons/control_end.png differ diff --git a/themes/default/images/icons/control_end_blue.png b/themes/default/images/icons/control_end_blue.png new file mode 100644 index 0000000..7207935 Binary files /dev/null and b/themes/default/images/icons/control_end_blue.png differ diff --git a/themes/default/images/icons/control_equalizer.png b/themes/default/images/icons/control_equalizer.png new file mode 100644 index 0000000..4606087 Binary files /dev/null and b/themes/default/images/icons/control_equalizer.png differ diff --git a/themes/default/images/icons/control_equalizer_blue.png b/themes/default/images/icons/control_equalizer_blue.png new file mode 100644 index 0000000..1b2e6a3 Binary files /dev/null and b/themes/default/images/icons/control_equalizer_blue.png differ diff --git a/themes/default/images/icons/control_fastforward.png b/themes/default/images/icons/control_fastforward.png new file mode 100644 index 0000000..31f7fd3 Binary files /dev/null and b/themes/default/images/icons/control_fastforward.png differ diff --git a/themes/default/images/icons/control_fastforward_blue.png b/themes/default/images/icons/control_fastforward_blue.png new file mode 100644 index 0000000..4a2f9d4 Binary files /dev/null and b/themes/default/images/icons/control_fastforward_blue.png differ diff --git a/themes/default/images/icons/control_pause.png b/themes/default/images/icons/control_pause.png new file mode 100644 index 0000000..2d9ce9c Binary files /dev/null and b/themes/default/images/icons/control_pause.png differ diff --git a/themes/default/images/icons/control_pause_blue.png b/themes/default/images/icons/control_pause_blue.png new file mode 100644 index 0000000..ec61099 Binary files /dev/null and b/themes/default/images/icons/control_pause_blue.png differ diff --git a/themes/default/images/icons/control_play.png b/themes/default/images/icons/control_play.png new file mode 100644 index 0000000..0846555 Binary files /dev/null and b/themes/default/images/icons/control_play.png differ diff --git a/themes/default/images/icons/control_play_blue.png b/themes/default/images/icons/control_play_blue.png new file mode 100644 index 0000000..f8c8ec6 Binary files /dev/null and b/themes/default/images/icons/control_play_blue.png differ diff --git a/themes/default/images/icons/control_repeat.png b/themes/default/images/icons/control_repeat.png new file mode 100644 index 0000000..1c4f57a Binary files /dev/null and b/themes/default/images/icons/control_repeat.png differ diff --git a/themes/default/images/icons/control_repeat_blue.png b/themes/default/images/icons/control_repeat_blue.png new file mode 100644 index 0000000..406ec33 Binary files /dev/null and b/themes/default/images/icons/control_repeat_blue.png differ diff --git a/themes/default/images/icons/control_rewind.png b/themes/default/images/icons/control_rewind.png new file mode 100644 index 0000000..c029447 Binary files /dev/null and b/themes/default/images/icons/control_rewind.png differ diff --git a/themes/default/images/icons/control_rewind_blue.png b/themes/default/images/icons/control_rewind_blue.png new file mode 100644 index 0000000..15d1584 Binary files /dev/null and b/themes/default/images/icons/control_rewind_blue.png differ diff --git a/themes/default/images/icons/control_start.png b/themes/default/images/icons/control_start.png new file mode 100644 index 0000000..7dd1c07 Binary files /dev/null and b/themes/default/images/icons/control_start.png differ diff --git a/themes/default/images/icons/control_start_blue.png b/themes/default/images/icons/control_start_blue.png new file mode 100644 index 0000000..6f11fcb Binary files /dev/null and b/themes/default/images/icons/control_start_blue.png differ diff --git a/themes/default/images/icons/control_stop.png b/themes/default/images/icons/control_stop.png new file mode 100644 index 0000000..893bb60 Binary files /dev/null and b/themes/default/images/icons/control_stop.png differ diff --git a/themes/default/images/icons/control_stop_blue.png b/themes/default/images/icons/control_stop_blue.png new file mode 100644 index 0000000..e6f75d2 Binary files /dev/null and b/themes/default/images/icons/control_stop_blue.png differ diff --git a/themes/default/images/icons/controller.png b/themes/default/images/icons/controller.png new file mode 100644 index 0000000..5cf76ed Binary files /dev/null and b/themes/default/images/icons/controller.png differ diff --git a/themes/default/images/icons/controller_add.png b/themes/default/images/icons/controller_add.png new file mode 100644 index 0000000..efecb38 Binary files /dev/null and b/themes/default/images/icons/controller_add.png differ diff --git a/themes/default/images/icons/controller_delete.png b/themes/default/images/icons/controller_delete.png new file mode 100644 index 0000000..3d83bc7 Binary files /dev/null and b/themes/default/images/icons/controller_delete.png differ diff --git a/themes/default/images/icons/controller_error.png b/themes/default/images/icons/controller_error.png new file mode 100644 index 0000000..7f17c0c Binary files /dev/null and b/themes/default/images/icons/controller_error.png differ diff --git a/themes/default/images/icons/creditcards.png b/themes/default/images/icons/creditcards.png new file mode 100644 index 0000000..4eae583 Binary files /dev/null and b/themes/default/images/icons/creditcards.png differ diff --git a/themes/default/images/icons/cross.png b/themes/default/images/icons/cross.png new file mode 100644 index 0000000..1514d51 Binary files /dev/null and b/themes/default/images/icons/cross.png differ diff --git a/themes/default/images/icons/css.png b/themes/default/images/icons/css.png new file mode 100644 index 0000000..23f3101 Binary files /dev/null and b/themes/default/images/icons/css.png differ diff --git a/themes/default/images/icons/css_add.png b/themes/default/images/icons/css_add.png new file mode 100644 index 0000000..e8ea10f Binary files /dev/null and b/themes/default/images/icons/css_add.png differ diff --git a/themes/default/images/icons/css_delete.png b/themes/default/images/icons/css_delete.png new file mode 100644 index 0000000..326aba4 Binary files /dev/null and b/themes/default/images/icons/css_delete.png differ diff --git a/themes/default/images/icons/css_go.png b/themes/default/images/icons/css_go.png new file mode 100644 index 0000000..6cdf38c Binary files /dev/null and b/themes/default/images/icons/css_go.png differ diff --git a/themes/default/images/icons/css_valid.png b/themes/default/images/icons/css_valid.png new file mode 100644 index 0000000..4c72ca5 Binary files /dev/null and b/themes/default/images/icons/css_valid.png differ diff --git a/themes/default/images/icons/cup.png b/themes/default/images/icons/cup.png new file mode 100644 index 0000000..b7bfcd1 Binary files /dev/null and b/themes/default/images/icons/cup.png differ diff --git a/themes/default/images/icons/cup_add.png b/themes/default/images/icons/cup_add.png new file mode 100644 index 0000000..4ecaece Binary files /dev/null and b/themes/default/images/icons/cup_add.png differ diff --git a/themes/default/images/icons/cup_delete.png b/themes/default/images/icons/cup_delete.png new file mode 100644 index 0000000..59a6d9c Binary files /dev/null and b/themes/default/images/icons/cup_delete.png differ diff --git a/themes/default/images/icons/cup_edit.png b/themes/default/images/icons/cup_edit.png new file mode 100644 index 0000000..0b8f1e1 Binary files /dev/null and b/themes/default/images/icons/cup_edit.png differ diff --git a/themes/default/images/icons/cup_error.png b/themes/default/images/icons/cup_error.png new file mode 100644 index 0000000..6879874 Binary files /dev/null and b/themes/default/images/icons/cup_error.png differ diff --git a/themes/default/images/icons/cup_go.png b/themes/default/images/icons/cup_go.png new file mode 100644 index 0000000..9527efb Binary files /dev/null and b/themes/default/images/icons/cup_go.png differ diff --git a/themes/default/images/icons/cup_key.png b/themes/default/images/icons/cup_key.png new file mode 100644 index 0000000..7ae160c Binary files /dev/null and b/themes/default/images/icons/cup_key.png differ diff --git a/themes/default/images/icons/cup_link.png b/themes/default/images/icons/cup_link.png new file mode 100644 index 0000000..41d1ace Binary files /dev/null and b/themes/default/images/icons/cup_link.png differ diff --git a/themes/default/images/icons/cursor.png b/themes/default/images/icons/cursor.png new file mode 100644 index 0000000..532f532 Binary files /dev/null and b/themes/default/images/icons/cursor.png differ diff --git a/themes/default/images/icons/cut.png b/themes/default/images/icons/cut.png new file mode 100644 index 0000000..f215d6f Binary files /dev/null and b/themes/default/images/icons/cut.png differ diff --git a/themes/default/images/icons/cut_red.png b/themes/default/images/icons/cut_red.png new file mode 100644 index 0000000..85bb2f0 Binary files /dev/null and b/themes/default/images/icons/cut_red.png differ diff --git a/themes/default/images/icons/database.png b/themes/default/images/icons/database.png new file mode 100644 index 0000000..3d09261 Binary files /dev/null and b/themes/default/images/icons/database.png differ diff --git a/themes/default/images/icons/database_add.png b/themes/default/images/icons/database_add.png new file mode 100644 index 0000000..802bd6c Binary files /dev/null and b/themes/default/images/icons/database_add.png differ diff --git a/themes/default/images/icons/database_connect.png b/themes/default/images/icons/database_connect.png new file mode 100644 index 0000000..3a11197 Binary files /dev/null and b/themes/default/images/icons/database_connect.png differ diff --git a/themes/default/images/icons/database_delete.png b/themes/default/images/icons/database_delete.png new file mode 100644 index 0000000..cce652e Binary files /dev/null and b/themes/default/images/icons/database_delete.png differ diff --git a/themes/default/images/icons/database_edit.png b/themes/default/images/icons/database_edit.png new file mode 100644 index 0000000..e501b66 Binary files /dev/null and b/themes/default/images/icons/database_edit.png differ diff --git a/themes/default/images/icons/database_error.png b/themes/default/images/icons/database_error.png new file mode 100644 index 0000000..578221a Binary files /dev/null and b/themes/default/images/icons/database_error.png differ diff --git a/themes/default/images/icons/database_gear.png b/themes/default/images/icons/database_gear.png new file mode 100644 index 0000000..7c0ab2b Binary files /dev/null and b/themes/default/images/icons/database_gear.png differ diff --git a/themes/default/images/icons/database_go.png b/themes/default/images/icons/database_go.png new file mode 100644 index 0000000..61a8556 Binary files /dev/null and b/themes/default/images/icons/database_go.png differ diff --git a/themes/default/images/icons/database_key.png b/themes/default/images/icons/database_key.png new file mode 100644 index 0000000..3334147 Binary files /dev/null and b/themes/default/images/icons/database_key.png differ diff --git a/themes/default/images/icons/database_lightning.png b/themes/default/images/icons/database_lightning.png new file mode 100644 index 0000000..d9eefc2 Binary files /dev/null and b/themes/default/images/icons/database_lightning.png differ diff --git a/themes/default/images/icons/database_link.png b/themes/default/images/icons/database_link.png new file mode 100644 index 0000000..4c8204a Binary files /dev/null and b/themes/default/images/icons/database_link.png differ diff --git a/themes/default/images/icons/database_refresh.png b/themes/default/images/icons/database_refresh.png new file mode 100644 index 0000000..ff803be Binary files /dev/null and b/themes/default/images/icons/database_refresh.png differ diff --git a/themes/default/images/icons/database_save.png b/themes/default/images/icons/database_save.png new file mode 100644 index 0000000..44c06dd Binary files /dev/null and b/themes/default/images/icons/database_save.png differ diff --git a/themes/default/images/icons/database_table.png b/themes/default/images/icons/database_table.png new file mode 100644 index 0000000..693709c Binary files /dev/null and b/themes/default/images/icons/database_table.png differ diff --git a/themes/default/images/icons/date.png b/themes/default/images/icons/date.png new file mode 100644 index 0000000..783c833 Binary files /dev/null and b/themes/default/images/icons/date.png differ diff --git a/themes/default/images/icons/date_add.png b/themes/default/images/icons/date_add.png new file mode 100644 index 0000000..6a7ae02 Binary files /dev/null and b/themes/default/images/icons/date_add.png differ diff --git a/themes/default/images/icons/date_delete.png b/themes/default/images/icons/date_delete.png new file mode 100644 index 0000000..969a6b7 Binary files /dev/null and b/themes/default/images/icons/date_delete.png differ diff --git a/themes/default/images/icons/date_edit.png b/themes/default/images/icons/date_edit.png new file mode 100644 index 0000000..e681065 Binary files /dev/null and b/themes/default/images/icons/date_edit.png differ diff --git a/themes/default/images/icons/date_error.png b/themes/default/images/icons/date_error.png new file mode 100644 index 0000000..442cd97 Binary files /dev/null and b/themes/default/images/icons/date_error.png differ diff --git a/themes/default/images/icons/date_go.png b/themes/default/images/icons/date_go.png new file mode 100644 index 0000000..52dd9f3 Binary files /dev/null and b/themes/default/images/icons/date_go.png differ diff --git a/themes/default/images/icons/date_link.png b/themes/default/images/icons/date_link.png new file mode 100644 index 0000000..9f0aada Binary files /dev/null and b/themes/default/images/icons/date_link.png differ diff --git a/themes/default/images/icons/date_magnify.png b/themes/default/images/icons/date_magnify.png new file mode 100644 index 0000000..cd05f19 Binary files /dev/null and b/themes/default/images/icons/date_magnify.png differ diff --git a/themes/default/images/icons/date_next.png b/themes/default/images/icons/date_next.png new file mode 100644 index 0000000..48d740a Binary files /dev/null and b/themes/default/images/icons/date_next.png differ diff --git a/themes/default/images/icons/date_previous.png b/themes/default/images/icons/date_previous.png new file mode 100644 index 0000000..e117a83 Binary files /dev/null and b/themes/default/images/icons/date_previous.png differ diff --git a/themes/default/images/icons/delete.png b/themes/default/images/icons/delete.png new file mode 100644 index 0000000..08f2493 Binary files /dev/null and b/themes/default/images/icons/delete.png differ diff --git a/themes/default/images/icons/disconnect.png b/themes/default/images/icons/disconnect.png new file mode 100644 index 0000000..b335cb1 Binary files /dev/null and b/themes/default/images/icons/disconnect.png differ diff --git a/themes/default/images/icons/disk.png b/themes/default/images/icons/disk.png new file mode 100644 index 0000000..99d532e Binary files /dev/null and b/themes/default/images/icons/disk.png differ diff --git a/themes/default/images/icons/disk_multiple.png b/themes/default/images/icons/disk_multiple.png new file mode 100644 index 0000000..fc5a52f Binary files /dev/null and b/themes/default/images/icons/disk_multiple.png differ diff --git a/themes/default/images/icons/door.png b/themes/default/images/icons/door.png new file mode 100644 index 0000000..369fc46 Binary files /dev/null and b/themes/default/images/icons/door.png differ diff --git a/themes/default/images/icons/door_in.png b/themes/default/images/icons/door_in.png new file mode 100644 index 0000000..41676a0 Binary files /dev/null and b/themes/default/images/icons/door_in.png differ diff --git a/themes/default/images/icons/door_open.png b/themes/default/images/icons/door_open.png new file mode 100644 index 0000000..64bab57 Binary files /dev/null and b/themes/default/images/icons/door_open.png differ diff --git a/themes/default/images/icons/door_out.png b/themes/default/images/icons/door_out.png new file mode 100644 index 0000000..2541d2b Binary files /dev/null and b/themes/default/images/icons/door_out.png differ diff --git a/themes/default/images/icons/drink.png b/themes/default/images/icons/drink.png new file mode 100644 index 0000000..d98359c Binary files /dev/null and b/themes/default/images/icons/drink.png differ diff --git a/themes/default/images/icons/drink_empty.png b/themes/default/images/icons/drink_empty.png new file mode 100644 index 0000000..a40211e Binary files /dev/null and b/themes/default/images/icons/drink_empty.png differ diff --git a/themes/default/images/icons/drive.png b/themes/default/images/icons/drive.png new file mode 100644 index 0000000..37b7c9b Binary files /dev/null and b/themes/default/images/icons/drive.png differ diff --git a/themes/default/images/icons/drive_add.png b/themes/default/images/icons/drive_add.png new file mode 100644 index 0000000..29a35d5 Binary files /dev/null and b/themes/default/images/icons/drive_add.png differ diff --git a/themes/default/images/icons/drive_burn.png b/themes/default/images/icons/drive_burn.png new file mode 100644 index 0000000..80fd79f Binary files /dev/null and b/themes/default/images/icons/drive_burn.png differ diff --git a/themes/default/images/icons/drive_cd.png b/themes/default/images/icons/drive_cd.png new file mode 100644 index 0000000..1850b70 Binary files /dev/null and b/themes/default/images/icons/drive_cd.png differ diff --git a/themes/default/images/icons/drive_cd_empty.png b/themes/default/images/icons/drive_cd_empty.png new file mode 100644 index 0000000..8df38d9 Binary files /dev/null and b/themes/default/images/icons/drive_cd_empty.png differ diff --git a/themes/default/images/icons/drive_delete.png b/themes/default/images/icons/drive_delete.png new file mode 100644 index 0000000..e6eb186 Binary files /dev/null and b/themes/default/images/icons/drive_delete.png differ diff --git a/themes/default/images/icons/drive_disk.png b/themes/default/images/icons/drive_disk.png new file mode 100644 index 0000000..5a51e81 Binary files /dev/null and b/themes/default/images/icons/drive_disk.png differ diff --git a/themes/default/images/icons/drive_edit.png b/themes/default/images/icons/drive_edit.png new file mode 100644 index 0000000..7923fad Binary files /dev/null and b/themes/default/images/icons/drive_edit.png differ diff --git a/themes/default/images/icons/drive_error.png b/themes/default/images/icons/drive_error.png new file mode 100644 index 0000000..309f639 Binary files /dev/null and b/themes/default/images/icons/drive_error.png differ diff --git a/themes/default/images/icons/drive_go.png b/themes/default/images/icons/drive_go.png new file mode 100644 index 0000000..fc53379 Binary files /dev/null and b/themes/default/images/icons/drive_go.png differ diff --git a/themes/default/images/icons/drive_key.png b/themes/default/images/icons/drive_key.png new file mode 100644 index 0000000..d0b3c67 Binary files /dev/null and b/themes/default/images/icons/drive_key.png differ diff --git a/themes/default/images/icons/drive_link.png b/themes/default/images/icons/drive_link.png new file mode 100644 index 0000000..8679c4b Binary files /dev/null and b/themes/default/images/icons/drive_link.png differ diff --git a/themes/default/images/icons/drive_magnify.png b/themes/default/images/icons/drive_magnify.png new file mode 100644 index 0000000..0f0f444 Binary files /dev/null and b/themes/default/images/icons/drive_magnify.png differ diff --git a/themes/default/images/icons/drive_network.png b/themes/default/images/icons/drive_network.png new file mode 100644 index 0000000..63d2d5d Binary files /dev/null and b/themes/default/images/icons/drive_network.png differ diff --git a/themes/default/images/icons/drive_rename.png b/themes/default/images/icons/drive_rename.png new file mode 100644 index 0000000..2a9f38b Binary files /dev/null and b/themes/default/images/icons/drive_rename.png differ diff --git a/themes/default/images/icons/drive_user.png b/themes/default/images/icons/drive_user.png new file mode 100644 index 0000000..0b4751c Binary files /dev/null and b/themes/default/images/icons/drive_user.png differ diff --git a/themes/default/images/icons/drive_web.png b/themes/default/images/icons/drive_web.png new file mode 100644 index 0000000..8850a83 Binary files /dev/null and b/themes/default/images/icons/drive_web.png differ diff --git a/themes/default/images/icons/dvd.png b/themes/default/images/icons/dvd.png new file mode 100644 index 0000000..9d94de5 Binary files /dev/null and b/themes/default/images/icons/dvd.png differ diff --git a/themes/default/images/icons/dvd_add.png b/themes/default/images/icons/dvd_add.png new file mode 100644 index 0000000..517d112 Binary files /dev/null and b/themes/default/images/icons/dvd_add.png differ diff --git a/themes/default/images/icons/dvd_delete.png b/themes/default/images/icons/dvd_delete.png new file mode 100644 index 0000000..87bed22 Binary files /dev/null and b/themes/default/images/icons/dvd_delete.png differ diff --git a/themes/default/images/icons/dvd_edit.png b/themes/default/images/icons/dvd_edit.png new file mode 100644 index 0000000..d6330aa Binary files /dev/null and b/themes/default/images/icons/dvd_edit.png differ diff --git a/themes/default/images/icons/dvd_error.png b/themes/default/images/icons/dvd_error.png new file mode 100644 index 0000000..8f6d4be Binary files /dev/null and b/themes/default/images/icons/dvd_error.png differ diff --git a/themes/default/images/icons/dvd_go.png b/themes/default/images/icons/dvd_go.png new file mode 100644 index 0000000..ef6959f Binary files /dev/null and b/themes/default/images/icons/dvd_go.png differ diff --git a/themes/default/images/icons/dvd_key.png b/themes/default/images/icons/dvd_key.png new file mode 100644 index 0000000..da9307f Binary files /dev/null and b/themes/default/images/icons/dvd_key.png differ diff --git a/themes/default/images/icons/dvd_link.png b/themes/default/images/icons/dvd_link.png new file mode 100644 index 0000000..caad726 Binary files /dev/null and b/themes/default/images/icons/dvd_link.png differ diff --git a/themes/default/images/icons/email.png b/themes/default/images/icons/email.png new file mode 100644 index 0000000..7348aed Binary files /dev/null and b/themes/default/images/icons/email.png differ diff --git a/themes/default/images/icons/email_add.png b/themes/default/images/icons/email_add.png new file mode 100644 index 0000000..6c93368 Binary files /dev/null and b/themes/default/images/icons/email_add.png differ diff --git a/themes/default/images/icons/email_attach.png b/themes/default/images/icons/email_attach.png new file mode 100644 index 0000000..1f99485 Binary files /dev/null and b/themes/default/images/icons/email_attach.png differ diff --git a/themes/default/images/icons/email_delete.png b/themes/default/images/icons/email_delete.png new file mode 100644 index 0000000..a9932b1 Binary files /dev/null and b/themes/default/images/icons/email_delete.png differ diff --git a/themes/default/images/icons/email_edit.png b/themes/default/images/icons/email_edit.png new file mode 100644 index 0000000..244f04a Binary files /dev/null and b/themes/default/images/icons/email_edit.png differ diff --git a/themes/default/images/icons/email_error.png b/themes/default/images/icons/email_error.png new file mode 100644 index 0000000..8bdd330 Binary files /dev/null and b/themes/default/images/icons/email_error.png differ diff --git a/themes/default/images/icons/email_go.png b/themes/default/images/icons/email_go.png new file mode 100644 index 0000000..4a6c5d3 Binary files /dev/null and b/themes/default/images/icons/email_go.png differ diff --git a/themes/default/images/icons/email_link.png b/themes/default/images/icons/email_link.png new file mode 100644 index 0000000..2c49f78 Binary files /dev/null and b/themes/default/images/icons/email_link.png differ diff --git a/themes/default/images/icons/email_open.png b/themes/default/images/icons/email_open.png new file mode 100644 index 0000000..7b6f981 Binary files /dev/null and b/themes/default/images/icons/email_open.png differ diff --git a/themes/default/images/icons/email_open_image.png b/themes/default/images/icons/email_open_image.png new file mode 100644 index 0000000..e588e2f Binary files /dev/null and b/themes/default/images/icons/email_open_image.png differ diff --git a/themes/default/images/icons/emoticon_evilgrin.png b/themes/default/images/icons/emoticon_evilgrin.png new file mode 100644 index 0000000..817bd50 Binary files /dev/null and b/themes/default/images/icons/emoticon_evilgrin.png differ diff --git a/themes/default/images/icons/emoticon_grin.png b/themes/default/images/icons/emoticon_grin.png new file mode 100644 index 0000000..fc60c5e Binary files /dev/null and b/themes/default/images/icons/emoticon_grin.png differ diff --git a/themes/default/images/icons/emoticon_happy.png b/themes/default/images/icons/emoticon_happy.png new file mode 100644 index 0000000..6b7336e Binary files /dev/null and b/themes/default/images/icons/emoticon_happy.png differ diff --git a/themes/default/images/icons/emoticon_smile.png b/themes/default/images/icons/emoticon_smile.png new file mode 100644 index 0000000..ade4318 Binary files /dev/null and b/themes/default/images/icons/emoticon_smile.png differ diff --git a/themes/default/images/icons/emoticon_surprised.png b/themes/default/images/icons/emoticon_surprised.png new file mode 100644 index 0000000..4520cfc Binary files /dev/null and b/themes/default/images/icons/emoticon_surprised.png differ diff --git a/themes/default/images/icons/emoticon_tongue.png b/themes/default/images/icons/emoticon_tongue.png new file mode 100644 index 0000000..ecafd2f Binary files /dev/null and b/themes/default/images/icons/emoticon_tongue.png differ diff --git a/themes/default/images/icons/emoticon_unhappy.png b/themes/default/images/icons/emoticon_unhappy.png new file mode 100644 index 0000000..fd5d030 Binary files /dev/null and b/themes/default/images/icons/emoticon_unhappy.png differ diff --git a/themes/default/images/icons/emoticon_waii.png b/themes/default/images/icons/emoticon_waii.png new file mode 100644 index 0000000..458f936 Binary files /dev/null and b/themes/default/images/icons/emoticon_waii.png differ diff --git a/themes/default/images/icons/emoticon_wink.png b/themes/default/images/icons/emoticon_wink.png new file mode 100644 index 0000000..a631949 Binary files /dev/null and b/themes/default/images/icons/emoticon_wink.png differ diff --git a/themes/default/images/icons/error.png b/themes/default/images/icons/error.png new file mode 100644 index 0000000..628cf2d Binary files /dev/null and b/themes/default/images/icons/error.png differ diff --git a/themes/default/images/icons/error_add.png b/themes/default/images/icons/error_add.png new file mode 100644 index 0000000..4c97484 Binary files /dev/null and b/themes/default/images/icons/error_add.png differ diff --git a/themes/default/images/icons/error_delete.png b/themes/default/images/icons/error_delete.png new file mode 100644 index 0000000..7f78bcc Binary files /dev/null and b/themes/default/images/icons/error_delete.png differ diff --git a/themes/default/images/icons/error_go.png b/themes/default/images/icons/error_go.png new file mode 100644 index 0000000..caa1838 Binary files /dev/null and b/themes/default/images/icons/error_go.png differ diff --git a/themes/default/images/icons/exclamation.png b/themes/default/images/icons/exclamation.png new file mode 100644 index 0000000..c37bd06 Binary files /dev/null and b/themes/default/images/icons/exclamation.png differ diff --git a/themes/default/images/icons/eye.png b/themes/default/images/icons/eye.png new file mode 100644 index 0000000..564a1a9 Binary files /dev/null and b/themes/default/images/icons/eye.png differ diff --git a/themes/default/images/icons/feed.png b/themes/default/images/icons/feed.png new file mode 100644 index 0000000..315c4f4 Binary files /dev/null and b/themes/default/images/icons/feed.png differ diff --git a/themes/default/images/icons/feed_add.png b/themes/default/images/icons/feed_add.png new file mode 100644 index 0000000..e77d46e Binary files /dev/null and b/themes/default/images/icons/feed_add.png differ diff --git a/themes/default/images/icons/feed_delete.png b/themes/default/images/icons/feed_delete.png new file mode 100644 index 0000000..5e332b4 Binary files /dev/null and b/themes/default/images/icons/feed_delete.png differ diff --git a/themes/default/images/icons/feed_disk.png b/themes/default/images/icons/feed_disk.png new file mode 100644 index 0000000..a158c99 Binary files /dev/null and b/themes/default/images/icons/feed_disk.png differ diff --git a/themes/default/images/icons/feed_edit.png b/themes/default/images/icons/feed_edit.png new file mode 100644 index 0000000..f1fde7a Binary files /dev/null and b/themes/default/images/icons/feed_edit.png differ diff --git a/themes/default/images/icons/feed_error.png b/themes/default/images/icons/feed_error.png new file mode 100644 index 0000000..c0a801c Binary files /dev/null and b/themes/default/images/icons/feed_error.png differ diff --git a/themes/default/images/icons/feed_go.png b/themes/default/images/icons/feed_go.png new file mode 100644 index 0000000..f2eed1e Binary files /dev/null and b/themes/default/images/icons/feed_go.png differ diff --git a/themes/default/images/icons/feed_key.png b/themes/default/images/icons/feed_key.png new file mode 100644 index 0000000..156bfa9 Binary files /dev/null and b/themes/default/images/icons/feed_key.png differ diff --git a/themes/default/images/icons/feed_link.png b/themes/default/images/icons/feed_link.png new file mode 100644 index 0000000..c45a534 Binary files /dev/null and b/themes/default/images/icons/feed_link.png differ diff --git a/themes/default/images/icons/feed_magnify.png b/themes/default/images/icons/feed_magnify.png new file mode 100644 index 0000000..3023695 Binary files /dev/null and b/themes/default/images/icons/feed_magnify.png differ diff --git a/themes/default/images/icons/female.png b/themes/default/images/icons/female.png new file mode 100644 index 0000000..f92958e Binary files /dev/null and b/themes/default/images/icons/female.png differ diff --git a/themes/default/images/icons/film.png b/themes/default/images/icons/film.png new file mode 100644 index 0000000..b0ce7bb Binary files /dev/null and b/themes/default/images/icons/film.png differ diff --git a/themes/default/images/icons/film_add.png b/themes/default/images/icons/film_add.png new file mode 100644 index 0000000..40d681f Binary files /dev/null and b/themes/default/images/icons/film_add.png differ diff --git a/themes/default/images/icons/film_delete.png b/themes/default/images/icons/film_delete.png new file mode 100644 index 0000000..23a2508 Binary files /dev/null and b/themes/default/images/icons/film_delete.png differ diff --git a/themes/default/images/icons/film_edit.png b/themes/default/images/icons/film_edit.png new file mode 100644 index 0000000..af66b73 Binary files /dev/null and b/themes/default/images/icons/film_edit.png differ diff --git a/themes/default/images/icons/film_error.png b/themes/default/images/icons/film_error.png new file mode 100644 index 0000000..88f3d69 Binary files /dev/null and b/themes/default/images/icons/film_error.png differ diff --git a/themes/default/images/icons/film_go.png b/themes/default/images/icons/film_go.png new file mode 100644 index 0000000..dd0168e Binary files /dev/null and b/themes/default/images/icons/film_go.png differ diff --git a/themes/default/images/icons/film_key.png b/themes/default/images/icons/film_key.png new file mode 100644 index 0000000..5892162 Binary files /dev/null and b/themes/default/images/icons/film_key.png differ diff --git a/themes/default/images/icons/film_link.png b/themes/default/images/icons/film_link.png new file mode 100644 index 0000000..0f24e86 Binary files /dev/null and b/themes/default/images/icons/film_link.png differ diff --git a/themes/default/images/icons/film_save.png b/themes/default/images/icons/film_save.png new file mode 100644 index 0000000..bc8c0d3 Binary files /dev/null and b/themes/default/images/icons/film_save.png differ diff --git a/themes/default/images/icons/find.png b/themes/default/images/icons/find.png new file mode 100644 index 0000000..1547479 Binary files /dev/null and b/themes/default/images/icons/find.png differ diff --git a/themes/default/images/icons/flag_blue.png b/themes/default/images/icons/flag_blue.png new file mode 100644 index 0000000..003924f Binary files /dev/null and b/themes/default/images/icons/flag_blue.png differ diff --git a/themes/default/images/icons/flag_green.png b/themes/default/images/icons/flag_green.png new file mode 100644 index 0000000..e4bc611 Binary files /dev/null and b/themes/default/images/icons/flag_green.png differ diff --git a/themes/default/images/icons/flag_orange.png b/themes/default/images/icons/flag_orange.png new file mode 100644 index 0000000..e632024 Binary files /dev/null and b/themes/default/images/icons/flag_orange.png differ diff --git a/themes/default/images/icons/flag_pink.png b/themes/default/images/icons/flag_pink.png new file mode 100644 index 0000000..5f15e52 Binary files /dev/null and b/themes/default/images/icons/flag_pink.png differ diff --git a/themes/default/images/icons/flag_purple.png b/themes/default/images/icons/flag_purple.png new file mode 100644 index 0000000..d069866 Binary files /dev/null and b/themes/default/images/icons/flag_purple.png differ diff --git a/themes/default/images/icons/flag_red.png b/themes/default/images/icons/flag_red.png new file mode 100644 index 0000000..e8a602d Binary files /dev/null and b/themes/default/images/icons/flag_red.png differ diff --git a/themes/default/images/icons/flag_yellow.png b/themes/default/images/icons/flag_yellow.png new file mode 100644 index 0000000..14c89a5 Binary files /dev/null and b/themes/default/images/icons/flag_yellow.png differ diff --git a/themes/default/images/icons/folder.png b/themes/default/images/icons/folder.png new file mode 100644 index 0000000..784e8fa Binary files /dev/null and b/themes/default/images/icons/folder.png differ diff --git a/themes/default/images/icons/folder_add.png b/themes/default/images/icons/folder_add.png new file mode 100644 index 0000000..529fe8f Binary files /dev/null and b/themes/default/images/icons/folder_add.png differ diff --git a/themes/default/images/icons/folder_bell.png b/themes/default/images/icons/folder_bell.png new file mode 100644 index 0000000..d04dd7f Binary files /dev/null and b/themes/default/images/icons/folder_bell.png differ diff --git a/themes/default/images/icons/folder_brick.png b/themes/default/images/icons/folder_brick.png new file mode 100644 index 0000000..5dea976 Binary files /dev/null and b/themes/default/images/icons/folder_brick.png differ diff --git a/themes/default/images/icons/folder_bug.png b/themes/default/images/icons/folder_bug.png new file mode 100644 index 0000000..4f791b6 Binary files /dev/null and b/themes/default/images/icons/folder_bug.png differ diff --git a/themes/default/images/icons/folder_camera.png b/themes/default/images/icons/folder_camera.png new file mode 100644 index 0000000..c951941 Binary files /dev/null and b/themes/default/images/icons/folder_camera.png differ diff --git a/themes/default/images/icons/folder_database.png b/themes/default/images/icons/folder_database.png new file mode 100644 index 0000000..5193e2e Binary files /dev/null and b/themes/default/images/icons/folder_database.png differ diff --git a/themes/default/images/icons/folder_delete.png b/themes/default/images/icons/folder_delete.png new file mode 100644 index 0000000..112b016 Binary files /dev/null and b/themes/default/images/icons/folder_delete.png differ diff --git a/themes/default/images/icons/folder_edit.png b/themes/default/images/icons/folder_edit.png new file mode 100644 index 0000000..ad669cc Binary files /dev/null and b/themes/default/images/icons/folder_edit.png differ diff --git a/themes/default/images/icons/folder_error.png b/themes/default/images/icons/folder_error.png new file mode 100644 index 0000000..1af8809 Binary files /dev/null and b/themes/default/images/icons/folder_error.png differ diff --git a/themes/default/images/icons/folder_explore.png b/themes/default/images/icons/folder_explore.png new file mode 100644 index 0000000..0ba9391 Binary files /dev/null and b/themes/default/images/icons/folder_explore.png differ diff --git a/themes/default/images/icons/folder_feed.png b/themes/default/images/icons/folder_feed.png new file mode 100644 index 0000000..d06ee51 Binary files /dev/null and b/themes/default/images/icons/folder_feed.png differ diff --git a/themes/default/images/icons/folder_find.png b/themes/default/images/icons/folder_find.png new file mode 100644 index 0000000..c64e2ee Binary files /dev/null and b/themes/default/images/icons/folder_find.png differ diff --git a/themes/default/images/icons/folder_go.png b/themes/default/images/icons/folder_go.png new file mode 100644 index 0000000..34a736f Binary files /dev/null and b/themes/default/images/icons/folder_go.png differ diff --git a/themes/default/images/icons/folder_heart.png b/themes/default/images/icons/folder_heart.png new file mode 100644 index 0000000..56d7da1 Binary files /dev/null and b/themes/default/images/icons/folder_heart.png differ diff --git a/themes/default/images/icons/folder_image.png b/themes/default/images/icons/folder_image.png new file mode 100644 index 0000000..d5df75b Binary files /dev/null and b/themes/default/images/icons/folder_image.png differ diff --git a/themes/default/images/icons/folder_key.png b/themes/default/images/icons/folder_key.png new file mode 100644 index 0000000..fb9b4c2 Binary files /dev/null and b/themes/default/images/icons/folder_key.png differ diff --git a/themes/default/images/icons/folder_lightbulb.png b/themes/default/images/icons/folder_lightbulb.png new file mode 100644 index 0000000..f367a51 Binary files /dev/null and b/themes/default/images/icons/folder_lightbulb.png differ diff --git a/themes/default/images/icons/folder_link.png b/themes/default/images/icons/folder_link.png new file mode 100644 index 0000000..b9b75f6 Binary files /dev/null and b/themes/default/images/icons/folder_link.png differ diff --git a/themes/default/images/icons/folder_magnify.png b/themes/default/images/icons/folder_magnify.png new file mode 100644 index 0000000..0a3e798 Binary files /dev/null and b/themes/default/images/icons/folder_magnify.png differ diff --git a/themes/default/images/icons/folder_page.png b/themes/default/images/icons/folder_page.png new file mode 100644 index 0000000..1ef6e11 Binary files /dev/null and b/themes/default/images/icons/folder_page.png differ diff --git a/themes/default/images/icons/folder_page_white.png b/themes/default/images/icons/folder_page_white.png new file mode 100644 index 0000000..14d6b61 Binary files /dev/null and b/themes/default/images/icons/folder_page_white.png differ diff --git a/themes/default/images/icons/folder_palette.png b/themes/default/images/icons/folder_palette.png new file mode 100644 index 0000000..ba12fe8 Binary files /dev/null and b/themes/default/images/icons/folder_palette.png differ diff --git a/themes/default/images/icons/folder_picture.png b/themes/default/images/icons/folder_picture.png new file mode 100644 index 0000000..052b336 Binary files /dev/null and b/themes/default/images/icons/folder_picture.png differ diff --git a/themes/default/images/icons/folder_star.png b/themes/default/images/icons/folder_star.png new file mode 100644 index 0000000..448e46f Binary files /dev/null and b/themes/default/images/icons/folder_star.png differ diff --git a/themes/default/images/icons/folder_table.png b/themes/default/images/icons/folder_table.png new file mode 100644 index 0000000..473cee3 Binary files /dev/null and b/themes/default/images/icons/folder_table.png differ diff --git a/themes/default/images/icons/folder_user.png b/themes/default/images/icons/folder_user.png new file mode 100644 index 0000000..f021c3e Binary files /dev/null and b/themes/default/images/icons/folder_user.png differ diff --git a/themes/default/images/icons/folder_wrench.png b/themes/default/images/icons/folder_wrench.png new file mode 100644 index 0000000..ea3404e Binary files /dev/null and b/themes/default/images/icons/folder_wrench.png differ diff --git a/themes/default/images/icons/font.png b/themes/default/images/icons/font.png new file mode 100644 index 0000000..b7960db Binary files /dev/null and b/themes/default/images/icons/font.png differ diff --git a/themes/default/images/icons/font_add.png b/themes/default/images/icons/font_add.png new file mode 100644 index 0000000..b709eba Binary files /dev/null and b/themes/default/images/icons/font_add.png differ diff --git a/themes/default/images/icons/font_delete.png b/themes/default/images/icons/font_delete.png new file mode 100644 index 0000000..1d6124d Binary files /dev/null and b/themes/default/images/icons/font_delete.png differ diff --git a/themes/default/images/icons/font_go.png b/themes/default/images/icons/font_go.png new file mode 100644 index 0000000..75eba80 Binary files /dev/null and b/themes/default/images/icons/font_go.png differ diff --git a/themes/default/images/icons/group.png b/themes/default/images/icons/group.png new file mode 100644 index 0000000..7fb4e1f Binary files /dev/null and b/themes/default/images/icons/group.png differ diff --git a/themes/default/images/icons/group_add.png b/themes/default/images/icons/group_add.png new file mode 100644 index 0000000..06c5350 Binary files /dev/null and b/themes/default/images/icons/group_add.png differ diff --git a/themes/default/images/icons/group_delete.png b/themes/default/images/icons/group_delete.png new file mode 100644 index 0000000..4489ca2 Binary files /dev/null and b/themes/default/images/icons/group_delete.png differ diff --git a/themes/default/images/icons/group_edit.png b/themes/default/images/icons/group_edit.png new file mode 100644 index 0000000..c88b945 Binary files /dev/null and b/themes/default/images/icons/group_edit.png differ diff --git a/themes/default/images/icons/group_error.png b/themes/default/images/icons/group_error.png new file mode 100644 index 0000000..7364a13 Binary files /dev/null and b/themes/default/images/icons/group_error.png differ diff --git a/themes/default/images/icons/group_gear.png b/themes/default/images/icons/group_gear.png new file mode 100644 index 0000000..2544f2e Binary files /dev/null and b/themes/default/images/icons/group_gear.png differ diff --git a/themes/default/images/icons/group_go.png b/themes/default/images/icons/group_go.png new file mode 100644 index 0000000..1f52333 Binary files /dev/null and b/themes/default/images/icons/group_go.png differ diff --git a/themes/default/images/icons/group_key.png b/themes/default/images/icons/group_key.png new file mode 100644 index 0000000..257f111 Binary files /dev/null and b/themes/default/images/icons/group_key.png differ diff --git a/themes/default/images/icons/group_link.png b/themes/default/images/icons/group_link.png new file mode 100644 index 0000000..c77ed88 Binary files /dev/null and b/themes/default/images/icons/group_link.png differ diff --git a/themes/default/images/icons/heart.png b/themes/default/images/icons/heart.png new file mode 100644 index 0000000..d9ee53e Binary files /dev/null and b/themes/default/images/icons/heart.png differ diff --git a/themes/default/images/icons/heart_add.png b/themes/default/images/icons/heart_add.png new file mode 100644 index 0000000..d4195ff Binary files /dev/null and b/themes/default/images/icons/heart_add.png differ diff --git a/themes/default/images/icons/heart_delete.png b/themes/default/images/icons/heart_delete.png new file mode 100644 index 0000000..ce523e3 Binary files /dev/null and b/themes/default/images/icons/heart_delete.png differ diff --git a/themes/default/images/icons/help.png b/themes/default/images/icons/help.png new file mode 100644 index 0000000..5c87017 Binary files /dev/null and b/themes/default/images/icons/help.png differ diff --git a/themes/default/images/icons/hourglass.png b/themes/default/images/icons/hourglass.png new file mode 100644 index 0000000..57b03ce Binary files /dev/null and b/themes/default/images/icons/hourglass.png differ diff --git a/themes/default/images/icons/hourglass_add.png b/themes/default/images/icons/hourglass_add.png new file mode 100644 index 0000000..170dfff Binary files /dev/null and b/themes/default/images/icons/hourglass_add.png differ diff --git a/themes/default/images/icons/hourglass_delete.png b/themes/default/images/icons/hourglass_delete.png new file mode 100644 index 0000000..4b1337b Binary files /dev/null and b/themes/default/images/icons/hourglass_delete.png differ diff --git a/themes/default/images/icons/hourglass_go.png b/themes/default/images/icons/hourglass_go.png new file mode 100644 index 0000000..b2d3a98 Binary files /dev/null and b/themes/default/images/icons/hourglass_go.png differ diff --git a/themes/default/images/icons/hourglass_link.png b/themes/default/images/icons/hourglass_link.png new file mode 100644 index 0000000..ecc59b0 Binary files /dev/null and b/themes/default/images/icons/hourglass_link.png differ diff --git a/themes/default/images/icons/house.png b/themes/default/images/icons/house.png new file mode 100644 index 0000000..fed6221 Binary files /dev/null and b/themes/default/images/icons/house.png differ diff --git a/themes/default/images/icons/house_go.png b/themes/default/images/icons/house_go.png new file mode 100644 index 0000000..5457dbd Binary files /dev/null and b/themes/default/images/icons/house_go.png differ diff --git a/themes/default/images/icons/house_link.png b/themes/default/images/icons/house_link.png new file mode 100644 index 0000000..be2c271 Binary files /dev/null and b/themes/default/images/icons/house_link.png differ diff --git a/themes/default/images/icons/html.png b/themes/default/images/icons/html.png new file mode 100644 index 0000000..55d1072 Binary files /dev/null and b/themes/default/images/icons/html.png differ diff --git a/themes/default/images/icons/html_add.png b/themes/default/images/icons/html_add.png new file mode 100644 index 0000000..f1c08b7 Binary files /dev/null and b/themes/default/images/icons/html_add.png differ diff --git a/themes/default/images/icons/html_delete.png b/themes/default/images/icons/html_delete.png new file mode 100644 index 0000000..1bd2848 Binary files /dev/null and b/themes/default/images/icons/html_delete.png differ diff --git a/themes/default/images/icons/html_go.png b/themes/default/images/icons/html_go.png new file mode 100644 index 0000000..a95cede Binary files /dev/null and b/themes/default/images/icons/html_go.png differ diff --git a/themes/default/images/icons/html_valid.png b/themes/default/images/icons/html_valid.png new file mode 100644 index 0000000..71cec92 Binary files /dev/null and b/themes/default/images/icons/html_valid.png differ diff --git a/themes/default/images/icons/image.png b/themes/default/images/icons/image.png new file mode 100644 index 0000000..fc3c393 Binary files /dev/null and b/themes/default/images/icons/image.png differ diff --git a/themes/default/images/icons/image_add.png b/themes/default/images/icons/image_add.png new file mode 100644 index 0000000..fc5d613 Binary files /dev/null and b/themes/default/images/icons/image_add.png differ diff --git a/themes/default/images/icons/image_delete.png b/themes/default/images/icons/image_delete.png new file mode 100644 index 0000000..c260e1d Binary files /dev/null and b/themes/default/images/icons/image_delete.png differ diff --git a/themes/default/images/icons/image_edit.png b/themes/default/images/icons/image_edit.png new file mode 100644 index 0000000..0aa4cc6 Binary files /dev/null and b/themes/default/images/icons/image_edit.png differ diff --git a/themes/default/images/icons/image_link.png b/themes/default/images/icons/image_link.png new file mode 100644 index 0000000..4bdb354 Binary files /dev/null and b/themes/default/images/icons/image_link.png differ diff --git a/themes/default/images/icons/images.png b/themes/default/images/icons/images.png new file mode 100644 index 0000000..184860d Binary files /dev/null and b/themes/default/images/icons/images.png differ diff --git a/themes/default/images/icons/information.png b/themes/default/images/icons/information.png new file mode 100644 index 0000000..12cd1ae Binary files /dev/null and b/themes/default/images/icons/information.png differ diff --git a/themes/default/images/icons/ipod.png b/themes/default/images/icons/ipod.png new file mode 100644 index 0000000..3f768da Binary files /dev/null and b/themes/default/images/icons/ipod.png differ diff --git a/themes/default/images/icons/ipod_cast.png b/themes/default/images/icons/ipod_cast.png new file mode 100644 index 0000000..6f6d340 Binary files /dev/null and b/themes/default/images/icons/ipod_cast.png differ diff --git a/themes/default/images/icons/ipod_cast_add.png b/themes/default/images/icons/ipod_cast_add.png new file mode 100644 index 0000000..c3257f5 Binary files /dev/null and b/themes/default/images/icons/ipod_cast_add.png differ diff --git a/themes/default/images/icons/ipod_cast_delete.png b/themes/default/images/icons/ipod_cast_delete.png new file mode 100644 index 0000000..377ab69 Binary files /dev/null and b/themes/default/images/icons/ipod_cast_delete.png differ diff --git a/themes/default/images/icons/ipod_sound.png b/themes/default/images/icons/ipod_sound.png new file mode 100644 index 0000000..fef6e8b Binary files /dev/null and b/themes/default/images/icons/ipod_sound.png differ diff --git a/themes/default/images/icons/joystick.png b/themes/default/images/icons/joystick.png new file mode 100644 index 0000000..62168f5 Binary files /dev/null and b/themes/default/images/icons/joystick.png differ diff --git a/themes/default/images/icons/joystick_add.png b/themes/default/images/icons/joystick_add.png new file mode 100644 index 0000000..77e7107 Binary files /dev/null and b/themes/default/images/icons/joystick_add.png differ diff --git a/themes/default/images/icons/joystick_delete.png b/themes/default/images/icons/joystick_delete.png new file mode 100644 index 0000000..5d44b59 Binary files /dev/null and b/themes/default/images/icons/joystick_delete.png differ diff --git a/themes/default/images/icons/joystick_error.png b/themes/default/images/icons/joystick_error.png new file mode 100644 index 0000000..b32149e Binary files /dev/null and b/themes/default/images/icons/joystick_error.png differ diff --git a/themes/default/images/icons/key.png b/themes/default/images/icons/key.png new file mode 100644 index 0000000..4ec1a92 Binary files /dev/null and b/themes/default/images/icons/key.png differ diff --git a/themes/default/images/icons/key_add.png b/themes/default/images/icons/key_add.png new file mode 100644 index 0000000..d407403 Binary files /dev/null and b/themes/default/images/icons/key_add.png differ diff --git a/themes/default/images/icons/key_delete.png b/themes/default/images/icons/key_delete.png new file mode 100644 index 0000000..00dec80 Binary files /dev/null and b/themes/default/images/icons/key_delete.png differ diff --git a/themes/default/images/icons/key_go.png b/themes/default/images/icons/key_go.png new file mode 100644 index 0000000..30b0dc3 Binary files /dev/null and b/themes/default/images/icons/key_go.png differ diff --git a/themes/default/images/icons/keyboard.png b/themes/default/images/icons/keyboard.png new file mode 100644 index 0000000..898d402 Binary files /dev/null and b/themes/default/images/icons/keyboard.png differ diff --git a/themes/default/images/icons/keyboard_add.png b/themes/default/images/icons/keyboard_add.png new file mode 100644 index 0000000..26938dd Binary files /dev/null and b/themes/default/images/icons/keyboard_add.png differ diff --git a/themes/default/images/icons/keyboard_delete.png b/themes/default/images/icons/keyboard_delete.png new file mode 100644 index 0000000..1786ed5 Binary files /dev/null and b/themes/default/images/icons/keyboard_delete.png differ diff --git a/themes/default/images/icons/keyboard_magnify.png b/themes/default/images/icons/keyboard_magnify.png new file mode 100644 index 0000000..928fc17 Binary files /dev/null and b/themes/default/images/icons/keyboard_magnify.png differ diff --git a/themes/default/images/icons/layers.png b/themes/default/images/icons/layers.png new file mode 100644 index 0000000..00818f6 Binary files /dev/null and b/themes/default/images/icons/layers.png differ diff --git a/themes/default/images/icons/layout.png b/themes/default/images/icons/layout.png new file mode 100644 index 0000000..ea086b0 Binary files /dev/null and b/themes/default/images/icons/layout.png differ diff --git a/themes/default/images/icons/layout_add.png b/themes/default/images/icons/layout_add.png new file mode 100644 index 0000000..6203722 Binary files /dev/null and b/themes/default/images/icons/layout_add.png differ diff --git a/themes/default/images/icons/layout_content.png b/themes/default/images/icons/layout_content.png new file mode 100644 index 0000000..b4aaad9 Binary files /dev/null and b/themes/default/images/icons/layout_content.png differ diff --git a/themes/default/images/icons/layout_delete.png b/themes/default/images/icons/layout_delete.png new file mode 100644 index 0000000..4bd45f1 Binary files /dev/null and b/themes/default/images/icons/layout_delete.png differ diff --git a/themes/default/images/icons/layout_edit.png b/themes/default/images/icons/layout_edit.png new file mode 100644 index 0000000..ab3100b Binary files /dev/null and b/themes/default/images/icons/layout_edit.png differ diff --git a/themes/default/images/icons/layout_error.png b/themes/default/images/icons/layout_error.png new file mode 100644 index 0000000..5b5acea Binary files /dev/null and b/themes/default/images/icons/layout_error.png differ diff --git a/themes/default/images/icons/layout_header.png b/themes/default/images/icons/layout_header.png new file mode 100644 index 0000000..c6ea7f2 Binary files /dev/null and b/themes/default/images/icons/layout_header.png differ diff --git a/themes/default/images/icons/layout_link.png b/themes/default/images/icons/layout_link.png new file mode 100644 index 0000000..3445d42 Binary files /dev/null and b/themes/default/images/icons/layout_link.png differ diff --git a/themes/default/images/icons/layout_sidebar.png b/themes/default/images/icons/layout_sidebar.png new file mode 100644 index 0000000..3be27bb Binary files /dev/null and b/themes/default/images/icons/layout_sidebar.png differ diff --git a/themes/default/images/icons/lightbulb.png b/themes/default/images/icons/lightbulb.png new file mode 100644 index 0000000..d22fde8 Binary files /dev/null and b/themes/default/images/icons/lightbulb.png differ diff --git a/themes/default/images/icons/lightbulb_add.png b/themes/default/images/icons/lightbulb_add.png new file mode 100644 index 0000000..0dd848b Binary files /dev/null and b/themes/default/images/icons/lightbulb_add.png differ diff --git a/themes/default/images/icons/lightbulb_delete.png b/themes/default/images/icons/lightbulb_delete.png new file mode 100644 index 0000000..f4781da Binary files /dev/null and b/themes/default/images/icons/lightbulb_delete.png differ diff --git a/themes/default/images/icons/lightbulb_off.png b/themes/default/images/icons/lightbulb_off.png new file mode 100644 index 0000000..e95b8c5 Binary files /dev/null and b/themes/default/images/icons/lightbulb_off.png differ diff --git a/themes/default/images/icons/lightning.png b/themes/default/images/icons/lightning.png new file mode 100644 index 0000000..9680afd Binary files /dev/null and b/themes/default/images/icons/lightning.png differ diff --git a/themes/default/images/icons/lightning_add.png b/themes/default/images/icons/lightning_add.png new file mode 100644 index 0000000..dac3c90 Binary files /dev/null and b/themes/default/images/icons/lightning_add.png differ diff --git a/themes/default/images/icons/lightning_delete.png b/themes/default/images/icons/lightning_delete.png new file mode 100644 index 0000000..dfe2770 Binary files /dev/null and b/themes/default/images/icons/lightning_delete.png differ diff --git a/themes/default/images/icons/lightning_go.png b/themes/default/images/icons/lightning_go.png new file mode 100644 index 0000000..29039e6 Binary files /dev/null and b/themes/default/images/icons/lightning_go.png differ diff --git a/themes/default/images/icons/link.png b/themes/default/images/icons/link.png new file mode 100644 index 0000000..25eacb7 Binary files /dev/null and b/themes/default/images/icons/link.png differ diff --git a/themes/default/images/icons/link_add.png b/themes/default/images/icons/link_add.png new file mode 100644 index 0000000..00be352 Binary files /dev/null and b/themes/default/images/icons/link_add.png differ diff --git a/themes/default/images/icons/link_break.png b/themes/default/images/icons/link_break.png new file mode 100644 index 0000000..5235753 Binary files /dev/null and b/themes/default/images/icons/link_break.png differ diff --git a/themes/default/images/icons/link_delete.png b/themes/default/images/icons/link_delete.png new file mode 100644 index 0000000..f66e297 Binary files /dev/null and b/themes/default/images/icons/link_delete.png differ diff --git a/themes/default/images/icons/link_edit.png b/themes/default/images/icons/link_edit.png new file mode 100644 index 0000000..5b3aed0 Binary files /dev/null and b/themes/default/images/icons/link_edit.png differ diff --git a/themes/default/images/icons/link_error.png b/themes/default/images/icons/link_error.png new file mode 100644 index 0000000..ab694b1 Binary files /dev/null and b/themes/default/images/icons/link_error.png differ diff --git a/themes/default/images/icons/link_go.png b/themes/default/images/icons/link_go.png new file mode 100644 index 0000000..ae8cae8 Binary files /dev/null and b/themes/default/images/icons/link_go.png differ diff --git a/themes/default/images/icons/lock.png b/themes/default/images/icons/lock.png new file mode 100644 index 0000000..2ebc4f6 Binary files /dev/null and b/themes/default/images/icons/lock.png differ diff --git a/themes/default/images/icons/lock_add.png b/themes/default/images/icons/lock_add.png new file mode 100644 index 0000000..a7b566b Binary files /dev/null and b/themes/default/images/icons/lock_add.png differ diff --git a/themes/default/images/icons/lock_break.png b/themes/default/images/icons/lock_break.png new file mode 100644 index 0000000..13578ab Binary files /dev/null and b/themes/default/images/icons/lock_break.png differ diff --git a/themes/default/images/icons/lock_delete.png b/themes/default/images/icons/lock_delete.png new file mode 100644 index 0000000..ecb50a9 Binary files /dev/null and b/themes/default/images/icons/lock_delete.png differ diff --git a/themes/default/images/icons/lock_edit.png b/themes/default/images/icons/lock_edit.png new file mode 100644 index 0000000..116aa5b Binary files /dev/null and b/themes/default/images/icons/lock_edit.png differ diff --git a/themes/default/images/icons/lock_go.png b/themes/default/images/icons/lock_go.png new file mode 100644 index 0000000..8c7c89b Binary files /dev/null and b/themes/default/images/icons/lock_go.png differ diff --git a/themes/default/images/icons/lock_open.png b/themes/default/images/icons/lock_open.png new file mode 100644 index 0000000..a471765 Binary files /dev/null and b/themes/default/images/icons/lock_open.png differ diff --git a/themes/default/images/icons/lorry.png b/themes/default/images/icons/lorry.png new file mode 100644 index 0000000..8f95f5a Binary files /dev/null and b/themes/default/images/icons/lorry.png differ diff --git a/themes/default/images/icons/lorry_add.png b/themes/default/images/icons/lorry_add.png new file mode 100644 index 0000000..a2c5124 Binary files /dev/null and b/themes/default/images/icons/lorry_add.png differ diff --git a/themes/default/images/icons/lorry_delete.png b/themes/default/images/icons/lorry_delete.png new file mode 100644 index 0000000..66217f5 Binary files /dev/null and b/themes/default/images/icons/lorry_delete.png differ diff --git a/themes/default/images/icons/lorry_error.png b/themes/default/images/icons/lorry_error.png new file mode 100644 index 0000000..3619ead Binary files /dev/null and b/themes/default/images/icons/lorry_error.png differ diff --git a/themes/default/images/icons/lorry_flatbed.png b/themes/default/images/icons/lorry_flatbed.png new file mode 100644 index 0000000..8b20f55 Binary files /dev/null and b/themes/default/images/icons/lorry_flatbed.png differ diff --git a/themes/default/images/icons/lorry_go.png b/themes/default/images/icons/lorry_go.png new file mode 100644 index 0000000..1c296a6 Binary files /dev/null and b/themes/default/images/icons/lorry_go.png differ diff --git a/themes/default/images/icons/lorry_link.png b/themes/default/images/icons/lorry_link.png new file mode 100644 index 0000000..5e6663e Binary files /dev/null and b/themes/default/images/icons/lorry_link.png differ diff --git a/themes/default/images/icons/magifier_zoom_out.png b/themes/default/images/icons/magifier_zoom_out.png new file mode 100644 index 0000000..81f2819 Binary files /dev/null and b/themes/default/images/icons/magifier_zoom_out.png differ diff --git a/themes/default/images/icons/magnifier.png b/themes/default/images/icons/magnifier.png new file mode 100644 index 0000000..cf3d97f Binary files /dev/null and b/themes/default/images/icons/magnifier.png differ diff --git a/themes/default/images/icons/magnifier_zoom_in.png b/themes/default/images/icons/magnifier_zoom_in.png new file mode 100644 index 0000000..af4fe07 Binary files /dev/null and b/themes/default/images/icons/magnifier_zoom_in.png differ diff --git a/themes/default/images/icons/male.png b/themes/default/images/icons/male.png new file mode 100644 index 0000000..25d6ea9 Binary files /dev/null and b/themes/default/images/icons/male.png differ diff --git a/themes/default/images/icons/map.png b/themes/default/images/icons/map.png new file mode 100644 index 0000000..f90ef25 Binary files /dev/null and b/themes/default/images/icons/map.png differ diff --git a/themes/default/images/icons/map_add.png b/themes/default/images/icons/map_add.png new file mode 100644 index 0000000..2b72da0 Binary files /dev/null and b/themes/default/images/icons/map_add.png differ diff --git a/themes/default/images/icons/map_delete.png b/themes/default/images/icons/map_delete.png new file mode 100644 index 0000000..e74402f Binary files /dev/null and b/themes/default/images/icons/map_delete.png differ diff --git a/themes/default/images/icons/map_edit.png b/themes/default/images/icons/map_edit.png new file mode 100644 index 0000000..93d4d7e Binary files /dev/null and b/themes/default/images/icons/map_edit.png differ diff --git a/themes/default/images/icons/map_go.png b/themes/default/images/icons/map_go.png new file mode 100644 index 0000000..11eab26 Binary files /dev/null and b/themes/default/images/icons/map_go.png differ diff --git a/themes/default/images/icons/map_magnify.png b/themes/default/images/icons/map_magnify.png new file mode 100644 index 0000000..7184c9d Binary files /dev/null and b/themes/default/images/icons/map_magnify.png differ diff --git a/themes/default/images/icons/medal_bronze_1.png b/themes/default/images/icons/medal_bronze_1.png new file mode 100644 index 0000000..5f8a6d6 Binary files /dev/null and b/themes/default/images/icons/medal_bronze_1.png differ diff --git a/themes/default/images/icons/medal_bronze_2.png b/themes/default/images/icons/medal_bronze_2.png new file mode 100644 index 0000000..623d68c Binary files /dev/null and b/themes/default/images/icons/medal_bronze_2.png differ diff --git a/themes/default/images/icons/medal_bronze_3.png b/themes/default/images/icons/medal_bronze_3.png new file mode 100644 index 0000000..ed3f43e Binary files /dev/null and b/themes/default/images/icons/medal_bronze_3.png differ diff --git a/themes/default/images/icons/medal_bronze_add.png b/themes/default/images/icons/medal_bronze_add.png new file mode 100644 index 0000000..8487b2c Binary files /dev/null and b/themes/default/images/icons/medal_bronze_add.png differ diff --git a/themes/default/images/icons/medal_bronze_delete.png b/themes/default/images/icons/medal_bronze_delete.png new file mode 100644 index 0000000..d32aed7 Binary files /dev/null and b/themes/default/images/icons/medal_bronze_delete.png differ diff --git a/themes/default/images/icons/medal_gold_1.png b/themes/default/images/icons/medal_gold_1.png new file mode 100644 index 0000000..87584dc Binary files /dev/null and b/themes/default/images/icons/medal_gold_1.png differ diff --git a/themes/default/images/icons/medal_gold_2.png b/themes/default/images/icons/medal_gold_2.png new file mode 100644 index 0000000..fa3a15d Binary files /dev/null and b/themes/default/images/icons/medal_gold_2.png differ diff --git a/themes/default/images/icons/medal_gold_3.png b/themes/default/images/icons/medal_gold_3.png new file mode 100644 index 0000000..ef1b08b Binary files /dev/null and b/themes/default/images/icons/medal_gold_3.png differ diff --git a/themes/default/images/icons/medal_gold_add.png b/themes/default/images/icons/medal_gold_add.png new file mode 100644 index 0000000..dcade0d Binary files /dev/null and b/themes/default/images/icons/medal_gold_add.png differ diff --git a/themes/default/images/icons/medal_gold_delete.png b/themes/default/images/icons/medal_gold_delete.png new file mode 100644 index 0000000..84b06d5 Binary files /dev/null and b/themes/default/images/icons/medal_gold_delete.png differ diff --git a/themes/default/images/icons/medal_silver_1.png b/themes/default/images/icons/medal_silver_1.png new file mode 100644 index 0000000..75a64da Binary files /dev/null and b/themes/default/images/icons/medal_silver_1.png differ diff --git a/themes/default/images/icons/medal_silver_2.png b/themes/default/images/icons/medal_silver_2.png new file mode 100644 index 0000000..2e0fe75 Binary files /dev/null and b/themes/default/images/icons/medal_silver_2.png differ diff --git a/themes/default/images/icons/medal_silver_3.png b/themes/default/images/icons/medal_silver_3.png new file mode 100644 index 0000000..e385b54 Binary files /dev/null and b/themes/default/images/icons/medal_silver_3.png differ diff --git a/themes/default/images/icons/medal_silver_add.png b/themes/default/images/icons/medal_silver_add.png new file mode 100644 index 0000000..b0633fa Binary files /dev/null and b/themes/default/images/icons/medal_silver_add.png differ diff --git a/themes/default/images/icons/medal_silver_delete.png b/themes/default/images/icons/medal_silver_delete.png new file mode 100644 index 0000000..06cab46 Binary files /dev/null and b/themes/default/images/icons/medal_silver_delete.png differ diff --git a/themes/default/images/icons/money.png b/themes/default/images/icons/money.png new file mode 100644 index 0000000..42c52d0 Binary files /dev/null and b/themes/default/images/icons/money.png differ diff --git a/themes/default/images/icons/money_add.png b/themes/default/images/icons/money_add.png new file mode 100644 index 0000000..588fa9d Binary files /dev/null and b/themes/default/images/icons/money_add.png differ diff --git a/themes/default/images/icons/money_delete.png b/themes/default/images/icons/money_delete.png new file mode 100644 index 0000000..eae2c52 Binary files /dev/null and b/themes/default/images/icons/money_delete.png differ diff --git a/themes/default/images/icons/money_dollar.png b/themes/default/images/icons/money_dollar.png new file mode 100644 index 0000000..59af163 Binary files /dev/null and b/themes/default/images/icons/money_dollar.png differ diff --git a/themes/default/images/icons/money_euro.png b/themes/default/images/icons/money_euro.png new file mode 100644 index 0000000..b322ba9 Binary files /dev/null and b/themes/default/images/icons/money_euro.png differ diff --git a/themes/default/images/icons/money_pound.png b/themes/default/images/icons/money_pound.png new file mode 100644 index 0000000..b711364 Binary files /dev/null and b/themes/default/images/icons/money_pound.png differ diff --git a/themes/default/images/icons/money_yen.png b/themes/default/images/icons/money_yen.png new file mode 100644 index 0000000..228a677 Binary files /dev/null and b/themes/default/images/icons/money_yen.png differ diff --git a/themes/default/images/icons/monitor.png b/themes/default/images/icons/monitor.png new file mode 100644 index 0000000..d040bd0 Binary files /dev/null and b/themes/default/images/icons/monitor.png differ diff --git a/themes/default/images/icons/monitor_add.png b/themes/default/images/icons/monitor_add.png new file mode 100644 index 0000000..a818066 Binary files /dev/null and b/themes/default/images/icons/monitor_add.png differ diff --git a/themes/default/images/icons/monitor_delete.png b/themes/default/images/icons/monitor_delete.png new file mode 100644 index 0000000..3733256 Binary files /dev/null and b/themes/default/images/icons/monitor_delete.png differ diff --git a/themes/default/images/icons/monitor_edit.png b/themes/default/images/icons/monitor_edit.png new file mode 100644 index 0000000..f772c56 Binary files /dev/null and b/themes/default/images/icons/monitor_edit.png differ diff --git a/themes/default/images/icons/monitor_error.png b/themes/default/images/icons/monitor_error.png new file mode 100644 index 0000000..270c501 Binary files /dev/null and b/themes/default/images/icons/monitor_error.png differ diff --git a/themes/default/images/icons/monitor_go.png b/themes/default/images/icons/monitor_go.png new file mode 100644 index 0000000..8af3eda Binary files /dev/null and b/themes/default/images/icons/monitor_go.png differ diff --git a/themes/default/images/icons/monitor_lightning.png b/themes/default/images/icons/monitor_lightning.png new file mode 100644 index 0000000..06e53a9 Binary files /dev/null and b/themes/default/images/icons/monitor_lightning.png differ diff --git a/themes/default/images/icons/monitor_link.png b/themes/default/images/icons/monitor_link.png new file mode 100644 index 0000000..a014b02 Binary files /dev/null and b/themes/default/images/icons/monitor_link.png differ diff --git a/themes/default/images/icons/mouse.png b/themes/default/images/icons/mouse.png new file mode 100644 index 0000000..63a92fa Binary files /dev/null and b/themes/default/images/icons/mouse.png differ diff --git a/themes/default/images/icons/mouse_add.png b/themes/default/images/icons/mouse_add.png new file mode 100644 index 0000000..65bcab5 Binary files /dev/null and b/themes/default/images/icons/mouse_add.png differ diff --git a/themes/default/images/icons/mouse_delete.png b/themes/default/images/icons/mouse_delete.png new file mode 100644 index 0000000..7286566 Binary files /dev/null and b/themes/default/images/icons/mouse_delete.png differ diff --git a/themes/default/images/icons/mouse_error.png b/themes/default/images/icons/mouse_error.png new file mode 100644 index 0000000..bcc1562 Binary files /dev/null and b/themes/default/images/icons/mouse_error.png differ diff --git a/themes/default/images/icons/music.png b/themes/default/images/icons/music.png new file mode 100644 index 0000000..a8b3ede Binary files /dev/null and b/themes/default/images/icons/music.png differ diff --git a/themes/default/images/icons/new.png b/themes/default/images/icons/new.png new file mode 100644 index 0000000..6a9bf03 Binary files /dev/null and b/themes/default/images/icons/new.png differ diff --git a/themes/default/images/icons/newspaper.png b/themes/default/images/icons/newspaper.png new file mode 100644 index 0000000..6a2ecce Binary files /dev/null and b/themes/default/images/icons/newspaper.png differ diff --git a/themes/default/images/icons/newspaper_add.png b/themes/default/images/icons/newspaper_add.png new file mode 100644 index 0000000..8140e8c Binary files /dev/null and b/themes/default/images/icons/newspaper_add.png differ diff --git a/themes/default/images/icons/newspaper_delete.png b/themes/default/images/icons/newspaper_delete.png new file mode 100644 index 0000000..bde96ce Binary files /dev/null and b/themes/default/images/icons/newspaper_delete.png differ diff --git a/themes/default/images/icons/newspaper_go.png b/themes/default/images/icons/newspaper_go.png new file mode 100644 index 0000000..fd61428 Binary files /dev/null and b/themes/default/images/icons/newspaper_go.png differ diff --git a/themes/default/images/icons/newspaper_link.png b/themes/default/images/icons/newspaper_link.png new file mode 100644 index 0000000..99e57cb Binary files /dev/null and b/themes/default/images/icons/newspaper_link.png differ diff --git a/themes/default/images/icons/note.png b/themes/default/images/icons/note.png new file mode 100644 index 0000000..244e6ca Binary files /dev/null and b/themes/default/images/icons/note.png differ diff --git a/themes/default/images/icons/note_add.png b/themes/default/images/icons/note_add.png new file mode 100644 index 0000000..abdad91 Binary files /dev/null and b/themes/default/images/icons/note_add.png differ diff --git a/themes/default/images/icons/note_delete.png b/themes/default/images/icons/note_delete.png new file mode 100644 index 0000000..8a1f0ff Binary files /dev/null and b/themes/default/images/icons/note_delete.png differ diff --git a/themes/default/images/icons/note_edit.png b/themes/default/images/icons/note_edit.png new file mode 100644 index 0000000..291bfc7 Binary files /dev/null and b/themes/default/images/icons/note_edit.png differ diff --git a/themes/default/images/icons/note_error.png b/themes/default/images/icons/note_error.png new file mode 100644 index 0000000..896dadf Binary files /dev/null and b/themes/default/images/icons/note_error.png differ diff --git a/themes/default/images/icons/note_go.png b/themes/default/images/icons/note_go.png new file mode 100644 index 0000000..49e54fd Binary files /dev/null and b/themes/default/images/icons/note_go.png differ diff --git a/themes/default/images/icons/openid.gif b/themes/default/images/icons/openid.gif new file mode 100644 index 0000000..e2d8377 Binary files /dev/null and b/themes/default/images/icons/openid.gif differ diff --git a/themes/default/images/icons/overlays.png b/themes/default/images/icons/overlays.png new file mode 100644 index 0000000..ab3100b Binary files /dev/null and b/themes/default/images/icons/overlays.png differ diff --git a/themes/default/images/icons/package.png b/themes/default/images/icons/package.png new file mode 100644 index 0000000..da3c2a2 Binary files /dev/null and b/themes/default/images/icons/package.png differ diff --git a/themes/default/images/icons/package_add.png b/themes/default/images/icons/package_add.png new file mode 100644 index 0000000..9c8a9da Binary files /dev/null and b/themes/default/images/icons/package_add.png differ diff --git a/themes/default/images/icons/package_delete.png b/themes/default/images/icons/package_delete.png new file mode 100644 index 0000000..86f7fbc Binary files /dev/null and b/themes/default/images/icons/package_delete.png differ diff --git a/themes/default/images/icons/package_go.png b/themes/default/images/icons/package_go.png new file mode 100644 index 0000000..aace63a Binary files /dev/null and b/themes/default/images/icons/package_go.png differ diff --git a/themes/default/images/icons/package_green.png b/themes/default/images/icons/package_green.png new file mode 100644 index 0000000..25b28bb Binary files /dev/null and b/themes/default/images/icons/package_green.png differ diff --git a/themes/default/images/icons/package_link.png b/themes/default/images/icons/package_link.png new file mode 100644 index 0000000..48e7ab5 Binary files /dev/null and b/themes/default/images/icons/package_link.png differ diff --git a/themes/default/images/icons/page.png b/themes/default/images/icons/page.png new file mode 100644 index 0000000..03ddd79 Binary files /dev/null and b/themes/default/images/icons/page.png differ diff --git a/themes/default/images/icons/page_add.png b/themes/default/images/icons/page_add.png new file mode 100644 index 0000000..d5bfa07 Binary files /dev/null and b/themes/default/images/icons/page_add.png differ diff --git a/themes/default/images/icons/page_attach.png b/themes/default/images/icons/page_attach.png new file mode 100644 index 0000000..89ee2da Binary files /dev/null and b/themes/default/images/icons/page_attach.png differ diff --git a/themes/default/images/icons/page_code.png b/themes/default/images/icons/page_code.png new file mode 100644 index 0000000..f7ea904 Binary files /dev/null and b/themes/default/images/icons/page_code.png differ diff --git a/themes/default/images/icons/page_copy.png b/themes/default/images/icons/page_copy.png new file mode 100644 index 0000000..195dc6d Binary files /dev/null and b/themes/default/images/icons/page_copy.png differ diff --git a/themes/default/images/icons/page_delete.png b/themes/default/images/icons/page_delete.png new file mode 100644 index 0000000..3141467 Binary files /dev/null and b/themes/default/images/icons/page_delete.png differ diff --git a/themes/default/images/icons/page_edit.png b/themes/default/images/icons/page_edit.png new file mode 100644 index 0000000..046811e Binary files /dev/null and b/themes/default/images/icons/page_edit.png differ diff --git a/themes/default/images/icons/page_error.png b/themes/default/images/icons/page_error.png new file mode 100644 index 0000000..f07f449 Binary files /dev/null and b/themes/default/images/icons/page_error.png differ diff --git a/themes/default/images/icons/page_excel.png b/themes/default/images/icons/page_excel.png new file mode 100644 index 0000000..eb6158e Binary files /dev/null and b/themes/default/images/icons/page_excel.png differ diff --git a/themes/default/images/icons/page_find.png b/themes/default/images/icons/page_find.png new file mode 100644 index 0000000..2f19388 Binary files /dev/null and b/themes/default/images/icons/page_find.png differ diff --git a/themes/default/images/icons/page_gear.png b/themes/default/images/icons/page_gear.png new file mode 100644 index 0000000..8e83281 Binary files /dev/null and b/themes/default/images/icons/page_gear.png differ diff --git a/themes/default/images/icons/page_go.png b/themes/default/images/icons/page_go.png new file mode 100644 index 0000000..80fe1ed Binary files /dev/null and b/themes/default/images/icons/page_go.png differ diff --git a/themes/default/images/icons/page_green.png b/themes/default/images/icons/page_green.png new file mode 100644 index 0000000..de8e003 Binary files /dev/null and b/themes/default/images/icons/page_green.png differ diff --git a/themes/default/images/icons/page_key.png b/themes/default/images/icons/page_key.png new file mode 100644 index 0000000..d6626cb Binary files /dev/null and b/themes/default/images/icons/page_key.png differ diff --git a/themes/default/images/icons/page_lightning.png b/themes/default/images/icons/page_lightning.png new file mode 100644 index 0000000..7e56870 Binary files /dev/null and b/themes/default/images/icons/page_lightning.png differ diff --git a/themes/default/images/icons/page_link.png b/themes/default/images/icons/page_link.png new file mode 100644 index 0000000..312eab0 Binary files /dev/null and b/themes/default/images/icons/page_link.png differ diff --git a/themes/default/images/icons/page_paintbrush.png b/themes/default/images/icons/page_paintbrush.png new file mode 100644 index 0000000..246a2f0 Binary files /dev/null and b/themes/default/images/icons/page_paintbrush.png differ diff --git a/themes/default/images/icons/page_paste.png b/themes/default/images/icons/page_paste.png new file mode 100644 index 0000000..968f073 Binary files /dev/null and b/themes/default/images/icons/page_paste.png differ diff --git a/themes/default/images/icons/page_red.png b/themes/default/images/icons/page_red.png new file mode 100644 index 0000000..0b18247 Binary files /dev/null and b/themes/default/images/icons/page_red.png differ diff --git a/themes/default/images/icons/page_refresh.png b/themes/default/images/icons/page_refresh.png new file mode 100644 index 0000000..cf347c7 Binary files /dev/null and b/themes/default/images/icons/page_refresh.png differ diff --git a/themes/default/images/icons/page_save.png b/themes/default/images/icons/page_save.png new file mode 100644 index 0000000..caea546 Binary files /dev/null and b/themes/default/images/icons/page_save.png differ diff --git a/themes/default/images/icons/page_white.png b/themes/default/images/icons/page_white.png new file mode 100644 index 0000000..8b8b1ca Binary files /dev/null and b/themes/default/images/icons/page_white.png differ diff --git a/themes/default/images/icons/page_white_acrobat.png b/themes/default/images/icons/page_white_acrobat.png new file mode 100644 index 0000000..8f8095e Binary files /dev/null and b/themes/default/images/icons/page_white_acrobat.png differ diff --git a/themes/default/images/icons/page_white_actionscript.png b/themes/default/images/icons/page_white_actionscript.png new file mode 100644 index 0000000..159b240 Binary files /dev/null and b/themes/default/images/icons/page_white_actionscript.png differ diff --git a/themes/default/images/icons/page_white_add.png b/themes/default/images/icons/page_white_add.png new file mode 100644 index 0000000..aa23dde Binary files /dev/null and b/themes/default/images/icons/page_white_add.png differ diff --git a/themes/default/images/icons/page_white_c.png b/themes/default/images/icons/page_white_c.png new file mode 100644 index 0000000..34a05cc Binary files /dev/null and b/themes/default/images/icons/page_white_c.png differ diff --git a/themes/default/images/icons/page_white_camera.png b/themes/default/images/icons/page_white_camera.png new file mode 100644 index 0000000..f501a59 Binary files /dev/null and b/themes/default/images/icons/page_white_camera.png differ diff --git a/themes/default/images/icons/page_white_cd.png b/themes/default/images/icons/page_white_cd.png new file mode 100644 index 0000000..848bdaf Binary files /dev/null and b/themes/default/images/icons/page_white_cd.png differ diff --git a/themes/default/images/icons/page_white_code.png b/themes/default/images/icons/page_white_code.png new file mode 100644 index 0000000..0c76bd1 Binary files /dev/null and b/themes/default/images/icons/page_white_code.png differ diff --git a/themes/default/images/icons/page_white_code_red.png b/themes/default/images/icons/page_white_code_red.png new file mode 100644 index 0000000..87a6914 Binary files /dev/null and b/themes/default/images/icons/page_white_code_red.png differ diff --git a/themes/default/images/icons/page_white_coldfusion.png b/themes/default/images/icons/page_white_coldfusion.png new file mode 100644 index 0000000..c66011f Binary files /dev/null and b/themes/default/images/icons/page_white_coldfusion.png differ diff --git a/themes/default/images/icons/page_white_compressed.png b/themes/default/images/icons/page_white_compressed.png new file mode 100644 index 0000000..2b6b100 Binary files /dev/null and b/themes/default/images/icons/page_white_compressed.png differ diff --git a/themes/default/images/icons/page_white_copy.png b/themes/default/images/icons/page_white_copy.png new file mode 100644 index 0000000..a9f31a2 Binary files /dev/null and b/themes/default/images/icons/page_white_copy.png differ diff --git a/themes/default/images/icons/page_white_cplusplus.png b/themes/default/images/icons/page_white_cplusplus.png new file mode 100644 index 0000000..a87cf84 Binary files /dev/null and b/themes/default/images/icons/page_white_cplusplus.png differ diff --git a/themes/default/images/icons/page_white_csharp.png b/themes/default/images/icons/page_white_csharp.png new file mode 100644 index 0000000..ffb8fc9 Binary files /dev/null and b/themes/default/images/icons/page_white_csharp.png differ diff --git a/themes/default/images/icons/page_white_cup.png b/themes/default/images/icons/page_white_cup.png new file mode 100644 index 0000000..0a7d6f4 Binary files /dev/null and b/themes/default/images/icons/page_white_cup.png differ diff --git a/themes/default/images/icons/page_white_database.png b/themes/default/images/icons/page_white_database.png new file mode 100644 index 0000000..bddba1f Binary files /dev/null and b/themes/default/images/icons/page_white_database.png differ diff --git a/themes/default/images/icons/page_white_delete.png b/themes/default/images/icons/page_white_delete.png new file mode 100644 index 0000000..af1ecaf Binary files /dev/null and b/themes/default/images/icons/page_white_delete.png differ diff --git a/themes/default/images/icons/page_white_dvd.png b/themes/default/images/icons/page_white_dvd.png new file mode 100644 index 0000000..4cc537a Binary files /dev/null and b/themes/default/images/icons/page_white_dvd.png differ diff --git a/themes/default/images/icons/page_white_edit.png b/themes/default/images/icons/page_white_edit.png new file mode 100644 index 0000000..b93e776 Binary files /dev/null and b/themes/default/images/icons/page_white_edit.png differ diff --git a/themes/default/images/icons/page_white_error.png b/themes/default/images/icons/page_white_error.png new file mode 100644 index 0000000..9fc5a0a Binary files /dev/null and b/themes/default/images/icons/page_white_error.png differ diff --git a/themes/default/images/icons/page_white_excel.png b/themes/default/images/icons/page_white_excel.png new file mode 100644 index 0000000..b977d7e Binary files /dev/null and b/themes/default/images/icons/page_white_excel.png differ diff --git a/themes/default/images/icons/page_white_find.png b/themes/default/images/icons/page_white_find.png new file mode 100644 index 0000000..5818436 Binary files /dev/null and b/themes/default/images/icons/page_white_find.png differ diff --git a/themes/default/images/icons/page_white_flash.png b/themes/default/images/icons/page_white_flash.png new file mode 100644 index 0000000..5769120 Binary files /dev/null and b/themes/default/images/icons/page_white_flash.png differ diff --git a/themes/default/images/icons/page_white_freehand.png b/themes/default/images/icons/page_white_freehand.png new file mode 100644 index 0000000..8d719df Binary files /dev/null and b/themes/default/images/icons/page_white_freehand.png differ diff --git a/themes/default/images/icons/page_white_gear.png b/themes/default/images/icons/page_white_gear.png new file mode 100644 index 0000000..106f5aa Binary files /dev/null and b/themes/default/images/icons/page_white_gear.png differ diff --git a/themes/default/images/icons/page_white_get.png b/themes/default/images/icons/page_white_get.png new file mode 100644 index 0000000..e4a1ecb Binary files /dev/null and b/themes/default/images/icons/page_white_get.png differ diff --git a/themes/default/images/icons/page_white_go.png b/themes/default/images/icons/page_white_go.png new file mode 100644 index 0000000..7e62a92 Binary files /dev/null and b/themes/default/images/icons/page_white_go.png differ diff --git a/themes/default/images/icons/page_white_h.png b/themes/default/images/icons/page_white_h.png new file mode 100644 index 0000000..e902abb Binary files /dev/null and b/themes/default/images/icons/page_white_h.png differ diff --git a/themes/default/images/icons/page_white_horizontal.png b/themes/default/images/icons/page_white_horizontal.png new file mode 100644 index 0000000..1d2d0a4 Binary files /dev/null and b/themes/default/images/icons/page_white_horizontal.png differ diff --git a/themes/default/images/icons/page_white_key.png b/themes/default/images/icons/page_white_key.png new file mode 100644 index 0000000..d616484 Binary files /dev/null and b/themes/default/images/icons/page_white_key.png differ diff --git a/themes/default/images/icons/page_white_lightning.png b/themes/default/images/icons/page_white_lightning.png new file mode 100644 index 0000000..7215d1e Binary files /dev/null and b/themes/default/images/icons/page_white_lightning.png differ diff --git a/themes/default/images/icons/page_white_link.png b/themes/default/images/icons/page_white_link.png new file mode 100644 index 0000000..bf7bd1c Binary files /dev/null and b/themes/default/images/icons/page_white_link.png differ diff --git a/themes/default/images/icons/page_white_magnify.png b/themes/default/images/icons/page_white_magnify.png new file mode 100644 index 0000000..f6b74cc Binary files /dev/null and b/themes/default/images/icons/page_white_magnify.png differ diff --git a/themes/default/images/icons/page_white_medal.png b/themes/default/images/icons/page_white_medal.png new file mode 100644 index 0000000..d3fffb6 Binary files /dev/null and b/themes/default/images/icons/page_white_medal.png differ diff --git a/themes/default/images/icons/page_white_office.png b/themes/default/images/icons/page_white_office.png new file mode 100644 index 0000000..a65bcb3 Binary files /dev/null and b/themes/default/images/icons/page_white_office.png differ diff --git a/themes/default/images/icons/page_white_paint.png b/themes/default/images/icons/page_white_paint.png new file mode 100644 index 0000000..23a37b8 Binary files /dev/null and b/themes/default/images/icons/page_white_paint.png differ diff --git a/themes/default/images/icons/page_white_paintbrush.png b/themes/default/images/icons/page_white_paintbrush.png new file mode 100644 index 0000000..f907e44 Binary files /dev/null and b/themes/default/images/icons/page_white_paintbrush.png differ diff --git a/themes/default/images/icons/page_white_paste.png b/themes/default/images/icons/page_white_paste.png new file mode 100644 index 0000000..5b2cbb3 Binary files /dev/null and b/themes/default/images/icons/page_white_paste.png differ diff --git a/themes/default/images/icons/page_white_php.png b/themes/default/images/icons/page_white_php.png new file mode 100644 index 0000000..7868a25 Binary files /dev/null and b/themes/default/images/icons/page_white_php.png differ diff --git a/themes/default/images/icons/page_white_picture.png b/themes/default/images/icons/page_white_picture.png new file mode 100644 index 0000000..134b669 Binary files /dev/null and b/themes/default/images/icons/page_white_picture.png differ diff --git a/themes/default/images/icons/page_white_powerpoint.png b/themes/default/images/icons/page_white_powerpoint.png new file mode 100644 index 0000000..c4eff03 Binary files /dev/null and b/themes/default/images/icons/page_white_powerpoint.png differ diff --git a/themes/default/images/icons/page_white_put.png b/themes/default/images/icons/page_white_put.png new file mode 100644 index 0000000..884ffd6 Binary files /dev/null and b/themes/default/images/icons/page_white_put.png differ diff --git a/themes/default/images/icons/page_white_ruby.png b/themes/default/images/icons/page_white_ruby.png new file mode 100644 index 0000000..f59b7c4 Binary files /dev/null and b/themes/default/images/icons/page_white_ruby.png differ diff --git a/themes/default/images/icons/page_white_stack.png b/themes/default/images/icons/page_white_stack.png new file mode 100644 index 0000000..44084ad Binary files /dev/null and b/themes/default/images/icons/page_white_stack.png differ diff --git a/themes/default/images/icons/page_white_star.png b/themes/default/images/icons/page_white_star.png new file mode 100644 index 0000000..3a1441c Binary files /dev/null and b/themes/default/images/icons/page_white_star.png differ diff --git a/themes/default/images/icons/page_white_swoosh.png b/themes/default/images/icons/page_white_swoosh.png new file mode 100644 index 0000000..e770829 Binary files /dev/null and b/themes/default/images/icons/page_white_swoosh.png differ diff --git a/themes/default/images/icons/page_white_text.png b/themes/default/images/icons/page_white_text.png new file mode 100644 index 0000000..813f712 Binary files /dev/null and b/themes/default/images/icons/page_white_text.png differ diff --git a/themes/default/images/icons/page_white_text_width.png b/themes/default/images/icons/page_white_text_width.png new file mode 100644 index 0000000..d9cf132 Binary files /dev/null and b/themes/default/images/icons/page_white_text_width.png differ diff --git a/themes/default/images/icons/page_white_tux.png b/themes/default/images/icons/page_white_tux.png new file mode 100644 index 0000000..52699bf Binary files /dev/null and b/themes/default/images/icons/page_white_tux.png differ diff --git a/themes/default/images/icons/page_white_vector.png b/themes/default/images/icons/page_white_vector.png new file mode 100644 index 0000000..4a05955 Binary files /dev/null and b/themes/default/images/icons/page_white_vector.png differ diff --git a/themes/default/images/icons/page_white_visualstudio.png b/themes/default/images/icons/page_white_visualstudio.png new file mode 100644 index 0000000..a0a433d Binary files /dev/null and b/themes/default/images/icons/page_white_visualstudio.png differ diff --git a/themes/default/images/icons/page_white_width.png b/themes/default/images/icons/page_white_width.png new file mode 100644 index 0000000..1eb8809 Binary files /dev/null and b/themes/default/images/icons/page_white_width.png differ diff --git a/themes/default/images/icons/page_white_word.png b/themes/default/images/icons/page_white_word.png new file mode 100644 index 0000000..ae8ecbf Binary files /dev/null and b/themes/default/images/icons/page_white_word.png differ diff --git a/themes/default/images/icons/page_white_world.png b/themes/default/images/icons/page_white_world.png new file mode 100644 index 0000000..6ed2490 Binary files /dev/null and b/themes/default/images/icons/page_white_world.png differ diff --git a/themes/default/images/icons/page_white_wrench.png b/themes/default/images/icons/page_white_wrench.png new file mode 100644 index 0000000..fecadd0 Binary files /dev/null and b/themes/default/images/icons/page_white_wrench.png differ diff --git a/themes/default/images/icons/page_white_zip.png b/themes/default/images/icons/page_white_zip.png new file mode 100644 index 0000000..fd4bbcc Binary files /dev/null and b/themes/default/images/icons/page_white_zip.png differ diff --git a/themes/default/images/icons/page_word.png b/themes/default/images/icons/page_word.png new file mode 100644 index 0000000..834cdfa Binary files /dev/null and b/themes/default/images/icons/page_word.png differ diff --git a/themes/default/images/icons/page_world.png b/themes/default/images/icons/page_world.png new file mode 100644 index 0000000..b8895dd Binary files /dev/null and b/themes/default/images/icons/page_world.png differ diff --git a/themes/default/images/icons/paintbrush.png b/themes/default/images/icons/paintbrush.png new file mode 100644 index 0000000..a3ecf87 Binary files /dev/null and b/themes/default/images/icons/paintbrush.png differ diff --git a/themes/default/images/icons/paintcan.png b/themes/default/images/icons/paintcan.png new file mode 100644 index 0000000..f82a886 Binary files /dev/null and b/themes/default/images/icons/paintcan.png differ diff --git a/themes/default/images/icons/palette.png b/themes/default/images/icons/palette.png new file mode 100644 index 0000000..73c5b3f Binary files /dev/null and b/themes/default/images/icons/palette.png differ diff --git a/themes/default/images/icons/paste_plain.png b/themes/default/images/icons/paste_plain.png new file mode 100644 index 0000000..c0490eb Binary files /dev/null and b/themes/default/images/icons/paste_plain.png differ diff --git a/themes/default/images/icons/paste_word.png b/themes/default/images/icons/paste_word.png new file mode 100644 index 0000000..f6b87f8 Binary files /dev/null and b/themes/default/images/icons/paste_word.png differ diff --git a/themes/default/images/icons/pencil.png b/themes/default/images/icons/pencil.png new file mode 100644 index 0000000..0bfecd5 Binary files /dev/null and b/themes/default/images/icons/pencil.png differ diff --git a/themes/default/images/icons/pencil_add.png b/themes/default/images/icons/pencil_add.png new file mode 100644 index 0000000..902bbe6 Binary files /dev/null and b/themes/default/images/icons/pencil_add.png differ diff --git a/themes/default/images/icons/pencil_delete.png b/themes/default/images/icons/pencil_delete.png new file mode 100644 index 0000000..d8944e6 Binary files /dev/null and b/themes/default/images/icons/pencil_delete.png differ diff --git a/themes/default/images/icons/pencil_go.png b/themes/default/images/icons/pencil_go.png new file mode 100644 index 0000000..937bded Binary files /dev/null and b/themes/default/images/icons/pencil_go.png differ diff --git a/themes/default/images/icons/phone.png b/themes/default/images/icons/phone.png new file mode 100644 index 0000000..c39f162 Binary files /dev/null and b/themes/default/images/icons/phone.png differ diff --git a/themes/default/images/icons/phone_add.png b/themes/default/images/icons/phone_add.png new file mode 100644 index 0000000..d3555e0 Binary files /dev/null and b/themes/default/images/icons/phone_add.png differ diff --git a/themes/default/images/icons/phone_delete.png b/themes/default/images/icons/phone_delete.png new file mode 100644 index 0000000..bbe4f8a Binary files /dev/null and b/themes/default/images/icons/phone_delete.png differ diff --git a/themes/default/images/icons/phone_sound.png b/themes/default/images/icons/phone_sound.png new file mode 100644 index 0000000..7fdf1c5 Binary files /dev/null and b/themes/default/images/icons/phone_sound.png differ diff --git a/themes/default/images/icons/photo.png b/themes/default/images/icons/photo.png new file mode 100644 index 0000000..6c2aaaa Binary files /dev/null and b/themes/default/images/icons/photo.png differ diff --git a/themes/default/images/icons/photo_add.png b/themes/default/images/icons/photo_add.png new file mode 100644 index 0000000..63cc355 Binary files /dev/null and b/themes/default/images/icons/photo_add.png differ diff --git a/themes/default/images/icons/photo_delete.png b/themes/default/images/icons/photo_delete.png new file mode 100644 index 0000000..18b67df Binary files /dev/null and b/themes/default/images/icons/photo_delete.png differ diff --git a/themes/default/images/icons/photo_link.png b/themes/default/images/icons/photo_link.png new file mode 100644 index 0000000..e6bb35f Binary files /dev/null and b/themes/default/images/icons/photo_link.png differ diff --git a/themes/default/images/icons/photos.png b/themes/default/images/icons/photos.png new file mode 100644 index 0000000..8836fe6 Binary files /dev/null and b/themes/default/images/icons/photos.png differ diff --git a/themes/default/images/icons/picture.png b/themes/default/images/icons/picture.png new file mode 100644 index 0000000..4a158fe Binary files /dev/null and b/themes/default/images/icons/picture.png differ diff --git a/themes/default/images/icons/picture_add.png b/themes/default/images/icons/picture_add.png new file mode 100644 index 0000000..d6d3f85 Binary files /dev/null and b/themes/default/images/icons/picture_add.png differ diff --git a/themes/default/images/icons/picture_delete.png b/themes/default/images/icons/picture_delete.png new file mode 100644 index 0000000..cca9f53 Binary files /dev/null and b/themes/default/images/icons/picture_delete.png differ diff --git a/themes/default/images/icons/picture_edit.png b/themes/default/images/icons/picture_edit.png new file mode 100644 index 0000000..9a70c34 Binary files /dev/null and b/themes/default/images/icons/picture_edit.png differ diff --git a/themes/default/images/icons/picture_empty.png b/themes/default/images/icons/picture_empty.png new file mode 100644 index 0000000..abd2b9b Binary files /dev/null and b/themes/default/images/icons/picture_empty.png differ diff --git a/themes/default/images/icons/picture_error.png b/themes/default/images/icons/picture_error.png new file mode 100644 index 0000000..d41d90d Binary files /dev/null and b/themes/default/images/icons/picture_error.png differ diff --git a/themes/default/images/icons/picture_go.png b/themes/default/images/icons/picture_go.png new file mode 100644 index 0000000..27c63c5 Binary files /dev/null and b/themes/default/images/icons/picture_go.png differ diff --git a/themes/default/images/icons/picture_key.png b/themes/default/images/icons/picture_key.png new file mode 100644 index 0000000..667086c Binary files /dev/null and b/themes/default/images/icons/picture_key.png differ diff --git a/themes/default/images/icons/picture_link.png b/themes/default/images/icons/picture_link.png new file mode 100644 index 0000000..42dca74 Binary files /dev/null and b/themes/default/images/icons/picture_link.png differ diff --git a/themes/default/images/icons/picture_save.png b/themes/default/images/icons/picture_save.png new file mode 100644 index 0000000..777fb5d Binary files /dev/null and b/themes/default/images/icons/picture_save.png differ diff --git a/themes/default/images/icons/pictures.png b/themes/default/images/icons/pictures.png new file mode 100644 index 0000000..d9591c1 Binary files /dev/null and b/themes/default/images/icons/pictures.png differ diff --git a/themes/default/images/icons/pilcrow.png b/themes/default/images/icons/pilcrow.png new file mode 100644 index 0000000..95704fb Binary files /dev/null and b/themes/default/images/icons/pilcrow.png differ diff --git a/themes/default/images/icons/pill.png b/themes/default/images/icons/pill.png new file mode 100644 index 0000000..f2bdef6 Binary files /dev/null and b/themes/default/images/icons/pill.png differ diff --git a/themes/default/images/icons/pill_add.png b/themes/default/images/icons/pill_add.png new file mode 100644 index 0000000..ac9c2df Binary files /dev/null and b/themes/default/images/icons/pill_add.png differ diff --git a/themes/default/images/icons/pill_delete.png b/themes/default/images/icons/pill_delete.png new file mode 100644 index 0000000..c61592e Binary files /dev/null and b/themes/default/images/icons/pill_delete.png differ diff --git a/themes/default/images/icons/pill_go.png b/themes/default/images/icons/pill_go.png new file mode 100644 index 0000000..e5c07d4 Binary files /dev/null and b/themes/default/images/icons/pill_go.png differ diff --git a/themes/default/images/icons/plugin.png b/themes/default/images/icons/plugin.png new file mode 100644 index 0000000..6187b15 Binary files /dev/null and b/themes/default/images/icons/plugin.png differ diff --git a/themes/default/images/icons/plugin_add.png b/themes/default/images/icons/plugin_add.png new file mode 100644 index 0000000..ae43690 Binary files /dev/null and b/themes/default/images/icons/plugin_add.png differ diff --git a/themes/default/images/icons/plugin_delete.png b/themes/default/images/icons/plugin_delete.png new file mode 100644 index 0000000..d9c3376 Binary files /dev/null and b/themes/default/images/icons/plugin_delete.png differ diff --git a/themes/default/images/icons/plugin_disabled.png b/themes/default/images/icons/plugin_disabled.png new file mode 100644 index 0000000..f4f6be5 Binary files /dev/null and b/themes/default/images/icons/plugin_disabled.png differ diff --git a/themes/default/images/icons/plugin_edit.png b/themes/default/images/icons/plugin_edit.png new file mode 100644 index 0000000..b6cb0ec Binary files /dev/null and b/themes/default/images/icons/plugin_edit.png differ diff --git a/themes/default/images/icons/plugin_error.png b/themes/default/images/icons/plugin_error.png new file mode 100644 index 0000000..cff65d7 Binary files /dev/null and b/themes/default/images/icons/plugin_error.png differ diff --git a/themes/default/images/icons/plugin_go.png b/themes/default/images/icons/plugin_go.png new file mode 100644 index 0000000..41da991 Binary files /dev/null and b/themes/default/images/icons/plugin_go.png differ diff --git a/themes/default/images/icons/plugin_link.png b/themes/default/images/icons/plugin_link.png new file mode 100644 index 0000000..445c188 Binary files /dev/null and b/themes/default/images/icons/plugin_link.png differ diff --git a/themes/default/images/icons/printer.png b/themes/default/images/icons/printer.png new file mode 100644 index 0000000..a350d18 Binary files /dev/null and b/themes/default/images/icons/printer.png differ diff --git a/themes/default/images/icons/printer_add.png b/themes/default/images/icons/printer_add.png new file mode 100644 index 0000000..d228d05 Binary files /dev/null and b/themes/default/images/icons/printer_add.png differ diff --git a/themes/default/images/icons/printer_delete.png b/themes/default/images/icons/printer_delete.png new file mode 100644 index 0000000..1d8605f Binary files /dev/null and b/themes/default/images/icons/printer_delete.png differ diff --git a/themes/default/images/icons/printer_empty.png b/themes/default/images/icons/printer_empty.png new file mode 100644 index 0000000..94e8c16 Binary files /dev/null and b/themes/default/images/icons/printer_empty.png differ diff --git a/themes/default/images/icons/printer_error.png b/themes/default/images/icons/printer_error.png new file mode 100644 index 0000000..279ebb0 Binary files /dev/null and b/themes/default/images/icons/printer_error.png differ diff --git a/themes/default/images/icons/rainbow.png b/themes/default/images/icons/rainbow.png new file mode 100644 index 0000000..5ede989 Binary files /dev/null and b/themes/default/images/icons/rainbow.png differ diff --git a/themes/default/images/icons/report.png b/themes/default/images/icons/report.png new file mode 100644 index 0000000..779ad58 Binary files /dev/null and b/themes/default/images/icons/report.png differ diff --git a/themes/default/images/icons/report_add.png b/themes/default/images/icons/report_add.png new file mode 100644 index 0000000..d5eac9b Binary files /dev/null and b/themes/default/images/icons/report_add.png differ diff --git a/themes/default/images/icons/report_delete.png b/themes/default/images/icons/report_delete.png new file mode 100644 index 0000000..dcce0b6 Binary files /dev/null and b/themes/default/images/icons/report_delete.png differ diff --git a/themes/default/images/icons/report_disk.png b/themes/default/images/icons/report_disk.png new file mode 100644 index 0000000..1c856cd Binary files /dev/null and b/themes/default/images/icons/report_disk.png differ diff --git a/themes/default/images/icons/report_edit.png b/themes/default/images/icons/report_edit.png new file mode 100644 index 0000000..c61a6d8 Binary files /dev/null and b/themes/default/images/icons/report_edit.png differ diff --git a/themes/default/images/icons/report_go.png b/themes/default/images/icons/report_go.png new file mode 100644 index 0000000..f35a979 Binary files /dev/null and b/themes/default/images/icons/report_go.png differ diff --git a/themes/default/images/icons/report_key.png b/themes/default/images/icons/report_key.png new file mode 100644 index 0000000..90b758e Binary files /dev/null and b/themes/default/images/icons/report_key.png differ diff --git a/themes/default/images/icons/report_link.png b/themes/default/images/icons/report_link.png new file mode 100644 index 0000000..23f2611 Binary files /dev/null and b/themes/default/images/icons/report_link.png differ diff --git a/themes/default/images/icons/report_magnify.png b/themes/default/images/icons/report_magnify.png new file mode 100644 index 0000000..aeaa889 Binary files /dev/null and b/themes/default/images/icons/report_magnify.png differ diff --git a/themes/default/images/icons/report_picture.png b/themes/default/images/icons/report_picture.png new file mode 100644 index 0000000..3a9a7e5 Binary files /dev/null and b/themes/default/images/icons/report_picture.png differ diff --git a/themes/default/images/icons/report_user.png b/themes/default/images/icons/report_user.png new file mode 100644 index 0000000..7766edd Binary files /dev/null and b/themes/default/images/icons/report_user.png differ diff --git a/themes/default/images/icons/report_word.png b/themes/default/images/icons/report_word.png new file mode 100644 index 0000000..9951342 Binary files /dev/null and b/themes/default/images/icons/report_word.png differ diff --git a/themes/default/images/icons/resultset_first.png b/themes/default/images/icons/resultset_first.png new file mode 100644 index 0000000..b03eaf8 Binary files /dev/null and b/themes/default/images/icons/resultset_first.png differ diff --git a/themes/default/images/icons/resultset_last.png b/themes/default/images/icons/resultset_last.png new file mode 100644 index 0000000..8ec8947 Binary files /dev/null and b/themes/default/images/icons/resultset_last.png differ diff --git a/themes/default/images/icons/resultset_next.png b/themes/default/images/icons/resultset_next.png new file mode 100644 index 0000000..e252606 Binary files /dev/null and b/themes/default/images/icons/resultset_next.png differ diff --git a/themes/default/images/icons/resultset_previous.png b/themes/default/images/icons/resultset_previous.png new file mode 100644 index 0000000..18f9cc1 Binary files /dev/null and b/themes/default/images/icons/resultset_previous.png differ diff --git a/themes/default/images/icons/rosette.png b/themes/default/images/icons/rosette.png new file mode 100644 index 0000000..f233bc7 Binary files /dev/null and b/themes/default/images/icons/rosette.png differ diff --git a/themes/default/images/icons/rss.png b/themes/default/images/icons/rss.png new file mode 100644 index 0000000..1dc6ff3 Binary files /dev/null and b/themes/default/images/icons/rss.png differ diff --git a/themes/default/images/icons/rss_add.png b/themes/default/images/icons/rss_add.png new file mode 100644 index 0000000..b590beb Binary files /dev/null and b/themes/default/images/icons/rss_add.png differ diff --git a/themes/default/images/icons/rss_delete.png b/themes/default/images/icons/rss_delete.png new file mode 100644 index 0000000..9deb738 Binary files /dev/null and b/themes/default/images/icons/rss_delete.png differ diff --git a/themes/default/images/icons/rss_go.png b/themes/default/images/icons/rss_go.png new file mode 100644 index 0000000..43a86bf Binary files /dev/null and b/themes/default/images/icons/rss_go.png differ diff --git a/themes/default/images/icons/rss_valid.png b/themes/default/images/icons/rss_valid.png new file mode 100644 index 0000000..a6d0b0e Binary files /dev/null and b/themes/default/images/icons/rss_valid.png differ diff --git a/themes/default/images/icons/ruby.png b/themes/default/images/icons/ruby.png new file mode 100644 index 0000000..f763a16 Binary files /dev/null and b/themes/default/images/icons/ruby.png differ diff --git a/themes/default/images/icons/ruby_add.png b/themes/default/images/icons/ruby_add.png new file mode 100644 index 0000000..a2cd648 Binary files /dev/null and b/themes/default/images/icons/ruby_add.png differ diff --git a/themes/default/images/icons/ruby_delete.png b/themes/default/images/icons/ruby_delete.png new file mode 100644 index 0000000..3002263 Binary files /dev/null and b/themes/default/images/icons/ruby_delete.png differ diff --git a/themes/default/images/icons/ruby_gear.png b/themes/default/images/icons/ruby_gear.png new file mode 100644 index 0000000..4a10590 Binary files /dev/null and b/themes/default/images/icons/ruby_gear.png differ diff --git a/themes/default/images/icons/ruby_get.png b/themes/default/images/icons/ruby_get.png new file mode 100644 index 0000000..f5203c7 Binary files /dev/null and b/themes/default/images/icons/ruby_get.png differ diff --git a/themes/default/images/icons/ruby_go.png b/themes/default/images/icons/ruby_go.png new file mode 100644 index 0000000..d8d276e Binary files /dev/null and b/themes/default/images/icons/ruby_go.png differ diff --git a/themes/default/images/icons/ruby_key.png b/themes/default/images/icons/ruby_key.png new file mode 100644 index 0000000..451cfeb Binary files /dev/null and b/themes/default/images/icons/ruby_key.png differ diff --git a/themes/default/images/icons/ruby_link.png b/themes/default/images/icons/ruby_link.png new file mode 100644 index 0000000..bf4be52 Binary files /dev/null and b/themes/default/images/icons/ruby_link.png differ diff --git a/themes/default/images/icons/ruby_put.png b/themes/default/images/icons/ruby_put.png new file mode 100644 index 0000000..e026323 Binary files /dev/null and b/themes/default/images/icons/ruby_put.png differ diff --git a/themes/default/images/icons/script.png b/themes/default/images/icons/script.png new file mode 100644 index 0000000..0f9ed4d Binary files /dev/null and b/themes/default/images/icons/script.png differ diff --git a/themes/default/images/icons/script_add.png b/themes/default/images/icons/script_add.png new file mode 100644 index 0000000..d650552 Binary files /dev/null and b/themes/default/images/icons/script_add.png differ diff --git a/themes/default/images/icons/script_code.png b/themes/default/images/icons/script_code.png new file mode 100644 index 0000000..63fe6ce Binary files /dev/null and b/themes/default/images/icons/script_code.png differ diff --git a/themes/default/images/icons/script_code_red.png b/themes/default/images/icons/script_code_red.png new file mode 100644 index 0000000..8fcf0f0 Binary files /dev/null and b/themes/default/images/icons/script_code_red.png differ diff --git a/themes/default/images/icons/script_delete.png b/themes/default/images/icons/script_delete.png new file mode 100644 index 0000000..e6500ce Binary files /dev/null and b/themes/default/images/icons/script_delete.png differ diff --git a/themes/default/images/icons/script_edit.png b/themes/default/images/icons/script_edit.png new file mode 100644 index 0000000..b4d31ce Binary files /dev/null and b/themes/default/images/icons/script_edit.png differ diff --git a/themes/default/images/icons/script_error.png b/themes/default/images/icons/script_error.png new file mode 100644 index 0000000..0491954 Binary files /dev/null and b/themes/default/images/icons/script_error.png differ diff --git a/themes/default/images/icons/script_gear.png b/themes/default/images/icons/script_gear.png new file mode 100644 index 0000000..56fcf84 Binary files /dev/null and b/themes/default/images/icons/script_gear.png differ diff --git a/themes/default/images/icons/script_go.png b/themes/default/images/icons/script_go.png new file mode 100644 index 0000000..8e154e2 Binary files /dev/null and b/themes/default/images/icons/script_go.png differ diff --git a/themes/default/images/icons/script_key.png b/themes/default/images/icons/script_key.png new file mode 100644 index 0000000..49bb24d Binary files /dev/null and b/themes/default/images/icons/script_key.png differ diff --git a/themes/default/images/icons/script_lightning.png b/themes/default/images/icons/script_lightning.png new file mode 100644 index 0000000..b3fa18c Binary files /dev/null and b/themes/default/images/icons/script_lightning.png differ diff --git a/themes/default/images/icons/script_link.png b/themes/default/images/icons/script_link.png new file mode 100644 index 0000000..bdeb985 Binary files /dev/null and b/themes/default/images/icons/script_link.png differ diff --git a/themes/default/images/icons/script_palette.png b/themes/default/images/icons/script_palette.png new file mode 100644 index 0000000..6d46962 Binary files /dev/null and b/themes/default/images/icons/script_palette.png differ diff --git a/themes/default/images/icons/script_save.png b/themes/default/images/icons/script_save.png new file mode 100644 index 0000000..36216d8 Binary files /dev/null and b/themes/default/images/icons/script_save.png differ diff --git a/themes/default/images/icons/server.png b/themes/default/images/icons/server.png new file mode 100644 index 0000000..720a237 Binary files /dev/null and b/themes/default/images/icons/server.png differ diff --git a/themes/default/images/icons/server_add.png b/themes/default/images/icons/server_add.png new file mode 100644 index 0000000..3f10a3a Binary files /dev/null and b/themes/default/images/icons/server_add.png differ diff --git a/themes/default/images/icons/server_chart.png b/themes/default/images/icons/server_chart.png new file mode 100644 index 0000000..1128d3f Binary files /dev/null and b/themes/default/images/icons/server_chart.png differ diff --git a/themes/default/images/icons/server_compressed.png b/themes/default/images/icons/server_compressed.png new file mode 100644 index 0000000..bf49fad Binary files /dev/null and b/themes/default/images/icons/server_compressed.png differ diff --git a/themes/default/images/icons/server_connect.png b/themes/default/images/icons/server_connect.png new file mode 100644 index 0000000..49b2691 Binary files /dev/null and b/themes/default/images/icons/server_connect.png differ diff --git a/themes/default/images/icons/server_database.png b/themes/default/images/icons/server_database.png new file mode 100644 index 0000000..b24e826 Binary files /dev/null and b/themes/default/images/icons/server_database.png differ diff --git a/themes/default/images/icons/server_delete.png b/themes/default/images/icons/server_delete.png new file mode 100644 index 0000000..61e740f Binary files /dev/null and b/themes/default/images/icons/server_delete.png differ diff --git a/themes/default/images/icons/server_edit.png b/themes/default/images/icons/server_edit.png new file mode 100644 index 0000000..dc76253 Binary files /dev/null and b/themes/default/images/icons/server_edit.png differ diff --git a/themes/default/images/icons/server_error.png b/themes/default/images/icons/server_error.png new file mode 100644 index 0000000..f640256 Binary files /dev/null and b/themes/default/images/icons/server_error.png differ diff --git a/themes/default/images/icons/server_go.png b/themes/default/images/icons/server_go.png new file mode 100644 index 0000000..540c8e2 Binary files /dev/null and b/themes/default/images/icons/server_go.png differ diff --git a/themes/default/images/icons/server_key.png b/themes/default/images/icons/server_key.png new file mode 100644 index 0000000..ecd5174 Binary files /dev/null and b/themes/default/images/icons/server_key.png differ diff --git a/themes/default/images/icons/server_lightning.png b/themes/default/images/icons/server_lightning.png new file mode 100644 index 0000000..b0f4e46 Binary files /dev/null and b/themes/default/images/icons/server_lightning.png differ diff --git a/themes/default/images/icons/server_link.png b/themes/default/images/icons/server_link.png new file mode 100644 index 0000000..e8821df Binary files /dev/null and b/themes/default/images/icons/server_link.png differ diff --git a/themes/default/images/icons/server_uncompressed.png b/themes/default/images/icons/server_uncompressed.png new file mode 100644 index 0000000..86e8325 Binary files /dev/null and b/themes/default/images/icons/server_uncompressed.png differ diff --git a/themes/default/images/icons/shading.png b/themes/default/images/icons/shading.png new file mode 100644 index 0000000..09275f9 Binary files /dev/null and b/themes/default/images/icons/shading.png differ diff --git a/themes/default/images/icons/shape_align_bottom.png b/themes/default/images/icons/shape_align_bottom.png new file mode 100644 index 0000000..55d2694 Binary files /dev/null and b/themes/default/images/icons/shape_align_bottom.png differ diff --git a/themes/default/images/icons/shape_align_center.png b/themes/default/images/icons/shape_align_center.png new file mode 100644 index 0000000..efe9a98 Binary files /dev/null and b/themes/default/images/icons/shape_align_center.png differ diff --git a/themes/default/images/icons/shape_align_left.png b/themes/default/images/icons/shape_align_left.png new file mode 100644 index 0000000..aaedc41 Binary files /dev/null and b/themes/default/images/icons/shape_align_left.png differ diff --git a/themes/default/images/icons/shape_align_middle.png b/themes/default/images/icons/shape_align_middle.png new file mode 100644 index 0000000..d350dd8 Binary files /dev/null and b/themes/default/images/icons/shape_align_middle.png differ diff --git a/themes/default/images/icons/shape_align_right.png b/themes/default/images/icons/shape_align_right.png new file mode 100644 index 0000000..ff556b6 Binary files /dev/null and b/themes/default/images/icons/shape_align_right.png differ diff --git a/themes/default/images/icons/shape_align_top.png b/themes/default/images/icons/shape_align_top.png new file mode 100644 index 0000000..1181b43 Binary files /dev/null and b/themes/default/images/icons/shape_align_top.png differ diff --git a/themes/default/images/icons/shape_flip_horizontal.png b/themes/default/images/icons/shape_flip_horizontal.png new file mode 100644 index 0000000..8667c81 Binary files /dev/null and b/themes/default/images/icons/shape_flip_horizontal.png differ diff --git a/themes/default/images/icons/shape_flip_vertical.png b/themes/default/images/icons/shape_flip_vertical.png new file mode 100644 index 0000000..0bd66d1 Binary files /dev/null and b/themes/default/images/icons/shape_flip_vertical.png differ diff --git a/themes/default/images/icons/shape_group.png b/themes/default/images/icons/shape_group.png new file mode 100644 index 0000000..bb2ff51 Binary files /dev/null and b/themes/default/images/icons/shape_group.png differ diff --git a/themes/default/images/icons/shape_handles.png b/themes/default/images/icons/shape_handles.png new file mode 100644 index 0000000..ce27fe3 Binary files /dev/null and b/themes/default/images/icons/shape_handles.png differ diff --git a/themes/default/images/icons/shape_move_back.png b/themes/default/images/icons/shape_move_back.png new file mode 100644 index 0000000..a216ffd Binary files /dev/null and b/themes/default/images/icons/shape_move_back.png differ diff --git a/themes/default/images/icons/shape_move_backwards.png b/themes/default/images/icons/shape_move_backwards.png new file mode 100644 index 0000000..ee3f9b2 Binary files /dev/null and b/themes/default/images/icons/shape_move_backwards.png differ diff --git a/themes/default/images/icons/shape_move_forwards.png b/themes/default/images/icons/shape_move_forwards.png new file mode 100644 index 0000000..cfe4493 Binary files /dev/null and b/themes/default/images/icons/shape_move_forwards.png differ diff --git a/themes/default/images/icons/shape_move_front.png b/themes/default/images/icons/shape_move_front.png new file mode 100644 index 0000000..b4a4e3b Binary files /dev/null and b/themes/default/images/icons/shape_move_front.png differ diff --git a/themes/default/images/icons/shape_rotate_anticlockwise.png b/themes/default/images/icons/shape_rotate_anticlockwise.png new file mode 100644 index 0000000..07a3020 Binary files /dev/null and b/themes/default/images/icons/shape_rotate_anticlockwise.png differ diff --git a/themes/default/images/icons/shape_rotate_clockwise.png b/themes/default/images/icons/shape_rotate_clockwise.png new file mode 100644 index 0000000..b99db7d Binary files /dev/null and b/themes/default/images/icons/shape_rotate_clockwise.png differ diff --git a/themes/default/images/icons/shape_square.png b/themes/default/images/icons/shape_square.png new file mode 100644 index 0000000..33af046 Binary files /dev/null and b/themes/default/images/icons/shape_square.png differ diff --git a/themes/default/images/icons/shape_square_add.png b/themes/default/images/icons/shape_square_add.png new file mode 100644 index 0000000..31edfce Binary files /dev/null and b/themes/default/images/icons/shape_square_add.png differ diff --git a/themes/default/images/icons/shape_square_delete.png b/themes/default/images/icons/shape_square_delete.png new file mode 100644 index 0000000..ede912d Binary files /dev/null and b/themes/default/images/icons/shape_square_delete.png differ diff --git a/themes/default/images/icons/shape_square_edit.png b/themes/default/images/icons/shape_square_edit.png new file mode 100644 index 0000000..d28dc6b Binary files /dev/null and b/themes/default/images/icons/shape_square_edit.png differ diff --git a/themes/default/images/icons/shape_square_error.png b/themes/default/images/icons/shape_square_error.png new file mode 100644 index 0000000..0d0dcfa Binary files /dev/null and b/themes/default/images/icons/shape_square_error.png differ diff --git a/themes/default/images/icons/shape_square_go.png b/themes/default/images/icons/shape_square_go.png new file mode 100644 index 0000000..5a2ad90 Binary files /dev/null and b/themes/default/images/icons/shape_square_go.png differ diff --git a/themes/default/images/icons/shape_square_key.png b/themes/default/images/icons/shape_square_key.png new file mode 100644 index 0000000..c34b982 Binary files /dev/null and b/themes/default/images/icons/shape_square_key.png differ diff --git a/themes/default/images/icons/shape_square_link.png b/themes/default/images/icons/shape_square_link.png new file mode 100644 index 0000000..b885fcc Binary files /dev/null and b/themes/default/images/icons/shape_square_link.png differ diff --git a/themes/default/images/icons/shape_ungroup.png b/themes/default/images/icons/shape_ungroup.png new file mode 100644 index 0000000..3a6f369 Binary files /dev/null and b/themes/default/images/icons/shape_ungroup.png differ diff --git a/themes/default/images/icons/shield.png b/themes/default/images/icons/shield.png new file mode 100644 index 0000000..3cb4e25 Binary files /dev/null and b/themes/default/images/icons/shield.png differ diff --git a/themes/default/images/icons/shield_add.png b/themes/default/images/icons/shield_add.png new file mode 100644 index 0000000..e20a1b4 Binary files /dev/null and b/themes/default/images/icons/shield_add.png differ diff --git a/themes/default/images/icons/shield_delete.png b/themes/default/images/icons/shield_delete.png new file mode 100644 index 0000000..22823a7 Binary files /dev/null and b/themes/default/images/icons/shield_delete.png differ diff --git a/themes/default/images/icons/shield_go.png b/themes/default/images/icons/shield_go.png new file mode 100644 index 0000000..e9bd852 Binary files /dev/null and b/themes/default/images/icons/shield_go.png differ diff --git a/themes/default/images/icons/sitemap.png b/themes/default/images/icons/sitemap.png new file mode 100644 index 0000000..ca779f3 Binary files /dev/null and b/themes/default/images/icons/sitemap.png differ diff --git a/themes/default/images/icons/sitemap_color.png b/themes/default/images/icons/sitemap_color.png new file mode 100644 index 0000000..c64582b Binary files /dev/null and b/themes/default/images/icons/sitemap_color.png differ diff --git a/themes/default/images/icons/sound.png b/themes/default/images/icons/sound.png new file mode 100644 index 0000000..6056d23 Binary files /dev/null and b/themes/default/images/icons/sound.png differ diff --git a/themes/default/images/icons/sound_add.png b/themes/default/images/icons/sound_add.png new file mode 100644 index 0000000..965c503 Binary files /dev/null and b/themes/default/images/icons/sound_add.png differ diff --git a/themes/default/images/icons/sound_delete.png b/themes/default/images/icons/sound_delete.png new file mode 100644 index 0000000..ab9577a Binary files /dev/null and b/themes/default/images/icons/sound_delete.png differ diff --git a/themes/default/images/icons/sound_low.png b/themes/default/images/icons/sound_low.png new file mode 100644 index 0000000..4d91863 Binary files /dev/null and b/themes/default/images/icons/sound_low.png differ diff --git a/themes/default/images/icons/sound_mute.png b/themes/default/images/icons/sound_mute.png new file mode 100644 index 0000000..b652d2a Binary files /dev/null and b/themes/default/images/icons/sound_mute.png differ diff --git a/themes/default/images/icons/sound_none.png b/themes/default/images/icons/sound_none.png new file mode 100644 index 0000000..b497ebd Binary files /dev/null and b/themes/default/images/icons/sound_none.png differ diff --git a/themes/default/images/icons/spellcheck.png b/themes/default/images/icons/spellcheck.png new file mode 100644 index 0000000..ebc632d Binary files /dev/null and b/themes/default/images/icons/spellcheck.png differ diff --git a/themes/default/images/icons/sport_8ball.png b/themes/default/images/icons/sport_8ball.png new file mode 100644 index 0000000..4f627b7 Binary files /dev/null and b/themes/default/images/icons/sport_8ball.png differ diff --git a/themes/default/images/icons/sport_basketball.png b/themes/default/images/icons/sport_basketball.png new file mode 100644 index 0000000..f7a000b Binary files /dev/null and b/themes/default/images/icons/sport_basketball.png differ diff --git a/themes/default/images/icons/sport_football.png b/themes/default/images/icons/sport_football.png new file mode 100644 index 0000000..199f0f7 Binary files /dev/null and b/themes/default/images/icons/sport_football.png differ diff --git a/themes/default/images/icons/sport_golf.png b/themes/default/images/icons/sport_golf.png new file mode 100644 index 0000000..e21fa44 Binary files /dev/null and b/themes/default/images/icons/sport_golf.png differ diff --git a/themes/default/images/icons/sport_raquet.png b/themes/default/images/icons/sport_raquet.png new file mode 100644 index 0000000..f5e0f0c Binary files /dev/null and b/themes/default/images/icons/sport_raquet.png differ diff --git a/themes/default/images/icons/sport_shuttlecock.png b/themes/default/images/icons/sport_shuttlecock.png new file mode 100644 index 0000000..917287f Binary files /dev/null and b/themes/default/images/icons/sport_shuttlecock.png differ diff --git a/themes/default/images/icons/sport_soccer.png b/themes/default/images/icons/sport_soccer.png new file mode 100644 index 0000000..3eb1828 Binary files /dev/null and b/themes/default/images/icons/sport_soccer.png differ diff --git a/themes/default/images/icons/sport_tennis.png b/themes/default/images/icons/sport_tennis.png new file mode 100644 index 0000000..e88a6ef Binary files /dev/null and b/themes/default/images/icons/sport_tennis.png differ diff --git a/themes/default/images/icons/star.png b/themes/default/images/icons/star.png new file mode 100644 index 0000000..b88c857 Binary files /dev/null and b/themes/default/images/icons/star.png differ diff --git a/themes/default/images/icons/status_away.png b/themes/default/images/icons/status_away.png new file mode 100644 index 0000000..70bcbcc Binary files /dev/null and b/themes/default/images/icons/status_away.png differ diff --git a/themes/default/images/icons/status_busy.png b/themes/default/images/icons/status_busy.png new file mode 100644 index 0000000..987c806 Binary files /dev/null and b/themes/default/images/icons/status_busy.png differ diff --git a/themes/default/images/icons/status_offline.png b/themes/default/images/icons/status_offline.png new file mode 100644 index 0000000..a88261a Binary files /dev/null and b/themes/default/images/icons/status_offline.png differ diff --git a/themes/default/images/icons/status_online.png b/themes/default/images/icons/status_online.png new file mode 100644 index 0000000..947bd4b Binary files /dev/null and b/themes/default/images/icons/status_online.png differ diff --git a/themes/default/images/icons/stop.png b/themes/default/images/icons/stop.png new file mode 100644 index 0000000..0cfd585 Binary files /dev/null and b/themes/default/images/icons/stop.png differ diff --git a/themes/default/images/icons/style.png b/themes/default/images/icons/style.png new file mode 100644 index 0000000..81e41de Binary files /dev/null and b/themes/default/images/icons/style.png differ diff --git a/themes/default/images/icons/style_add.png b/themes/default/images/icons/style_add.png new file mode 100644 index 0000000..e0369c6 Binary files /dev/null and b/themes/default/images/icons/style_add.png differ diff --git a/themes/default/images/icons/style_delete.png b/themes/default/images/icons/style_delete.png new file mode 100644 index 0000000..640f187 Binary files /dev/null and b/themes/default/images/icons/style_delete.png differ diff --git a/themes/default/images/icons/style_edit.png b/themes/default/images/icons/style_edit.png new file mode 100644 index 0000000..25bb5b6 Binary files /dev/null and b/themes/default/images/icons/style_edit.png differ diff --git a/themes/default/images/icons/style_go.png b/themes/default/images/icons/style_go.png new file mode 100644 index 0000000..25d6181 Binary files /dev/null and b/themes/default/images/icons/style_go.png differ diff --git a/themes/default/images/icons/sum.png b/themes/default/images/icons/sum.png new file mode 100644 index 0000000..fd7b32e Binary files /dev/null and b/themes/default/images/icons/sum.png differ diff --git a/themes/default/images/icons/tab.png b/themes/default/images/icons/tab.png new file mode 100644 index 0000000..3d8207f Binary files /dev/null and b/themes/default/images/icons/tab.png differ diff --git a/themes/default/images/icons/tab_add.png b/themes/default/images/icons/tab_add.png new file mode 100644 index 0000000..d3b9936 Binary files /dev/null and b/themes/default/images/icons/tab_add.png differ diff --git a/themes/default/images/icons/tab_delete.png b/themes/default/images/icons/tab_delete.png new file mode 100644 index 0000000..100da2f Binary files /dev/null and b/themes/default/images/icons/tab_delete.png differ diff --git a/themes/default/images/icons/tab_edit.png b/themes/default/images/icons/tab_edit.png new file mode 100644 index 0000000..4c09c0f Binary files /dev/null and b/themes/default/images/icons/tab_edit.png differ diff --git a/themes/default/images/icons/tab_go.png b/themes/default/images/icons/tab_go.png new file mode 100644 index 0000000..844ce04 Binary files /dev/null and b/themes/default/images/icons/tab_go.png differ diff --git a/themes/default/images/icons/table.png b/themes/default/images/icons/table.png new file mode 100644 index 0000000..abcd936 Binary files /dev/null and b/themes/default/images/icons/table.png differ diff --git a/themes/default/images/icons/table_add.png b/themes/default/images/icons/table_add.png new file mode 100644 index 0000000..2a3e5c4 Binary files /dev/null and b/themes/default/images/icons/table_add.png differ diff --git a/themes/default/images/icons/table_delete.png b/themes/default/images/icons/table_delete.png new file mode 100644 index 0000000..b85916d Binary files /dev/null and b/themes/default/images/icons/table_delete.png differ diff --git a/themes/default/images/icons/table_edit.png b/themes/default/images/icons/table_edit.png new file mode 100644 index 0000000..bfcb024 Binary files /dev/null and b/themes/default/images/icons/table_edit.png differ diff --git a/themes/default/images/icons/table_error.png b/themes/default/images/icons/table_error.png new file mode 100644 index 0000000..589e92b Binary files /dev/null and b/themes/default/images/icons/table_error.png differ diff --git a/themes/default/images/icons/table_gear.png b/themes/default/images/icons/table_gear.png new file mode 100644 index 0000000..cfc2702 Binary files /dev/null and b/themes/default/images/icons/table_gear.png differ diff --git a/themes/default/images/icons/table_go.png b/themes/default/images/icons/table_go.png new file mode 100644 index 0000000..0528dfa Binary files /dev/null and b/themes/default/images/icons/table_go.png differ diff --git a/themes/default/images/icons/table_key.png b/themes/default/images/icons/table_key.png new file mode 100644 index 0000000..34e23e2 Binary files /dev/null and b/themes/default/images/icons/table_key.png differ diff --git a/themes/default/images/icons/table_lightning.png b/themes/default/images/icons/table_lightning.png new file mode 100644 index 0000000..612612b Binary files /dev/null and b/themes/default/images/icons/table_lightning.png differ diff --git a/themes/default/images/icons/table_link.png b/themes/default/images/icons/table_link.png new file mode 100644 index 0000000..decac8a Binary files /dev/null and b/themes/default/images/icons/table_link.png differ diff --git a/themes/default/images/icons/table_multiple.png b/themes/default/images/icons/table_multiple.png new file mode 100644 index 0000000..d76448e Binary files /dev/null and b/themes/default/images/icons/table_multiple.png differ diff --git a/themes/default/images/icons/table_refresh.png b/themes/default/images/icons/table_refresh.png new file mode 100644 index 0000000..ab92010 Binary files /dev/null and b/themes/default/images/icons/table_refresh.png differ diff --git a/themes/default/images/icons/table_relationship.png b/themes/default/images/icons/table_relationship.png new file mode 100644 index 0000000..28b8505 Binary files /dev/null and b/themes/default/images/icons/table_relationship.png differ diff --git a/themes/default/images/icons/table_row_delete.png b/themes/default/images/icons/table_row_delete.png new file mode 100644 index 0000000..54c6969 Binary files /dev/null and b/themes/default/images/icons/table_row_delete.png differ diff --git a/themes/default/images/icons/table_row_insert.png b/themes/default/images/icons/table_row_insert.png new file mode 100644 index 0000000..ff5925e Binary files /dev/null and b/themes/default/images/icons/table_row_insert.png differ diff --git a/themes/default/images/icons/table_save.png b/themes/default/images/icons/table_save.png new file mode 100644 index 0000000..25b74d1 Binary files /dev/null and b/themes/default/images/icons/table_save.png differ diff --git a/themes/default/images/icons/table_sort.png b/themes/default/images/icons/table_sort.png new file mode 100644 index 0000000..ed6785a Binary files /dev/null and b/themes/default/images/icons/table_sort.png differ diff --git a/themes/default/images/icons/tag.png b/themes/default/images/icons/tag.png new file mode 100644 index 0000000..e093032 Binary files /dev/null and b/themes/default/images/icons/tag.png differ diff --git a/themes/default/images/icons/tag_blue.png b/themes/default/images/icons/tag_blue.png new file mode 100644 index 0000000..9757fc6 Binary files /dev/null and b/themes/default/images/icons/tag_blue.png differ diff --git a/themes/default/images/icons/tag_blue_add.png b/themes/default/images/icons/tag_blue_add.png new file mode 100644 index 0000000..f135248 Binary files /dev/null and b/themes/default/images/icons/tag_blue_add.png differ diff --git a/themes/default/images/icons/tag_blue_delete.png b/themes/default/images/icons/tag_blue_delete.png new file mode 100644 index 0000000..9fbae67 Binary files /dev/null and b/themes/default/images/icons/tag_blue_delete.png differ diff --git a/themes/default/images/icons/tag_blue_edit.png b/themes/default/images/icons/tag_blue_edit.png new file mode 100644 index 0000000..2a9f626 Binary files /dev/null and b/themes/default/images/icons/tag_blue_edit.png differ diff --git a/themes/default/images/icons/tag_green.png b/themes/default/images/icons/tag_green.png new file mode 100644 index 0000000..83ec984 Binary files /dev/null and b/themes/default/images/icons/tag_green.png differ diff --git a/themes/default/images/icons/tag_orange.png b/themes/default/images/icons/tag_orange.png new file mode 100644 index 0000000..454a59f Binary files /dev/null and b/themes/default/images/icons/tag_orange.png differ diff --git a/themes/default/images/icons/tag_pink.png b/themes/default/images/icons/tag_pink.png new file mode 100644 index 0000000..76e2296 Binary files /dev/null and b/themes/default/images/icons/tag_pink.png differ diff --git a/themes/default/images/icons/tag_purple.png b/themes/default/images/icons/tag_purple.png new file mode 100644 index 0000000..ebaf0e8 Binary files /dev/null and b/themes/default/images/icons/tag_purple.png differ diff --git a/themes/default/images/icons/tag_red.png b/themes/default/images/icons/tag_red.png new file mode 100644 index 0000000..6ebb37d Binary files /dev/null and b/themes/default/images/icons/tag_red.png differ diff --git a/themes/default/images/icons/tag_yellow.png b/themes/default/images/icons/tag_yellow.png new file mode 100644 index 0000000..83d1292 Binary files /dev/null and b/themes/default/images/icons/tag_yellow.png differ diff --git a/themes/default/images/icons/telephone.png b/themes/default/images/icons/telephone.png new file mode 100644 index 0000000..cecc436 Binary files /dev/null and b/themes/default/images/icons/telephone.png differ diff --git a/themes/default/images/icons/telephone_add.png b/themes/default/images/icons/telephone_add.png new file mode 100644 index 0000000..5591cfc Binary files /dev/null and b/themes/default/images/icons/telephone_add.png differ diff --git a/themes/default/images/icons/telephone_delete.png b/themes/default/images/icons/telephone_delete.png new file mode 100644 index 0000000..0013268 Binary files /dev/null and b/themes/default/images/icons/telephone_delete.png differ diff --git a/themes/default/images/icons/telephone_edit.png b/themes/default/images/icons/telephone_edit.png new file mode 100644 index 0000000..bcf6d7e Binary files /dev/null and b/themes/default/images/icons/telephone_edit.png differ diff --git a/themes/default/images/icons/telephone_error.png b/themes/default/images/icons/telephone_error.png new file mode 100644 index 0000000..d3ec3a1 Binary files /dev/null and b/themes/default/images/icons/telephone_error.png differ diff --git a/themes/default/images/icons/telephone_go.png b/themes/default/images/icons/telephone_go.png new file mode 100644 index 0000000..395c8fb Binary files /dev/null and b/themes/default/images/icons/telephone_go.png differ diff --git a/themes/default/images/icons/telephone_key.png b/themes/default/images/icons/telephone_key.png new file mode 100644 index 0000000..cef5dec Binary files /dev/null and b/themes/default/images/icons/telephone_key.png differ diff --git a/themes/default/images/icons/telephone_link.png b/themes/default/images/icons/telephone_link.png new file mode 100644 index 0000000..ef1ee5d Binary files /dev/null and b/themes/default/images/icons/telephone_link.png differ diff --git a/themes/default/images/icons/television.png b/themes/default/images/icons/television.png new file mode 100644 index 0000000..1738a4f Binary files /dev/null and b/themes/default/images/icons/television.png differ diff --git a/themes/default/images/icons/television_add.png b/themes/default/images/icons/television_add.png new file mode 100644 index 0000000..2baaad9 Binary files /dev/null and b/themes/default/images/icons/television_add.png differ diff --git a/themes/default/images/icons/television_delete.png b/themes/default/images/icons/television_delete.png new file mode 100644 index 0000000..b9a5860 Binary files /dev/null and b/themes/default/images/icons/television_delete.png differ diff --git a/themes/default/images/icons/text_align_center.png b/themes/default/images/icons/text_align_center.png new file mode 100644 index 0000000..57beb38 Binary files /dev/null and b/themes/default/images/icons/text_align_center.png differ diff --git a/themes/default/images/icons/text_align_justify.png b/themes/default/images/icons/text_align_justify.png new file mode 100644 index 0000000..2fbdd69 Binary files /dev/null and b/themes/default/images/icons/text_align_justify.png differ diff --git a/themes/default/images/icons/text_align_left.png b/themes/default/images/icons/text_align_left.png new file mode 100644 index 0000000..6c8fcc1 Binary files /dev/null and b/themes/default/images/icons/text_align_left.png differ diff --git a/themes/default/images/icons/text_align_right.png b/themes/default/images/icons/text_align_right.png new file mode 100644 index 0000000..a150257 Binary files /dev/null and b/themes/default/images/icons/text_align_right.png differ diff --git a/themes/default/images/icons/text_allcaps.png b/themes/default/images/icons/text_allcaps.png new file mode 100644 index 0000000..280fd44 Binary files /dev/null and b/themes/default/images/icons/text_allcaps.png differ diff --git a/themes/default/images/icons/text_bold.png b/themes/default/images/icons/text_bold.png new file mode 100644 index 0000000..889ae80 Binary files /dev/null and b/themes/default/images/icons/text_bold.png differ diff --git a/themes/default/images/icons/text_columns.png b/themes/default/images/icons/text_columns.png new file mode 100644 index 0000000..97b2e03 Binary files /dev/null and b/themes/default/images/icons/text_columns.png differ diff --git a/themes/default/images/icons/text_dropcaps.png b/themes/default/images/icons/text_dropcaps.png new file mode 100644 index 0000000..dd65786 Binary files /dev/null and b/themes/default/images/icons/text_dropcaps.png differ diff --git a/themes/default/images/icons/text_heading_1.png b/themes/default/images/icons/text_heading_1.png new file mode 100644 index 0000000..9c122e9 Binary files /dev/null and b/themes/default/images/icons/text_heading_1.png differ diff --git a/themes/default/images/icons/text_heading_2.png b/themes/default/images/icons/text_heading_2.png new file mode 100644 index 0000000..fbd8765 Binary files /dev/null and b/themes/default/images/icons/text_heading_2.png differ diff --git a/themes/default/images/icons/text_heading_3.png b/themes/default/images/icons/text_heading_3.png new file mode 100644 index 0000000..c7836cf Binary files /dev/null and b/themes/default/images/icons/text_heading_3.png differ diff --git a/themes/default/images/icons/text_heading_4.png b/themes/default/images/icons/text_heading_4.png new file mode 100644 index 0000000..4e929ea Binary files /dev/null and b/themes/default/images/icons/text_heading_4.png differ diff --git a/themes/default/images/icons/text_heading_5.png b/themes/default/images/icons/text_heading_5.png new file mode 100644 index 0000000..30cabeb Binary files /dev/null and b/themes/default/images/icons/text_heading_5.png differ diff --git a/themes/default/images/icons/text_heading_6.png b/themes/default/images/icons/text_heading_6.png new file mode 100644 index 0000000..058170a Binary files /dev/null and b/themes/default/images/icons/text_heading_6.png differ diff --git a/themes/default/images/icons/text_horizontalrule.png b/themes/default/images/icons/text_horizontalrule.png new file mode 100644 index 0000000..8dd1da1 Binary files /dev/null and b/themes/default/images/icons/text_horizontalrule.png differ diff --git a/themes/default/images/icons/text_indent.png b/themes/default/images/icons/text_indent.png new file mode 100644 index 0000000..9364532 Binary files /dev/null and b/themes/default/images/icons/text_indent.png differ diff --git a/themes/default/images/icons/text_indent_remove.png b/themes/default/images/icons/text_indent_remove.png new file mode 100644 index 0000000..1651b07 Binary files /dev/null and b/themes/default/images/icons/text_indent_remove.png differ diff --git a/themes/default/images/icons/text_italic.png b/themes/default/images/icons/text_italic.png new file mode 100644 index 0000000..8482ac8 Binary files /dev/null and b/themes/default/images/icons/text_italic.png differ diff --git a/themes/default/images/icons/text_kerning.png b/themes/default/images/icons/text_kerning.png new file mode 100644 index 0000000..377def6 Binary files /dev/null and b/themes/default/images/icons/text_kerning.png differ diff --git a/themes/default/images/icons/text_letter_omega.png b/themes/default/images/icons/text_letter_omega.png new file mode 100644 index 0000000..5075ec6 Binary files /dev/null and b/themes/default/images/icons/text_letter_omega.png differ diff --git a/themes/default/images/icons/text_letterspacing.png b/themes/default/images/icons/text_letterspacing.png new file mode 100644 index 0000000..41390f5 Binary files /dev/null and b/themes/default/images/icons/text_letterspacing.png differ diff --git a/themes/default/images/icons/text_linespacing.png b/themes/default/images/icons/text_linespacing.png new file mode 100644 index 0000000..1a91cbd Binary files /dev/null and b/themes/default/images/icons/text_linespacing.png differ diff --git a/themes/default/images/icons/text_list_bullets.png b/themes/default/images/icons/text_list_bullets.png new file mode 100644 index 0000000..4a8672b Binary files /dev/null and b/themes/default/images/icons/text_list_bullets.png differ diff --git a/themes/default/images/icons/text_list_numbers.png b/themes/default/images/icons/text_list_numbers.png new file mode 100644 index 0000000..33b0b8d Binary files /dev/null and b/themes/default/images/icons/text_list_numbers.png differ diff --git a/themes/default/images/icons/text_lowercase.png b/themes/default/images/icons/text_lowercase.png new file mode 100644 index 0000000..382a102 Binary files /dev/null and b/themes/default/images/icons/text_lowercase.png differ diff --git a/themes/default/images/icons/text_padding_bottom.png b/themes/default/images/icons/text_padding_bottom.png new file mode 100644 index 0000000..4880c43 Binary files /dev/null and b/themes/default/images/icons/text_padding_bottom.png differ diff --git a/themes/default/images/icons/text_padding_left.png b/themes/default/images/icons/text_padding_left.png new file mode 100644 index 0000000..b55482e Binary files /dev/null and b/themes/default/images/icons/text_padding_left.png differ diff --git a/themes/default/images/icons/text_padding_right.png b/themes/default/images/icons/text_padding_right.png new file mode 100644 index 0000000..106edae Binary files /dev/null and b/themes/default/images/icons/text_padding_right.png differ diff --git a/themes/default/images/icons/text_padding_top.png b/themes/default/images/icons/text_padding_top.png new file mode 100644 index 0000000..c5c45b2 Binary files /dev/null and b/themes/default/images/icons/text_padding_top.png differ diff --git a/themes/default/images/icons/text_replace.png b/themes/default/images/icons/text_replace.png new file mode 100644 index 0000000..877f82f Binary files /dev/null and b/themes/default/images/icons/text_replace.png differ diff --git a/themes/default/images/icons/text_signature.png b/themes/default/images/icons/text_signature.png new file mode 100644 index 0000000..c72fd80 Binary files /dev/null and b/themes/default/images/icons/text_signature.png differ diff --git a/themes/default/images/icons/text_smallcaps.png b/themes/default/images/icons/text_smallcaps.png new file mode 100644 index 0000000..5b98a6e Binary files /dev/null and b/themes/default/images/icons/text_smallcaps.png differ diff --git a/themes/default/images/icons/text_strikethrough.png b/themes/default/images/icons/text_strikethrough.png new file mode 100644 index 0000000..612058a Binary files /dev/null and b/themes/default/images/icons/text_strikethrough.png differ diff --git a/themes/default/images/icons/text_subscript.png b/themes/default/images/icons/text_subscript.png new file mode 100644 index 0000000..1a2b010 Binary files /dev/null and b/themes/default/images/icons/text_subscript.png differ diff --git a/themes/default/images/icons/text_superscript.png b/themes/default/images/icons/text_superscript.png new file mode 100644 index 0000000..2fb2a7c Binary files /dev/null and b/themes/default/images/icons/text_superscript.png differ diff --git a/themes/default/images/icons/text_underline.png b/themes/default/images/icons/text_underline.png new file mode 100644 index 0000000..90d0df2 Binary files /dev/null and b/themes/default/images/icons/text_underline.png differ diff --git a/themes/default/images/icons/text_uppercase.png b/themes/default/images/icons/text_uppercase.png new file mode 100644 index 0000000..8dcc2db Binary files /dev/null and b/themes/default/images/icons/text_uppercase.png differ diff --git a/themes/default/images/icons/textfield.png b/themes/default/images/icons/textfield.png new file mode 100644 index 0000000..d37e730 Binary files /dev/null and b/themes/default/images/icons/textfield.png differ diff --git a/themes/default/images/icons/textfield_add.png b/themes/default/images/icons/textfield_add.png new file mode 100644 index 0000000..204de72 Binary files /dev/null and b/themes/default/images/icons/textfield_add.png differ diff --git a/themes/default/images/icons/textfield_delete.png b/themes/default/images/icons/textfield_delete.png new file mode 100644 index 0000000..c7bd58b Binary files /dev/null and b/themes/default/images/icons/textfield_delete.png differ diff --git a/themes/default/images/icons/textfield_key.png b/themes/default/images/icons/textfield_key.png new file mode 100644 index 0000000..a9d5e4f Binary files /dev/null and b/themes/default/images/icons/textfield_key.png differ diff --git a/themes/default/images/icons/textfield_rename.png b/themes/default/images/icons/textfield_rename.png new file mode 100644 index 0000000..4e3688e Binary files /dev/null and b/themes/default/images/icons/textfield_rename.png differ diff --git a/themes/default/images/icons/thumb_down.png b/themes/default/images/icons/thumb_down.png new file mode 100644 index 0000000..3c832d4 Binary files /dev/null and b/themes/default/images/icons/thumb_down.png differ diff --git a/themes/default/images/icons/thumb_up.png b/themes/default/images/icons/thumb_up.png new file mode 100644 index 0000000..2bd16cc Binary files /dev/null and b/themes/default/images/icons/thumb_up.png differ diff --git a/themes/default/images/icons/tick.png b/themes/default/images/icons/tick.png new file mode 100644 index 0000000..a9925a0 Binary files /dev/null and b/themes/default/images/icons/tick.png differ diff --git a/themes/default/images/icons/time.png b/themes/default/images/icons/time.png new file mode 100644 index 0000000..911da3f Binary files /dev/null and b/themes/default/images/icons/time.png differ diff --git a/themes/default/images/icons/time_add.png b/themes/default/images/icons/time_add.png new file mode 100644 index 0000000..dcc45cb Binary files /dev/null and b/themes/default/images/icons/time_add.png differ diff --git a/themes/default/images/icons/time_delete.png b/themes/default/images/icons/time_delete.png new file mode 100644 index 0000000..5bf8313 Binary files /dev/null and b/themes/default/images/icons/time_delete.png differ diff --git a/themes/default/images/icons/time_go.png b/themes/default/images/icons/time_go.png new file mode 100644 index 0000000..d451ee0 Binary files /dev/null and b/themes/default/images/icons/time_go.png differ diff --git a/themes/default/images/icons/timeline_marker.png b/themes/default/images/icons/timeline_marker.png new file mode 100644 index 0000000..a3fbddf Binary files /dev/null and b/themes/default/images/icons/timeline_marker.png differ diff --git a/themes/default/images/icons/transmit.png b/themes/default/images/icons/transmit.png new file mode 100644 index 0000000..f54bf73 Binary files /dev/null and b/themes/default/images/icons/transmit.png differ diff --git a/themes/default/images/icons/transmit_add.png b/themes/default/images/icons/transmit_add.png new file mode 100644 index 0000000..b7fd4e6 Binary files /dev/null and b/themes/default/images/icons/transmit_add.png differ diff --git a/themes/default/images/icons/transmit_blue.png b/themes/default/images/icons/transmit_blue.png new file mode 100644 index 0000000..7b1142f Binary files /dev/null and b/themes/default/images/icons/transmit_blue.png differ diff --git a/themes/default/images/icons/transmit_delete.png b/themes/default/images/icons/transmit_delete.png new file mode 100644 index 0000000..3d72be2 Binary files /dev/null and b/themes/default/images/icons/transmit_delete.png differ diff --git a/themes/default/images/icons/transmit_edit.png b/themes/default/images/icons/transmit_edit.png new file mode 100644 index 0000000..eb9a3dd Binary files /dev/null and b/themes/default/images/icons/transmit_edit.png differ diff --git a/themes/default/images/icons/transmit_error.png b/themes/default/images/icons/transmit_error.png new file mode 100644 index 0000000..fd1d449 Binary files /dev/null and b/themes/default/images/icons/transmit_error.png differ diff --git a/themes/default/images/icons/transmit_go.png b/themes/default/images/icons/transmit_go.png new file mode 100644 index 0000000..10137e5 Binary files /dev/null and b/themes/default/images/icons/transmit_go.png differ diff --git a/themes/default/images/icons/tux.png b/themes/default/images/icons/tux.png new file mode 100644 index 0000000..bbefe2e Binary files /dev/null and b/themes/default/images/icons/tux.png differ diff --git a/themes/default/images/icons/user.png b/themes/default/images/icons/user.png new file mode 100644 index 0000000..79f35cc Binary files /dev/null and b/themes/default/images/icons/user.png differ diff --git a/themes/default/images/icons/user_add.png b/themes/default/images/icons/user_add.png new file mode 100644 index 0000000..deae99b Binary files /dev/null and b/themes/default/images/icons/user_add.png differ diff --git a/themes/default/images/icons/user_comment.png b/themes/default/images/icons/user_comment.png new file mode 100644 index 0000000..e54ebeb Binary files /dev/null and b/themes/default/images/icons/user_comment.png differ diff --git a/themes/default/images/icons/user_delete.png b/themes/default/images/icons/user_delete.png new file mode 100644 index 0000000..acbb563 Binary files /dev/null and b/themes/default/images/icons/user_delete.png differ diff --git a/themes/default/images/icons/user_edit.png b/themes/default/images/icons/user_edit.png new file mode 100644 index 0000000..c1974cd Binary files /dev/null and b/themes/default/images/icons/user_edit.png differ diff --git a/themes/default/images/icons/user_female.png b/themes/default/images/icons/user_female.png new file mode 100644 index 0000000..7c71de0 Binary files /dev/null and b/themes/default/images/icons/user_female.png differ diff --git a/themes/default/images/icons/user_go.png b/themes/default/images/icons/user_go.png new file mode 100644 index 0000000..0468cf0 Binary files /dev/null and b/themes/default/images/icons/user_go.png differ diff --git a/themes/default/images/icons/user_gray.png b/themes/default/images/icons/user_gray.png new file mode 100644 index 0000000..8fd539e Binary files /dev/null and b/themes/default/images/icons/user_gray.png differ diff --git a/themes/default/images/icons/user_green.png b/themes/default/images/icons/user_green.png new file mode 100644 index 0000000..30383c2 Binary files /dev/null and b/themes/default/images/icons/user_green.png differ diff --git a/themes/default/images/icons/user_orange.png b/themes/default/images/icons/user_orange.png new file mode 100644 index 0000000..b818127 Binary files /dev/null and b/themes/default/images/icons/user_orange.png differ diff --git a/themes/default/images/icons/user_red.png b/themes/default/images/icons/user_red.png new file mode 100644 index 0000000..c6f66e8 Binary files /dev/null and b/themes/default/images/icons/user_red.png differ diff --git a/themes/default/images/icons/user_suit.png b/themes/default/images/icons/user_suit.png new file mode 100644 index 0000000..b3454e1 Binary files /dev/null and b/themes/default/images/icons/user_suit.png differ diff --git a/themes/default/images/icons/vcard.png b/themes/default/images/icons/vcard.png new file mode 100644 index 0000000..c02f315 Binary files /dev/null and b/themes/default/images/icons/vcard.png differ diff --git a/themes/default/images/icons/vcard_add.png b/themes/default/images/icons/vcard_add.png new file mode 100644 index 0000000..2a68453 Binary files /dev/null and b/themes/default/images/icons/vcard_add.png differ diff --git a/themes/default/images/icons/vcard_delete.png b/themes/default/images/icons/vcard_delete.png new file mode 100644 index 0000000..b194b97 Binary files /dev/null and b/themes/default/images/icons/vcard_delete.png differ diff --git a/themes/default/images/icons/vcard_edit.png b/themes/default/images/icons/vcard_edit.png new file mode 100644 index 0000000..ab0f6e7 Binary files /dev/null and b/themes/default/images/icons/vcard_edit.png differ diff --git a/themes/default/images/icons/vector.png b/themes/default/images/icons/vector.png new file mode 100644 index 0000000..a1291c2 Binary files /dev/null and b/themes/default/images/icons/vector.png differ diff --git a/themes/default/images/icons/vector_add.png b/themes/default/images/icons/vector_add.png new file mode 100644 index 0000000..988770f Binary files /dev/null and b/themes/default/images/icons/vector_add.png differ diff --git a/themes/default/images/icons/vector_delete.png b/themes/default/images/icons/vector_delete.png new file mode 100644 index 0000000..ca139e0 Binary files /dev/null and b/themes/default/images/icons/vector_delete.png differ diff --git a/themes/default/images/icons/wand.png b/themes/default/images/icons/wand.png new file mode 100644 index 0000000..44ccbf8 Binary files /dev/null and b/themes/default/images/icons/wand.png differ diff --git a/themes/default/images/icons/weather_clouds.png b/themes/default/images/icons/weather_clouds.png new file mode 100644 index 0000000..3f73eaa Binary files /dev/null and b/themes/default/images/icons/weather_clouds.png differ diff --git a/themes/default/images/icons/weather_cloudy.png b/themes/default/images/icons/weather_cloudy.png new file mode 100644 index 0000000..5856e1d Binary files /dev/null and b/themes/default/images/icons/weather_cloudy.png differ diff --git a/themes/default/images/icons/weather_lightning.png b/themes/default/images/icons/weather_lightning.png new file mode 100644 index 0000000..1d42b36 Binary files /dev/null and b/themes/default/images/icons/weather_lightning.png differ diff --git a/themes/default/images/icons/weather_rain.png b/themes/default/images/icons/weather_rain.png new file mode 100644 index 0000000..cb3d54d Binary files /dev/null and b/themes/default/images/icons/weather_rain.png differ diff --git a/themes/default/images/icons/weather_snow.png b/themes/default/images/icons/weather_snow.png new file mode 100644 index 0000000..45bbdf1 Binary files /dev/null and b/themes/default/images/icons/weather_snow.png differ diff --git a/themes/default/images/icons/weather_sun.png b/themes/default/images/icons/weather_sun.png new file mode 100644 index 0000000..0156c26 Binary files /dev/null and b/themes/default/images/icons/weather_sun.png differ diff --git a/themes/default/images/icons/webcam.png b/themes/default/images/icons/webcam.png new file mode 100644 index 0000000..af71c30 Binary files /dev/null and b/themes/default/images/icons/webcam.png differ diff --git a/themes/default/images/icons/webcam_add.png b/themes/default/images/icons/webcam_add.png new file mode 100644 index 0000000..f02fcfa Binary files /dev/null and b/themes/default/images/icons/webcam_add.png differ diff --git a/themes/default/images/icons/webcam_delete.png b/themes/default/images/icons/webcam_delete.png new file mode 100644 index 0000000..bd6277f Binary files /dev/null and b/themes/default/images/icons/webcam_delete.png differ diff --git a/themes/default/images/icons/webcam_error.png b/themes/default/images/icons/webcam_error.png new file mode 100644 index 0000000..2faa706 Binary files /dev/null and b/themes/default/images/icons/webcam_error.png differ diff --git a/themes/default/images/icons/world.png b/themes/default/images/icons/world.png new file mode 100644 index 0000000..68f21d3 Binary files /dev/null and b/themes/default/images/icons/world.png differ diff --git a/themes/default/images/icons/world_add.png b/themes/default/images/icons/world_add.png new file mode 100644 index 0000000..6d0d7f7 Binary files /dev/null and b/themes/default/images/icons/world_add.png differ diff --git a/themes/default/images/icons/world_delete.png b/themes/default/images/icons/world_delete.png new file mode 100644 index 0000000..ffcd115 Binary files /dev/null and b/themes/default/images/icons/world_delete.png differ diff --git a/themes/default/images/icons/world_edit.png b/themes/default/images/icons/world_edit.png new file mode 100644 index 0000000..00794d4 Binary files /dev/null and b/themes/default/images/icons/world_edit.png differ diff --git a/themes/default/images/icons/world_go.png b/themes/default/images/icons/world_go.png new file mode 100644 index 0000000..aee9c97 Binary files /dev/null and b/themes/default/images/icons/world_go.png differ diff --git a/themes/default/images/icons/world_link.png b/themes/default/images/icons/world_link.png new file mode 100644 index 0000000..b8edc12 Binary files /dev/null and b/themes/default/images/icons/world_link.png differ diff --git a/themes/default/images/icons/wrench.png b/themes/default/images/icons/wrench.png new file mode 100644 index 0000000..5c8213f Binary files /dev/null and b/themes/default/images/icons/wrench.png differ diff --git a/themes/default/images/icons/wrench_orange.png b/themes/default/images/icons/wrench_orange.png new file mode 100644 index 0000000..565a933 Binary files /dev/null and b/themes/default/images/icons/wrench_orange.png differ diff --git a/themes/default/images/icons/xhtml.png b/themes/default/images/icons/xhtml.png new file mode 100644 index 0000000..da5dbf2 Binary files /dev/null and b/themes/default/images/icons/xhtml.png differ diff --git a/themes/default/images/icons/xhtml_add.png b/themes/default/images/icons/xhtml_add.png new file mode 100644 index 0000000..bbaf784 Binary files /dev/null and b/themes/default/images/icons/xhtml_add.png differ diff --git a/themes/default/images/icons/xhtml_delete.png b/themes/default/images/icons/xhtml_delete.png new file mode 100644 index 0000000..157b520 Binary files /dev/null and b/themes/default/images/icons/xhtml_delete.png differ diff --git a/themes/default/images/icons/xhtml_go.png b/themes/default/images/icons/xhtml_go.png new file mode 100644 index 0000000..43cf814 Binary files /dev/null and b/themes/default/images/icons/xhtml_go.png differ diff --git a/themes/default/images/icons/xhtml_valid.png b/themes/default/images/icons/xhtml_valid.png new file mode 100644 index 0000000..d2e1cfb Binary files /dev/null and b/themes/default/images/icons/xhtml_valid.png differ diff --git a/themes/default/images/icons/zoom.png b/themes/default/images/icons/zoom.png new file mode 100644 index 0000000..908612e Binary files /dev/null and b/themes/default/images/icons/zoom.png differ diff --git a/themes/default/images/icons/zoom_in.png b/themes/default/images/icons/zoom_in.png new file mode 100644 index 0000000..cdf0a52 Binary files /dev/null and b/themes/default/images/icons/zoom_in.png differ diff --git a/themes/default/images/icons/zoom_out.png b/themes/default/images/icons/zoom_out.png new file mode 100644 index 0000000..07bf98a Binary files /dev/null and b/themes/default/images/icons/zoom_out.png differ diff --git a/themes/default/images/links.gif b/themes/default/images/links.gif new file mode 100644 index 0000000..0064c67 Binary files /dev/null and b/themes/default/images/links.gif differ diff --git a/themes/default/images/members.gif b/themes/default/images/members.gif new file mode 100644 index 0000000..bc98a50 Binary files /dev/null and b/themes/default/images/members.gif differ diff --git a/themes/default/images/navigation.gif b/themes/default/images/navigation.gif new file mode 100644 index 0000000..2fe4ad1 Binary files /dev/null and b/themes/default/images/navigation.gif differ diff --git a/themes/default/images/projectx.png b/themes/default/images/projectx.png new file mode 100644 index 0000000..03d036c Binary files /dev/null and b/themes/default/images/projectx.png differ diff --git a/themes/default/images/rdo_off.png b/themes/default/images/rdo_off.png new file mode 100644 index 0000000..5761970 Binary files /dev/null and b/themes/default/images/rdo_off.png differ diff --git a/themes/default/images/rdo_on.png b/themes/default/images/rdo_on.png new file mode 100644 index 0000000..058ad26 Binary files /dev/null and b/themes/default/images/rdo_on.png differ diff --git a/themes/default/images/up.gif b/themes/default/images/up.gif new file mode 100644 index 0000000..c5ef548 Binary files /dev/null and b/themes/default/images/up.gif differ diff --git a/themes/default/images/yellow.gif b/themes/default/images/yellow.gif new file mode 100644 index 0000000..2babccb Binary files /dev/null and b/themes/default/images/yellow.gif differ diff --git a/themes/default/index.html b/themes/default/index.html new file mode 100644 index 0000000..7676b73 --- /dev/null +++ b/themes/default/index.html @@ -0,0 +1,102 @@ + + + + + + + + +andreas04: close to attraction + + + +
    +
    +

    close to attraction

    +

    the andreas04 template

    +
    + + + +
    +
    +
    +

    With a touch from the old school...

    +Entry photo example

    So here it is, my first design with classic .gif animation here on OSWD.org. And maybe my last, since I find the .gif format outdated and mostly annoying. If you feel the same, you can still enjoy this design: It is really easy to remove the animations and images - see the comments in the stylesheet for instructions.

    + +

    Standards and accessibility compliancy

    +

    Despite the classic influences and the animated visuals, the coding is very simple and modern. No Flash or scripts have been used, only valid XHTML 1.1 and CSS2. Because of that, the design works in most browsers, even in text-based browsers. The design also complies to Section 508 and a WCAG 1.0 Double-A rating.

    +

    Edit: Removed the alternate version, since it didn't display correctly in IE. Thanks marcus!

    +

    September 24, 2005 Posted by Andreas | Tags: Design, XHTML, CSS | 14 comments

    +
    + +
    +

    Open source

    +

    If you like this layout and would like to use it in any way, you are free to do so. This design is released as open source, which means that you are free to make any changes you may want to. I kindly ask that you leave the "Design by Andreas Viklund" link in the footer, I would really appreciate that! If you use this design for commercial purposes, please consider making a symbolic donation through my website.

    + +

    Also, if you would use this design to build a theme or template set for WordPress, Textpattern, MovableType or any other interesting blog/CMS package, I would be glad to distribute it through the free template support section of my website. If you have any comments or questions, or if you are interested in custom design or branding services, you are welcome to contact me through OSWD.org.

    +

    September 22, 2005 Posted by Andreas | Tags: Information, Copyright | No comments

    +
    + + +
    + + + +
    + + \ No newline at end of file diff --git a/themes/default/index.tpl b/themes/default/index.tpl new file mode 100644 index 0000000..1db3d29 --- /dev/null +++ b/themes/default/index.tpl @@ -0,0 +1,10 @@ +{$header} +
    +{$leftnav} +
    +
    +{$content} +
    + diff --git a/themes/default/left_nav.tpl b/themes/default/left_nav.tpl new file mode 100644 index 0000000..deae412 --- /dev/null +++ b/themes/default/left_nav.tpl @@ -0,0 +1,3 @@ +
    +{$leftnav} +
    diff --git a/themes/default/login.tpl b/themes/default/login.tpl new file mode 100644 index 0000000..d770308 --- /dev/null +++ b/themes/default/login.tpl @@ -0,0 +1,13 @@ +

    Einloggen

    + +
    + Username:
    +
    + Passwort:
    +
    +
    + + +
    +
    +
    diff --git a/themes/default/lostpw.tpl b/themes/default/lostpw.tpl new file mode 100644 index 0000000..1249418 --- /dev/null +++ b/themes/default/lostpw.tpl @@ -0,0 +1,14 @@ +

    Passwort verloren

    +{$emsg} +

    Passwort weg?

    +

    Kein Problem. Hier kannst du einfach ein neues anfordern.
    +Gib dazu einfach deinen Usernamen und die Mailadresse deines Accounts ein.

    + +
    + Username:
    +
    + E-Mail:
    +
    + +
    +
    diff --git a/themes/default/lostpw_mail.tpl b/themes/default/lostpw_mail.tpl new file mode 100644 index 0000000..d15254e --- /dev/null +++ b/themes/default/lostpw_mail.tpl @@ -0,0 +1,14 @@ +Hallo {$username}! + +Wir haben mitbekommen das du dein Passwort verloren hast. + +Keine Panik. +Benutze einfach folgenden Link um dir dein neues Passwort zusenden zu lassen: +{$url} + +Solltest du kein neues Passwort angefordert haben, ignoriere diese Mail ganz einfach. + +Liebe Grüsse + +Dein +{$sitename}-Team diff --git a/themes/default/lostpw_mail_pw.tpl b/themes/default/lostpw_mail_pw.tpl new file mode 100644 index 0000000..85ddc23 --- /dev/null +++ b/themes/default/lostpw_mail_pw.tpl @@ -0,0 +1,14 @@ +Hallo {$username}! + +Hier dein neues Passwort: + +{$passwort} + +Du kannst dich nun ganz normal in deinen Account einloggen. + +Bitte denk daran sofort ein neues Passwort festzulegen. + +Liebe Grüsse + +Dein +{$sitename}-Team diff --git a/themes/default/message.tpl b/themes/default/message.tpl new file mode 100644 index 0000000..a98582c --- /dev/null +++ b/themes/default/message.tpl @@ -0,0 +1,2 @@ +

    {$messagetitle}

    +{$message} diff --git a/themes/default/nav.tpl b/themes/default/nav.tpl new file mode 100644 index 0000000..51269fc --- /dev/null +++ b/themes/default/nav.tpl @@ -0,0 +1,2 @@ + +

    {$navcontent}

    diff --git a/themes/default/nav_login.tpl b/themes/default/nav_login.tpl new file mode 100644 index 0000000..12ffb1b --- /dev/null +++ b/themes/default/nav_login.tpl @@ -0,0 +1,12 @@ + +
    + Username:
    +
    + Passwort:
    +
    +
    + + +
    Passwort vergessen?
    +Registrieren
    +
    diff --git a/themes/default/nav_menu.tpl b/themes/default/nav_menu.tpl new file mode 100644 index 0000000..3b8444c --- /dev/null +++ b/themes/default/nav_menu.tpl @@ -0,0 +1,5 @@ + +

    {$navtitle}

    + diff --git a/themes/default/nav_mod.tpl b/themes/default/nav_mod.tpl new file mode 100644 index 0000000..25b1bea --- /dev/null +++ b/themes/default/nav_mod.tpl @@ -0,0 +1,4 @@ +

    {$navtitle}

    +Comics freischalten
    ({$queued} {if $queued==1}wartet{else}warten{/if})

    +Profil bearbeiten
    +System verwalten diff --git a/themes/default/nav_search.tpl b/themes/default/nav_search.tpl new file mode 100644 index 0000000..9cc27d7 --- /dev/null +++ b/themes/default/nav_search.tpl @@ -0,0 +1,10 @@ +
    +
    +

    {$navtitle}

    +
    +

    +
    +


    +Erweiterte Suche

    +
    +
    diff --git a/themes/default/nav_stats.tpl b/themes/default/nav_stats.tpl new file mode 100644 index 0000000..eb30bb0 --- /dev/null +++ b/themes/default/nav_stats.tpl @@ -0,0 +1,6 @@ + +

    +User:
    +Registrierte Benutzer: {$stats.users}
    +Neuerster Benutzer:
    {$stats.lastusername}
    +
    diff --git a/themes/default/nav_tag.tpl b/themes/default/nav_tag.tpl new file mode 100644 index 0000000..e42970b --- /dev/null +++ b/themes/default/nav_tag.tpl @@ -0,0 +1,5 @@ +

    Tagcloud

    +

    +

    +{$tagcloud} +

    diff --git a/themes/default/nav_welcome.tpl b/themes/default/nav_welcome.tpl new file mode 100644 index 0000000..2806f26 --- /dev/null +++ b/themes/default/nav_welcome.tpl @@ -0,0 +1,7 @@ + +

    Hallo, {$username}
    +{if $admincenter==1} + Admincenter
    +{/if} + User-CP
    + Ausloggen

    diff --git a/themes/default/navmain.tpl b/themes/default/navmain.tpl new file mode 100644 index 0000000..e957ca5 --- /dev/null +++ b/themes/default/navmain.tpl @@ -0,0 +1 @@ +{$nav} diff --git a/themes/default/r_nav.tpl b/themes/default/r_nav.tpl new file mode 100644 index 0000000..bcdd840 --- /dev/null +++ b/themes/default/r_nav.tpl @@ -0,0 +1,5 @@ +
    +
    +

    {$navtitle}

    +

    {$navcontent}

    +
    diff --git a/themes/default/register.tpl b/themes/default/register.tpl new file mode 100644 index 0000000..0f467c2 --- /dev/null +++ b/themes/default/register.tpl @@ -0,0 +1,43 @@ +

    Registrieren

    + +{$emsg} +
    +
    +Grunddaten +
    Username:
    +
    +
    + E-Mail:
    +
    +
    Passwort:
    +
    +
    + Passwort wiederholen:
    +
    +
    Realer Name:
    +
    +
    + Herkunft:
    +
    +
    / Geschlecht:
    +
    +
    + Geburtstag:
    +
    +
    +
    +{if $captcha != ""} +Captcha +
    Captcha:
    +{$captcha} +
    +
    +{/if} + benötigtes Feld
    + +
    +
    diff --git a/themes/default/register_mail.tpl b/themes/default/register_mail.tpl new file mode 100644 index 0000000..7ea7ccf --- /dev/null +++ b/themes/default/register_mail.tpl @@ -0,0 +1,12 @@ +Hallo {$username}! + +Du (oder jemand der sich für dich hält) hast dich auf {$sitename} registriert. + +Wir freuen uns das du zu uns gestossen bist. +Um deinen Account freizuschalten benutze einfach folgenden Link: +{$url} + +Liebe Grüsse + +Dein +{$sitename}-Team diff --git a/themes/default/right_nav.tpl b/themes/default/right_nav.tpl new file mode 100644 index 0000000..fce640c --- /dev/null +++ b/themes/default/right_nav.tpl @@ -0,0 +1,3 @@ + diff --git a/themes/default/style.css b/themes/default/style.css new file mode 100644 index 0000000..9a98f64 --- /dev/null +++ b/themes/default/style.css @@ -0,0 +1,299 @@ + +body{ + font: normal 12px/24px Verdana, Arial, Helvetica, sans-serif; + margin: 0; + padding: 0; + background: url("images/background.gif"); + text-align: center; +} +div{ + font-family: Arial, Helvetica; + font-size: 11px; +} +a{ + color: #6699FF; +} +a:hover{ + color: #cccccc; +} +img{ + border:0px; + text-decoration:none; +} +#sitetitle{ + width: 875px; + margin: 0 auto; + padding: 5px; + text-align: left; + border-right: 1px solid #d1d1d1; + border-left: 1px solid #d1d1d1; + border-bottom:1px solid #D1D1D1; + background-color: #fcfcfc; +} +#container{ + width: 875px; + margin: 0 auto; + padding: 5px; + text-align: left; + border-right: 1px solid #d1d1d1; + border-left: 1px solid #d1d1d1; + border-bottom:1px solid #D1D1D1; + background-color: #fcfcfc; +} +#left{ + float: left; + width: 180px; + padding-top:5px; + margin: 0; + border-right: 1px solid #cccccc; +} +.menuitem_green{ + width: 175px; + height: 50px; + text-align: right; + background-image: url("images/green.gif"); +} +.menuitem_blue{ + width: 175px; + height: 50px; + text-align: right; + background-image: url("images/blue.gif"); +} +.menuitem_yellow{ + width: 175px; + height: 50px; + text-align: right; + background-image: url("images/yellow.gif"); +} +.menuitem_text{ + font-size:15px; + font-weight:bold; + text-decoration: bold; + font-variant:small-caps; + color: #FFFFFF; + padding:20px 12px 0 0; +} +#left ul{ + list-style-type: none; + margin: 0; + padding: 0; +} +#left li{ + text-indent: 1em; +} +#left li a{ + color: #6699ff; + text-decoration: none; +} +#left li a:hover{ + text-decoration: underline; +} +#left p{ + margin: 1px; + padding-left: 1em; +} +#left form{ + padding: 1em 0 0 0; + margin: 0; +} +#left form input{ + margin: 0.2em 0; + background-color: #f3f3f3; + border: 1px solid #333333; + width: 125px; + font: 11px/22px Arial, Helvetica, sans-serif; + padding: 0.2em; +} +#left form .button{ + width: 75px; + background-color: #6699FF; + padding: 0; + margin: 0; +} +#content{ + border-left:1px solid #CCCCCC; + border-right:1px solid #CCCCCC; + float:left; + margin-left:-1px; + margin-right:-1px; + margin-top:-5px; + min-height:300px; + padding-left:1em; + padding-right:1em; + padding-top:5px; + width:487px; +} +#minimal_content{ + float:left; + margin-left:-1px; + margin-right:-1px; + margin-top:-5px; + min-height:100px; + padding-left:1em; + padding-right:1em; + padding-top:5px; + width:860px; +} +#minimal_content h2{ + background-color: #B2EA6A; + text-indent: 1em; + font-size: 12px; + font-variant: small-caps; + color: #ffffff; + margin: 0; +} +#minimal_content h1{ + background-color:#B2EA6A; + color:#FFFFFF; + font-size:25px; + font-variant:small-caps; + height:25px; + margin:0; + text-indent:15px; +} +#minimal_content p{ + margin: 0; + padding: 1em; +} + +#content h2{ + background-color: #B2EA6A; + text-indent: 1em; + font-size: 12px; + font-variant: small-caps; + color: #ffffff; + margin: 0; +} +#content h1{ + background-color:#B2EA6A; + color:#FFFFFF; + font-size:25px; + font-variant:small-caps; + height:25px; + margin:0; + text-indent:15px; +} +#content p{ + margin: 0; + padding: 1em; +} +#right{ + width: 180px; + float: right; + background-color: #f9f9f9; + /*border-left:1px solid #CCCCCC;*/ + padding-top:5px; + padding-left:7px; + margin-right:-5px; + margin-bottom: 1em; +} +#right p{ + margin: 1px; + padding-left: 1em; +} +#right form{ + margin: 1px; + padding-left: 1em; +} +#right form input{ + margin: 0.2em 0; + background-color: #f3f3f3; + border: 1px solid #333333; + width: 125px; + font: 11px/22px Arial, Helvetica, sans-serif; + padding: 0.2em; +} +#right form .button{ + width: 75px; + background-color: #6699FF; + padding: 0; + margin: 0; +} +#header{ + width: 175px; + height: 50px; + background-image: url("images/header.gif"); + float: right; + padding: 0; + margin: 0; + margin-bottom: 1em; +} +#header h3{ + font: 16px verdana, arial; + color: #ffffff; + padding: 25px 10px 5px 0; + margin: 0; + font-weight: bold; + text-align: right; +} +#right form label{ + background-position:0 5px; + background-repeat:no-repeat; + clear:both; + margin-bottom:2px; + margin-right:3px; + padding-left:0.5em; + cursor:pointer; + padding:0.5em 0.5em 0.5em 20px; +} + +#left form label{ + background-position:0 5px; + background-repeat:no-repeat; + clear:both; + margin-bottom:2px; + margin-right:3px; + padding-left:0.5em; + cursor:pointer; + padding:0.5em 0.5em 0.5em 20px; +} + +#minimal_content form label{ + background-position:0 5px; + background-repeat:no-repeat; + clear:both; + margin-bottom:2px; + margin-right:3px; + padding-left:0.5em; + cursor:pointer; + padding:0.5em 0.5em 0.5em 20px; +} +.unchecked { + background-image:url("images/chk_off.png"); +} +.checked { + background-image:url("images/chk_on.png"); +} +.unselected { + background-image:url("images/rdo_off.png"); +} +.selected { + background-image:url("images/rdo_on.png"); +} +.sortcol { + cursor: pointer; + padding-right: 20px; + background-repeat: no-repeat; + background-position: right center; +} +.sortasc { + background-color: #DDFFAC; + background-image: url("images/up.gif"); +} +.sortdesc { + background-color: #B9DDFF; + background-image: url("images/down.gif"); +} +.nosort { + cursor: default; +} + +#footer{ + clear: both; + text-align: center; + margin: 0; + padding: 0; + background-color: #f9f9f9; + border: 1px solid #cccccc; +} + diff --git a/themes/default/usercp.tpl b/themes/default/usercp.tpl new file mode 100644 index 0000000..1d146b2 --- /dev/null +++ b/themes/default/usercp.tpl @@ -0,0 +1,39 @@ +

    User Control Panel

    + +{$emsg} +
    +
    +Grunddaten +
    altes Passwort:
    +
    +
    + E-Mail:
    +
    +
    neues Passwort:
    +
    + +
    Realer Name:
    +
    + +
    + neues Passwort wiederholen:
    +
    + Herkunft:
    +
    +
    + Geburtstag:
    +
    + + +
    / Geschlecht:
    +
    +
    +
    + benötigtes Feld
    + + + diff --git a/themes/index.html b/themes/index.html new file mode 100644 index 0000000..b17d232 --- /dev/null +++ b/themes/index.html @@ -0,0 +1,95 @@ + + + +andreas06: falling leaves + + + + + + + + +
    +

    Skip to: site menu | section menu | main content

    + +
    +

    andreas06: falling leaves

    +It is all about colors... + +
    + + + +
    +
    + +
    +Currently viewing: andreas06: Falling leaves » Front page +
    + +
    + +

    Use the navigation tabs to read more about the template and to see alternative layouts and features.

    +

    Example menu:

    + +
    + +
    +

    Template info:

    +

    andreas06 is built with valid XHTML 1.1 and CSS2. It conforms to section 508 and a WCAG 1.0 AAA rating. It has full support for browser-based font-resizing, 100% readable also even in text-based browsers.

    +

    /Andreas

    + +

    Links:

    +

    +My website
    +Free templates
    +Baygroove.com
    +Open Web Design
    +OSWD.org
    +sNews CMS
    +

    +

    andreas06 v1.2
    +(Nov 28, 2005)

    +
    + + +
    +

    Welcome to "falling leaves"...

    +Gravatar example +

    ...also known as "andreas06", yet another open source template by Andreas. This one has a lot of useful features, such as the two-level menu and a good set of formatting and layout styles!

    +

    Like in my other templates, the extra features are all built into the stylesheet. The simple structure of the code (all content is separated from the presentation) makes it easy to customize the look and feel of the design, and you get several layouts to choose from in the download zip. Click the menu tabs to view the examples.

    +

    The design is inspired by the colors of the fall, since the template was created as an entry in the Open Web Design "fall/autumn" competition in October 2005 (where it as awarded 1st place). The colors are picked from a photo of the local park, taken on Oct 1st.

    +

    Open source design

    +

    This template is released as open source, which means that you are free to use it in any way you may want to. If you like this design, you can download my other designs directly from my website (where you can also find a WordPress version of this theme) or from Open Web Design. Comments, questions and suggestions are always very welcome!

    +

    Back to top

    +
    +
    + + +
    + + diff --git a/thirdparty/SimpleOpenID.class.php b/thirdparty/SimpleOpenID.class.php new file mode 100644 index 0000000..65be2e5 --- /dev/null +++ b/thirdparty/SimpleOpenID.class.php @@ -0,0 +1,426 @@ +SetIdentity($_POST['openid_url']); + :: SET RETURN URL :: + $openid->SetApprovedURL('http://www.yoursite.com/return.php'); // Script which handles a response from OpenID Server + :: SET TRUST ROOT :: + $openid->SetTrustRoot('http://www.yoursite.com/'); + :: FETCH SERVER URL FROM IDENTITY PAGE :: [Note: It is recomended to cache this (Session, Cookie, Database)] + $openid->GetOpenIDServer(); // Returns false if server is not found + :: REDIRECT USER TO OPEN ID SERVER FOR APPROVAL :: + + :: (OPTIONAL) SET OPENID SERVER :: + $openid->SetOpenIDServer($server_url); // If you have cached previously this, you don't have to call GetOpenIDServer and set value this directly + + STEP 2) + Once user gets returned we must validate signature + :: VALIDATE REQUEST :: + true|false = $openid->ValidateWithServer(); + + ERRORS: + array = $openid->GetError(); // Get latest Error code + + FIELDS: + OpenID allowes you to retreive a profile. To set what fields you'd like to get use (accepts either string or array): + $openid->SetRequiredFields(array('email','fullname','dob','gender','postcode','country','language','timezone')); + or + $openid->SetOptionalFields('postcode'); + +IMPORTANT TIPS: +OPENID as is now, is not trust system. It is a great single-sign on method. If you want to +store information about OpenID in your database for later use, make sure you handle url identities +properly. +For example: + https://steve.myopenid.com/ + https://steve.myopenid.com + http://steve.myopenid.com/ + http://steve.myopenid.com + ... are representing one single user. Some OpenIDs can be in format openidserver.com/users/user/ - keep this in mind when storing identities + + To help you store an OpenID in your DB, you can use function: + $openid_db_safe = $openid->OpenID_Standarize($upenid); + This may not be comatible with current specs, but it works in current enviroment. Use this function to get openid + in one format like steve.myopenid.com (without trailing slashes and http/https). + Use output to insert Identity to database. Don't use this for validation - it may fail. + +*/ + +class SimpleOpenID{ + var $openid_url_identity; + var $openid_url_type; + var $openid_url_orig; + var $URLs = array(); + var $error = array(); + var $fields = array(); + + function SimpleOpenID(){ + if (!function_exists('curl_exec')) { + die('Error: Class SimpleOpenID requires curl extension to work'); + } + } + function SetOpenIDServer($a){ + $this->URLs['openid_server'] = $a; + } + function SetTrustRoot($a){ + $this->URLs['trust_root'] = $a; + } + function SetCancelURL($a){ + $this->URLs['cancel'] = $a; + } + function SetApprovedURL($a){ + $this->URLs['approved'] = $a; + } + function SetPolicyURL($a) { + $this->URLs['policyurl'] = $a; + } + function SetRequiredFields($a){ + if (is_array($a)){ + $this->fields['required'] = $a; + }else{ + $this->fields['required'][] = $a; + } + } + function SetOptionalFields($a){ + if (is_array($a)){ + $this->fields['optional'] = $a; + }else{ + $this->fields['optional'][] = $a; + } + } + function SetIdentity($a){ // Set Identity URL + $this->openid_url_orig = $a; + $this->openid_url_type = 1; + + $xriprefixes = array("xri://", "xri://\$ip*", "xri://\$dns*"); + $inameprefixes = array("=", "@", "+", "$", "!"); + + foreach ($inameprefixes as $prefix) { + if (substr($a, 0, 1) == $prefix) { + $this->openid_url_type = 2; + $this->openid_url_identity = $a; + return; + } + } + foreach ($xriprefixes as $prefix) { + if(substr($a, 0, strlen($prefix)) == $prefix) { + $a = substr($a, strlen($prefix), strlen($a)-strlen($prefix)); + $this->openid_url_type = 2; + $this->openid_url_identity = $a; + return; + } + } + if(substr($a, 0, 7) != 'http://') { + $a = 'http://'.$a; + // RS change - append a slash - Wordpress example remysharp.wordpress.com - not found + slash = ok. + if (substr($a, -1) != '/') $a .= '/'; + $this->openid_url_type = 1; + $this->openid_url_identity = $a; + return; + } + $this->openid_url_identity = $a; + } + function GetIdentity(){ // Get Identity + return $this->openid_url_identity; + } + function GetError(){ + $e = $this->error; + return array('code'=>$e[0],'description'=>$e[1]); + } + + function ErrorStore($code, $desc = null){ + $errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server using this identity.'; + if ($desc == null){ + $desc = $errs[$code]; + } + $this->error = array($code,$desc); + } + + function IsError(){ + if (count($this->error) > 0){ + return true; + }else{ + return false; + } + } + + function splitResponse($response) { + $r = array(); + $response = explode("\n", $response); + foreach($response as $line) { + $line = trim($line); + if ($line != "") { + @list($key, $value) = explode(":", $line, 2); + $r[trim($key)] = trim($value); + } + } + return $r; + } + + function OpenID_Standarize($openid_identity){ + if ($this->openid_url_type == 2) { + return $openid_identity; + } + + $u = parse_url(strtolower(trim($openid_identity))); + if ($u['path'] == '/'){ + $u['path'] = ''; + } + if(substr($u['path'],-1,1) == '/'){ + $u['path'] = substr($u['path'], 0, strlen($u['path'])-1); + } + if (isset($u['query'])){ // If there is a query string, then use identity as is + return $u['host'] . $u['path'] . '?' . $u['query']; + }else{ + return $u['host'] . $u['path']; + } + } + + function array2url($arr){ // converts associated array to URL Query String + if (!is_array($arr)){ + return false; + } + $query = ''; + foreach($arr as $key => $value){ + $query .= $key . "=" . $value . "&"; + } + return $query; + } + function CURL_Request($url, $method="GET", $params = "") { // Remember, SSL MUST BE SUPPORTED + if (is_array($params)) $params = $this->array2url($params); + + if ($this->openid_url_type == 2) { $url = 'http://xri.net/'.$url; } + + if ($method == 'GET' && $params != '') { + // mod the URL - but first check whether there's existing args - RS change + if (stripos($url, '?')) { + $url .= '&' . $params; + } else { + $url .= '?' . $params; + } + } + + $curl = curl_init($url); + + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_HTTPGET, ($method == "GET")); + curl_setopt($curl, CURLOPT_POST, ($method == "POST")); + + if ($this->openid_url_type == 2) { + $headers = array("Accept: application/xrds+xml"); + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); + } + + if ($method == "POST") curl_setopt($curl, CURLOPT_POSTFIELDS, $params); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + $response = curl_exec($curl); + + if (curl_errno($curl) == 0){ + $response; + }else{ + $this->ErrorStore('OPENID_CURL', curl_error($curl)); + } + return $response; + } + + function HTML2OpenIDServer($content) { + $get = array(); + // Get details of their OpenID server and (optional) delegate + $reg1 = '/]*rel="openid.server"[^>]*href="([^"]+)"[^>]*\/?>/i'; + $reg2 = '/]*href="([^"]+)"[^>]*rel="openid.server"[^>]*\/?>/i'; + + preg_match_all($reg1, $content, $matches1); + preg_match_all($reg1, $content, $matches2); + + // match on non-xhtml - RS change + preg_match_all(preg_replace('/"/', "'", $reg1), $content, $matches3); + preg_match_all(preg_replace('/"/', "'", $reg2), $content, $matches4); + + $servers = array_merge($matches1[1], $matches2[1], $matches3[1], $matches4[1]); + + $reg1 = '/]*rel="openid.delegate"[^>]*href="([^"]+)"[^>]*\/?>/i'; + $reg2 = '/]*href="([^"]+)"[^>]*rel="openid.delegate"[^>]*\/?>/i'; + + preg_match_all($reg1, $content, $matches1); + preg_match_all($reg2, $content, $matches2); + preg_match_all(preg_replace('/"/', "'", $reg1), $content, $matches3); + preg_match_all(preg_replace('/"/', "'", $reg2), $content, $matches4); + $delegates = array_merge($matches1[1], $matches2[1], $matches3[1], $matches4[1]); + + if (count($servers) == 0 && count($delegates) == 0) { + preg_match_all('/]*http-equiv="X-XRDS-Location"[^>]*content="([^"]+)"[^>]*\/>/i', $content, $matches3); + preg_match_all('/]*content="([^"]+)"[^>]*http-equiv="X-XRDS-Location"[^>]*\/>/i', $content, $matches4); + if ($matches3[1][0] != "") { $url = $matches3[1][0]; } + else if ($matches4[1][0] != "") { $url = $matches4[1][0]; } + if ($url != "") { + $response = $this->CURL_Request($url); + list($servers, $delegates) = $this->XRDS2OpenIDServer($response); + } + } + + $ret = array($servers, $delegates); + return $ret; + } + + function XRDS2OpenIDServer($content) { + $arrcon = explode("\n", $content); + $services = array(); + $delegates = array(); + $i=0; + while ($i < count($arrcon)) { + if (substr(trim($arrcon[$i]),0,8) == "]*>([^<]+)<\/URI>/i', $service, $matches1); + preg_match_all('/]*>([^<]+)<\/openid:Delegate>/i', $service, $matches2); + } + } + $servers = $matches1[1]; + $delegates = $matches2[1]; + $ret = array($servers, $delegates); + return $ret; + } + + function CheckHeadersForXRDS($content) { + $arrcon = explode("\n", $content); + $i = 0; + while ($i < count($arrcon)) { + if (substr($arrcon[$i],0,16) == "X-XRDS-Location:") { + $keyval = explode(':', $arrcon[$i], 2); + $newurl = trim($keyval[1]); + return $newurl; + } + $i++; + } + return ""; + } + + function GetOpenIDServer(){ + $response = $this->CURL_Request($this->openid_url_identity); + $xrds_url = $this->CheckHeadersForXRDS($response); + if ($xrds_url != "") { + $response = $this->CURL_Request($xrds_url); + list($servers, $delegates) = $this->XRDS2OpenIDServer($response); + } + else if ($this->openid_url_type == 1) { + list($servers, $delegates) = $this->HTML2OpenIDServer($response); + } + else if ($this->openid_url_type == 2) { + list($servers, $delegates) = $this->XRDS2OpenIDServer($response); + } + + if (count($servers) == 0){ + $this->ErrorStore('OPENID_NOSERVERSFOUND'); + return false; + } + if ($delegates[0] != ""){ + $this->openid_url_identity = $delegates[0]; + } + $this->SetOpenIDServer($servers[0]); + return $servers[0]; + } + + function GetRedirectURL(){ + $params = array(); + $params['openid.return_to'] = urlencode($this->URLs['approved']); + $params['openid.mode'] = 'checkid_setup'; + $params['openid.identity'] = urlencode($this->openid_url_identity); + $params['openid.trust_root'] = urlencode($this->URLs['trust_root']); + + if (count($this->fields['required']) > 0){ + $params['openid.sreg.required'] = implode(',',$this->fields['required']); + } + if (count($this->fields['optional']) > 0){ + $params['openid.sreg.optional'] = implode(',',$this->fields['optional']); + } + $params['openid.sreg.policy_url'] = urlencode($this->URLs['policyurl']); + + $join = stripos($this->URLs['openid_server'], '?') ? '&' : '?'; + + return $this->URLs['openid_server'] . $join. $this->array2url($params); + } + + function Redirect(){ + $redirect_to = $this->GetRedirectURL(); + if (headers_sent()){ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe) + echo ''; + }else{ // Default Header Redirect + header('Location: ' . $redirect_to); + } + } + + function ValidateWithServer(){ + $params = array( + 'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']), + 'openid.signed' => urlencode($_GET['openid_signed']), + 'openid.sig' => urlencode($_GET['openid_sig']) + ); + // Send only required parameters to confirm validity + $arr_signed = explode(",",str_replace('sreg.','sreg_',$_GET['openid_signed'])); + for ($i=0; $iGetOpenIDServer(); + + // print "
    ";
    +    // print_r($_GET);
    +    // print_r($params);
    +    // print_r($openid_server);
    +    // print "
    "; + + if ($openid_server == false){ + return false; + } + // RS change - GET => POST http://openid.net/specs/openid-authentication-1_1.html#mode_check_authentication + $response = $this->CURL_Request($openid_server,'POST',$params); + $data = $this->splitResponse($response); + + + if ($data['is_valid'] == "true") { + return true; + }else{ + return false; + } + } + +} + +?> \ No newline at end of file diff --git a/thirdparty/ckeditor/CHANGES.md b/thirdparty/ckeditor/CHANGES.md new file mode 100644 index 0000000..f1fb5c7 --- /dev/null +++ b/thirdparty/ckeditor/CHANGES.md @@ -0,0 +1,1080 @@ +CKEditor 4 Changelog +==================== + +## CKEditor 4.5.9 + +Fixed Issues: + +* [#10685](http://dev.ckeditor.com/ticket/10685): Fixed: Unreadable toolbar icons after updating to the new editor version. Fixed with [6876179](https://github.com/ckeditor/ckeditor-dev/commit/6876179db4ee97e786b07b8fd72e6b4120732185) in [ckeditor-dev](https://github.com/ckeditor/ckeditor-dev) and [6c9189f4](https://github.com/ckeditor/ckeditor-presets/commit/6c9189f46392d2c126854fe8889b820b8c76d291) in [ckeditor-presets](https://github.com/ckeditor/ckeditor-presets). +* [#14573](https://dev.ckeditor.com/ticket/14573): Fixed: Missing [Widget](http://ckeditor.com/addon/widget) drag handler CSS when there are multiple editor instances. +* [#14620](https://dev.ckeditor.com/ticket/14620): Fixed: Setting both the `min-height` style for the `` element and the `height` style for the `` element breaks the [Auto Grow](http://ckeditor.com/addon/autogrow) plugin. +* [#14538](http://dev.ckeditor.com/ticket/14538): Fixed: Keyboard focus goes into an embedded `'; +} + +var wHeight=0, wWidth=0, owHeight=0, owWidth=0; + +function initIframe(doc) { + var dir = tinyMCEPopup.editor.settings.directionality; + + doc.body.dir = dir; + + // Remove Gecko spellchecking + if (tinymce.isGecko) + doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); + + resizeInputs(); +} + +function resizeInputs() { + if (!tinymce.isIE) { + wHeight = self.innerHeight - 80; + wWidth = self.innerWidth - 18; + } else { + wHeight = document.body.clientHeight - 80; + wWidth = document.body.clientWidth - 18; + } + + var elm = document.getElementById('frmData'); + if (elm) { + elm.style.height = Math.abs(wHeight) + 'px'; + elm.style.width = Math.abs(wWidth) + 'px'; + } +} + +tinyMCEPopup.onInit.add(onLoadInit); diff --git a/thirdparty/tiny/plugins/paste/js/pastetext.js b/thirdparty/tiny/plugins/paste/js/pastetext.js new file mode 100644 index 0000000..2807387 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/js/pastetext.js @@ -0,0 +1,42 @@ +tinyMCEPopup.requireLangPack(); + +function saveContent() { + if (document.forms[0].htmlSource.value == '') { + tinyMCEPopup.close(); + return false; + } + + tinyMCEPopup.execCommand('mcePasteText', false, { + html : document.forms[0].htmlSource.value, + linebreaks : document.forms[0].linebreaks.checked + }); + + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); + + resizeInputs(); +} + +var wHeight=0, wWidth=0, owHeight=0, owWidth=0; + +function resizeInputs() { + if (!tinymce.isIE) { + wHeight = self.innerHeight-80; + wWidth = self.innerWidth-17; + } else { + wHeight = document.body.clientHeight-80; + wWidth = document.body.clientWidth-17; + } + + document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px'; + document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px'; +} + +tinyMCEPopup.onInit.add(onLoadInit); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/paste/js/pasteword.js b/thirdparty/tiny/plugins/paste/js/pasteword.js new file mode 100644 index 0000000..ea9c29c --- /dev/null +++ b/thirdparty/tiny/plugins/paste/js/pasteword.js @@ -0,0 +1,56 @@ +tinyMCEPopup.requireLangPack(); + +function saveContent() { + var html = document.getElementById("frmData").contentWindow.document.body.innerHTML; + + if (html == ''){ + tinyMCEPopup.close(); + return false; + } + + tinyMCEPopup.execCommand('mcePasteWord', false, html); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Fix for endless reloading in FF + window.setTimeout(createIFrame, 10); +} + +function createIFrame() { + document.getElementById('iframecontainer').innerHTML = ''; +} + +var wHeight=0, wWidth=0, owHeight=0, owWidth=0; + +function initIframe(doc) { + var dir = tinyMCEPopup.editor.settings.directionality; + + doc.body.dir = dir; + + // Remove Gecko spellchecking + if (tinymce.isGecko) + doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck"); + + resizeInputs(); +} + +function resizeInputs() { + if (!tinymce.isIE) { + wHeight = self.innerHeight - 80; + wWidth = self.innerWidth - 18; + } else { + wHeight = document.body.clientHeight - 80; + wWidth = document.body.clientWidth - 18; + } + + var elm = document.getElementById('frmData'); + if (elm) { + elm.style.height = Math.abs(wHeight) + 'px'; + elm.style.width = Math.abs(wWidth) + 'px'; + } +} + +tinyMCEPopup.onInit.add(onLoadInit); diff --git a/thirdparty/tiny/plugins/paste/langs/.svn/all-wcprops b/thirdparty/tiny/plugins/paste/langs/.svn/all-wcprops new file mode 100644 index 0000000..0db32d1 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/paste/langs +END +en_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/paste/langs/en_dlg.js +END +de_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/paste/langs/de_dlg.js +END diff --git a/thirdparty/tiny/plugins/paste/langs/.svn/entries b/thirdparty/tiny/plugins/paste/langs/.svn/entries new file mode 100644 index 0000000..f9fbd83 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/paste/langs +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +en_dlg.js +file + + + + +2009-06-08T19:44:28.000000Z +aa388d5558885cf8f4c6ec3eb4ca3a7a +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +228 + +de_dlg.js +file + + + + +2009-06-08T19:44:28.000000Z +8d6db4a1ef8689c0995222518bd8156a +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +264 + diff --git a/thirdparty/tiny/plugins/paste/langs/.svn/format b/thirdparty/tiny/plugins/paste/langs/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/paste/langs/.svn/text-base/de_dlg.js.svn-base b/thirdparty/tiny/plugins/paste/langs/.svn/text-base/de_dlg.js.svn-base new file mode 100644 index 0000000..ab0bd6b --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/.svn/text-base/de_dlg.js.svn-base @@ -0,0 +1,5 @@ +tinyMCE.addI18n('de.paste_dlg',{ +text_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen.", +text_linebreaks:"Zeilenumbr\u00FCche beibehalten", +word_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen." +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/paste/langs/.svn/text-base/en_dlg.js.svn-base b/thirdparty/tiny/plugins/paste/langs/.svn/text-base/en_dlg.js.svn-base new file mode 100644 index 0000000..823eb16 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/.svn/text-base/en_dlg.js.svn-base @@ -0,0 +1,5 @@ +tinyMCE.addI18n('en.paste_dlg',{ +text_title:"Use CTRL+V on your keyboard to paste the text into the window.", +text_linebreaks:"Keep linebreaks", +word_title:"Use CTRL+V on your keyboard to paste the text into the window." +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/paste/langs/de_dlg.js b/thirdparty/tiny/plugins/paste/langs/de_dlg.js new file mode 100644 index 0000000..ab0bd6b --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/de_dlg.js @@ -0,0 +1,5 @@ +tinyMCE.addI18n('de.paste_dlg',{ +text_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen.", +text_linebreaks:"Zeilenumbr\u00FCche beibehalten", +word_title:"Dr\u00FCcken Sie auf Ihrer Tastatur Strg+V, um den Text einzuf\u00FCgen." +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/paste/langs/en_dlg.js b/thirdparty/tiny/plugins/paste/langs/en_dlg.js new file mode 100644 index 0000000..823eb16 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/langs/en_dlg.js @@ -0,0 +1,5 @@ +tinyMCE.addI18n('en.paste_dlg',{ +text_title:"Use CTRL+V on your keyboard to paste the text into the window.", +text_linebreaks:"Keep linebreaks", +word_title:"Use CTRL+V on your keyboard to paste the text into the window." +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/paste/pastetext.htm b/thirdparty/tiny/plugins/paste/pastetext.htm new file mode 100644 index 0000000..0e0d99f --- /dev/null +++ b/thirdparty/tiny/plugins/paste/pastetext.htm @@ -0,0 +1,34 @@ + + + {#paste.paste_text_desc} + + + + + + +
    +
    {#paste.paste_text_desc}
    + +
    + +
    + +
    + +
    {#paste_dlg.text_title}
    + + + +
    +
    + +
    + +
    + +
    +
    +
    + + \ No newline at end of file diff --git a/thirdparty/tiny/plugins/paste/pasteword.htm b/thirdparty/tiny/plugins/paste/pasteword.htm new file mode 100644 index 0000000..f96d478 --- /dev/null +++ b/thirdparty/tiny/plugins/paste/pasteword.htm @@ -0,0 +1,29 @@ + + + + {#paste.paste_word_desc} + + + + + + +
    +
    {#paste.paste_word_desc}
    + +
    {#paste_dlg.word_title}
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/preview/.svn/all-wcprops b/thirdparty/tiny/plugins/preview/.svn/all-wcprops new file mode 100644 index 0000000..a4b0539 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 55 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 72 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview/editor_plugin.js +END +preview.html +K 25 +svn:wc:ra_dav:version-url +V 68 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview/preview.html +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 76 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview/editor_plugin_src.js +END +example.html +K 25 +svn:wc:ra_dav:version-url +V 68 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview/example.html +END diff --git a/thirdparty/tiny/plugins/preview/.svn/entries b/thirdparty/tiny/plugins/preview/.svn/entries new file mode 100644 index 0000000..e0f70b8 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/entries @@ -0,0 +1,167 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/preview +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +7bcbf12854d82cd45f7b4a9ec17f7391 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +988 + +jscripts +dir + +preview.html +file + + + + +2009-06-08T19:44:27.000000Z +68ed4a06f904c41e9ba8ad4997d6626c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +563 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +c24dd47c4c6bcf32f5059f077a8d9ad2 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1437 + +example.html +file + + + + +2009-06-08T19:44:27.000000Z +9b9290408ae10fa29ec29db60682be91 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +731 + diff --git a/thirdparty/tiny/plugins/preview/.svn/format b/thirdparty/tiny/plugins/preview/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/preview/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/preview/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..deb4bce --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this,css=tinymce.explode(ed.settings.content_css);t.editor=ed;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.join(','),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};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/preview/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/preview/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..b2d27f7 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,50 @@ +/** + * $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(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.join(','), + 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 diff --git a/thirdparty/tiny/plugins/preview/.svn/text-base/example.html.svn-base b/thirdparty/tiny/plugins/preview/.svn/text-base/example.html.svn-base new file mode 100644 index 0000000..4820222 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/text-base/example.html.svn-base @@ -0,0 +1,28 @@ + + + + + +Example of a custom preview page + + + +Editor contents:
    +
    + +
    + + + diff --git a/thirdparty/tiny/plugins/preview/.svn/text-base/preview.html.svn-base b/thirdparty/tiny/plugins/preview/.svn/text-base/preview.html.svn-base new file mode 100644 index 0000000..7c761d3 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/.svn/text-base/preview.html.svn-base @@ -0,0 +1,19 @@ + + + + + +{#preview.preview_desc} + + + + + diff --git a/thirdparty/tiny/plugins/preview/editor_plugin.js b/thirdparty/tiny/plugins/preview/editor_plugin.js new file mode 100644 index 0000000..deb4bce --- /dev/null +++ b/thirdparty/tiny/plugins/preview/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this,css=tinymce.explode(ed.settings.content_css);t.editor=ed;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.join(','),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};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/preview/editor_plugin_src.js b/thirdparty/tiny/plugins/preview/editor_plugin_src.js new file mode 100644 index 0000000..b2d27f7 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/editor_plugin_src.js @@ -0,0 +1,50 @@ +/** + * $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(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.join(','), + 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 diff --git a/thirdparty/tiny/plugins/preview/example.html b/thirdparty/tiny/plugins/preview/example.html new file mode 100644 index 0000000..4820222 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/example.html @@ -0,0 +1,28 @@ + + + + + +Example of a custom preview page + + + +Editor contents:
    +
    + +
    + + + diff --git a/thirdparty/tiny/plugins/preview/jscripts/.svn/all-wcprops b/thirdparty/tiny/plugins/preview/jscripts/.svn/all-wcprops new file mode 100644 index 0000000..ba99b52 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/jscripts/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview/jscripts +END +embed.js +K 25 +svn:wc:ra_dav:version-url +V 73 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/preview/jscripts/embed.js +END diff --git a/thirdparty/tiny/plugins/preview/jscripts/.svn/entries b/thirdparty/tiny/plugins/preview/jscripts/.svn/entries new file mode 100644 index 0000000..f0cfd35 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/jscripts/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/preview/jscripts +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +embed.js +file + + + + +2009-06-08T19:44:27.000000Z +39ebc57f44e1cc683724e1c1ff761894 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1938 + diff --git a/thirdparty/tiny/plugins/preview/jscripts/.svn/format b/thirdparty/tiny/plugins/preview/jscripts/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/preview/jscripts/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/preview/jscripts/.svn/text-base/embed.js.svn-base b/thirdparty/tiny/plugins/preview/jscripts/.svn/text-base/embed.js.svn-base new file mode 100644 index 0000000..6fe25de --- /dev/null +++ b/thirdparty/tiny/plugins/preview/jscripts/.svn/text-base/embed.js.svn-base @@ -0,0 +1,73 @@ +/** + * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. + */ + +function writeFlash(p) { + writeEmbed( + 'D27CDB6E-AE6D-11cf-96B8-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'application/x-shockwave-flash', + p + ); +} + +function writeShockWave(p) { + writeEmbed( + '166B1BCA-3F9C-11CF-8075-444553540000', + 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', + 'application/x-director', + p + ); +} + +function writeQuickTime(p) { + writeEmbed( + '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', + 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', + 'video/quicktime', + p + ); +} + +function writeRealMedia(p) { + writeEmbed( + 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', + 'audio/x-pn-realaudio-plugin', + p + ); +} + +function writeWindowsMedia(p) { + p.url = p.src; + writeEmbed( + '6BF52A52-394A-11D3-B153-00C04F79FAA6', + 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', + 'application/x-mplayer2', + p + ); +} + +function writeEmbed(cls, cb, mt, p) { + var h = '', n; + + h += ''; + + h += ''; + + h += ' + + + + +{#preview.preview_desc} + + + + + diff --git a/thirdparty/tiny/plugins/print/.svn/all-wcprops b/thirdparty/tiny/plugins/print/.svn/all-wcprops new file mode 100644 index 0000000..a8ba6c8 --- /dev/null +++ b/thirdparty/tiny/plugins/print/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/print +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 70 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/print/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/print/editor_plugin_src.js +END diff --git a/thirdparty/tiny/plugins/print/.svn/entries b/thirdparty/tiny/plugins/print/.svn/entries new file mode 100644 index 0000000..c2c21a3 --- /dev/null +++ b/thirdparty/tiny/plugins/print/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/print +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +6557fd2bd935aefa392ba71679edbebe +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +502 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +9609f12ff4498ef3bc889c830f63f99f +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +835 + diff --git a/thirdparty/tiny/plugins/print/.svn/format b/thirdparty/tiny/plugins/print/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/print/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/print/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/print/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..7d09a87 --- /dev/null +++ b/thirdparty/tiny/plugins/print/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.Print',{init:function(ed,url){ed.addCommand('mcePrint',function(){ed.getWin().print();});ed.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 diff --git a/thirdparty/tiny/plugins/print/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/print/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..cb37c11 --- /dev/null +++ b/thirdparty/tiny/plugins/print/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,31 @@ +/** + * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/thirdparty/tiny/plugins/print/editor_plugin.js b/thirdparty/tiny/plugins/print/editor_plugin.js new file mode 100644 index 0000000..7d09a87 --- /dev/null +++ b/thirdparty/tiny/plugins/print/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.Print',{init:function(ed,url){ed.addCommand('mcePrint',function(){ed.getWin().print();});ed.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 diff --git a/thirdparty/tiny/plugins/print/editor_plugin_src.js b/thirdparty/tiny/plugins/print/editor_plugin_src.js new file mode 100644 index 0000000..cb37c11 --- /dev/null +++ b/thirdparty/tiny/plugins/print/editor_plugin_src.js @@ -0,0 +1,31 @@ +/** + * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Print', { + init : function(ed, url) { + ed.addCommand('mcePrint', function() { + ed.getWin().print(); + }); + + ed.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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('print', tinymce.plugins.Print); +})(); diff --git a/thirdparty/tiny/plugins/safari/.svn/all-wcprops b/thirdparty/tiny/plugins/safari/.svn/all-wcprops new file mode 100644 index 0000000..d13600f --- /dev/null +++ b/thirdparty/tiny/plugins/safari/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 54 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/safari +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 71 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/safari/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 75 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/safari/editor_plugin_src.js +END +blank.htm +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/safari/blank.htm +END diff --git a/thirdparty/tiny/plugins/safari/.svn/entries b/thirdparty/tiny/plugins/safari/.svn/entries new file mode 100644 index 0000000..817091e --- /dev/null +++ b/thirdparty/tiny/plugins/safari/.svn/entries @@ -0,0 +1,130 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/safari +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +9d7a37a26a6773ae236ed7a75f4617da +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +8409 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +06e7285622fa79888f91661d12308c05 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +14053 + +blank.htm +file + + + + +2009-06-08T19:44:27.000000Z +c9a4909a579f24cd23fc0ae847e06241 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +15 + diff --git a/thirdparty/tiny/plugins/safari/.svn/format b/thirdparty/tiny/plugins/safari/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/safari/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/safari/.svn/text-base/blank.htm.svn-base b/thirdparty/tiny/plugins/safari/.svn/text-base/blank.htm.svn-base new file mode 100644 index 0000000..266808c --- /dev/null +++ b/thirdparty/tiny/plugins/safari/.svn/text-base/blank.htm.svn-base @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/thirdparty/tiny/plugins/safari/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/safari/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..4daac19 --- /dev/null +++ b/thirdparty/tiny/plugins/safari/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;function isEmpty(d,e,f){var w,n;w=d.createTreeWalker(e,NodeFilter.SHOW_ALL,null,false);while(n=w.nextNode()){if(f){if(!f(n))return false;}if(n.nodeType==3&&n.nodeValue&&/[^\s\u00a0]+/.test(n.nodeValue))return false;if(n.nodeType==1&&/^(HR|IMG|TABLE)$/.test(n.nodeName))return false;}return true;};tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b,r,n,s;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;s=ed.selection;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0){ed.setContent('


    ',{format:'raw'});n=b.firstChild;r=s.getRng();r.setStart(n,0);r.setEnd(n,0);s.setRng(r);}}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,ed.dom.processHTML(v)+'XX');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){var se,li,lic,r1,r2,n,sel,doc,be,af,pa;if(e.keyCode==13){sel=ed.selection;se=sel.getNode();if(e.shiftKey||ed.settings.force_br_newlines&&se.nodeName!='LI'){t._insertBR(ed);Event.cancel(e);}if(li=dom.getParent(se,'LI')){lic=dom.getParent(li,'OL,UL');doc=ed.getDoc();pa=dom.create('p');dom.add(pa,'br',{mce_bogus:"1"});if(isEmpty(doc,li)){if(n=dom.getParent(lic.parentNode,'LI,OL,UL'))return;n=dom.getParent(lic,'p,h1,h2,h3,h4,h5,h6,div')||lic;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(li);r2=doc.createRange();r2.setStartAfter(li);r2.setEndAfter(n);be=r1.cloneContents();af=r2.cloneContents();if(!isEmpty(doc,af))dom.insertAfter(af,n);dom.insertAfter(pa,n);if(!isEmpty(doc,be))dom.insertAfter(be,n);dom.remove(n);n=pa.firstChild;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(n);sel.setRng(r1);return Event.cancel(e);}}}});ed.onExecCommand.add(function(ed,cmd){var sel,dom,bl,bm;if(cmd=='InsertUnorderedList'||cmd=='InsertOrderedList'){sel=ed.selection;dom=ed.dom;if(bl=dom.getParent(sel.getNode(),function(n){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})){bm=sel.getBookmark();dom.remove(bl,1);sel.moveToBookmark(bm);}}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/
    <\/(h[1-6]|div|p|address|pre)>/g,'');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/safari/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/safari/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..34df5f4 --- /dev/null +++ b/thirdparty/tiny/plugins/safari/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,514 @@ +/** + * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit; + + function isEmpty(d, e, f) { + var w, n; + + w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false); + while (n = w.nextNode()) { + // Filter func + if (f) { + if (!f(n)) + return false; + } + + // Non whitespace text node + if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue)) + return false; + + // Is non text element byt still content + if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName)) + return false; + } + + return true; + }; + + tinymce.create('tinymce.plugins.Safari', { + init : function(ed) { + var t = this, dom; + + // Ignore on non webkit + if (!tinymce.isWebKit) + return; + + t.editor = ed; + t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; + t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; + + // Safari CreateLink command will not work correctly on images that is aligned + ed.addCommand('CreateLink', function(u, v) { + var n = ed.selection.getNode(), dom = ed.dom, a; + + if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) { + a = dom.create('a', {href : v}, n.cloneNode()); + n.parentNode.replaceChild(a, n); + ed.selection.select(a); + } else + ed.getDoc().execCommand("CreateLink", false, v); + }); + + ed.onPaste.add(function(ed, e) { + function removeStyles(e) { + e = e.target; + + if (e.nodeType == 1) { + e.style.cssText = ''; + + each(ed.dom.select('*', e), function(e) { + e.style.cssText = ''; + }); + } + }; + + Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles); + + window.setTimeout(function() { + Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles); + }, 0); + }); + + ed.onKeyUp.add(function(ed, e) { + var h, b, r, n, s; + + // If backspace or delete key + if (e.keyCode == 46 || e.keyCode == 8) { + b = ed.getBody(); + h = b.innerHTML; + s = ed.selection; + + // If there is no text content or images or hr elements then remove everything + if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) { + // Inject paragrah and bogus br + ed.setContent('


    ', {format : 'raw'}); + + // Move caret before bogus br + n = b.firstChild; + r = s.getRng(); + r.setStart(n, 0); + r.setEnd(n, 0); + s.setRng(r); + } + } + }); + + // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004 + ed.addCommand('FormatBlock', function(u, v) { + var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock); + + if (e) + dom.replace(dom.create(v), e, 1); + else + ed.getDoc().execCommand("FormatBlock", false, v); + }); + + // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382 + ed.addCommand('mceInsertContent', function(u, v) { + ed.getDoc().execCommand("InsertText", false, 'mce_marker'); + ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + 'XX'); + ed.selection.select(ed.dom.get('_mce_tmp')); + ed.getDoc().execCommand("Delete", false, ' '); + }); + + ed.onKeyPress.add(function(ed, e) { + var se, li, lic, r1, r2, n, sel, doc, be, af, pa; + + if (e.keyCode == 13) { + sel = ed.selection; + se = sel.getNode(); + + // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 + if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') { + t._insertBR(ed); + Event.cancel(e); + } + + // Workaround for DIV elements produced by Safari + if (li = dom.getParent(se, 'LI')) { + lic = dom.getParent(li, 'OL,UL'); + doc = ed.getDoc(); + + pa = dom.create('p'); + dom.add(pa, 'br', {mce_bogus : "1"}); + + if (isEmpty(doc, li)) { + // If list in list then use browser default behavior + if (n = dom.getParent(lic.parentNode, 'LI,OL,UL')) + return; + + n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic; + + // Create range from the start of block element to the list item + r1 = doc.createRange(); + r1.setStartBefore(n); + r1.setEndBefore(li); + + // Create range after the list to the end of block element + r2 = doc.createRange(); + r2.setStartAfter(li); + r2.setEndAfter(n); + + be = r1.cloneContents(); + af = r2.cloneContents(); + + if (!isEmpty(doc, af)) + dom.insertAfter(af, n); + + dom.insertAfter(pa, n); + + if (!isEmpty(doc, be)) + dom.insertAfter(be, n); + + dom.remove(n); + + n = pa.firstChild; + r1 = doc.createRange(); + r1.setStartBefore(n); + r1.setEndBefore(n); + sel.setRng(r1); + + return Event.cancel(e); + } + } + } + }); + + // Safari doesn't place lists outside block elements + ed.onExecCommand.add(function(ed, cmd) { + var sel, dom, bl, bm; + + if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') { + sel = ed.selection; + dom = ed.dom; + + if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) { + bm = sel.getBookmark(); + dom.remove(bl, 1); + sel.moveToBookmark(bm); + } + } + }); + + // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName == 'IMG') { + t.selElm = e; + ed.selection.select(e); + } else + t.selElm = null; + }); + + ed.onInit.add(function() { + t._fixWebKitSpans(); + + if (isOldWebKit) + t._patchSafari2x(ed); + }); + + ed.onSetContent.add(function() { + dom = ed.dom; + + // Convert strong,b,em,u,strike to spans + each(['strong','b','em','u','strike','sub','sup','a'], function(v) { + each(grep(dom.select(v)).reverse(), function(n) { + var nn = n.nodeName.toLowerCase(), st; + + // Convert anchors into images + if (nn == 'a') { + if (n.name) + dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n); + + return; + } + + switch (nn) { + case 'b': + case 'strong': + if (nn == 'b') + nn = 'strong'; + + st = 'font-weight: bold;'; + break; + + case 'em': + st = 'font-style: italic;'; + break; + + case 'u': + st = 'text-decoration: underline;'; + break; + + case 'sub': + st = 'vertical-align: sub;'; + break; + + case 'sup': + st = 'vertical-align: super;'; + break; + + case 'strike': + st = 'text-decoration: line-through;'; + break; + } + + dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1); + }); + }); + }); + + ed.onPreProcess.add(function(ed, o) { + dom = ed.dom; + + each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) { + var v, bg; + + if (o.get) { + if (dom.hasClass(n, 'Apple-style-span')) { + bg = n.style.backgroundColor; + + switch (dom.getAttrib(n, 'mce_name')) { + case 'font': + if (!ed.settings.convert_fonts_to_spans) + dom.setAttrib(n, 'style', ''); + break; + + case 'strong': + case 'em': + case 'sub': + case 'sup': + dom.setAttrib(n, 'style', ''); + break; + + case 'strike': + case 'u': + if (!ed.settings.inline_styles) + dom.setAttrib(n, 'style', ''); + else + dom.setAttrib(n, 'mce_name', ''); + + break; + + default: + if (!ed.settings.inline_styles) + dom.setAttrib(n, 'style', ''); + } + + + if (bg) + n.style.backgroundColor = bg; + } + } + + if (dom.hasClass(n, 'mceItemRemoved')) + dom.remove(n, 1); + }); + }); + + ed.onPostProcess.add(function(ed, o) { + // Safari adds BR at end of all block elements + o.content = o.content.replace(/
    <\/(h[1-6]|div|p|address|pre)>/g, ''); + + // Safari adds id="undefined" to HR elements + o.content = o.content.replace(/ id=\"undefined\"/g, ''); + }); + }, + + getInfo : function() { + return { + longname : 'Safari compatibility', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Internal methods + + _fixWebKitSpans : function() { + var t = this, ed = t.editor; + + if (!isOldWebKit) { + // Use mutator events on new WebKit + Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { + e = e.target; + + if (e && e.nodeType == 1) + t._fixAppleSpan(e); + }); + } else { + // Do post command processing in old WebKit since the browser crashes on Mutator events :( + ed.onExecCommand.add(function() { + each(ed.dom.select('span'), function(n) { + t._fixAppleSpan(n); + }); + + ed.nodeChanged(); + }); + } + }, + + _fixAppleSpan : function(e) { + var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p; + + if (dom.getAttrib(e, 'mce_fixed')) + return; + + // Handle Apple style spans + if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') { + st = e.style; + + if (!s.convert_fonts_to_spans) { + if (st.fontSize) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1); + } + + if (st.fontFamily) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setAttrib(e, 'face', st.fontFamily); + } + + if (st.color) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setAttrib(e, 'color', dom.toHex(st.color)); + } + + if (st.backgroundColor) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setStyle(e, 'background-color', st.backgroundColor); + } + } else { + if (st.fontSize) + dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]); + } + + if (st.fontWeight == 'bold') + dom.setAttrib(e, 'mce_name', 'strong'); + + if (st.fontStyle == 'italic') + dom.setAttrib(e, 'mce_name', 'em'); + + if (st.textDecoration == 'underline') + dom.setAttrib(e, 'mce_name', 'u'); + + if (st.textDecoration == 'line-through') + dom.setAttrib(e, 'mce_name', 'strike'); + + if (st.verticalAlign == 'super') + dom.setAttrib(e, 'mce_name', 'sup'); + + if (st.verticalAlign == 'sub') + dom.setAttrib(e, 'mce_name', 'sub'); + + dom.setAttrib(e, 'mce_fixed', '1'); + } + }, + + _patchSafari2x : function(ed) { + var t = this, setContent, getNode, dom = ed.dom, lr; + + // Inline dialogs + if (ed.windowManager.onBeforeOpen) { + ed.windowManager.onBeforeOpen.add(function() { + r = ed.selection.getRng(); + }); + } + + // Fake select on 2.x + ed.selection.select = function(n) { + this.getSel().setBaseAndExtent(n, 0, n, 1); + }; + + getNode = ed.selection.getNode; + ed.selection.getNode = function() { + return t.selElm || getNode.call(this); + }; + + // Fake range on Safari 2.x + ed.selection.getRng = function() { + var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di; + + // Fake range on Safari 2.x + if (s.anchorNode) { + r = d.createRange(); + + try { + // Setup before range + rb = d.createRange(); + rb.setStart(s.anchorNode, s.anchorOffset); + rb.collapse(1); + + // Setup after range + ra = d.createRange(); + ra.setStart(s.focusNode, s.focusOffset); + ra.collapse(1); + + // Setup start/end points by comparing locations + di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; + r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset); + r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset); + + lr = r; + } catch (ex) { + // Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!! + } + } + + return r || lr; + }; + + // Fix setContent so it works + setContent = ed.selection.setContent; + ed.selection.setContent = function(h, s) { + var r = this.getRng(), b; + + try { + setContent.call(this, h, s); + } catch (ex) { + // Workaround for Safari 2.x + b = dom.create('body'); + b.innerHTML = h; + + each(b.childNodes, function(n) { + r.insertNode(n.cloneNode(true)); + }); + } + }; + }, + + _insertBR : function(ed) { + var dom = ed.dom, s = ed.selection, r = s.getRng(), br; + + // Insert BR element + r.insertNode(br = dom.create('br')); + + // Place caret after BR + r.setStartAfter(br); + r.setEndAfter(br); + s.setRng(r); + + // Could not place caret after BR then insert an nbsp entity and move the caret + if (s.getSel().focusNode == br.previousSibling) { + s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); + s.collapse(1); + } + + // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 + ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y); + } + }); + + // Register plugin + tinymce.PluginManager.add('safari', tinymce.plugins.Safari); +})(); + diff --git a/thirdparty/tiny/plugins/safari/blank.htm b/thirdparty/tiny/plugins/safari/blank.htm new file mode 100644 index 0000000..266808c --- /dev/null +++ b/thirdparty/tiny/plugins/safari/blank.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/thirdparty/tiny/plugins/safari/editor_plugin.js b/thirdparty/tiny/plugins/safari/editor_plugin.js new file mode 100644 index 0000000..4daac19 --- /dev/null +++ b/thirdparty/tiny/plugins/safari/editor_plugin.js @@ -0,0 +1 @@ +(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;function isEmpty(d,e,f){var w,n;w=d.createTreeWalker(e,NodeFilter.SHOW_ALL,null,false);while(n=w.nextNode()){if(f){if(!f(n))return false;}if(n.nodeType==3&&n.nodeValue&&/[^\s\u00a0]+/.test(n.nodeValue))return false;if(n.nodeType==1&&/^(HR|IMG|TABLE)$/.test(n.nodeName))return false;}return true;};tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b,r,n,s;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;s=ed.selection;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0){ed.setContent('


    ',{format:'raw'});n=b.firstChild;r=s.getRng();r.setStart(n,0);r.setEnd(n,0);s.setRng(r);}}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,ed.dom.processHTML(v)+'XX');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){var se,li,lic,r1,r2,n,sel,doc,be,af,pa;if(e.keyCode==13){sel=ed.selection;se=sel.getNode();if(e.shiftKey||ed.settings.force_br_newlines&&se.nodeName!='LI'){t._insertBR(ed);Event.cancel(e);}if(li=dom.getParent(se,'LI')){lic=dom.getParent(li,'OL,UL');doc=ed.getDoc();pa=dom.create('p');dom.add(pa,'br',{mce_bogus:"1"});if(isEmpty(doc,li)){if(n=dom.getParent(lic.parentNode,'LI,OL,UL'))return;n=dom.getParent(lic,'p,h1,h2,h3,h4,h5,h6,div')||lic;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(li);r2=doc.createRange();r2.setStartAfter(li);r2.setEndAfter(n);be=r1.cloneContents();af=r2.cloneContents();if(!isEmpty(doc,af))dom.insertAfter(af,n);dom.insertAfter(pa,n);if(!isEmpty(doc,be))dom.insertAfter(be,n);dom.remove(n);n=pa.firstChild;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(n);sel.setRng(r1);return Event.cancel(e);}}}});ed.onExecCommand.add(function(ed,cmd){var sel,dom,bl,bm;if(cmd=='InsertUnorderedList'||cmd=='InsertOrderedList'){sel=ed.selection;dom=ed.dom;if(bl=dom.getParent(sel.getNode(),function(n){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})){bm=sel.getBookmark();dom.remove(bl,1);sel.moveToBookmark(bm);}}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/
    <\/(h[1-6]|div|p|address|pre)>/g,'');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/safari/editor_plugin_src.js b/thirdparty/tiny/plugins/safari/editor_plugin_src.js new file mode 100644 index 0000000..34df5f4 --- /dev/null +++ b/thirdparty/tiny/plugins/safari/editor_plugin_src.js @@ -0,0 +1,514 @@ +/** + * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit; + + function isEmpty(d, e, f) { + var w, n; + + w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false); + while (n = w.nextNode()) { + // Filter func + if (f) { + if (!f(n)) + return false; + } + + // Non whitespace text node + if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue)) + return false; + + // Is non text element byt still content + if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName)) + return false; + } + + return true; + }; + + tinymce.create('tinymce.plugins.Safari', { + init : function(ed) { + var t = this, dom; + + // Ignore on non webkit + if (!tinymce.isWebKit) + return; + + t.editor = ed; + t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; + t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; + + // Safari CreateLink command will not work correctly on images that is aligned + ed.addCommand('CreateLink', function(u, v) { + var n = ed.selection.getNode(), dom = ed.dom, a; + + if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) { + a = dom.create('a', {href : v}, n.cloneNode()); + n.parentNode.replaceChild(a, n); + ed.selection.select(a); + } else + ed.getDoc().execCommand("CreateLink", false, v); + }); + + ed.onPaste.add(function(ed, e) { + function removeStyles(e) { + e = e.target; + + if (e.nodeType == 1) { + e.style.cssText = ''; + + each(ed.dom.select('*', e), function(e) { + e.style.cssText = ''; + }); + } + }; + + Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles); + + window.setTimeout(function() { + Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles); + }, 0); + }); + + ed.onKeyUp.add(function(ed, e) { + var h, b, r, n, s; + + // If backspace or delete key + if (e.keyCode == 46 || e.keyCode == 8) { + b = ed.getBody(); + h = b.innerHTML; + s = ed.selection; + + // If there is no text content or images or hr elements then remove everything + if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) { + // Inject paragrah and bogus br + ed.setContent('


    ', {format : 'raw'}); + + // Move caret before bogus br + n = b.firstChild; + r = s.getRng(); + r.setStart(n, 0); + r.setEnd(n, 0); + s.setRng(r); + } + } + }); + + // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004 + ed.addCommand('FormatBlock', function(u, v) { + var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock); + + if (e) + dom.replace(dom.create(v), e, 1); + else + ed.getDoc().execCommand("FormatBlock", false, v); + }); + + // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382 + ed.addCommand('mceInsertContent', function(u, v) { + ed.getDoc().execCommand("InsertText", false, 'mce_marker'); + ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + 'XX'); + ed.selection.select(ed.dom.get('_mce_tmp')); + ed.getDoc().execCommand("Delete", false, ' '); + }); + + ed.onKeyPress.add(function(ed, e) { + var se, li, lic, r1, r2, n, sel, doc, be, af, pa; + + if (e.keyCode == 13) { + sel = ed.selection; + se = sel.getNode(); + + // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 + if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') { + t._insertBR(ed); + Event.cancel(e); + } + + // Workaround for DIV elements produced by Safari + if (li = dom.getParent(se, 'LI')) { + lic = dom.getParent(li, 'OL,UL'); + doc = ed.getDoc(); + + pa = dom.create('p'); + dom.add(pa, 'br', {mce_bogus : "1"}); + + if (isEmpty(doc, li)) { + // If list in list then use browser default behavior + if (n = dom.getParent(lic.parentNode, 'LI,OL,UL')) + return; + + n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic; + + // Create range from the start of block element to the list item + r1 = doc.createRange(); + r1.setStartBefore(n); + r1.setEndBefore(li); + + // Create range after the list to the end of block element + r2 = doc.createRange(); + r2.setStartAfter(li); + r2.setEndAfter(n); + + be = r1.cloneContents(); + af = r2.cloneContents(); + + if (!isEmpty(doc, af)) + dom.insertAfter(af, n); + + dom.insertAfter(pa, n); + + if (!isEmpty(doc, be)) + dom.insertAfter(be, n); + + dom.remove(n); + + n = pa.firstChild; + r1 = doc.createRange(); + r1.setStartBefore(n); + r1.setEndBefore(n); + sel.setRng(r1); + + return Event.cancel(e); + } + } + } + }); + + // Safari doesn't place lists outside block elements + ed.onExecCommand.add(function(ed, cmd) { + var sel, dom, bl, bm; + + if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') { + sel = ed.selection; + dom = ed.dom; + + if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) { + bm = sel.getBookmark(); + dom.remove(bl, 1); + sel.moveToBookmark(bm); + } + } + }); + + // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName == 'IMG') { + t.selElm = e; + ed.selection.select(e); + } else + t.selElm = null; + }); + + ed.onInit.add(function() { + t._fixWebKitSpans(); + + if (isOldWebKit) + t._patchSafari2x(ed); + }); + + ed.onSetContent.add(function() { + dom = ed.dom; + + // Convert strong,b,em,u,strike to spans + each(['strong','b','em','u','strike','sub','sup','a'], function(v) { + each(grep(dom.select(v)).reverse(), function(n) { + var nn = n.nodeName.toLowerCase(), st; + + // Convert anchors into images + if (nn == 'a') { + if (n.name) + dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n); + + return; + } + + switch (nn) { + case 'b': + case 'strong': + if (nn == 'b') + nn = 'strong'; + + st = 'font-weight: bold;'; + break; + + case 'em': + st = 'font-style: italic;'; + break; + + case 'u': + st = 'text-decoration: underline;'; + break; + + case 'sub': + st = 'vertical-align: sub;'; + break; + + case 'sup': + st = 'vertical-align: super;'; + break; + + case 'strike': + st = 'text-decoration: line-through;'; + break; + } + + dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1); + }); + }); + }); + + ed.onPreProcess.add(function(ed, o) { + dom = ed.dom; + + each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) { + var v, bg; + + if (o.get) { + if (dom.hasClass(n, 'Apple-style-span')) { + bg = n.style.backgroundColor; + + switch (dom.getAttrib(n, 'mce_name')) { + case 'font': + if (!ed.settings.convert_fonts_to_spans) + dom.setAttrib(n, 'style', ''); + break; + + case 'strong': + case 'em': + case 'sub': + case 'sup': + dom.setAttrib(n, 'style', ''); + break; + + case 'strike': + case 'u': + if (!ed.settings.inline_styles) + dom.setAttrib(n, 'style', ''); + else + dom.setAttrib(n, 'mce_name', ''); + + break; + + default: + if (!ed.settings.inline_styles) + dom.setAttrib(n, 'style', ''); + } + + + if (bg) + n.style.backgroundColor = bg; + } + } + + if (dom.hasClass(n, 'mceItemRemoved')) + dom.remove(n, 1); + }); + }); + + ed.onPostProcess.add(function(ed, o) { + // Safari adds BR at end of all block elements + o.content = o.content.replace(/
    <\/(h[1-6]|div|p|address|pre)>/g, ''); + + // Safari adds id="undefined" to HR elements + o.content = o.content.replace(/ id=\"undefined\"/g, ''); + }); + }, + + getInfo : function() { + return { + longname : 'Safari compatibility', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Internal methods + + _fixWebKitSpans : function() { + var t = this, ed = t.editor; + + if (!isOldWebKit) { + // Use mutator events on new WebKit + Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { + e = e.target; + + if (e && e.nodeType == 1) + t._fixAppleSpan(e); + }); + } else { + // Do post command processing in old WebKit since the browser crashes on Mutator events :( + ed.onExecCommand.add(function() { + each(ed.dom.select('span'), function(n) { + t._fixAppleSpan(n); + }); + + ed.nodeChanged(); + }); + } + }, + + _fixAppleSpan : function(e) { + var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p; + + if (dom.getAttrib(e, 'mce_fixed')) + return; + + // Handle Apple style spans + if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') { + st = e.style; + + if (!s.convert_fonts_to_spans) { + if (st.fontSize) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1); + } + + if (st.fontFamily) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setAttrib(e, 'face', st.fontFamily); + } + + if (st.color) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setAttrib(e, 'color', dom.toHex(st.color)); + } + + if (st.backgroundColor) { + dom.setAttrib(e, 'mce_name', 'font'); + dom.setStyle(e, 'background-color', st.backgroundColor); + } + } else { + if (st.fontSize) + dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]); + } + + if (st.fontWeight == 'bold') + dom.setAttrib(e, 'mce_name', 'strong'); + + if (st.fontStyle == 'italic') + dom.setAttrib(e, 'mce_name', 'em'); + + if (st.textDecoration == 'underline') + dom.setAttrib(e, 'mce_name', 'u'); + + if (st.textDecoration == 'line-through') + dom.setAttrib(e, 'mce_name', 'strike'); + + if (st.verticalAlign == 'super') + dom.setAttrib(e, 'mce_name', 'sup'); + + if (st.verticalAlign == 'sub') + dom.setAttrib(e, 'mce_name', 'sub'); + + dom.setAttrib(e, 'mce_fixed', '1'); + } + }, + + _patchSafari2x : function(ed) { + var t = this, setContent, getNode, dom = ed.dom, lr; + + // Inline dialogs + if (ed.windowManager.onBeforeOpen) { + ed.windowManager.onBeforeOpen.add(function() { + r = ed.selection.getRng(); + }); + } + + // Fake select on 2.x + ed.selection.select = function(n) { + this.getSel().setBaseAndExtent(n, 0, n, 1); + }; + + getNode = ed.selection.getNode; + ed.selection.getNode = function() { + return t.selElm || getNode.call(this); + }; + + // Fake range on Safari 2.x + ed.selection.getRng = function() { + var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di; + + // Fake range on Safari 2.x + if (s.anchorNode) { + r = d.createRange(); + + try { + // Setup before range + rb = d.createRange(); + rb.setStart(s.anchorNode, s.anchorOffset); + rb.collapse(1); + + // Setup after range + ra = d.createRange(); + ra.setStart(s.focusNode, s.focusOffset); + ra.collapse(1); + + // Setup start/end points by comparing locations + di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; + r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset); + r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset); + + lr = r; + } catch (ex) { + // Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!! + } + } + + return r || lr; + }; + + // Fix setContent so it works + setContent = ed.selection.setContent; + ed.selection.setContent = function(h, s) { + var r = this.getRng(), b; + + try { + setContent.call(this, h, s); + } catch (ex) { + // Workaround for Safari 2.x + b = dom.create('body'); + b.innerHTML = h; + + each(b.childNodes, function(n) { + r.insertNode(n.cloneNode(true)); + }); + } + }; + }, + + _insertBR : function(ed) { + var dom = ed.dom, s = ed.selection, r = s.getRng(), br; + + // Insert BR element + r.insertNode(br = dom.create('br')); + + // Place caret after BR + r.setStartAfter(br); + r.setEndAfter(br); + s.setRng(r); + + // Could not place caret after BR then insert an nbsp entity and move the caret + if (s.getSel().focusNode == br.previousSibling) { + s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); + s.collapse(1); + } + + // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 + ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y); + } + }); + + // Register plugin + tinymce.PluginManager.add('safari', tinymce.plugins.Safari); +})(); + diff --git a/thirdparty/tiny/plugins/save/.svn/all-wcprops b/thirdparty/tiny/plugins/save/.svn/all-wcprops new file mode 100644 index 0000000..da27d87 --- /dev/null +++ b/thirdparty/tiny/plugins/save/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 52 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/save +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/save/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 73 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/save/editor_plugin_src.js +END diff --git a/thirdparty/tiny/plugins/save/.svn/entries b/thirdparty/tiny/plugins/save/.svn/entries new file mode 100644 index 0000000..34d4d18 --- /dev/null +++ b/thirdparty/tiny/plugins/save/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/save +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +b9cc817b9e834924aca4af95b3d0c1bf +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1665 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +068c80f54b2a8704483b131579f1cdea +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2483 + diff --git a/thirdparty/tiny/plugins/save/.svn/format b/thirdparty/tiny/plugins/save/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/save/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/save/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/save/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..8a13e7d --- /dev/null +++ b/thirdparty/tiny/plugins/save/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.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(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return;tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}if(formObj){ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/save/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/save/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..9ec0440 --- /dev/null +++ b/thirdparty/tiny/plugins/save/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,98 @@ +/** + * $Id: editor_plugin_src.js 851 2008-05-26 15:38:49Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.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 + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/save/editor_plugin.js b/thirdparty/tiny/plugins/save/editor_plugin.js new file mode 100644 index 0000000..8a13e7d --- /dev/null +++ b/thirdparty/tiny/plugins/save/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.Save',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceSave',t._save,t);ed.addCommand('mceCancel',t._cancel,t);ed.addButton('save',{title:'save.save_desc',cmd:'mceSave'});ed.addButton('cancel',{title:'save.cancel_desc',cmd:'mceCancel'});ed.onNodeChange.add(t._nodeChange,t);ed.addShortcut('ctrl+s',ed.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(ed,cm,n){var ed=this.editor;if(ed.getParam('save_enablewhendirty')){cm.setDisabled('save',!ed.isDirty());cm.setDisabled('cancel',!ed.isDirty());}},_save:function(){var ed=this.editor,formObj,os,i,elementId;formObj=tinymce.DOM.get(ed.id).form||tinymce.DOM.getParent(ed.id,'form');if(ed.getParam("save_enablewhendirty")&&!ed.isDirty())return;tinyMCE.triggerSave();if(os=ed.getParam("save_onsavecallback")){if(ed.execCallback('save_onsavecallback',ed)){ed.startContent=tinymce.trim(ed.getContent({format:'raw'}));ed.nodeChanged();}return;}if(formObj){ed.isNotDirty=true;if(formObj.onsubmit==null||formObj.onsubmit()!=false)formObj.submit();ed.nodeChanged();}else ed.windowManager.alert("Error: No form element found.");},_cancel:function(){var ed=this.editor,os,h=tinymce.trim(ed.startContent);if(os=ed.getParam("save_oncancelcallback")){ed.execCallback('save_oncancelcallback',ed);return;}ed.setContent(h);ed.undoManager.clear();ed.nodeChanged();}});tinymce.PluginManager.add('save',tinymce.plugins.Save);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/save/editor_plugin_src.js b/thirdparty/tiny/plugins/save/editor_plugin_src.js new file mode 100644 index 0000000..9ec0440 --- /dev/null +++ b/thirdparty/tiny/plugins/save/editor_plugin_src.js @@ -0,0 +1,98 @@ +/** + * $Id: editor_plugin_src.js 851 2008-05-26 15:38:49Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.Save', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + + // Register commands + ed.addCommand('mceSave', t._save, t); + ed.addCommand('mceCancel', t._cancel, t); + + // Register buttons + ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); + ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); + + ed.onNodeChange.add(t._nodeChange, t); + ed.addShortcut('ctrl+s', ed.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 + }; + }, + + // Private methods + + _nodeChange : function(ed, cm, n) { + var ed = this.editor; + + if (ed.getParam('save_enablewhendirty')) { + cm.setDisabled('save', !ed.isDirty()); + cm.setDisabled('cancel', !ed.isDirty()); + } + }, + + // Private methods + + _save : function() { + var ed = this.editor, formObj, os, i, elementId; + + formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); + + if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) + return; + + tinyMCE.triggerSave(); + + // Use callback instead + if (os = ed.getParam("save_onsavecallback")) { + if (ed.execCallback('save_onsavecallback', ed)) { + ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); + ed.nodeChanged(); + } + + return; + } + + if (formObj) { + ed.isNotDirty = true; + + if (formObj.onsubmit == null || formObj.onsubmit() != false) + formObj.submit(); + + ed.nodeChanged(); + } else + ed.windowManager.alert("Error: No form element found."); + }, + + _cancel : function() { + var ed = this.editor, os, h = tinymce.trim(ed.startContent); + + // Use callback instead + if (os = ed.getParam("save_oncancelcallback")) { + ed.execCallback('save_oncancelcallback', ed); + return; + } + + ed.setContent(h); + ed.undoManager.clear(); + ed.nodeChanged(); + } + }); + + // Register plugin + tinymce.PluginManager.add('save', tinymce.plugins.Save); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/.svn/all-wcprops b/thirdparty/tiny/plugins/searchreplace/.svn/all-wcprops new file mode 100644 index 0000000..9e42fb6 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 78 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 82 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/editor_plugin_src.js +END +searchreplace.htm +K 25 +svn:wc:ra_dav:version-url +V 79 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/searchreplace.htm +END diff --git a/thirdparty/tiny/plugins/searchreplace/.svn/entries b/thirdparty/tiny/plugins/searchreplace/.svn/entries new file mode 100644 index 0000000..0b374ca --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/.svn/entries @@ -0,0 +1,139 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/searchreplace +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +3154c3cb319e9dd9c5994ae7125ad4f2 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1063 + +langs +dir + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +1246e382a76c59f1ea7f8e67ab8c3e4b +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1597 + +css +dir + +searchreplace.htm +file + + + + +2009-06-08T19:44:27.000000Z +06c98f16bbfdf78fb09b09eb5985d080 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +4896 + +js +dir + diff --git a/thirdparty/tiny/plugins/searchreplace/.svn/format b/thirdparty/tiny/plugins/searchreplace/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/searchreplace/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/searchreplace/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..7fd913b --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.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 diff --git a/thirdparty/tiny/plugins/searchreplace/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/searchreplace/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..0781286 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,54 @@ +/** + * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/.svn/text-base/searchreplace.htm.svn-base b/thirdparty/tiny/plugins/searchreplace/.svn/text-base/searchreplace.htm.svn-base new file mode 100644 index 0000000..90e80d0 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/.svn/text-base/searchreplace.htm.svn-base @@ -0,0 +1,105 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
    + + +
    +
    + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + +
    +
    + + + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/searchreplace/css/.svn/all-wcprops b/thirdparty/tiny/plugins/searchreplace/css/.svn/all-wcprops new file mode 100644 index 0000000..b52dfb6 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/css/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/css +END +searchreplace.css +K 25 +svn:wc:ra_dav:version-url +V 83 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/css/searchreplace.css +END diff --git a/thirdparty/tiny/plugins/searchreplace/css/.svn/entries b/thirdparty/tiny/plugins/searchreplace/css/.svn/entries new file mode 100644 index 0000000..0c8d744 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/css/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/searchreplace/css +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +searchreplace.css +file + + + + +2009-06-08T19:44:27.000000Z +ad0addca1bd5727432f39ec9b7fdac1e +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +176 + diff --git a/thirdparty/tiny/plugins/searchreplace/css/.svn/format b/thirdparty/tiny/plugins/searchreplace/css/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/css/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/searchreplace/css/.svn/text-base/searchreplace.css.svn-base b/thirdparty/tiny/plugins/searchreplace/css/.svn/text-base/searchreplace.css.svn-base new file mode 100644 index 0000000..3e2eaf3 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/css/.svn/text-base/searchreplace.css.svn-base @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/thirdparty/tiny/plugins/searchreplace/css/searchreplace.css b/thirdparty/tiny/plugins/searchreplace/css/searchreplace.css new file mode 100644 index 0000000..3e2eaf3 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/css/searchreplace.css @@ -0,0 +1,6 @@ +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/thirdparty/tiny/plugins/searchreplace/editor_plugin.js b/thirdparty/tiny/plugins/searchreplace/editor_plugin.js new file mode 100644 index 0000000..7fd913b --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.SearchReplacePlugin',{init:function(ed,url){function open(m){ed.windowManager.open({file:url+'/searchreplace.htm',width:420+parseInt(ed.getLang('searchreplace.delta_width',0)),height:160+parseInt(ed.getLang('searchreplace.delta_height',0)),inline:1,auto_focus:0},{mode:m,search_string:ed.selection.getContent({format:'text'}),plugin_url:url});};ed.addCommand('mceSearch',function(){open('search');});ed.addCommand('mceReplace',function(){open('replace');});ed.addButton('search',{title:'searchreplace.search_desc',cmd:'mceSearch'});ed.addButton('replace',{title:'searchreplace.replace_desc',cmd:'mceReplace'});ed.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 diff --git a/thirdparty/tiny/plugins/searchreplace/editor_plugin_src.js b/thirdparty/tiny/plugins/searchreplace/editor_plugin_src.js new file mode 100644 index 0000000..0781286 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/editor_plugin_src.js @@ -0,0 +1,54 @@ +/** + * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.SearchReplacePlugin', { + init : function(ed, url) { + function open(m) { + ed.windowManager.open({ + file : url + '/searchreplace.htm', + width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), + height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)), + inline : 1, + auto_focus : 0 + }, { + mode : m, + search_string : ed.selection.getContent({format : 'text'}), + plugin_url : url + }); + }; + + // Register commands + ed.addCommand('mceSearch', function() { + open('search'); + }); + + ed.addCommand('mceReplace', function() { + open('replace'); + }); + + // Register buttons + ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); + ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + + ed.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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/js/.svn/all-wcprops b/thirdparty/tiny/plugins/searchreplace/js/.svn/all-wcprops new file mode 100644 index 0000000..539c6f5 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/js/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/js +END +searchreplace.js +K 25 +svn:wc:ra_dav:version-url +V 81 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/js/searchreplace.js +END diff --git a/thirdparty/tiny/plugins/searchreplace/js/.svn/entries b/thirdparty/tiny/plugins/searchreplace/js/.svn/entries new file mode 100644 index 0000000..ea65378 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/js/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/searchreplace/js +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +searchreplace.js +file + + + + +2009-06-08T19:44:27.000000Z +87821d4ab6f4205ec4ae5ed9ad3b0480 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +3259 + diff --git a/thirdparty/tiny/plugins/searchreplace/js/.svn/format b/thirdparty/tiny/plugins/searchreplace/js/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/js/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/searchreplace/js/.svn/text-base/searchreplace.js.svn-base b/thirdparty/tiny/plugins/searchreplace/js/.svn/text-base/searchreplace.js.svn-base new file mode 100644 index 0000000..e555a3f --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/js/.svn/text-base/searchreplace.js.svn-base @@ -0,0 +1,126 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + this.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + 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; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + if (tinymce.isIE) + ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE + else + ed.getDoc().execCommand('InsertHTML', false, rs); + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/thirdparty/tiny/plugins/searchreplace/js/searchreplace.js b/thirdparty/tiny/plugins/searchreplace/js/searchreplace.js new file mode 100644 index 0000000..e555a3f --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/js/searchreplace.js @@ -0,0 +1,126 @@ +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + this.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + 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; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + if (tinymce.isIE) + ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE + else + ed.getDoc().execCommand('InsertHTML', false, rs); + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/thirdparty/tiny/plugins/searchreplace/langs/.svn/all-wcprops b/thirdparty/tiny/plugins/searchreplace/langs/.svn/all-wcprops new file mode 100644 index 0000000..9381a2d --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/langs +END +en_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 77 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/langs/en_dlg.js +END +de_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 77 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/searchreplace/langs/de_dlg.js +END diff --git a/thirdparty/tiny/plugins/searchreplace/langs/.svn/entries b/thirdparty/tiny/plugins/searchreplace/langs/.svn/entries new file mode 100644 index 0000000..370f281 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/searchreplace/langs +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +en_dlg.js +file + + + + +2009-06-08T19:44:27.000000Z +5f735d67877a4ecb9faf4ca19d2035dd +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +469 + +de_dlg.js +file + + + + +2009-06-08T19:44:27.000000Z +be773177b95d8ed66b4aaa334b2684af +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +546 + diff --git a/thirdparty/tiny/plugins/searchreplace/langs/.svn/format b/thirdparty/tiny/plugins/searchreplace/langs/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/searchreplace/langs/.svn/text-base/de_dlg.js.svn-base b/thirdparty/tiny/plugins/searchreplace/langs/.svn/text-base/de_dlg.js.svn-base new file mode 100644 index 0000000..6bb60d6 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/.svn/text-base/de_dlg.js.svn-base @@ -0,0 +1,16 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{ +searchnext_desc:"Weitersuchen", +notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.", +search_title:"Suchen", +replace_title:"Suchen/Ersetzen", +allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.", +findwhat:"Zu suchender Text", +replacewith:"Ersetzen durch", +direction:"Suchrichtung", +up:"Aufw\u00E4rts", +down:"Abw\u00E4rts", +mcase:"Gro\u00DF-/Kleinschreibung beachten", +findnext:"Weitersuchen", +replace:"Ersetzen", +replaceall:"Alle ersetzen" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/langs/.svn/text-base/en_dlg.js.svn-base b/thirdparty/tiny/plugins/searchreplace/langs/.svn/text-base/en_dlg.js.svn-base new file mode 100644 index 0000000..3dd3453 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/.svn/text-base/en_dlg.js.svn-base @@ -0,0 +1,16 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/langs/de_dlg.js b/thirdparty/tiny/plugins/searchreplace/langs/de_dlg.js new file mode 100644 index 0000000..6bb60d6 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/de_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('de.searchreplace_dlg',{ +searchnext_desc:"Weitersuchen", +notfound:"Die Suche ist am Ende angelangt. Die Zeichenkette konnte nicht gefunden werden.", +search_title:"Suchen", +replace_title:"Suchen/Ersetzen", +allreplaced:"Alle Vorkommen der Zeichenkette wurden ersetzt.", +findwhat:"Zu suchender Text", +replacewith:"Ersetzen durch", +direction:"Suchrichtung", +up:"Aufw\u00E4rts", +down:"Abw\u00E4rts", +mcase:"Gro\u00DF-/Kleinschreibung beachten", +findnext:"Weitersuchen", +replace:"Ersetzen", +replaceall:"Alle ersetzen" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/langs/en_dlg.js b/thirdparty/tiny/plugins/searchreplace/langs/en_dlg.js new file mode 100644 index 0000000..3dd3453 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/langs/en_dlg.js @@ -0,0 +1,16 @@ +tinyMCE.addI18n('en.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/searchreplace/searchreplace.htm b/thirdparty/tiny/plugins/searchreplace/searchreplace.htm new file mode 100644 index 0000000..90e80d0 --- /dev/null +++ b/thirdparty/tiny/plugins/searchreplace/searchreplace.htm @@ -0,0 +1,105 @@ + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
    + + +
    +
    + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + +
    +
    + + + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/spellchecker/.svn/all-wcprops b/thirdparty/tiny/plugins/spellchecker/.svn/all-wcprops new file mode 100644 index 0000000..18f000b --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 60 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 77 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 81 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker/editor_plugin_src.js +END diff --git a/thirdparty/tiny/plugins/spellchecker/.svn/entries b/thirdparty/tiny/plugins/spellchecker/.svn/entries new file mode 100644 index 0000000..d246c4b --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/.svn/entries @@ -0,0 +1,102 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/spellchecker +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:28.000000Z +aed898ab6ffa523d8967696445630198 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +6018 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:28.000000Z +afcc0f15a4bbe09a6e2c2ec76f22bfb9 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +8710 + +css +dir + +img +dir + diff --git a/thirdparty/tiny/plugins/spellchecker/.svn/format b/thirdparty/tiny/plugins/spellchecker/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/spellchecker/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/spellchecker/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..9cb6799 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){var JSONRequest=tinymce.util.JSONRequest,each=tinymce.each,DOM=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(ed,url){var t=this,cm;t.url=url;t.editor=ed;ed.addCommand('mceSpellCheck',function(){if(!t.active){ed.setProgressState(1);t._sendRPC('checkWords',[t.selectedLang,t._getWords()],function(r){if(r.length>0){t.active=1;t._markWords(r);ed.setProgressState(0);ed.nodeChanged();}else{ed.setProgressState(0);ed.windowManager.alert('spellchecker.no_mpell');}});}else t._done();});ed.onInit.add(function(){if(ed.settings.content_css!==false)ed.dom.loadCSS(url+'/css/content.css');});ed.onClick.add(t._showMenu,t);ed.onContextMenu.add(t._showMenu,t);ed.onBeforeGetContent.add(function(){if(t.active)t._removeWords();});ed.onNodeChange.add(function(ed,cm){cm.setActive('spellchecker',t.active);});ed.onSetContent.add(function(){t._done();});ed.onBeforeGetContent.add(function(){t._done();});ed.onBeforeExecCommand.add(function(ed,cmd){if(cmd=='mceFullScreen')t._done();});t.languages={};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){if(k.indexOf('+')===0){k=k.substring(1);t.selectedLang=v;}t.languages[k]=v;});},createControl:function(n,cm){var t=this,c,ed=t.editor;if(n=='spellchecker'){c=cm.createSplitButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});c.onRenderMenu.add(function(c,m){m.add({title:'spellchecker.langs','class':'mceMenuItemTitle'}).setDisabled(1);each(t.languages,function(v,k){var o={icon:1},mi;o.onclick=function(){mi.setSelected(1);t.selectedItem.setSelected(0);t.selectedItem=mi;t.selectedLang=v;};o.title=k;mi=m.add(o);mi.setSelected(v==t.selectedLang);if(v==t.selectedLang)t.selectedItem=mi;})});return c;}},_walk:function(n,f){var d=this.editor.getDoc(),w;if(d.createTreeWalker){w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while((n=w.nextNode())!=null)f.call(this,n);}else tinymce.walk(n,f,'childNodes');},_getSeparators:function(){var re='',i,str=this.editor.getParam('spellchecker_word_separator_chars','\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}����������������\u201d\u201c');for(i=0;i$1$2');v=v.replace(r3,'$1$2');dom.replace(dom.create('span',{'class':'mceItemHidden'},v),n);}}});se.moveToBookmark(b);},_showMenu:function(ed,e){var t=this,ed=t.editor,m=t._menu,p1,dom=ed.dom,vp=dom.getViewPort(ed.getWin());if(!m){p1=DOM.getPos(ed.getContentAreaContainer());m=ed.controlManager.createDropMenu('spellcheckermenu',{offset_x:p1.x,offset_y:p1.y,'class':'mceNoIcons'});t._menu=m;}if(dom.hasClass(e.target,'mceItemHiddenSpellWord')){m.removeAll();m.add({title:'spellchecker.wait','class':'mceMenuItemTitle'}).setDisabled(1);t._sendRPC('getSuggestions',[t.selectedLang,dom.decode(e.target.innerHTML)],function(r){m.removeAll();if(r.length>0){m.add({title:'spellchecker.sug','class':'mceMenuItemTitle'}).setDisabled(1);each(r,function(v){m.add({title:v,onclick:function(){dom.replace(ed.getDoc().createTextNode(v),e.target);t._checkDone();}});});m.addSeparator();}else m.add({title:'spellchecker.no_sug','class':'mceMenuItemTitle'}).setDisabled(1);m.add({title:'spellchecker.ignore_word',onclick:function(){dom.remove(e.target,1);t._checkDone();}});m.add({title:'spellchecker.ignore_words',onclick:function(){t._removeWords(dom.decode(e.target.innerHTML));t._checkDone();}});m.update();});ed.selection.select(e.target);p1=dom.getPos(e.target);m.showMenu(p1.x,p1.y+e.target.offsetHeight-vp.y);return tinymce.dom.Event.cancel(e);}else m.hideMenu();},_checkDone:function(){var t=this,ed=t.editor,dom=ed.dom,o;each(dom.select('span'),function(n){if(n&&dom.hasClass(n,'mceItemHiddenSpellWord')){o=true;return false;}});if(!o)t._done();},_done:function(){var t=this,la=t.active;if(t.active){t.active=0;t._removeWords();if(t._menu)t._menu.hideMenu();if(la)t.editor.nodeChanged();}},_sendRPC:function(m,p,cb){var t=this,url=t.editor.getParam("spellchecker_rpc_url","{backend}");if(url=='{backend}'){t.editor.setProgressState(0);alert('Please specify: spellchecker_rpc_url');return;}JSONRequest.sendRPC({url:url,method:m,params:p,success:cb,error:function(e,x){t.editor.setProgressState(0);t.editor.windowManager.alert(e.errstr||('Error response: '+x.responseText));}});}});tinymce.PluginManager.add('spellchecker',tinymce.plugins.SpellcheckerPlugin);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/spellchecker/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/spellchecker/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..ebcf475 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,338 @@ +/** + * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = 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(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + ed.onInit.add(function() { + if (ed.settings.content_css !== false) + ed.dom.loadCSS(url + '/css/content.css'); + }); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + 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) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»Ľ˝ľż×÷¤\u201d\u201c'); + + // Build word separator regexp + for (i=0; i$1$2'); + v = v.replace(r3, '$1$2'); + + dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); + } + } + }); + + se.moveToBookmark(b); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); + + if (!m) { + p1 = DOM.getPos(ed.getContentAreaContainer()); + //p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('spellcheckermenu', { + offset_x : p1.x, + offset_y : p1.y, + 'class' : 'mceNoIcons' + }); + + t._menu = m; + } + + if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), e.target); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + dom.remove(e.target, 1); + t._checkDone(); + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + t._removeWords(dom.decode(e.target.innerHTML)); + t._checkDone(); + } + }); + + m.update(); + }); + + ed.selection.select(e.target); + p1 = dom.getPos(e.target); + m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}"); + + if (url == '{backend}') { + t.editor.setProgressState(0); + alert('Please specify: spellchecker_rpc_url'); + return; + } + + JSONRequest.sendRPC({ + url : url, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/spellchecker/css/.svn/all-wcprops b/thirdparty/tiny/plugins/spellchecker/css/.svn/all-wcprops new file mode 100644 index 0000000..bb92dec --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/css/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker/css +END +content.css +K 25 +svn:wc:ra_dav:version-url +V 76 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker/css/content.css +END diff --git a/thirdparty/tiny/plugins/spellchecker/css/.svn/entries b/thirdparty/tiny/plugins/spellchecker/css/.svn/entries new file mode 100644 index 0000000..5c77729 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/css/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/spellchecker/css +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +content.css +file + + + + +2009-06-08T19:44:28.000000Z +ac0c7dbbbe44022d29d63b7b05123e3d +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +98 + diff --git a/thirdparty/tiny/plugins/spellchecker/css/.svn/format b/thirdparty/tiny/plugins/spellchecker/css/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/css/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/spellchecker/css/.svn/text-base/content.css.svn-base b/thirdparty/tiny/plugins/spellchecker/css/.svn/text-base/content.css.svn-base new file mode 100644 index 0000000..656ce1e --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/css/.svn/text-base/content.css.svn-base @@ -0,0 +1 @@ +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/thirdparty/tiny/plugins/spellchecker/css/content.css b/thirdparty/tiny/plugins/spellchecker/css/content.css new file mode 100644 index 0000000..656ce1e --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/css/content.css @@ -0,0 +1 @@ +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/thirdparty/tiny/plugins/spellchecker/editor_plugin.js b/thirdparty/tiny/plugins/spellchecker/editor_plugin.js new file mode 100644 index 0000000..9cb6799 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/editor_plugin.js @@ -0,0 +1 @@ +(function(){var JSONRequest=tinymce.util.JSONRequest,each=tinymce.each,DOM=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(ed,url){var t=this,cm;t.url=url;t.editor=ed;ed.addCommand('mceSpellCheck',function(){if(!t.active){ed.setProgressState(1);t._sendRPC('checkWords',[t.selectedLang,t._getWords()],function(r){if(r.length>0){t.active=1;t._markWords(r);ed.setProgressState(0);ed.nodeChanged();}else{ed.setProgressState(0);ed.windowManager.alert('spellchecker.no_mpell');}});}else t._done();});ed.onInit.add(function(){if(ed.settings.content_css!==false)ed.dom.loadCSS(url+'/css/content.css');});ed.onClick.add(t._showMenu,t);ed.onContextMenu.add(t._showMenu,t);ed.onBeforeGetContent.add(function(){if(t.active)t._removeWords();});ed.onNodeChange.add(function(ed,cm){cm.setActive('spellchecker',t.active);});ed.onSetContent.add(function(){t._done();});ed.onBeforeGetContent.add(function(){t._done();});ed.onBeforeExecCommand.add(function(ed,cmd){if(cmd=='mceFullScreen')t._done();});t.languages={};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){if(k.indexOf('+')===0){k=k.substring(1);t.selectedLang=v;}t.languages[k]=v;});},createControl:function(n,cm){var t=this,c,ed=t.editor;if(n=='spellchecker'){c=cm.createSplitButton(n,{title:'spellchecker.desc',cmd:'mceSpellCheck',scope:t});c.onRenderMenu.add(function(c,m){m.add({title:'spellchecker.langs','class':'mceMenuItemTitle'}).setDisabled(1);each(t.languages,function(v,k){var o={icon:1},mi;o.onclick=function(){mi.setSelected(1);t.selectedItem.setSelected(0);t.selectedItem=mi;t.selectedLang=v;};o.title=k;mi=m.add(o);mi.setSelected(v==t.selectedLang);if(v==t.selectedLang)t.selectedItem=mi;})});return c;}},_walk:function(n,f){var d=this.editor.getDoc(),w;if(d.createTreeWalker){w=d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false);while((n=w.nextNode())!=null)f.call(this,n);}else tinymce.walk(n,f,'childNodes');},_getSeparators:function(){var re='',i,str=this.editor.getParam('spellchecker_word_separator_chars','\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}����������������\u201d\u201c');for(i=0;i$1$2');v=v.replace(r3,'$1$2');dom.replace(dom.create('span',{'class':'mceItemHidden'},v),n);}}});se.moveToBookmark(b);},_showMenu:function(ed,e){var t=this,ed=t.editor,m=t._menu,p1,dom=ed.dom,vp=dom.getViewPort(ed.getWin());if(!m){p1=DOM.getPos(ed.getContentAreaContainer());m=ed.controlManager.createDropMenu('spellcheckermenu',{offset_x:p1.x,offset_y:p1.y,'class':'mceNoIcons'});t._menu=m;}if(dom.hasClass(e.target,'mceItemHiddenSpellWord')){m.removeAll();m.add({title:'spellchecker.wait','class':'mceMenuItemTitle'}).setDisabled(1);t._sendRPC('getSuggestions',[t.selectedLang,dom.decode(e.target.innerHTML)],function(r){m.removeAll();if(r.length>0){m.add({title:'spellchecker.sug','class':'mceMenuItemTitle'}).setDisabled(1);each(r,function(v){m.add({title:v,onclick:function(){dom.replace(ed.getDoc().createTextNode(v),e.target);t._checkDone();}});});m.addSeparator();}else m.add({title:'spellchecker.no_sug','class':'mceMenuItemTitle'}).setDisabled(1);m.add({title:'spellchecker.ignore_word',onclick:function(){dom.remove(e.target,1);t._checkDone();}});m.add({title:'spellchecker.ignore_words',onclick:function(){t._removeWords(dom.decode(e.target.innerHTML));t._checkDone();}});m.update();});ed.selection.select(e.target);p1=dom.getPos(e.target);m.showMenu(p1.x,p1.y+e.target.offsetHeight-vp.y);return tinymce.dom.Event.cancel(e);}else m.hideMenu();},_checkDone:function(){var t=this,ed=t.editor,dom=ed.dom,o;each(dom.select('span'),function(n){if(n&&dom.hasClass(n,'mceItemHiddenSpellWord')){o=true;return false;}});if(!o)t._done();},_done:function(){var t=this,la=t.active;if(t.active){t.active=0;t._removeWords();if(t._menu)t._menu.hideMenu();if(la)t.editor.nodeChanged();}},_sendRPC:function(m,p,cb){var t=this,url=t.editor.getParam("spellchecker_rpc_url","{backend}");if(url=='{backend}'){t.editor.setProgressState(0);alert('Please specify: spellchecker_rpc_url');return;}JSONRequest.sendRPC({url:url,method:m,params:p,success:cb,error:function(e,x){t.editor.setProgressState(0);t.editor.windowManager.alert(e.errstr||('Error response: '+x.responseText));}});}});tinymce.PluginManager.add('spellchecker',tinymce.plugins.SpellcheckerPlugin);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/spellchecker/editor_plugin_src.js b/thirdparty/tiny/plugins/spellchecker/editor_plugin_src.js new file mode 100644 index 0000000..ebcf475 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/editor_plugin_src.js @@ -0,0 +1,338 @@ +/** + * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = 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(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + ed.onInit.add(function() { + if (ed.settings.content_css !== false) + ed.dom.loadCSS(url + '/css/content.css'); + }); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + 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) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»Ľ˝ľż×÷¤\u201d\u201c'); + + // Build word separator regexp + for (i=0; i$1$2'); + v = v.replace(r3, '$1$2'); + + dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); + } + } + }); + + se.moveToBookmark(b); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); + + if (!m) { + p1 = DOM.getPos(ed.getContentAreaContainer()); + //p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('spellcheckermenu', { + offset_x : p1.x, + offset_y : p1.y, + 'class' : 'mceNoIcons' + }); + + t._menu = m; + } + + if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), e.target); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + dom.remove(e.target, 1); + t._checkDone(); + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + t._removeWords(dom.decode(e.target.innerHTML)); + t._checkDone(); + } + }); + + m.update(); + }); + + ed.selection.select(e.target); + p1 = dom.getPos(e.target); + m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}"); + + if (url == '{backend}') { + t.editor.setProgressState(0); + alert('Please specify: spellchecker_rpc_url'); + return; + } + + JSONRequest.sendRPC({ + url : url, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/spellchecker/img/.svn/all-wcprops b/thirdparty/tiny/plugins/spellchecker/img/.svn/all-wcprops new file mode 100644 index 0000000..f3d5d2a --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/img/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker/img +END +wline.gif +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/spellchecker/img/wline.gif +END diff --git a/thirdparty/tiny/plugins/spellchecker/img/.svn/entries b/thirdparty/tiny/plugins/spellchecker/img/.svn/entries new file mode 100644 index 0000000..5f8ab33 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/img/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/spellchecker/img +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +wline.gif +file + + + + +2009-06-08T19:44:28.000000Z +c136c9f8e00718a98947a21d8adbcc56 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +46 + diff --git a/thirdparty/tiny/plugins/spellchecker/img/.svn/format b/thirdparty/tiny/plugins/spellchecker/img/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/img/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/spellchecker/img/.svn/prop-base/wline.gif.svn-base b/thirdparty/tiny/plugins/spellchecker/img/.svn/prop-base/wline.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/plugins/spellchecker/img/.svn/prop-base/wline.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/plugins/spellchecker/img/.svn/text-base/wline.gif.svn-base b/thirdparty/tiny/plugins/spellchecker/img/.svn/text-base/wline.gif.svn-base new file mode 100644 index 0000000..7d0a4db Binary files /dev/null and b/thirdparty/tiny/plugins/spellchecker/img/.svn/text-base/wline.gif.svn-base differ diff --git a/thirdparty/tiny/plugins/spellchecker/img/wline.gif b/thirdparty/tiny/plugins/spellchecker/img/wline.gif new file mode 100644 index 0000000..7d0a4db Binary files /dev/null and b/thirdparty/tiny/plugins/spellchecker/img/wline.gif differ diff --git a/thirdparty/tiny/plugins/style/.svn/all-wcprops b/thirdparty/tiny/plugins/style/.svn/all-wcprops new file mode 100644 index 0000000..e93d2a1 --- /dev/null +++ b/thirdparty/tiny/plugins/style/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 70 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/editor_plugin_src.js +END +props.htm +K 25 +svn:wc:ra_dav:version-url +V 63 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/props.htm +END diff --git a/thirdparty/tiny/plugins/style/.svn/entries b/thirdparty/tiny/plugins/style/.svn/entries new file mode 100644 index 0000000..21f4e84 --- /dev/null +++ b/thirdparty/tiny/plugins/style/.svn/entries @@ -0,0 +1,139 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/style +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +a33cf070cce70e0aaa4dd395366d9911 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +966 + +langs +dir + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +10ec7b919444e93153ff183260e64453 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1492 + +css +dir + +props.htm +file + + + + +2009-06-08T19:44:27.000000Z +d4e3d92f757881513ad4200472b1e87c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +27702 + +js +dir + diff --git a/thirdparty/tiny/plugins/style/.svn/format b/thirdparty/tiny/plugins/style/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/style/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/style/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/style/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..6ebaa91 --- /dev/null +++ b/thirdparty/tiny/plugins/style/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){ed.windowManager.open({file:url+'/props.htm',width:480+parseInt(ed.getLang('style.delta_width',0)),height:320+parseInt(ed.getLang('style.delta_height',0)),inline:1},{plugin_url:url,style_text:ed.selection.getNode().style.cssText});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.onNodeChange.add(function(ed,cm,n){cm.setDisabled('styleprops',n.nodeName==='BODY');});ed.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 diff --git a/thirdparty/tiny/plugins/style/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/style/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..de2bd68 --- /dev/null +++ b/thirdparty/tiny/plugins/style/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,52 @@ +/** + * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 320 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + style_text : ed.selection.getNode().style.cssText + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/style/.svn/text-base/props.htm.svn-base b/thirdparty/tiny/plugins/style/.svn/text-base/props.htm.svn-base new file mode 100644 index 0000000..54538e3 --- /dev/null +++ b/thirdparty/tiny/plugins/style/.svn/text-base/props.htm.svn-base @@ -0,0 +1,731 @@ + + + + {#style_dlg.title} + + + + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + +
     
    +
    + +
    + + + +
    + + + + + + +
    + +  
    +
    + +
    + + + + + +
     
    +
    {#style_dlg.text_decoration} + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
     
    +
    + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    + +
    + + + + + + + + + + + + + + +
    + + + + + + +
     
    +
       
    + + + + + + +
     
    +
       
    +
    +
    + {#style_dlg.padding} + + + + + + + + + + + + + + + + + + + + + + +
     
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    +
    + +
    +
    + {#style_dlg.margin} + + + + + + + + + + + + + + + + + + + + + + +
     
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
          
    {#style_dlg.top}   + + + + + + +
     
    +
      + + + + + +
     
    +
    {#style_dlg.right}   + + + + + + +
     
    +
      + + + + + +
     
    +
    {#style_dlg.bottom}   + + + + + + +
     
    +
      + + + + + +
     
    +
    {#style_dlg.left}   + + + + + + +
     
    +
      + + + + + +
     
    +
    +
    + +
    + + + + + + + + + + + + + + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
       
    + + + + + + +
     
    +
       
    + + + + + + +
     
    +
       
    + +
    +
    + {#style_dlg.placement} + + + + + + + + + + + + + + + + + + + + + + +
     
    {#style_dlg.top} + + + + + + +
     
    +
    {#style_dlg.right} + + + + + + +
     
    +
    {#style_dlg.bottom} + + + + + + +
     
    +
    {#style_dlg.left} + + + + + + +
     
    +
    +
    +
    + +
    +
    + {#style_dlg.clip} + + + + + + + + + + + + + + + + + + + + + + +
     
    {#style_dlg.top} + + + + + + +
     
    +
    {#style_dlg.right} + + + + + + +
     
    +
    {#style_dlg.bottom} + + + + + + +
     
    +
    {#style_dlg.left} + + + + + + +
     
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
     
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + + + diff --git a/thirdparty/tiny/plugins/style/css/.svn/all-wcprops b/thirdparty/tiny/plugins/style/css/.svn/all-wcprops new file mode 100644 index 0000000..72315a4 --- /dev/null +++ b/thirdparty/tiny/plugins/style/css/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/css +END +props.css +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/css/props.css +END diff --git a/thirdparty/tiny/plugins/style/css/.svn/entries b/thirdparty/tiny/plugins/style/css/.svn/entries new file mode 100644 index 0000000..e7ca0f0 --- /dev/null +++ b/thirdparty/tiny/plugins/style/css/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/style/css +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +props.css +file + + + + +2009-06-08T19:44:27.000000Z +3442be519751bad52b23dc35a1de30d5 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +859 + diff --git a/thirdparty/tiny/plugins/style/css/.svn/format b/thirdparty/tiny/plugins/style/css/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/style/css/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/style/css/.svn/text-base/props.css.svn-base b/thirdparty/tiny/plugins/style/css/.svn/text-base/props.css.svn-base new file mode 100644 index 0000000..5550b09 --- /dev/null +++ b/thirdparty/tiny/plugins/style/css/.svn/text-base/props.css.svn-base @@ -0,0 +1,13 @@ +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/thirdparty/tiny/plugins/style/css/props.css b/thirdparty/tiny/plugins/style/css/props.css new file mode 100644 index 0000000..5550b09 --- /dev/null +++ b/thirdparty/tiny/plugins/style/css/props.css @@ -0,0 +1,13 @@ +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/thirdparty/tiny/plugins/style/editor_plugin.js b/thirdparty/tiny/plugins/style/editor_plugin.js new file mode 100644 index 0000000..6ebaa91 --- /dev/null +++ b/thirdparty/tiny/plugins/style/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.StylePlugin',{init:function(ed,url){ed.addCommand('mceStyleProps',function(){ed.windowManager.open({file:url+'/props.htm',width:480+parseInt(ed.getLang('style.delta_width',0)),height:320+parseInt(ed.getLang('style.delta_height',0)),inline:1},{plugin_url:url,style_text:ed.selection.getNode().style.cssText});});ed.addCommand('mceSetElementStyle',function(ui,v){if(e=ed.selection.getNode()){ed.dom.setAttrib(e,'style',v);ed.execCommand('mceRepaint');}});ed.onNodeChange.add(function(ed,cm,n){cm.setDisabled('styleprops',n.nodeName==='BODY');});ed.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 diff --git a/thirdparty/tiny/plugins/style/editor_plugin_src.js b/thirdparty/tiny/plugins/style/editor_plugin_src.js new file mode 100644 index 0000000..de2bd68 --- /dev/null +++ b/thirdparty/tiny/plugins/style/editor_plugin_src.js @@ -0,0 +1,52 @@ +/** + * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.StylePlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceStyleProps', function() { + ed.windowManager.open({ + file : url + '/props.htm', + width : 480 + parseInt(ed.getLang('style.delta_width', 0)), + height : 320 + parseInt(ed.getLang('style.delta_height', 0)), + inline : 1 + }, { + plugin_url : url, + style_text : ed.selection.getNode().style.cssText + }); + }); + + ed.addCommand('mceSetElementStyle', function(ui, v) { + if (e = ed.selection.getNode()) { + ed.dom.setAttrib(e, 'style', v); + ed.execCommand('mceRepaint'); + } + }); + + ed.onNodeChange.add(function(ed, cm, n) { + cm.setDisabled('styleprops', n.nodeName === 'BODY'); + }); + + // Register buttons + ed.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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/style/js/.svn/all-wcprops b/thirdparty/tiny/plugins/style/js/.svn/all-wcprops new file mode 100644 index 0000000..a56f7f0 --- /dev/null +++ b/thirdparty/tiny/plugins/style/js/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/js +END +props.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/js/props.js +END diff --git a/thirdparty/tiny/plugins/style/js/.svn/entries b/thirdparty/tiny/plugins/style/js/.svn/entries new file mode 100644 index 0000000..3dda8c3 --- /dev/null +++ b/thirdparty/tiny/plugins/style/js/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/style/js +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +props.js +file + + + + +2009-06-08T19:44:27.000000Z +704cc52cc4973f3a6ae667b634aca2b9 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +30274 + diff --git a/thirdparty/tiny/plugins/style/js/.svn/format b/thirdparty/tiny/plugins/style/js/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/style/js/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/style/js/.svn/text-base/props.js.svn-base b/thirdparty/tiny/plugins/style/js/.svn/text-base/props.js.svn-base new file mode 100644 index 0000000..4fdfceb --- /dev/null +++ b/thirdparty/tiny/plugins/style/js/.svn/text-base/props.js.svn-base @@ -0,0 +1,641 @@ +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +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"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function init() { + var ce = document.getElementById('container'), h; + + ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + + if (tinymce.isGecko) + selectByValue(f, 'box_float', ce.style.cssFloat, true, true); + else + selectByValue(f, 'box_float', ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s)) + return s.replace(/[^0-9]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + + if (tinymce.isGecko) + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value; + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/style/js/props.js b/thirdparty/tiny/plugins/style/js/props.js new file mode 100644 index 0000000..4fdfceb --- /dev/null +++ b/thirdparty/tiny/plugins/style/js/props.js @@ -0,0 +1,641 @@ +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;em;in;cm;mm;picas;ems;exs;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +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"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function init() { + var ce = document.getElementById('container'), h; + + ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + + if (tinymce.isGecko) + selectByValue(f, 'box_float', ce.style.cssFloat, true, true); + else + selectByValue(f, 'box_float', ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s)) + return s.replace(/[^0-9]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + + if (tinymce.isGecko) + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value; + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/style/langs/.svn/all-wcprops b/thirdparty/tiny/plugins/style/langs/.svn/all-wcprops new file mode 100644 index 0000000..c781987 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/langs +END +en_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/langs/en_dlg.js +END +de_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/style/langs/de_dlg.js +END diff --git a/thirdparty/tiny/plugins/style/langs/.svn/entries b/thirdparty/tiny/plugins/style/langs/.svn/entries new file mode 100644 index 0000000..6eabed2 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/style/langs +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +en_dlg.js +file + + + + +2009-06-08T19:44:27.000000Z +1e069c2c7583b278b3cab074d1ff07d9 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1531 + +de_dlg.js +file + + + + +2009-06-08T19:44:27.000000Z +0d5e8cb9608c3e2fc22fa3350ffeee55 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1774 + diff --git a/thirdparty/tiny/plugins/style/langs/.svn/format b/thirdparty/tiny/plugins/style/langs/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/style/langs/.svn/text-base/de_dlg.js.svn-base b/thirdparty/tiny/plugins/style/langs/.svn/text-base/de_dlg.js.svn-base new file mode 100644 index 0000000..c30de26 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/.svn/text-base/de_dlg.js.svn-base @@ -0,0 +1,63 @@ +tinyMCE.addI18n('de.style_dlg',{ +title:"CSS-Styles bearbeiten", +apply:"\u00DCbernehmen", +text_tab:"Text", +background_tab:"Hintergrund", +block_tab:"Block", +box_tab:"Box", +border_tab:"Rahmen", +list_tab:"Liste", +positioning_tab:"Positionierung", +text_props:"Text", +text_font:"Schriftart", +text_size:"Gr\u00F6\u00DFe", +text_weight:"Dicke", +text_style:"Stil", +text_variant:"Variante", +text_lineheight:"Zeilenh\u00F6he", +text_case:"Schreibung", +text_color:"Farbe", +text_decoration:"Gestaltung", +text_overline:"\u00FCberstrichen", +text_underline:"unterstrichen", +text_striketrough:"durchgestrichen", +text_blink:"blinkend", +text_none:"keine", +background_color:"Hintergrundfarbe", +background_image:"Hintergrundbild", +background_repeat:"Wiederholung", +background_attachment:"Wasserzeicheneffekt", +background_hpos:"Position X", +background_vpos:"Position Y", +block_wordspacing:"Wortabstand", +block_letterspacing:"Buchstabenabstand", +block_vertical_alignment:"Vertikale Ausrichtung", +block_text_align:"Ausrichtung", +block_text_indent:"Einr\u00FCckung", +block_whitespace:"Automatischer Umbruch", +block_display:"Umbruchverhalten", +box_width:"Breite", +box_height:"H\u00F6he", +box_float:"Umflie\u00DFung", +box_clear:"Umflie\u00DFung verhindern", +padding:"Innerer Abstand", +same:"Alle gleich", +top:"Oben", +right:"Rechts", +bottom:"Unten", +left:"Links", +margin:"\u00C4u\u00DFerer Abstand", +style:"Format", +width:"Breite", +height:"H\u00F6he", +color:"Textfarbe", +list_type:"Listenpunkt-Art", +bullet_image:"Listenpunkt-Grafik", +position:"Positionierung", +positioning_type:"Art der Positionierung", +visibility:"Sichtbar", +zindex:"Z-Wert", +overflow:"Verhalten bei \u00DCbergr\u00F6\u00DFe", +placement:"Platzierung", +clip:"Ausschnitt" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/style/langs/.svn/text-base/en_dlg.js.svn-base b/thirdparty/tiny/plugins/style/langs/.svn/text-base/en_dlg.js.svn-base new file mode 100644 index 0000000..d9d7762 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/.svn/text-base/en_dlg.js.svn-base @@ -0,0 +1,63 @@ +tinyMCE.addI18n('en.style_dlg',{ +title:"Edit CSS Style", +apply:"Apply", +text_tab:"Text", +background_tab:"Background", +block_tab:"Block", +box_tab:"Box", +border_tab:"Border", +list_tab:"List", +positioning_tab:"Positioning", +text_props:"Text", +text_font:"Font", +text_size:"Size", +text_weight:"Weight", +text_style:"Style", +text_variant:"Variant", +text_lineheight:"Line height", +text_case:"Case", +text_color:"Color", +text_decoration:"Decoration", +text_overline:"overline", +text_underline:"underline", +text_striketrough:"strikethrough", +text_blink:"blink", +text_none:"none", +background_color:"Background color", +background_image:"Background image", +background_repeat:"Repeat", +background_attachment:"Attachment", +background_hpos:"Horizontal position", +background_vpos:"Vertical position", +block_wordspacing:"Word spacing", +block_letterspacing:"Letter spacing", +block_vertical_alignment:"Vertical alignment", +block_text_align:"Text align", +block_text_indent:"Text indent", +block_whitespace:"Whitespace", +block_display:"Display", +box_width:"Width", +box_height:"Height", +box_float:"Float", +box_clear:"Clear", +padding:"Padding", +same:"Same for all", +top:"Top", +right:"Right", +bottom:"Bottom", +left:"Left", +margin:"Margin", +style:"Style", +width:"Width", +height:"Height", +color:"Color", +list_type:"Type", +bullet_image:"Bullet image", +position:"Position", +positioning_type:"Type", +visibility:"Visibility", +zindex:"Z-index", +overflow:"Overflow", +placement:"Placement", +clip:"Clip" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/style/langs/de_dlg.js b/thirdparty/tiny/plugins/style/langs/de_dlg.js new file mode 100644 index 0000000..c30de26 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/de_dlg.js @@ -0,0 +1,63 @@ +tinyMCE.addI18n('de.style_dlg',{ +title:"CSS-Styles bearbeiten", +apply:"\u00DCbernehmen", +text_tab:"Text", +background_tab:"Hintergrund", +block_tab:"Block", +box_tab:"Box", +border_tab:"Rahmen", +list_tab:"Liste", +positioning_tab:"Positionierung", +text_props:"Text", +text_font:"Schriftart", +text_size:"Gr\u00F6\u00DFe", +text_weight:"Dicke", +text_style:"Stil", +text_variant:"Variante", +text_lineheight:"Zeilenh\u00F6he", +text_case:"Schreibung", +text_color:"Farbe", +text_decoration:"Gestaltung", +text_overline:"\u00FCberstrichen", +text_underline:"unterstrichen", +text_striketrough:"durchgestrichen", +text_blink:"blinkend", +text_none:"keine", +background_color:"Hintergrundfarbe", +background_image:"Hintergrundbild", +background_repeat:"Wiederholung", +background_attachment:"Wasserzeicheneffekt", +background_hpos:"Position X", +background_vpos:"Position Y", +block_wordspacing:"Wortabstand", +block_letterspacing:"Buchstabenabstand", +block_vertical_alignment:"Vertikale Ausrichtung", +block_text_align:"Ausrichtung", +block_text_indent:"Einr\u00FCckung", +block_whitespace:"Automatischer Umbruch", +block_display:"Umbruchverhalten", +box_width:"Breite", +box_height:"H\u00F6he", +box_float:"Umflie\u00DFung", +box_clear:"Umflie\u00DFung verhindern", +padding:"Innerer Abstand", +same:"Alle gleich", +top:"Oben", +right:"Rechts", +bottom:"Unten", +left:"Links", +margin:"\u00C4u\u00DFerer Abstand", +style:"Format", +width:"Breite", +height:"H\u00F6he", +color:"Textfarbe", +list_type:"Listenpunkt-Art", +bullet_image:"Listenpunkt-Grafik", +position:"Positionierung", +positioning_type:"Art der Positionierung", +visibility:"Sichtbar", +zindex:"Z-Wert", +overflow:"Verhalten bei \u00DCbergr\u00F6\u00DFe", +placement:"Platzierung", +clip:"Ausschnitt" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/style/langs/en_dlg.js b/thirdparty/tiny/plugins/style/langs/en_dlg.js new file mode 100644 index 0000000..d9d7762 --- /dev/null +++ b/thirdparty/tiny/plugins/style/langs/en_dlg.js @@ -0,0 +1,63 @@ +tinyMCE.addI18n('en.style_dlg',{ +title:"Edit CSS Style", +apply:"Apply", +text_tab:"Text", +background_tab:"Background", +block_tab:"Block", +box_tab:"Box", +border_tab:"Border", +list_tab:"List", +positioning_tab:"Positioning", +text_props:"Text", +text_font:"Font", +text_size:"Size", +text_weight:"Weight", +text_style:"Style", +text_variant:"Variant", +text_lineheight:"Line height", +text_case:"Case", +text_color:"Color", +text_decoration:"Decoration", +text_overline:"overline", +text_underline:"underline", +text_striketrough:"strikethrough", +text_blink:"blink", +text_none:"none", +background_color:"Background color", +background_image:"Background image", +background_repeat:"Repeat", +background_attachment:"Attachment", +background_hpos:"Horizontal position", +background_vpos:"Vertical position", +block_wordspacing:"Word spacing", +block_letterspacing:"Letter spacing", +block_vertical_alignment:"Vertical alignment", +block_text_align:"Text align", +block_text_indent:"Text indent", +block_whitespace:"Whitespace", +block_display:"Display", +box_width:"Width", +box_height:"Height", +box_float:"Float", +box_clear:"Clear", +padding:"Padding", +same:"Same for all", +top:"Top", +right:"Right", +bottom:"Bottom", +left:"Left", +margin:"Margin", +style:"Style", +width:"Width", +height:"Height", +color:"Color", +list_type:"Type", +bullet_image:"Bullet image", +position:"Position", +positioning_type:"Type", +visibility:"Visibility", +zindex:"Z-index", +overflow:"Overflow", +placement:"Placement", +clip:"Clip" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/style/props.htm b/thirdparty/tiny/plugins/style/props.htm new file mode 100644 index 0000000..54538e3 --- /dev/null +++ b/thirdparty/tiny/plugins/style/props.htm @@ -0,0 +1,731 @@ + + + + {#style_dlg.title} + + + + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + +
     
    +
    + +
    + + + +
    + + + + + + +
    + +  
    +
    + +
    + + + + + +
     
    +
    {#style_dlg.text_decoration} + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
     
    +
    + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    + +
    + + + + + + + + + + + + + + +
    + + + + + + +
     
    +
       
    + + + + + + +
     
    +
       
    +
    +
    + {#style_dlg.padding} + + + + + + + + + + + + + + + + + + + + + + +
     
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    +
    + +
    +
    + {#style_dlg.margin} + + + + + + + + + + + + + + + + + + + + + + +
     
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    + + + + + + +
     
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
          
    {#style_dlg.top}   + + + + + + +
     
    +
      + + + + + +
     
    +
    {#style_dlg.right}   + + + + + + +
     
    +
      + + + + + +
     
    +
    {#style_dlg.bottom}   + + + + + + +
     
    +
      + + + + + +
     
    +
    {#style_dlg.left}   + + + + + + +
     
    +
      + + + + + +
     
    +
    +
    + +
    + + + + + + + + + + + + + + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
       
    + + + + + + +
     
    +
       
    + + + + + + +
     
    +
       
    + +
    +
    + {#style_dlg.placement} + + + + + + + + + + + + + + + + + + + + + + +
     
    {#style_dlg.top} + + + + + + +
     
    +
    {#style_dlg.right} + + + + + + +
     
    +
    {#style_dlg.bottom} + + + + + + +
     
    +
    {#style_dlg.left} + + + + + + +
     
    +
    +
    +
    + +
    +
    + {#style_dlg.clip} + + + + + + + + + + + + + + + + + + + + + + +
     
    {#style_dlg.top} + + + + + + +
     
    +
    {#style_dlg.right} + + + + + + +
     
    +
    {#style_dlg.bottom} + + + + + + +
     
    +
    {#style_dlg.left} + + + + + + +
     
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
     
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + + + diff --git a/thirdparty/tiny/plugins/table/.svn/all-wcprops b/thirdparty/tiny/plugins/table/.svn/all-wcprops new file mode 100644 index 0000000..ff35343 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/all-wcprops @@ -0,0 +1,41 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 70 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/editor_plugin.js +END +cell.htm +K 25 +svn:wc:ra_dav:version-url +V 62 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/cell.htm +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/editor_plugin_src.js +END +merge_cells.htm +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/merge_cells.htm +END +row.htm +K 25 +svn:wc:ra_dav:version-url +V 61 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/row.htm +END +table.htm +K 25 +svn:wc:ra_dav:version-url +V 63 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/table.htm +END diff --git a/thirdparty/tiny/plugins/table/.svn/entries b/thirdparty/tiny/plugins/table/.svn/entries new file mode 100644 index 0000000..7b10a88 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/entries @@ -0,0 +1,241 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/table +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +aa25f98e7fc772c84c3a5e822417c781 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +20562 + +langs +dir + +cell.htm +file + + + + +2009-06-08T19:44:27.000000Z +44bdd56658d8afd1b17bb8f0b36a3eda +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +6944 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +57332e1871a88dbbee43c63b5b11628b +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +32480 + +css +dir + +merge_cells.htm +file + + + + +2009-06-08T19:44:27.000000Z +e2c8360c37f1a4f7492ee555a9d2ff40 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1474 + +js +dir + +row.htm +file + + + + +2009-06-08T19:44:27.000000Z +862dcb05201061bea985b7ba8c26a013 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +6018 + +table.htm +file + + + + +2009-06-08T19:44:27.000000Z +8eaf68b57c9322259402021fbf6b057a +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +8706 + diff --git a/thirdparty/tiny/plugins/table/.svn/format b/thirdparty/tiny/plugins/table/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/table/.svn/text-base/cell.htm.svn-base b/thirdparty/tiny/plugins/table/.svn/text-base/cell.htm.svn-base new file mode 100644 index 0000000..c931731 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/text-base/cell.htm.svn-base @@ -0,0 +1,184 @@ + + + + {#table_dlg.cell_title} + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/table/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..97a9d25 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['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(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});if(ed.getParam('inline_styles')){ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('table',o.node),function(n){var v;if(v=dom.getAttrib(n,'width')){dom.setStyle(n,'width',v);dom.setAttrib(n,'width');}if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height');}});});}ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();if(el.nodeName=='A'&&!ed.dom.getAttrib(el,'name')){m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});m.addSeparator();}if(el.nodeName=='IMG'&&el.className.indexOf('mceItem')==-1){m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();}m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2> ':'<$1$2>
    ');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='
    ';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y1){for(var i=x;i1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if((grid.length>1&&grid[0].length<=1)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;ycolSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;xrowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/table/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..3e57a84 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,1136 @@ +/** + * $Id: editor_plugin_src.js 953 2008-11-04 10:16:50Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Register buttons + each([ + ['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(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + if (ed.getParam('inline_styles')) { + // Force move of attribs to styles in strict mode + ed.onPreProcess.add(function(ed, o) { + var dom = ed.dom; + + each(dom.select('table', o.node), function(n) { + var v; + + if (v = dom.getAttrib(n, 'width')) { + dom.setStyle(n, 'width', v); + dom.setAttrib(n, 'width'); + } + + if (v = dom.getAttrib(n, 'height')) { + dom.setStyle(n, 'height', v); + dom.setAttrib(n, 'height'); + } + }); + }); + } + + ed.onInit.add(function() { + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true, value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable', ui : true}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete', ui : true}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps', ui : true}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells', ui : true}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells', ui : true}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps', ui : true}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true}); + }); + } + }); + + // Add undo level when new rows are created using the tab key + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 9 && ed.dom.getParent(ed.selection.getNode(), 'TABLE')) { + if (!tinymce.isGecko && !tinymce.isOpera) { + tinyMCE.execInstanceCommand(ed.editorId, "mceTableMoveToNextRow", true); + return tinymce.dom.Event.cancel(e); + } + + ed.undoManager.add(); + } + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + if (ed.getParam('table_selection', true)) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') + ed.selection.select(e); + }); + } + } + + ed.onNodeChange.add(function(ed, cm, n) { + var p = ed.dom.getParent(n, 'td,th,caption'); + + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + if (p && p.nodeName === 'CAPTION') + p = null; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p || (parseInt(ed.dom.getAttrib(p, 'colspan', '1')) < 2 && parseInt(ed.dom.getAttrib(p, 'rowspan', '1')) < 2)); + cm.setDisabled('merge_cells', !p); + }); + + // Padd empty table cells + if (!tinymce.isIE) { + ed.onBeforeSetContent.add(function(ed, o) { + if (o.initial) + o.content = o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g, tinymce.isOpera ? '<$1$2> ' : '<$1$2>
    '); + }); + } + }, + + execCommand : function(cmd, ui, val) { + var ed = this.editor, b; + + // Is table command + switch (cmd) { + case "mceTableMoveToNextRow": + case "mceInsertTable": + case "mceTableRowProps": + case "mceTableCellProps": + case "mceTableSplitCells": + case "mceTableMergeCells": + case "mceTableInsertRowBefore": + case "mceTableInsertRowAfter": + case "mceTableDeleteRow": + case "mceTableInsertColBefore": + case "mceTableInsertColAfter": + case "mceTableDeleteCol": + case "mceTableCutRow": + case "mceTableCopyRow": + case "mceTablePasteRowBefore": + case "mceTablePasteRowAfter": + case "mceTableDelete": + ed.execCommand('mceBeginUndoLevel'); + this._doExecCommand(cmd, ui, val); + ed.execCommand('mceEndUndoLevel'); + + return true; + } + + // Pass to next handler in chain + return false; + }, + + getInfo : function() { + return { + longname : 'Tables', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + /** + * Executes the table commands. + */ + _doExecCommand : function(command, user_interface, value) { + var inst = this.editor, ed = inst, url = this.url; + var focusElm = inst.selection.getNode(); + var trElm = inst.dom.getParent(focusElm, "tr"); + var tdElm = inst.dom.getParent(focusElm, "td,th"); + var tableElm = inst.dom.getParent(focusElm, "table"); + var doc = inst.contentWindow.document; + var tableBorder = tableElm ? tableElm.getAttribute("border") : ""; + + // Get first TD if no TD found + if (trElm && tdElm == null) + tdElm = trElm.cells[0]; + + function inArray(ar, v) { + for (var i=0; i 0 && inArray(ar[i], v)) + return true; + + // Found value + if (ar[i] == v) + return true; + } + + return false; + } + + function select(dx, dy) { + var td; + + grid = getTableGrid(tableElm); + dx = dx || 0; + dy = dy || 0; + dx = Math.max(cpos.cellindex + dx, 0); + dy = Math.max(cpos.rowindex + dy, 0); + + // Recalculate grid and select + inst.execCommand('mceRepaint'); + td = getCell(grid, dy, dx); + + if (td) { + inst.selection.select(td.firstChild || td); + inst.selection.collapse(1); + } + }; + + function makeTD() { + var newTD = doc.createElement("td"); + + if (!tinymce.isIE) + newTD.innerHTML = '
    '; + } + + function getColRowSpan(td) { + var colspan = inst.dom.getAttrib(td, "colspan"); + var rowspan = inst.dom.getAttrib(td, "rowspan"); + + colspan = colspan == "" ? 1 : parseInt(colspan); + rowspan = rowspan == "" ? 1 : parseInt(rowspan); + + return {colspan : colspan, rowspan : rowspan}; + } + + function getCellPos(grid, td) { + var x, y; + + for (y=0; y 1) { // Remove due to colspan + for (var i=x; i 1) + td.rowSpan = sd.rowspan + 1; + + lastElm = td; + } + + deleteMarked(tableElm); + } + } + + function prevElm(node, name) { + while ((node = node.previousSibling) != null) { + if (node.nodeName == name) + return node; + } + + return null; + } + + function nextElm(node, names) { + var namesAr = names.split(','); + + while ((node = node.nextSibling) != null) { + for (var i=0; i 1) { + do { + var nexttd = nextElm(td, "TD,TH"); + + if (td._delete) + td.parentNode.removeChild(td); + } while ((td = nexttd) != null); + } + } while ((tr = next) != null); + } + + function addRows(td_elm, tr_elm, rowspan) { + // Add rows + td_elm.rowSpan = 1; + var trNext = nextElm(tr_elm, "TR"); + for (var i=1; i 1) { + var newTD = cells[x].cloneNode(true); + var sd = getColRowSpan(cells[x]); + + newTD.rowSpan = sd.rowspan - 1; + + var nextTD = nextTR.cells[x]; + + if (nextTD == null) + nextTR.appendChild(newTD); + else + nextTR.insertBefore(newTD, nextTD); + } + } + + // Delete cells + var lastTDElm = null; + for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd.rowspan > 1) { + tdElm.rowSpan = sd.rowspan - 1; + } else { + trElm = tdElm.parentNode; + + if (trElm.parentNode) + trElm._delete = true; + } + + lastTDElm = tdElm; + } + } + + deleteMarked(tableElm); + + select(0, -1); + break; + + case "mceTableInsertColBefore": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] == 1) { + var newTD = doc.createElement(tdElm.nodeName); + + if (!tinymce.isIE) + newTD.innerHTML = '
    '; + + newTD.rowSpan = tdElm.rowSpan; + + tdElm.parentNode.insertBefore(newTD, tdElm); + } else + tdElm.colSpan++; + + lastTDElm = tdElm; + } + } + + select(); + break; + + case "mceTableInsertColAfter": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] == 1) { + var newTD = doc.createElement(tdElm.nodeName); + + if (!tinymce.isIE) + newTD.innerHTML = '
    '; + + newTD.rowSpan = tdElm.rowSpan; + + var nextTD = nextElm(tdElm, "TD,TH"); + if (nextTD == null) + tdElm.parentNode.appendChild(newTD); + else + nextTD.parentNode.insertBefore(newTD, nextTD); + } else + tdElm.colSpan++; + + lastTDElm = tdElm; + } + } + + select(1); + break; + + case "mceTableDeleteCol": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(tableElm); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + // Only one col, remove whole table + if ((grid.length > 1 && grid[0].length <= 1) && tableElm.nodeName == 'TBODY') { + inst.dom.remove(inst.dom.getParent(tableElm, "table")); + return true; + } + + // Delete cells + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] > 1) + tdElm.colSpan = sd['colspan'] - 1; + else { + if (tdElm.parentNode) + tdElm.parentNode.removeChild(tdElm); + } + + lastTDElm = tdElm; + } + } + + select(-1); + break; + + case "mceTableSplitCells": + if (!trElm || !tdElm) + return true; + + var spandata = getColRowSpan(tdElm); + + var colspan = spandata["colspan"]; + var rowspan = spandata["rowspan"]; + + // Needs splitting + if (colspan > 1 || rowspan > 1) { + // Generate cols + tdElm.colSpan = 1; + for (var i=1; i 1) + addRows(newTD, trElm, rowspan); + } + + addRows(tdElm, trElm, rowspan); + } + + // Apply visual aids + tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); + break; + + case "mceTableMergeCells": + var rows = []; + var sel = inst.selection.getSel(); + var grid = getTableGrid(tableElm); + + if (tinymce.isIE || sel.rangeCount == 1) { + if (user_interface) { + // Setup template + var sp = getColRowSpan(tdElm); + + inst.windowManager.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(inst.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(inst.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + action : "update", + numcols : sp.colspan, + numrows : sp.rowspan, + plugin_url : url + }); + + return true; + } else { + var numRows = parseInt(value['numrows']); + var numCols = parseInt(value['numcols']); + var cpos = getCellPos(grid, tdElm); + + if (("" + numRows) == "NaN") + numRows = 1; + + if (("" + numCols) == "NaN") + numCols = 1; + + // Get rows and cells + var tRows = tableElm.rows; + for (var y=cpos.rowindex; y 0) + rows[rows.length] = rowCells; + + var td = getCell(grid, cpos.rowindex, cpos.cellindex); + each(ed.dom.select('br', td), function(e, i) { + if (i > 0 && ed.dom.getAttrib('mce_bogus')) + ed.dom.remove(e); + }); + } + + //return true; + } + } else { + var cells = []; + var sel = inst.selection.getSel(); + var lastTR = null; + var curRow = null; + var x1 = -1, y1 = -1, x2, y2; + + // Only one cell selected, whats the point? + if (sel.rangeCount < 2) + return true; + + // Get all selected cells + for (var i=0; i 0) + rows[rows.length] = rowCells; + } + + // Find selected cells in grid and box + var curRow = []; + var lastTR = null; + for (var y=0; y colSpan) + colSpan = rowColSpan; + + lastRowSpan = -1; + } + + // Validate vertical and get total rowspan + var lastColSpan = -1; + for (var x=0; x rowSpan) + rowSpan = colRowSpan; + + lastColSpan = -1; + } + + // Setup td + tdElm = rows[0][0]; + tdElm.rowSpan = rowSpan; + tdElm.colSpan = colSpan; + + // Merge cells + for (var y=0; y 0)) + tdElm.innerHTML += html; + + // Not current cell + if (rows[y][x] != tdElm && !rows[y][x]._deleted) { + var cpos = getCellPos(grid, rows[y][x]); + var tr = rows[y][x].parentNode; + + tr.removeChild(rows[y][x]); + rows[y][x]._deleted = true; + + // Empty TR, remove it + if (!tr.hasChildNodes()) { + tr.parentNode.removeChild(tr); + + var lastCell = null; + for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) { + if (cellElm != lastCell && cellElm.rowSpan > 1) + cellElm.rowSpan--; + + lastCell = cellElm; + } + + if (tdElm.rowSpan > 1) + tdElm.rowSpan--; + } + } + } + } + + // Remove all but one bogus br + each(ed.dom.select('br', tdElm), function(e, i) { + if (i > 0 && ed.dom.getAttrib(e, 'mce_bogus')) + ed.dom.remove(e); + }); + + break; + } + + tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); + inst.addVisual(tableElm); + inst.nodeChanged(); + } + + return true; + } + + // Pass to next handler in chain + return false; + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/.svn/text-base/merge_cells.htm.svn-base b/thirdparty/tiny/plugins/table/.svn/text-base/merge_cells.htm.svn-base new file mode 100644 index 0000000..f2dcbec --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/text-base/merge_cells.htm.svn-base @@ -0,0 +1,38 @@ + + + + {#table_dlg.merge_cells_title} + + + + + + + +
    +
    + {#table_dlg.merge_cells_title} + + + + + + + + + +
    {#table_dlg.cols}:
    {#table_dlg.rows}:
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/.svn/text-base/row.htm.svn-base b/thirdparty/tiny/plugins/table/.svn/text-base/row.htm.svn-base new file mode 100644 index 0000000..4a709d3 --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/text-base/row.htm.svn-base @@ -0,0 +1,161 @@ + + + + {#table_dlg.row_title} + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/.svn/text-base/table.htm.svn-base b/thirdparty/tiny/plugins/table/.svn/text-base/table.htm.svn-base new file mode 100644 index 0000000..74982fa --- /dev/null +++ b/thirdparty/tiny/plugins/table/.svn/text-base/table.htm.svn-base @@ -0,0 +1,193 @@ + + + + {#table_dlg.title} + + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
     
    +
    + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/cell.htm b/thirdparty/tiny/plugins/table/cell.htm new file mode 100644 index 0000000..c931731 --- /dev/null +++ b/thirdparty/tiny/plugins/table/cell.htm @@ -0,0 +1,184 @@ + + + + {#table_dlg.cell_title} + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/css/.svn/all-wcprops b/thirdparty/tiny/plugins/table/css/.svn/all-wcprops new file mode 100644 index 0000000..6e3dc0d --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/css +END +cell.css +K 25 +svn:wc:ra_dav:version-url +V 66 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/css/cell.css +END +row.css +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/css/row.css +END +table.css +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/css/table.css +END diff --git a/thirdparty/tiny/plugins/table/css/.svn/entries b/thirdparty/tiny/plugins/table/css/.svn/entries new file mode 100644 index 0000000..b48630d --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/.svn/entries @@ -0,0 +1,130 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/table/css +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +cell.css +file + + + + +2009-06-08T19:44:27.000000Z +56394e6cdb267d97e23a07a98820e84b +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +205 + +row.css +file + + + + +2009-06-08T19:44:27.000000Z +81a75523c1e83be93e524c8bb901a089 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +306 + +table.css +file + + + + +2009-06-08T19:44:27.000000Z +f5e651f5a32284f1c4e0faa1d7cd5ff4 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +170 + diff --git a/thirdparty/tiny/plugins/table/css/.svn/format b/thirdparty/tiny/plugins/table/css/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/table/css/.svn/text-base/cell.css.svn-base b/thirdparty/tiny/plugins/table/css/.svn/text-base/cell.css.svn-base new file mode 100644 index 0000000..a47cc1a --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/.svn/text-base/cell.css.svn-base @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/css/.svn/text-base/row.css.svn-base b/thirdparty/tiny/plugins/table/css/.svn/text-base/row.css.svn-base new file mode 100644 index 0000000..0e397db --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/.svn/text-base/row.css.svn-base @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/thirdparty/tiny/plugins/table/css/.svn/text-base/table.css.svn-base b/thirdparty/tiny/plugins/table/css/.svn/text-base/table.css.svn-base new file mode 100644 index 0000000..8f10783 --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/.svn/text-base/table.css.svn-base @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/thirdparty/tiny/plugins/table/css/cell.css b/thirdparty/tiny/plugins/table/css/cell.css new file mode 100644 index 0000000..a47cc1a --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/cell.css @@ -0,0 +1,17 @@ +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; +} \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/css/row.css b/thirdparty/tiny/plugins/table/css/row.css new file mode 100644 index 0000000..0e397db --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/row.css @@ -0,0 +1,25 @@ +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/thirdparty/tiny/plugins/table/css/table.css b/thirdparty/tiny/plugins/table/css/table.css new file mode 100644 index 0000000..8f10783 --- /dev/null +++ b/thirdparty/tiny/plugins/table/css/table.css @@ -0,0 +1,13 @@ +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/thirdparty/tiny/plugins/table/editor_plugin.js b/thirdparty/tiny/plugins/table/editor_plugin.js new file mode 100644 index 0000000..97a9d25 --- /dev/null +++ b/thirdparty/tiny/plugins/table/editor_plugin.js @@ -0,0 +1 @@ +(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['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(c){ed.addButton(c[0],{title:c[1],cmd:c[2],ui:c[3]});});if(ed.getParam('inline_styles')){ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('table',o.node),function(n){var v;if(v=dom.getAttrib(n,'width')){dom.setStyle(n,'width',v);dom.setAttrib(n,'width');}if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height');}});});}ed.onInit.add(function(){if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){var sm,se=ed.selection,el=se.getNode()||ed.getBody();if(ed.dom.getParent(e,'td')||ed.dom.getParent(e,'th')){m.removeAll();if(el.nodeName=='A'&&!ed.dom.getAttrib(el,'name')){m.add({title:'advanced.link_desc',icon:'link',cmd:ed.plugins.advlink?'mceAdvLink':'mceLink',ui:true});m.add({title:'advanced.unlink_desc',icon:'unlink',cmd:'UnLink'});m.addSeparator();}if(el.nodeName=='IMG'&&el.className.indexOf('mceItem')==-1){m.add({title:'advanced.image_desc',icon:'image',cmd:ed.plugins.advimage?'mceAdvImage':'mceImage',ui:true});m.addSeparator();}m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true,value:{action:'insert'}});m.add({title:'table.props_desc',icon:'table_props',cmd:'mceInsertTable',ui:true});m.add({title:'table.del',icon:'delete_table',cmd:'mceTableDelete',ui:true});m.addSeparator();sm=m.addMenu({title:'table.cell'});sm.add({title:'table.cell_desc',icon:'cell_props',cmd:'mceTableCellProps',ui:true});sm.add({title:'table.split_cells_desc',icon:'split_cells',cmd:'mceTableSplitCells',ui:true});sm.add({title:'table.merge_cells_desc',icon:'merge_cells',cmd:'mceTableMergeCells',ui:true});sm=m.addMenu({title:'table.row'});sm.add({title:'table.row_desc',icon:'row_props',cmd:'mceTableRowProps',ui:true});sm.add({title:'table.row_before_desc',icon:'row_before',cmd:'mceTableInsertRowBefore'});sm.add({title:'table.row_after_desc',icon:'row_after',cmd:'mceTableInsertRowAfter'});sm.add({title:'table.delete_row_desc',icon:'delete_row',cmd:'mceTableDeleteRow'});sm.addSeparator();sm.add({title:'table.cut_row_desc',icon:'cut',cmd:'mceTableCutRow'});sm.add({title:'table.copy_row_desc',icon:'copy',cmd:'mceTableCopyRow'});sm.add({title:'table.paste_row_before_desc',icon:'paste',cmd:'mceTablePasteRowBefore'});sm.add({title:'table.paste_row_after_desc',icon:'paste',cmd:'mceTablePasteRowAfter'});sm=m.addMenu({title:'table.col'});sm.add({title:'table.col_before_desc',icon:'col_before',cmd:'mceTableInsertColBefore'});sm.add({title:'table.col_after_desc',icon:'col_after',cmd:'mceTableInsertColAfter'});sm.add({title:'table.delete_col_desc',icon:'delete_col',cmd:'mceTableDeleteCol'});}else m.add({title:'table.desc',icon:'table',cmd:'mceInsertTable',ui:true});});}});ed.onKeyDown.add(function(ed,e){if(e.keyCode==9&&ed.dom.getParent(ed.selection.getNode(),'TABLE')){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(ed.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(e);}ed.undoManager.add();}});if(!tinymce.isIE){if(ed.getParam('table_selection',true)){ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName==='TABLE')ed.selection.select(e);});}}ed.onNodeChange.add(function(ed,cm,n){var p=ed.dom.getParent(n,'td,th,caption');cm.setActive('table',n.nodeName==='TABLE'||!!p);if(p&&p.nodeName==='CAPTION')p=null;cm.setDisabled('delete_table',!p);cm.setDisabled('delete_col',!p);cm.setDisabled('delete_table',!p);cm.setDisabled('delete_row',!p);cm.setDisabled('col_after',!p);cm.setDisabled('col_before',!p);cm.setDisabled('row_after',!p);cm.setDisabled('row_before',!p);cm.setDisabled('row_props',!p);cm.setDisabled('cell_props',!p);cm.setDisabled('split_cells',!p||(parseInt(ed.dom.getAttrib(p,'colspan','1'))<2&&parseInt(ed.dom.getAttrib(p,'rowspan','1'))<2));cm.setDisabled('merge_cells',!p);});if(!tinymce.isIE){ed.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?'<$1$2> ':'<$1$2>
    ');});}},execCommand:function(cmd,ui,val){var ed=this.editor,b;switch(cmd){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":ed.execCommand('mceBeginUndoLevel');this._doExecCommand(cmd,ui,val);ed.execCommand('mceEndUndoLevel');return true;}return false;},getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_doExecCommand:function(command,user_interface,value){var inst=this.editor,ed=inst,url=this.url;var focusElm=inst.selection.getNode();var trElm=inst.dom.getParent(focusElm,"tr");var tdElm=inst.dom.getParent(focusElm,"td,th");var tableElm=inst.dom.getParent(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function select(dx,dy){var td;grid=getTableGrid(tableElm);dx=dx||0;dy=dy||0;dx=Math.max(cpos.cellindex+dx,0);dy=Math.max(cpos.rowindex+dy,0);inst.execCommand('mceRepaint');td=getCell(grid,dy,dx);if(td){inst.selection.select(td.firstChild||td);inst.selection.collapse(1);}};function makeTD(){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='
    ';}function getColRowSpan(td){var colspan=inst.dom.getAttrib(td,"colspan");var rowspan=inst.dom.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){var x,y;for(y=0;y1){for(var i=x;i1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i';if(tinymce.isIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=inst.dom.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i';}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableMoveToNextRow":var nextCell=getNextCell(tableElm,tdElm);if(!nextCell){inst.execCommand("mceTableInsertRowAfter",tdElm);nextCell=getNextCell(tableElm,tdElm);}inst.selection.select(nextCell);inst.selection.collapse(true);return true;case"mceTableRowProps":if(trElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/row.htm',width:400+parseInt(inst.getLang('table.rowprops_delta_width',0)),height:295+parseInt(inst.getLang('table.rowprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){inst.windowManager.open({url:url+'/cell.htm',width:400+parseInt(inst.getLang('table.cellprops_delta_width',0)),height:295+parseInt(inst.getLang('table.cellprops_delta_height',0)),inline:1},{plugin_url:url});}return true;case"mceInsertTable":if(user_interface){inst.windowManager.open({url:url+'/table.htm',width:400+parseInt(inst.getLang('table.table_delta_width',0)),height:320+parseInt(inst.getLang('table.table_delta_height',0)),inline:1},{plugin_url:url,action:value?value.action:0});}return true;case"mceTableDelete":var table=inst.dom.getParent(inst.selection.getNode(),"table");if(table){table.parentNode.removeChild(table);inst.execCommand('mceRepaint');}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);select(0,1);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}select(0,1);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);select(0,-1);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}select();break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(inst.dom.getParent(tableElm,"table"));var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);if(!tinymce.isIE)newTD.innerHTML='
    ';newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}select(1);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if((grid.length>1&&grid[0].length<=1)&&tableElm.nodeName=='TBODY'){inst.dom.remove(inst.dom.getParent(tableElm,"table"));return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}select(-1);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i';trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");break;case"mceTableMergeCells":var rows=[];var sel=inst.selection.getSel();var grid=getTableGrid(tableElm);if(tinymce.isIE||sel.rangeCount==1){if(user_interface){var sp=getColRowSpan(tdElm);inst.windowManager.open({url:url+'/merge_cells.htm',width:240+parseInt(inst.getLang('table.merge_cells_delta_width',0)),height:110+parseInt(inst.getLang('table.merge_cells_delta_height',0)),inline:1},{action:"update",numcols:sp.colspan,numrows:sp.rowspan,plugin_url:url});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y0)rows[rows.length]=rowCells;var td=getCell(grid,cpos.rowindex,cpos.cellindex);each(ed.dom.select('br',td),function(e,i){if(i>0&&ed.dom.getAttrib('mce_bogus'))ed.dom.remove(e);});}}}else{var cells=[];var sel=inst.selection.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i0)rows[rows.length]=rowCells;}var curRow=[];var lastTR=null;for(var y=0;ycolSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;xrowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}each(ed.dom.select('br',tdElm),function(e,i){if(i>0&&ed.dom.getAttrib(e,'mce_bogus'))ed.dom.remove(e);});break;}tableElm=inst.dom.getParent(inst.selection.getNode(),"table");inst.addVisual(tableElm);inst.nodeChanged();}return true;}return false;}});tinymce.PluginManager.add('table',tinymce.plugins.TablePlugin);})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/editor_plugin_src.js b/thirdparty/tiny/plugins/table/editor_plugin_src.js new file mode 100644 index 0000000..3e57a84 --- /dev/null +++ b/thirdparty/tiny/plugins/table/editor_plugin_src.js @@ -0,0 +1,1136 @@ +/** + * $Id: editor_plugin_src.js 953 2008-11-04 10:16:50Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var each = tinymce.each; + + tinymce.create('tinymce.plugins.TablePlugin', { + init : function(ed, url) { + var t = this; + + t.editor = ed; + t.url = url; + + // Register buttons + each([ + ['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(c) { + ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); + }); + + if (ed.getParam('inline_styles')) { + // Force move of attribs to styles in strict mode + ed.onPreProcess.add(function(ed, o) { + var dom = ed.dom; + + each(dom.select('table', o.node), function(n) { + var v; + + if (v = dom.getAttrib(n, 'width')) { + dom.setStyle(n, 'width', v); + dom.setAttrib(n, 'width'); + } + + if (v = dom.getAttrib(n, 'height')) { + dom.setStyle(n, 'height', v); + dom.setAttrib(n, 'height'); + } + }); + }); + } + + ed.onInit.add(function() { + if (ed && ed.plugins.contextmenu) { + ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { + var sm, se = ed.selection, el = se.getNode() || ed.getBody(); + + if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) { + m.removeAll(); + + if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { + m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); + m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); + m.addSeparator(); + } + + if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { + m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); + m.addSeparator(); + } + + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true, value : {action : 'insert'}}); + m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable', ui : true}); + m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete', ui : true}); + m.addSeparator(); + + // Cell menu + sm = m.addMenu({title : 'table.cell'}); + sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps', ui : true}); + sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells', ui : true}); + sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells', ui : true}); + + // Row menu + sm = m.addMenu({title : 'table.row'}); + sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps', ui : true}); + sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); + sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); + sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); + sm.addSeparator(); + sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); + sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); + sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}); + sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}); + + // Column menu + sm = m.addMenu({title : 'table.col'}); + sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); + sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); + sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); + } else + m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true}); + }); + } + }); + + // Add undo level when new rows are created using the tab key + ed.onKeyDown.add(function(ed, e) { + if (e.keyCode == 9 && ed.dom.getParent(ed.selection.getNode(), 'TABLE')) { + if (!tinymce.isGecko && !tinymce.isOpera) { + tinyMCE.execInstanceCommand(ed.editorId, "mceTableMoveToNextRow", true); + return tinymce.dom.Event.cancel(e); + } + + ed.undoManager.add(); + } + }); + + // Select whole table is a table border is clicked + if (!tinymce.isIE) { + if (ed.getParam('table_selection', true)) { + ed.onClick.add(function(ed, e) { + e = e.target; + + if (e.nodeName === 'TABLE') + ed.selection.select(e); + }); + } + } + + ed.onNodeChange.add(function(ed, cm, n) { + var p = ed.dom.getParent(n, 'td,th,caption'); + + cm.setActive('table', n.nodeName === 'TABLE' || !!p); + if (p && p.nodeName === 'CAPTION') + p = null; + + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_col', !p); + cm.setDisabled('delete_table', !p); + cm.setDisabled('delete_row', !p); + cm.setDisabled('col_after', !p); + cm.setDisabled('col_before', !p); + cm.setDisabled('row_after', !p); + cm.setDisabled('row_before', !p); + cm.setDisabled('row_props', !p); + cm.setDisabled('cell_props', !p); + cm.setDisabled('split_cells', !p || (parseInt(ed.dom.getAttrib(p, 'colspan', '1')) < 2 && parseInt(ed.dom.getAttrib(p, 'rowspan', '1')) < 2)); + cm.setDisabled('merge_cells', !p); + }); + + // Padd empty table cells + if (!tinymce.isIE) { + ed.onBeforeSetContent.add(function(ed, o) { + if (o.initial) + o.content = o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g, tinymce.isOpera ? '<$1$2> ' : '<$1$2>
    '); + }); + } + }, + + execCommand : function(cmd, ui, val) { + var ed = this.editor, b; + + // Is table command + switch (cmd) { + case "mceTableMoveToNextRow": + case "mceInsertTable": + case "mceTableRowProps": + case "mceTableCellProps": + case "mceTableSplitCells": + case "mceTableMergeCells": + case "mceTableInsertRowBefore": + case "mceTableInsertRowAfter": + case "mceTableDeleteRow": + case "mceTableInsertColBefore": + case "mceTableInsertColAfter": + case "mceTableDeleteCol": + case "mceTableCutRow": + case "mceTableCopyRow": + case "mceTablePasteRowBefore": + case "mceTablePasteRowAfter": + case "mceTableDelete": + ed.execCommand('mceBeginUndoLevel'); + this._doExecCommand(cmd, ui, val); + ed.execCommand('mceEndUndoLevel'); + + return true; + } + + // Pass to next handler in chain + return false; + }, + + getInfo : function() { + return { + longname : 'Tables', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', + version : tinymce.majorVersion + "." + tinymce.minorVersion + }; + }, + + // Private plugin internal methods + + /** + * Executes the table commands. + */ + _doExecCommand : function(command, user_interface, value) { + var inst = this.editor, ed = inst, url = this.url; + var focusElm = inst.selection.getNode(); + var trElm = inst.dom.getParent(focusElm, "tr"); + var tdElm = inst.dom.getParent(focusElm, "td,th"); + var tableElm = inst.dom.getParent(focusElm, "table"); + var doc = inst.contentWindow.document; + var tableBorder = tableElm ? tableElm.getAttribute("border") : ""; + + // Get first TD if no TD found + if (trElm && tdElm == null) + tdElm = trElm.cells[0]; + + function inArray(ar, v) { + for (var i=0; i 0 && inArray(ar[i], v)) + return true; + + // Found value + if (ar[i] == v) + return true; + } + + return false; + } + + function select(dx, dy) { + var td; + + grid = getTableGrid(tableElm); + dx = dx || 0; + dy = dy || 0; + dx = Math.max(cpos.cellindex + dx, 0); + dy = Math.max(cpos.rowindex + dy, 0); + + // Recalculate grid and select + inst.execCommand('mceRepaint'); + td = getCell(grid, dy, dx); + + if (td) { + inst.selection.select(td.firstChild || td); + inst.selection.collapse(1); + } + }; + + function makeTD() { + var newTD = doc.createElement("td"); + + if (!tinymce.isIE) + newTD.innerHTML = '
    '; + } + + function getColRowSpan(td) { + var colspan = inst.dom.getAttrib(td, "colspan"); + var rowspan = inst.dom.getAttrib(td, "rowspan"); + + colspan = colspan == "" ? 1 : parseInt(colspan); + rowspan = rowspan == "" ? 1 : parseInt(rowspan); + + return {colspan : colspan, rowspan : rowspan}; + } + + function getCellPos(grid, td) { + var x, y; + + for (y=0; y 1) { // Remove due to colspan + for (var i=x; i 1) + td.rowSpan = sd.rowspan + 1; + + lastElm = td; + } + + deleteMarked(tableElm); + } + } + + function prevElm(node, name) { + while ((node = node.previousSibling) != null) { + if (node.nodeName == name) + return node; + } + + return null; + } + + function nextElm(node, names) { + var namesAr = names.split(','); + + while ((node = node.nextSibling) != null) { + for (var i=0; i 1) { + do { + var nexttd = nextElm(td, "TD,TH"); + + if (td._delete) + td.parentNode.removeChild(td); + } while ((td = nexttd) != null); + } + } while ((tr = next) != null); + } + + function addRows(td_elm, tr_elm, rowspan) { + // Add rows + td_elm.rowSpan = 1; + var trNext = nextElm(tr_elm, "TR"); + for (var i=1; i 1) { + var newTD = cells[x].cloneNode(true); + var sd = getColRowSpan(cells[x]); + + newTD.rowSpan = sd.rowspan - 1; + + var nextTD = nextTR.cells[x]; + + if (nextTD == null) + nextTR.appendChild(newTD); + else + nextTR.insertBefore(newTD, nextTD); + } + } + + // Delete cells + var lastTDElm = null; + for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd.rowspan > 1) { + tdElm.rowSpan = sd.rowspan - 1; + } else { + trElm = tdElm.parentNode; + + if (trElm.parentNode) + trElm._delete = true; + } + + lastTDElm = tdElm; + } + } + + deleteMarked(tableElm); + + select(0, -1); + break; + + case "mceTableInsertColBefore": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] == 1) { + var newTD = doc.createElement(tdElm.nodeName); + + if (!tinymce.isIE) + newTD.innerHTML = '
    '; + + newTD.rowSpan = tdElm.rowSpan; + + tdElm.parentNode.insertBefore(newTD, tdElm); + } else + tdElm.colSpan++; + + lastTDElm = tdElm; + } + } + + select(); + break; + + case "mceTableInsertColAfter": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] == 1) { + var newTD = doc.createElement(tdElm.nodeName); + + if (!tinymce.isIE) + newTD.innerHTML = '
    '; + + newTD.rowSpan = tdElm.rowSpan; + + var nextTD = nextElm(tdElm, "TD,TH"); + if (nextTD == null) + tdElm.parentNode.appendChild(newTD); + else + nextTD.parentNode.insertBefore(newTD, nextTD); + } else + tdElm.colSpan++; + + lastTDElm = tdElm; + } + } + + select(1); + break; + + case "mceTableDeleteCol": + if (!trElm || !tdElm) + return true; + + var grid = getTableGrid(tableElm); + var cpos = getCellPos(grid, tdElm); + var lastTDElm = null; + + // Only one col, remove whole table + if ((grid.length > 1 && grid[0].length <= 1) && tableElm.nodeName == 'TBODY') { + inst.dom.remove(inst.dom.getParent(tableElm, "table")); + return true; + } + + // Delete cells + for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { + if (tdElm != lastTDElm) { + var sd = getColRowSpan(tdElm); + + if (sd['colspan'] > 1) + tdElm.colSpan = sd['colspan'] - 1; + else { + if (tdElm.parentNode) + tdElm.parentNode.removeChild(tdElm); + } + + lastTDElm = tdElm; + } + } + + select(-1); + break; + + case "mceTableSplitCells": + if (!trElm || !tdElm) + return true; + + var spandata = getColRowSpan(tdElm); + + var colspan = spandata["colspan"]; + var rowspan = spandata["rowspan"]; + + // Needs splitting + if (colspan > 1 || rowspan > 1) { + // Generate cols + tdElm.colSpan = 1; + for (var i=1; i 1) + addRows(newTD, trElm, rowspan); + } + + addRows(tdElm, trElm, rowspan); + } + + // Apply visual aids + tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); + break; + + case "mceTableMergeCells": + var rows = []; + var sel = inst.selection.getSel(); + var grid = getTableGrid(tableElm); + + if (tinymce.isIE || sel.rangeCount == 1) { + if (user_interface) { + // Setup template + var sp = getColRowSpan(tdElm); + + inst.windowManager.open({ + url : url + '/merge_cells.htm', + width : 240 + parseInt(inst.getLang('table.merge_cells_delta_width', 0)), + height : 110 + parseInt(inst.getLang('table.merge_cells_delta_height', 0)), + inline : 1 + }, { + action : "update", + numcols : sp.colspan, + numrows : sp.rowspan, + plugin_url : url + }); + + return true; + } else { + var numRows = parseInt(value['numrows']); + var numCols = parseInt(value['numcols']); + var cpos = getCellPos(grid, tdElm); + + if (("" + numRows) == "NaN") + numRows = 1; + + if (("" + numCols) == "NaN") + numCols = 1; + + // Get rows and cells + var tRows = tableElm.rows; + for (var y=cpos.rowindex; y 0) + rows[rows.length] = rowCells; + + var td = getCell(grid, cpos.rowindex, cpos.cellindex); + each(ed.dom.select('br', td), function(e, i) { + if (i > 0 && ed.dom.getAttrib('mce_bogus')) + ed.dom.remove(e); + }); + } + + //return true; + } + } else { + var cells = []; + var sel = inst.selection.getSel(); + var lastTR = null; + var curRow = null; + var x1 = -1, y1 = -1, x2, y2; + + // Only one cell selected, whats the point? + if (sel.rangeCount < 2) + return true; + + // Get all selected cells + for (var i=0; i 0) + rows[rows.length] = rowCells; + } + + // Find selected cells in grid and box + var curRow = []; + var lastTR = null; + for (var y=0; y colSpan) + colSpan = rowColSpan; + + lastRowSpan = -1; + } + + // Validate vertical and get total rowspan + var lastColSpan = -1; + for (var x=0; x rowSpan) + rowSpan = colRowSpan; + + lastColSpan = -1; + } + + // Setup td + tdElm = rows[0][0]; + tdElm.rowSpan = rowSpan; + tdElm.colSpan = colSpan; + + // Merge cells + for (var y=0; y 0)) + tdElm.innerHTML += html; + + // Not current cell + if (rows[y][x] != tdElm && !rows[y][x]._deleted) { + var cpos = getCellPos(grid, rows[y][x]); + var tr = rows[y][x].parentNode; + + tr.removeChild(rows[y][x]); + rows[y][x]._deleted = true; + + // Empty TR, remove it + if (!tr.hasChildNodes()) { + tr.parentNode.removeChild(tr); + + var lastCell = null; + for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) { + if (cellElm != lastCell && cellElm.rowSpan > 1) + cellElm.rowSpan--; + + lastCell = cellElm; + } + + if (tdElm.rowSpan > 1) + tdElm.rowSpan--; + } + } + } + } + + // Remove all but one bogus br + each(ed.dom.select('br', tdElm), function(e, i) { + if (i > 0 && ed.dom.getAttrib(e, 'mce_bogus')) + ed.dom.remove(e); + }); + + break; + } + + tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); + inst.addVisual(tableElm); + inst.nodeChanged(); + } + + return true; + } + + // Pass to next handler in chain + return false; + } + }); + + // Register plugin + tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/js/.svn/all-wcprops b/thirdparty/tiny/plugins/table/js/.svn/all-wcprops new file mode 100644 index 0000000..e2db507 --- /dev/null +++ b/thirdparty/tiny/plugins/table/js/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/js +END +row.js +K 25 +svn:wc:ra_dav:version-url +V 63 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/js/row.js +END +table.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/js/table.js +END +cell.js +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/js/cell.js +END +merge_cells.js +K 25 +svn:wc:ra_dav:version-url +V 71 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/js/merge_cells.js +END diff --git a/thirdparty/tiny/plugins/table/js/.svn/entries b/thirdparty/tiny/plugins/table/js/.svn/entries new file mode 100644 index 0000000..5edfda0 --- /dev/null +++ b/thirdparty/tiny/plugins/table/js/.svn/entries @@ -0,0 +1,164 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/table/js +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +row.js +file + + + + +2009-06-08T19:44:27.000000Z +2693fc4c10154d8bfcc577c799e3b7d5 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +6697 + +table.js +file + + + + +2009-06-08T19:44:27.000000Z +db3fbeddf77b5f6541316c2dc33e71b0 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +13337 + +cell.js +file + + + + +2009-06-08T19:44:27.000000Z +972146156268a52e5477d4c1922cbadd +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +8109 + +merge_cells.js +file + + + + +2009-06-08T19:44:27.000000Z +254f6cd01295c5f7aa78950d37fd3aab +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +677 + diff --git a/thirdparty/tiny/plugins/table/js/.svn/format b/thirdparty/tiny/plugins/table/js/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/table/js/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/table/js/.svn/text-base/cell.js.svn-base b/thirdparty/tiny/plugins/table/js/.svn/text-base/cell.js.svn-base new file mode 100644 index 0000000..07320ac --- /dev/null +++ b/thirdparty/tiny/plugins/table/js/.svn/text-base/cell.js.svn-base @@ -0,0 +1,269 @@ +tinyMCEPopup.requireLangPack(); + +var ed; + +function init() { + ed = tinyMCEPopup.editor; + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = ed; + var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th"); + var formObj = document.forms[0]; + var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = ed.dom.getAttrib(tdElm, 'align'); + var valign = ed.dom.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = ed.dom.getAttrib(tdElm, 'class'); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; + var id = ed.dom.getAttrib(tdElm, 'id'); + var lang = ed.dom.getAttrib(tdElm, 'lang'); + var dir = ed.dom.getAttrib(tdElm, 'dir'); + var scope = ed.dom.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + TinyMCE_EditableSelects.init(); + + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = ed.dom.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className, true, true); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); +} + +function updateAction() { + var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getNode(); + tdElm = ed.dom.getParent(el, "td,th"); + trElm = ed.dom.getParent(el, "tr"); + tableElm = ed.dom.getParent(el, "table"); + + ed.execCommand('mceBeginUndoLevel'); + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + function doUpdate(s) { + if (s) { + updateCell(tdElm); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + } + }; + + if (ed.getParam("accessibility_warnings", 1)) { + if (celltype == "th" && scope == "") + tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); + else + doUpdate(1); + + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + inst.execCommand('mceBeginUndoLevel'); + + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + dom.setAttrib(elm, 'border', border); + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
    '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = border == "" ? "1px" : border; + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += '/g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'frame', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && formObj.bordercolor.value != "") + st['border-width'] = formObj.border.value + "px"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/table/js/cell.js b/thirdparty/tiny/plugins/table/js/cell.js new file mode 100644 index 0000000..07320ac --- /dev/null +++ b/thirdparty/tiny/plugins/table/js/cell.js @@ -0,0 +1,269 @@ +tinyMCEPopup.requireLangPack(); + +var ed; + +function init() { + ed = tinyMCEPopup.editor; + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') + + var inst = ed; + var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th"); + var formObj = document.forms[0]; + var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); + + // Get table cell data + var celltype = tdElm.nodeName.toLowerCase(); + var align = ed.dom.getAttrib(tdElm, 'align'); + var valign = ed.dom.getAttrib(tdElm, 'valign'); + var width = trimSize(getStyle(tdElm, 'width', 'width')); + var height = trimSize(getStyle(tdElm, 'height', 'height')); + var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); + var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); + var className = ed.dom.getAttrib(tdElm, 'class'); + var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; + var id = ed.dom.getAttrib(tdElm, 'id'); + var lang = ed.dom.getAttrib(tdElm, 'lang'); + var dir = ed.dom.getAttrib(tdElm, 'dir'); + var scope = ed.dom.getAttrib(tdElm, 'scope'); + + // Setup form + addClassesToList('class', 'table_cell_styles'); + TinyMCE_EditableSelects.init(); + + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.backgroundimage.value = backgroundimage; + formObj.width.value = width; + formObj.height.value = height; + formObj.id.value = id; + formObj.lang.value = lang; + formObj.style.value = ed.dom.serializeStyle(st); + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'valign', valign); + selectByValue(formObj, 'class', className, true, true); + selectByValue(formObj, 'celltype', celltype); + selectByValue(formObj, 'dir', dir); + selectByValue(formObj, 'scope', scope); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); +} + +function updateAction() { + var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; + + tinyMCEPopup.restoreSelection(); + el = ed.selection.getNode(); + tdElm = ed.dom.getParent(el, "td,th"); + trElm = ed.dom.getParent(el, "tr"); + tableElm = ed.dom.getParent(el, "table"); + + ed.execCommand('mceBeginUndoLevel'); + + switch (getSelectValue(formObj, 'action')) { + case "cell": + var celltype = getSelectValue(formObj, 'celltype'); + var scope = getSelectValue(formObj, 'scope'); + + function doUpdate(s) { + if (s) { + updateCell(tdElm); + + ed.addVisual(); + ed.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + } + }; + + if (ed.getParam("accessibility_warnings", 1)) { + if (celltype == "th" && scope == "") + tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); + else + doUpdate(1); + + return; + } + + updateCell(tdElm); + break; + + case "row": + var cell = trElm.firstChild; + + if (cell.nodeName != "TD" && cell.nodeName != "TH") + cell = nextCell(cell); + + do { + cell = updateCell(cell, true); + } while ((cell = nextCell(cell)) != null); + + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + inst.execCommand('mceBeginUndoLevel'); + + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + dom.setAttrib(elm, 'border', border); + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
    '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = border == "" ? "1px" : border; + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += '/g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'frame', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && formObj.bordercolor.value != "") + st['border-width'] = formObj.border.value + "px"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/table/langs/.svn/all-wcprops b/thirdparty/tiny/plugins/table/langs/.svn/all-wcprops new file mode 100644 index 0000000..e01e37d --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/langs +END +en_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/langs/en_dlg.js +END +de_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/table/langs/de_dlg.js +END diff --git a/thirdparty/tiny/plugins/table/langs/.svn/entries b/thirdparty/tiny/plugins/table/langs/.svn/entries new file mode 100644 index 0000000..d4d15bf --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/table/langs +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +en_dlg.js +file + + + + +2009-06-08T19:44:27.000000Z +9828ab260a60ea25a88b7657c937f666 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2137 + +de_dlg.js +file + + + + +2009-06-08T19:44:27.000000Z +0a02566a7fd33fa0d4b03eef0b5d24c9 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2388 + diff --git a/thirdparty/tiny/plugins/table/langs/.svn/format b/thirdparty/tiny/plugins/table/langs/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/table/langs/.svn/text-base/de_dlg.js.svn-base b/thirdparty/tiny/plugins/table/langs/.svn/text-base/de_dlg.js.svn-base new file mode 100644 index 0000000..faf7c7d --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/.svn/text-base/de_dlg.js.svn-base @@ -0,0 +1,74 @@ +tinyMCE.addI18n('de.table_dlg',{ +general_tab:"Allgemein", +advanced_tab:"Erweitert", +general_props:"Allgemeine Einstellungen", +advanced_props:"Erweiterte Einstellungen", +rowtype:"Row in table part", +title:"Tabelle einf\u00FCgen/bearbeiten", +width:"Breite", +height:"H\u00F6he", +cols:"Spalten", +rows:"Zeilen", +cellspacing:"Zellenabstand", +cellpadding:"Abstand innerhalb der Zellen", +border:"Rahmen", +align:"Ausrichtung", +align_default:"Standard", +align_left:"Links", +align_right:"Rechts", +align_middle:"Mittig", +row_title:"Eigenschaften der Zeile", +cell_title:"Eigenschaften der Zelle", +cell_type:"Zellentyp", +valign:"Vertikale Ausrichtung", +align_top:"Oben", +align_bottom:"Unten", +bordercolor:"Rahmenfarbe", +bgcolor:"Hintergrundfarbe", +merge_cells_title:"Zellen vereinen", +id:"ID", +style:"Format", +langdir:"Schriftrichtung", +langcode:"Sprachcode", +mime:"MIME-Type des Inhalts", +ltr:"Links nach rechts", +rtl:"Rechts nach links", +bgimage:"Hintergrundbild", +summary:"Zusammenfassung", +td:"Textzelle", +th:"\u00DCberschrift", +cell_cell:"Diese Zelle ver\u00E4ndern", +cell_row:"Alle Zellen in dieser Zeile ver\u00E4ndern", +cell_all:"Alle Zellen der Tabelle ver\u00E4ndern", +row_row:"Diese Zeile ver\u00E4ndern", +row_odd:"Ungerade Zeilen ver\u00E4ndern", +row_even:"Gerade Zeilen ver\u00E4ndern", +row_all:"Alle Zeilen ver\u00E4ndern", +thead:"Tabellenkopf", +tbody:"Tabelleninhalt", +tfoot:"Tabellenfu\u00DF", +scope:"Zusammenhang", +rowgroup:"Vertikal gruppieren", +colgroup:"Horizontal gruppieren", +col_limit:"Sie haben die maximale Spaltenzahl von {$cols} \u00FCberschritten.", +row_limit:"Sie haben die maximale Zeilenzahl von {$rows} \u00FCberschritten.", +cell_limit:"Sie haben die maximale Zellenzahl von {$cells} \u00FCberschritten.", +missing_scope:"Sind Sie sicher, dass Sie keinen Zusammenhang f\u00FCr diese \u00DCberschrift angeben wollen? Benutzer mit k\u00F6rperlichen Einschr\u00E4nkungen k\u00F6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.", +caption:"Beschriftung der Tabelle", +frame:"Gitter", +frame_none:"keins", +frame_groups:"Gruppen", +frame_rows:"Zeilen", +frame_cols:"Spalten", +frame_all:"Alle", +rules:"Rules", +rules_void:"void", +rules_above:"above", +rules_below:"below", +rules_hsides:"hsides", +rules_lhs:"lhs", +rules_rhs:"rhs", +rules_vsides:"vsides", +rules_box:"box", +rules_border:"border" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/langs/.svn/text-base/en_dlg.js.svn-base b/thirdparty/tiny/plugins/table/langs/.svn/text-base/en_dlg.js.svn-base new file mode 100644 index 0000000..a33c987 --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/.svn/text-base/en_dlg.js.svn-base @@ -0,0 +1,74 @@ +tinyMCE.addI18n('en.table_dlg',{ +general_tab:"General", +advanced_tab:"Advanced", +general_props:"General properties", +advanced_props:"Advanced properties", +rowtype:"Row in table part", +title:"Insert/Modify table", +width:"Width", +height:"Height", +cols:"Cols", +rows:"Rows", +cellspacing:"Cellspacing", +cellpadding:"Cellpadding", +border:"Border", +align:"Alignment", +align_default:"Default", +align_left:"Left", +align_right:"Right", +align_middle:"Center", +row_title:"Table row properties", +cell_title:"Table cell properties", +cell_type:"Cell type", +valign:"Vertical alignment", +align_top:"Top", +align_bottom:"Bottom", +bordercolor:"Border color", +bgcolor:"Background color", +merge_cells_title:"Merge table cells", +id:"Id", +style:"Style", +langdir:"Language direction", +langcode:"Language code", +mime:"Target MIME type", +ltr:"Left to right", +rtl:"Right to left", +bgimage:"Background image", +summary:"Summary", +td:"Data", +th:"Header", +cell_cell:"Update current cell", +cell_row:"Update all cells in row", +cell_all:"Update all cells in table", +row_row:"Update current row", +row_odd:"Update odd rows in table", +row_even:"Update even rows in table", +row_all:"Update all rows in table", +thead:"Table Head", +tbody:"Table Body", +tfoot:"Table Foot", +scope:"Scope", +rowgroup:"Row Group", +colgroup:"Col Group", +col_limit:"You've exceeded the maximum number of columns of {$cols}.", +row_limit:"You've exceeded the maximum number of rows of {$rows}.", +cell_limit:"You've exceeded the maximum number of cells of {$cells}.", +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.", +caption:"Table caption", +frame:"Frame", +frame_none:"none", +frame_groups:"groups", +frame_rows:"rows", +frame_cols:"cols", +frame_all:"all", +rules:"Rules", +rules_void:"void", +rules_above:"above", +rules_below:"below", +rules_hsides:"hsides", +rules_lhs:"lhs", +rules_rhs:"rhs", +rules_vsides:"vsides", +rules_box:"box", +rules_border:"border" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/langs/de_dlg.js b/thirdparty/tiny/plugins/table/langs/de_dlg.js new file mode 100644 index 0000000..faf7c7d --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/de_dlg.js @@ -0,0 +1,74 @@ +tinyMCE.addI18n('de.table_dlg',{ +general_tab:"Allgemein", +advanced_tab:"Erweitert", +general_props:"Allgemeine Einstellungen", +advanced_props:"Erweiterte Einstellungen", +rowtype:"Row in table part", +title:"Tabelle einf\u00FCgen/bearbeiten", +width:"Breite", +height:"H\u00F6he", +cols:"Spalten", +rows:"Zeilen", +cellspacing:"Zellenabstand", +cellpadding:"Abstand innerhalb der Zellen", +border:"Rahmen", +align:"Ausrichtung", +align_default:"Standard", +align_left:"Links", +align_right:"Rechts", +align_middle:"Mittig", +row_title:"Eigenschaften der Zeile", +cell_title:"Eigenschaften der Zelle", +cell_type:"Zellentyp", +valign:"Vertikale Ausrichtung", +align_top:"Oben", +align_bottom:"Unten", +bordercolor:"Rahmenfarbe", +bgcolor:"Hintergrundfarbe", +merge_cells_title:"Zellen vereinen", +id:"ID", +style:"Format", +langdir:"Schriftrichtung", +langcode:"Sprachcode", +mime:"MIME-Type des Inhalts", +ltr:"Links nach rechts", +rtl:"Rechts nach links", +bgimage:"Hintergrundbild", +summary:"Zusammenfassung", +td:"Textzelle", +th:"\u00DCberschrift", +cell_cell:"Diese Zelle ver\u00E4ndern", +cell_row:"Alle Zellen in dieser Zeile ver\u00E4ndern", +cell_all:"Alle Zellen der Tabelle ver\u00E4ndern", +row_row:"Diese Zeile ver\u00E4ndern", +row_odd:"Ungerade Zeilen ver\u00E4ndern", +row_even:"Gerade Zeilen ver\u00E4ndern", +row_all:"Alle Zeilen ver\u00E4ndern", +thead:"Tabellenkopf", +tbody:"Tabelleninhalt", +tfoot:"Tabellenfu\u00DF", +scope:"Zusammenhang", +rowgroup:"Vertikal gruppieren", +colgroup:"Horizontal gruppieren", +col_limit:"Sie haben die maximale Spaltenzahl von {$cols} \u00FCberschritten.", +row_limit:"Sie haben die maximale Zeilenzahl von {$rows} \u00FCberschritten.", +cell_limit:"Sie haben die maximale Zellenzahl von {$cells} \u00FCberschritten.", +missing_scope:"Sind Sie sicher, dass Sie keinen Zusammenhang f\u00FCr diese \u00DCberschrift angeben wollen? Benutzer mit k\u00F6rperlichen Einschr\u00E4nkungen k\u00F6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.", +caption:"Beschriftung der Tabelle", +frame:"Gitter", +frame_none:"keins", +frame_groups:"Gruppen", +frame_rows:"Zeilen", +frame_cols:"Spalten", +frame_all:"Alle", +rules:"Rules", +rules_void:"void", +rules_above:"above", +rules_below:"below", +rules_hsides:"hsides", +rules_lhs:"lhs", +rules_rhs:"rhs", +rules_vsides:"vsides", +rules_box:"box", +rules_border:"border" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/langs/en_dlg.js b/thirdparty/tiny/plugins/table/langs/en_dlg.js new file mode 100644 index 0000000..a33c987 --- /dev/null +++ b/thirdparty/tiny/plugins/table/langs/en_dlg.js @@ -0,0 +1,74 @@ +tinyMCE.addI18n('en.table_dlg',{ +general_tab:"General", +advanced_tab:"Advanced", +general_props:"General properties", +advanced_props:"Advanced properties", +rowtype:"Row in table part", +title:"Insert/Modify table", +width:"Width", +height:"Height", +cols:"Cols", +rows:"Rows", +cellspacing:"Cellspacing", +cellpadding:"Cellpadding", +border:"Border", +align:"Alignment", +align_default:"Default", +align_left:"Left", +align_right:"Right", +align_middle:"Center", +row_title:"Table row properties", +cell_title:"Table cell properties", +cell_type:"Cell type", +valign:"Vertical alignment", +align_top:"Top", +align_bottom:"Bottom", +bordercolor:"Border color", +bgcolor:"Background color", +merge_cells_title:"Merge table cells", +id:"Id", +style:"Style", +langdir:"Language direction", +langcode:"Language code", +mime:"Target MIME type", +ltr:"Left to right", +rtl:"Right to left", +bgimage:"Background image", +summary:"Summary", +td:"Data", +th:"Header", +cell_cell:"Update current cell", +cell_row:"Update all cells in row", +cell_all:"Update all cells in table", +row_row:"Update current row", +row_odd:"Update odd rows in table", +row_even:"Update even rows in table", +row_all:"Update all rows in table", +thead:"Table Head", +tbody:"Table Body", +tfoot:"Table Foot", +scope:"Scope", +rowgroup:"Row Group", +colgroup:"Col Group", +col_limit:"You've exceeded the maximum number of columns of {$cols}.", +row_limit:"You've exceeded the maximum number of rows of {$rows}.", +cell_limit:"You've exceeded the maximum number of cells of {$cells}.", +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.", +caption:"Table caption", +frame:"Frame", +frame_none:"none", +frame_groups:"groups", +frame_rows:"rows", +frame_cols:"cols", +frame_all:"all", +rules:"Rules", +rules_void:"void", +rules_above:"above", +rules_below:"below", +rules_hsides:"hsides", +rules_lhs:"lhs", +rules_rhs:"rhs", +rules_vsides:"vsides", +rules_box:"box", +rules_border:"border" +}); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/table/merge_cells.htm b/thirdparty/tiny/plugins/table/merge_cells.htm new file mode 100644 index 0000000..f2dcbec --- /dev/null +++ b/thirdparty/tiny/plugins/table/merge_cells.htm @@ -0,0 +1,38 @@ + + + + {#table_dlg.merge_cells_title} + + + + + + + +
    +
    + {#table_dlg.merge_cells_title} + + + + + + + + + +
    {#table_dlg.cols}:
    {#table_dlg.rows}:
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/row.htm b/thirdparty/tiny/plugins/table/row.htm new file mode 100644 index 0000000..4a709d3 --- /dev/null +++ b/thirdparty/tiny/plugins/table/row.htm @@ -0,0 +1,161 @@ + + + + {#table_dlg.row_title} + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/table/table.htm b/thirdparty/tiny/plugins/table/table.htm new file mode 100644 index 0000000..74982fa --- /dev/null +++ b/thirdparty/tiny/plugins/table/table.htm @@ -0,0 +1,193 @@ + + + + {#table_dlg.title} + + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
     
    +
    + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/template/.svn/all-wcprops b/thirdparty/tiny/plugins/template/.svn/all-wcprops new file mode 100644 index 0000000..20969f7 --- /dev/null +++ b/thirdparty/tiny/plugins/template/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 73 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/editor_plugin.js +END +template.htm +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/template.htm +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 77 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/editor_plugin_src.js +END +blank.htm +K 25 +svn:wc:ra_dav:version-url +V 66 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/blank.htm +END diff --git a/thirdparty/tiny/plugins/template/.svn/entries b/thirdparty/tiny/plugins/template/.svn/entries new file mode 100644 index 0000000..ee92568 --- /dev/null +++ b/thirdparty/tiny/plugins/template/.svn/entries @@ -0,0 +1,173 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/template +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:28.000000Z +345d085ce78d9bb1e14ab6fe4f151e44 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +3567 + +template.htm +file + + + + +2009-06-08T19:44:28.000000Z +767d3434a6716d7f6448df091e2516a3 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1586 + +langs +dir + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:28.000000Z +d366df72a7b56db7914d320e5f7800e0 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +4924 + +css +dir + +js +dir + +blank.htm +file + + + + +2009-06-08T19:44:28.000000Z +9553e76581d74579d23bea5c7ea8a807 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +332 + diff --git a/thirdparty/tiny/plugins/template/.svn/format b/thirdparty/tiny/plugins/template/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/template/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/template/.svn/text-base/blank.htm.svn-base b/thirdparty/tiny/plugins/template/.svn/text-base/blank.htm.svn-base new file mode 100644 index 0000000..538a3b1 --- /dev/null +++ b/thirdparty/tiny/plugins/template/.svn/text-base/blank.htm.svn-base @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/thirdparty/tiny/plugins/template/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/template/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..0f7fb01 --- /dev/null +++ b/thirdparty/tiny/plugins/template/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TemplatePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceTemplate',function(ui){ed.windowManager.open({file:url+'/template.htm',width:ed.getParam('template_popup_width',750),height:ed.getParam('template_popup_height',600),inline:1},{plugin_url:url});});ed.addCommand('mceInsertTemplate',t._insertTemplate,t);ed.addButton('template',{title:'template.desc',cmd:'mceTemplate'});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('div',o.node),function(e){if(dom.hasClass(e,'mceTmpl')){each(dom.select('*',e),function(e){if(dom.hasClass(e,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))e.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));});t._replaceVals(e);}});});},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(ui,v){var t=this,ed=t.editor,h,el,dom=ed.dom,sel=ed.selection.getContent();h=v.content;each(t.editor.getParam('template_replace_values'),function(v,k){if(typeof(v)!='function')h=h.replace(new RegExp('\\{\\$'+k+'\\}','g'),v);});el=dom.create('div',null,h);n=dom.select('.mceTmpl',el);if(n&&n.length>0){el=dom.create('div',null);el.appendChild(n[0].cloneNode(true));}function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(dom.select('*',el),function(n){if(hasClass(n,ed.getParam('template_cdate_classes','cdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_cdate_format",ed.getLang("template.cdate_format")));if(hasClass(n,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));if(hasClass(n,ed.getParam('template_selected_content_classes','selcontent').replace(/\s+/g,'|')))n.innerHTML=sel;});t._replaceVals(el);ed.execCommand('mceInsertContent',false,el.innerHTML);ed.addVisual();},_replaceVals:function(e){var dom=this.editor.dom,vl=this.editor.getParam('template_replace_values');each(dom.select('*',e),function(e){each(vl,function(v,k){if(dom.hasClass(e,k)){if(typeof(vl[k])=='function')vl[k](e);}});});},_getDateTime:function(d,fmt){if(!fmt)return"";function addZeros(value,len){var i;value=""+value;if(value.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + tinyMCE.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + tinyMCE.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/template/.svn/text-base/template.htm.svn-base b/thirdparty/tiny/plugins/template/.svn/text-base/template.htm.svn-base new file mode 100644 index 0000000..600b91b --- /dev/null +++ b/thirdparty/tiny/plugins/template/.svn/text-base/template.htm.svn-base @@ -0,0 +1,39 @@ + + + {#template_dlg.title} + + + + + + +
    +
    +
    {#template_dlg.desc}
    +
    + +
    +
    +
    +
    + {#template_dlg.preview} + +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/template/blank.htm b/thirdparty/tiny/plugins/template/blank.htm new file mode 100644 index 0000000..538a3b1 --- /dev/null +++ b/thirdparty/tiny/plugins/template/blank.htm @@ -0,0 +1,12 @@ + + + blank_page + + + + + + + diff --git a/thirdparty/tiny/plugins/template/css/.svn/all-wcprops b/thirdparty/tiny/plugins/template/css/.svn/all-wcprops new file mode 100644 index 0000000..76590cd --- /dev/null +++ b/thirdparty/tiny/plugins/template/css/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 60 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/css +END +template.css +K 25 +svn:wc:ra_dav:version-url +V 73 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/css/template.css +END diff --git a/thirdparty/tiny/plugins/template/css/.svn/entries b/thirdparty/tiny/plugins/template/css/.svn/entries new file mode 100644 index 0000000..be9f88b --- /dev/null +++ b/thirdparty/tiny/plugins/template/css/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/template/css +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +template.css +file + + + + +2009-06-08T19:44:28.000000Z +5b2c159120cbef004c9b0804c292820b +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +275 + diff --git a/thirdparty/tiny/plugins/template/css/.svn/format b/thirdparty/tiny/plugins/template/css/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/template/css/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/template/css/.svn/text-base/template.css.svn-base b/thirdparty/tiny/plugins/template/css/.svn/text-base/template.css.svn-base new file mode 100644 index 0000000..0a03f2e --- /dev/null +++ b/thirdparty/tiny/plugins/template/css/.svn/text-base/template.css.svn-base @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/thirdparty/tiny/plugins/template/css/template.css b/thirdparty/tiny/plugins/template/css/template.css new file mode 100644 index 0000000..0a03f2e --- /dev/null +++ b/thirdparty/tiny/plugins/template/css/template.css @@ -0,0 +1,23 @@ +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/thirdparty/tiny/plugins/template/editor_plugin.js b/thirdparty/tiny/plugins/template/editor_plugin.js new file mode 100644 index 0000000..0f7fb01 --- /dev/null +++ b/thirdparty/tiny/plugins/template/editor_plugin.js @@ -0,0 +1 @@ +(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TemplatePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceTemplate',function(ui){ed.windowManager.open({file:url+'/template.htm',width:ed.getParam('template_popup_width',750),height:ed.getParam('template_popup_height',600),inline:1},{plugin_url:url});});ed.addCommand('mceInsertTemplate',t._insertTemplate,t);ed.addButton('template',{title:'template.desc',cmd:'mceTemplate'});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;each(dom.select('div',o.node),function(e){if(dom.hasClass(e,'mceTmpl')){each(dom.select('*',e),function(e){if(dom.hasClass(e,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))e.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));});t._replaceVals(e);}});});},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(ui,v){var t=this,ed=t.editor,h,el,dom=ed.dom,sel=ed.selection.getContent();h=v.content;each(t.editor.getParam('template_replace_values'),function(v,k){if(typeof(v)!='function')h=h.replace(new RegExp('\\{\\$'+k+'\\}','g'),v);});el=dom.create('div',null,h);n=dom.select('.mceTmpl',el);if(n&&n.length>0){el=dom.create('div',null);el.appendChild(n[0].cloneNode(true));}function hasClass(n,c){return new RegExp('\\b'+c+'\\b','g').test(n.className);};each(dom.select('*',el),function(n){if(hasClass(n,ed.getParam('template_cdate_classes','cdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_cdate_format",ed.getLang("template.cdate_format")));if(hasClass(n,ed.getParam('template_mdate_classes','mdate').replace(/\s+/g,'|')))n.innerHTML=t._getDateTime(new Date(),ed.getParam("template_mdate_format",ed.getLang("template.mdate_format")));if(hasClass(n,ed.getParam('template_selected_content_classes','selcontent').replace(/\s+/g,'|')))n.innerHTML=sel;});t._replaceVals(el);ed.execCommand('mceInsertContent',false,el.innerHTML);ed.addVisual();},_replaceVals:function(e){var dom=this.editor.dom,vl=this.editor.getParam('template_replace_values');each(dom.select('*',e),function(e){each(vl,function(v,k){if(dom.hasClass(e,k)){if(typeof(vl[k])=='function')vl[k](e);}});});},_getDateTime:function(d,fmt){if(!fmt)return"";function addZeros(value,len){var i;value=""+value;if(value.length 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + + function hasClass(n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + + each(dom.select('*', el), function(n) { + // Replace cdate + if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); + + // Replace mdate + if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) + n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); + + // Replace selection + if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) + n.innerHTML = sel; + }); + + t._replaceVals(el); + + ed.execCommand('mceInsertContent', false, el.innerHTML); + ed.addVisual(); + }, + + _replaceVals : function(e) { + var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); + + each(dom.select('*', e), function(e) { + each(vl, function(v, k) { + if (dom.hasClass(e, k)) { + if (typeof(vl[k]) == 'function') + vl[k](e); + } + }); + }); + }, + + _getDateTime : function(d, fmt) { + if (!fmt) + return ""; + + function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; + } + + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%B", "" + tinyMCE.getLang("template_months_long").split(',')[d.getMonth()]); + fmt = fmt.replace("%b", "" + tinyMCE.getLang("template_months_short").split(',')[d.getMonth()]); + fmt = fmt.replace("%A", "" + tinyMCE.getLang("template_day_long").split(',')[d.getDay()]); + fmt = fmt.replace("%a", "" + tinyMCE.getLang("template_day_short").split(',')[d.getDay()]); + fmt = fmt.replace("%%", "%"); + + return fmt; + } + }); + + // Register plugin + tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/template/js/.svn/all-wcprops b/thirdparty/tiny/plugins/template/js/.svn/all-wcprops new file mode 100644 index 0000000..a1b1149 --- /dev/null +++ b/thirdparty/tiny/plugins/template/js/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/js +END +template.js +K 25 +svn:wc:ra_dav:version-url +V 71 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/template/js/template.js +END diff --git a/thirdparty/tiny/plugins/template/js/.svn/entries b/thirdparty/tiny/plugins/template/js/.svn/entries new file mode 100644 index 0000000..26a60fd --- /dev/null +++ b/thirdparty/tiny/plugins/template/js/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/template/js +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +template.js +file + + + + +2009-06-08T19:44:28.000000Z +48fe76a8ef588730634bd4e76aec32f8 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2778 + diff --git a/thirdparty/tiny/plugins/template/js/.svn/format b/thirdparty/tiny/plugins/template/js/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/template/js/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/template/js/.svn/text-base/template.js.svn-base b/thirdparty/tiny/plugins/template/js/.svn/text-base/template.js.svn-base new file mode 100644 index 0000000..7eab2eb --- /dev/null +++ b/thirdparty/tiny/plugins/template/js/.svn/text-base/template.js.svn-base @@ -0,0 +1,106 @@ +tinyMCEPopup.requireLangPack(); + +var TemplateDialog = { + preInit : function() { + var url = tinyMCEPopup.getParam("template_external_list_url"); + + if (url != null) + document.write(''); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x'); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x + + {#template_dlg.title} + + + + + + +
    +
    +
    {#template_dlg.desc}
    +
    + +
    +
    +
    +
    + {#template_dlg.preview} + +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/plugins/visualchars/.svn/all-wcprops b/thirdparty/tiny/plugins/visualchars/.svn/all-wcprops new file mode 100644 index 0000000..5ab101c --- /dev/null +++ b/thirdparty/tiny/plugins/visualchars/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/visualchars +END +editor_plugin.js +K 25 +svn:wc:ra_dav:version-url +V 76 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/visualchars/editor_plugin.js +END +editor_plugin_src.js +K 25 +svn:wc:ra_dav:version-url +V 80 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/visualchars/editor_plugin_src.js +END diff --git a/thirdparty/tiny/plugins/visualchars/.svn/entries b/thirdparty/tiny/plugins/visualchars/.svn/entries new file mode 100644 index 0000000..6fcc413 --- /dev/null +++ b/thirdparty/tiny/plugins/visualchars/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/visualchars +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_plugin.js +file + + + + +2009-06-08T19:44:27.000000Z +8fec0ef8561966c627ef5997a4b76ce6 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1384 + +editor_plugin_src.js +file + + + + +2009-06-08T19:44:27.000000Z +4d1e295cca6cdbafa60d622a6938a03c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2061 + diff --git a/thirdparty/tiny/plugins/visualchars/.svn/format b/thirdparty/tiny/plugins/visualchars/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/visualchars/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/visualchars/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/visualchars/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..e1e4238 --- /dev/null +++ b/thirdparty/tiny/plugins/visualchars/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.VisualChars',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceVisualChars',t._toggleVisualChars,t);ed.addButton('visualchars',{title:'visualchars.desc',cmd:'mceVisualChars'});ed.onBeforeGetContent.add(function(ed,o){if(t.state){t.state=true;t._toggleVisualChars();}});},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(){var t=this,ed=t.editor,nl,i,h,d=ed.getDoc(),b=ed.getBody(),nv,s=ed.selection,bo;t.state=!t.state;ed.controlManager.setActive('visualchars',t.state);if(t.state){nl=[];tinymce.walk(b,function(n){if(n.nodeType==3&&n.nodeValue&&n.nodeValue.indexOf('\u00a0')!=-1)nl.push(n);},'childNodes');for(i=0;i$1');nv=nv.replace(/\u00a0/g,'\u00b7');ed.dom.setOuterHTML(nl[i],nv,d);}}else{nl=tinymce.grep(ed.dom.select('span',b),function(n){return ed.dom.hasClass(n,'mceVisualNbsp');});for(i=0;i$1'); + nv = nv.replace(/\u00a0/g, '\u00b7'); + ed.dom.setOuterHTML(nl[i], nv, d); + } + } else { + nl = tinymce.grep(ed.dom.select('span', b), function(n) { + return ed.dom.hasClass(n, 'mceVisualNbsp'); + }); + + for (i=0; i$1');nv=nv.replace(/\u00a0/g,'\u00b7');ed.dom.setOuterHTML(nl[i],nv,d);}}else{nl=tinymce.grep(ed.dom.select('span',b),function(n){return ed.dom.hasClass(n,'mceVisualNbsp');});for(i=0;i$1'); + nv = nv.replace(/\u00a0/g, '\u00b7'); + ed.dom.setOuterHTML(nl[i], nv, d); + } + } else { + nl = tinymce.grep(ed.dom.select('span', b), function(n) { + return ed.dom.hasClass(n, 'mceVisualNbsp'); + }); + + for (i=0; i + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/acronym.htm.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/acronym.htm.svn-base new file mode 100644 index 0000000..3cbe57e --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/acronym.htm.svn-base @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/attributes.htm.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/attributes.htm.svn-base new file mode 100644 index 0000000..1d88200 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/attributes.htm.svn-base @@ -0,0 +1,154 @@ + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/cite.htm.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/cite.htm.svn-base new file mode 100644 index 0000000..aa24db6 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/cite.htm.svn-base @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/del.htm.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/del.htm.svn-base new file mode 100644 index 0000000..f67e84f --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/del.htm.svn-base @@ -0,0 +1,170 @@ + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
    : + + + + + +
    +
    :
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/editor_plugin.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/editor_plugin.js.svn-base new file mode 100644 index 0000000..00c178e --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/editor_plugin.js.svn-base @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/]+)>/gi,'');o.content=o.content.replace(/<\/abbr>/gi,'');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);if(n){do{cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}while(n=n.parentNode);}});},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 diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/editor_plugin_src.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/editor_plugin_src.js.svn-base new file mode 100644 index 0000000..4492ad2 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/editor_plugin_src.js.svn-base @@ -0,0 +1,136 @@ +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380, + height : 370, + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + if (tinymce.isIE) { + function fix(ed, o) { + if (o.set) { + o.content = o.content.replace(/]+)>/gi, ''); + o.content = o.content.replace(/<\/abbr>/gi, ''); + } + }; + + ed.onBeforeSetContent.add(fix); + ed.onPostProcess.add(fix); + } + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + }, + + 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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/ins.htm.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/ins.htm.svn-base new file mode 100644 index 0000000..2411e82 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/.svn/text-base/ins.htm.svn-base @@ -0,0 +1,170 @@ + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
    : + + + + + +
    +
    :
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/abbr.htm b/thirdparty/tiny/plugins/xhtmlxtras/abbr.htm new file mode 100644 index 0000000..fb43a78 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/abbr.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/acronym.htm b/thirdparty/tiny/plugins/xhtmlxtras/acronym.htm new file mode 100644 index 0000000..3cbe57e --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/acronym.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/attributes.htm b/thirdparty/tiny/plugins/xhtmlxtras/attributes.htm new file mode 100644 index 0000000..1d88200 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/attributes.htm @@ -0,0 +1,154 @@ + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/cite.htm b/thirdparty/tiny/plugins/xhtmlxtras/cite.htm new file mode 100644 index 0000000..aa24db6 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/cite.htm @@ -0,0 +1,149 @@ + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/all-wcprops b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/all-wcprops new file mode 100644 index 0000000..8dac928 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 62 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/css +END +popup.css +K 25 +svn:wc:ra_dav:version-url +V 72 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/css/popup.css +END +attributes.css +K 25 +svn:wc:ra_dav:version-url +V 77 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/css/attributes.css +END diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/entries b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/entries new file mode 100644 index 0000000..6011245 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/xhtmlxtras/css +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +popup.css +file + + + + +2009-06-08T19:44:28.000000Z +ed53e7b6ab799f6a249c3d403047dcfc +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +514 + +attributes.css +file + + + + +2009-06-08T19:44:28.000000Z +abc1b941c6eef8e1ea76915984e8a03e +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +197 + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/format b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/text-base/attributes.css.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/text-base/attributes.css.svn-base new file mode 100644 index 0000000..85b1b37 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/text-base/attributes.css.svn-base @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/text-base/popup.css.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/text-base/popup.css.svn-base new file mode 100644 index 0000000..034b985 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/.svn/text-base/popup.css.svn-base @@ -0,0 +1,9 @@ +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/attributes.css b/thirdparty/tiny/plugins/xhtmlxtras/css/attributes.css new file mode 100644 index 0000000..85b1b37 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/attributes.css @@ -0,0 +1,11 @@ +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/thirdparty/tiny/plugins/xhtmlxtras/css/popup.css b/thirdparty/tiny/plugins/xhtmlxtras/css/popup.css new file mode 100644 index 0000000..034b985 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/css/popup.css @@ -0,0 +1,9 @@ +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/thirdparty/tiny/plugins/xhtmlxtras/del.htm b/thirdparty/tiny/plugins/xhtmlxtras/del.htm new file mode 100644 index 0000000..f67e84f --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/del.htm @@ -0,0 +1,170 @@ + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
    : + + + + + +
    +
    :
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/editor_plugin.js b/thirdparty/tiny/plugins/xhtmlxtras/editor_plugin.js new file mode 100644 index 0000000..00c178e --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create('tinymce.plugins.XHTMLXtrasPlugin',{init:function(ed,url){ed.addCommand('mceCite',function(){ed.windowManager.open({file:url+'/cite.htm',width:350+parseInt(ed.getLang('xhtmlxtras.cite_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.cite_delta_height',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAcronym',function(){ed.windowManager.open({file:url+'/acronym.htm',width:350+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.acronym_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAbbr',function(){ed.windowManager.open({file:url+'/abbr.htm',width:350+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),height:250+parseInt(ed.getLang('xhtmlxtras.abbr_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceDel',function(){ed.windowManager.open({file:url+'/del.htm',width:340+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.del_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceIns',function(){ed.windowManager.open({file:url+'/ins.htm',width:340+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),height:310+parseInt(ed.getLang('xhtmlxtras.ins_delta_width',0)),inline:1},{plugin_url:url});});ed.addCommand('mceAttributes',function(){ed.windowManager.open({file:url+'/attributes.htm',width:380,height:370,inline:1},{plugin_url:url});});ed.addButton('cite',{title:'xhtmlxtras.cite_desc',cmd:'mceCite'});ed.addButton('acronym',{title:'xhtmlxtras.acronym_desc',cmd:'mceAcronym'});ed.addButton('abbr',{title:'xhtmlxtras.abbr_desc',cmd:'mceAbbr'});ed.addButton('del',{title:'xhtmlxtras.del_desc',cmd:'mceDel'});ed.addButton('ins',{title:'xhtmlxtras.ins_desc',cmd:'mceIns'});ed.addButton('attribs',{title:'xhtmlxtras.attribs_desc',cmd:'mceAttributes'});if(tinymce.isIE){function fix(ed,o){if(o.set){o.content=o.content.replace(/]+)>/gi,'');o.content=o.content.replace(/<\/abbr>/gi,'');}};ed.onBeforeSetContent.add(fix);ed.onPostProcess.add(fix);}ed.onNodeChange.add(function(ed,cm,n,co){n=ed.dom.getParent(n,'CITE,ACRONYM,ABBR,DEL,INS');cm.setDisabled('cite',co);cm.setDisabled('acronym',co);cm.setDisabled('abbr',co);cm.setDisabled('del',co);cm.setDisabled('ins',co);cm.setDisabled('attribs',n&&n.nodeName=='BODY');cm.setActive('cite',0);cm.setActive('acronym',0);cm.setActive('abbr',0);cm.setActive('del',0);cm.setActive('ins',0);if(n){do{cm.setDisabled(n.nodeName.toLowerCase(),0);cm.setActive(n.nodeName.toLowerCase(),1);}while(n=n.parentNode);}});},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 diff --git a/thirdparty/tiny/plugins/xhtmlxtras/editor_plugin_src.js b/thirdparty/tiny/plugins/xhtmlxtras/editor_plugin_src.js new file mode 100644 index 0000000..4492ad2 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/editor_plugin_src.js @@ -0,0 +1,136 @@ +/** + * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { + init : function(ed, url) { + // Register commands + ed.addCommand('mceCite', function() { + ed.windowManager.open({ + file : url + '/cite.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAcronym', function() { + ed.windowManager.open({ + file : url + '/acronym.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAbbr', function() { + ed.windowManager.open({ + file : url + '/abbr.htm', + width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceDel', function() { + ed.windowManager.open({ + file : url + '/del.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceIns', function() { + ed.windowManager.open({ + file : url + '/ins.htm', + width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), + inline : 1 + }, { + plugin_url : url + }); + }); + + ed.addCommand('mceAttributes', function() { + ed.windowManager.open({ + file : url + '/attributes.htm', + width : 380, + height : 370, + inline : 1 + }, { + plugin_url : url + }); + }); + + // Register buttons + ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); + ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); + ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); + ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); + ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); + ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); + + if (tinymce.isIE) { + function fix(ed, o) { + if (o.set) { + o.content = o.content.replace(/]+)>/gi, ''); + o.content = o.content.replace(/<\/abbr>/gi, ''); + } + }; + + ed.onBeforeSetContent.add(fix); + ed.onPostProcess.add(fix); + } + + ed.onNodeChange.add(function(ed, cm, n, co) { + n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); + + cm.setDisabled('cite', co); + cm.setDisabled('acronym', co); + cm.setDisabled('abbr', co); + cm.setDisabled('del', co); + cm.setDisabled('ins', co); + cm.setDisabled('attribs', n && n.nodeName == 'BODY'); + cm.setActive('cite', 0); + cm.setActive('acronym', 0); + cm.setActive('abbr', 0); + cm.setActive('del', 0); + cm.setActive('ins', 0); + + // Activate all + if (n) { + do { + cm.setDisabled(n.nodeName.toLowerCase(), 0); + cm.setActive(n.nodeName.toLowerCase(), 1); + } while (n = n.parentNode); + } + }); + }, + + 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 + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); +})(); \ No newline at end of file diff --git a/thirdparty/tiny/plugins/xhtmlxtras/ins.htm b/thirdparty/tiny/plugins/xhtmlxtras/ins.htm new file mode 100644 index 0000000..2411e82 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/ins.htm @@ -0,0 +1,170 @@ + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
    : + + + + + +
    +
    :
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/all-wcprops b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/all-wcprops new file mode 100644 index 0000000..868a896 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js +END +cite.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/cite.js +END +del.js +K 25 +svn:wc:ra_dav:version-url +V 68 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/del.js +END +abbr.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/abbr.js +END +attributes.js +K 25 +svn:wc:ra_dav:version-url +V 75 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/attributes.js +END +acronym.js +K 25 +svn:wc:ra_dav:version-url +V 72 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/acronym.js +END +ins.js +K 25 +svn:wc:ra_dav:version-url +V 68 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/ins.js +END +element_common.js +K 25 +svn:wc:ra_dav:version-url +V 79 +/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/element_common.js +END diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/entries b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/entries new file mode 100644 index 0000000..74b7b93 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/entries @@ -0,0 +1,266 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/xhtmlxtras/js +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +cite.js +file + + + + +2009-06-08T19:44:28.000000Z +e040502ec18d1753e06ad2539845c94d +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +541 + +del.js +file + + + + +2009-06-08T19:44:28.000000Z +1a3e75fcc6068565321ee605c14600eb +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1752 + +abbr.js +file + + + + +2009-06-08T19:44:28.000000Z +892a82c58482d8562e39030d5207e917 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +570 + +attributes.js +file + + + + +2009-06-08T19:44:28.000000Z +174131d5cd479e39470099964d5d0cec +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +3791 + +acronym.js +file + + + + +2009-06-08T19:44:28.000000Z +1f21ff0566ddcf3050f8c3af19b7875d +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +556 + +ins.js +file + + + + +2009-06-08T19:44:28.000000Z +4062038470e36e8da56a9fc4ce31fa4e +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1750 + +element_common.js +file + + + + +2009-06-08T19:44:28.000000Z +26055edb8559dd22e18819dfe93d895c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +7385 + diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/format b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/abbr.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/abbr.js.svn-base new file mode 100644 index 0000000..2f4ec11 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/abbr.js.svn-base @@ -0,0 +1,25 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/acronym.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/acronym.js.svn-base new file mode 100644 index 0000000..4a3215d --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/acronym.js.svn-base @@ -0,0 +1,25 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/attributes.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/attributes.js.svn-base new file mode 100644 index 0000000..b336ce1 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/attributes.js.svn-base @@ -0,0 +1,123 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value != "") { + dom.setAttrib(elm, attrib.toLowerCase(), value); + + if (attrib == "style") + attrib = "style.cssText"; + + if (attrib.substring(0, 2) == 'on') + value = 'return true;' + value; + + if (attrib == "class") + attrib = "className"; + + elm[attrib]=value; + } else + elm.removeAttribute(attrib); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/cite.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/cite.js.svn-base new file mode 100644 index 0000000..b8b0ccd --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/cite.js.svn-base @@ -0,0 +1,25 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/del.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/del.js.svn-base new file mode 100644 index 0000000..b66da9c --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/del.js.svn-base @@ -0,0 +1,60 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('del'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); +} + +function insertDel() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); + + tinyMCEPopup.execCommand('mceBeginUndoLevel'); + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('del'); + var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); + for (var i=0; i 0) { + tagName = element_name; + + if (tinymce.isIE && element_name.indexOf('html:') == 0) + element_name = element_name.substring(5).toLowerCase(); + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {_mce_new : 1}), n, 1); + }); +} diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/ins.js.svn-base b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/ins.js.svn-base new file mode 100644 index 0000000..568abd5 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/.svn/text-base/ins.js.svn-base @@ -0,0 +1,59 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('ins'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); +} + +function insertIns() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); + tinyMCEPopup.execCommand('mceBeginUndoLevel'); + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('INS'); + var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); + for (var i=0; i 0) { + insertInlineElement('del'); + var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); + for (var i=0; i 0) { + tagName = element_name; + + if (tinymce.isIE && element_name.indexOf('html:') == 0) + element_name = element_name.substring(5).toLowerCase(); + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {_mce_new : 1}), n, 1); + }); +} diff --git a/thirdparty/tiny/plugins/xhtmlxtras/js/ins.js b/thirdparty/tiny/plugins/xhtmlxtras/js/ins.js new file mode 100644 index 0000000..568abd5 --- /dev/null +++ b/thirdparty/tiny/plugins/xhtmlxtras/js/ins.js @@ -0,0 +1,59 @@ + /** + * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('ins'); + if (SXE.currentAction == "update") { + setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); + setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); + SXE.showRemoveButton(); + } +} + +function setElementAttribs(elm) { + setAllCommonAttribs(elm); + setAttrib(elm, 'datetime'); + setAttrib(elm, 'cite'); +} + +function insertIns() { + var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); + tinyMCEPopup.execCommand('mceBeginUndoLevel'); + if (elm == null) { + var s = SXE.inst.selection.getContent(); + if(s.length > 0) { + insertInlineElement('INS'); + var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); + for (var i=0; i + + + {#advanced_dlg.about_title} + + + + + + + +
    +
    +

    {#advanced_dlg.about_title}

    +

    Version: ()

    +

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    +

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    +

    For more information about this software visit the TinyMCE website.

    + +
    + Got Moxie? + Hosted By Sourceforge + Also on freshmeat +
    +
    + +
    +
    +

    {#advanced_dlg.about_loaded}

    + +
    +
    + +

     

    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/anchor.htm.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/anchor.htm.svn-base new file mode 100644 index 0000000..054cde5 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/anchor.htm.svn-base @@ -0,0 +1,32 @@ + + + + {#advanced_dlg.anchor_title} + + + + + +
    + + + + + + + + +
    {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_name}:
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/charmap.htm.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/charmap.htm.svn-base new file mode 100644 index 0000000..8ca0113 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/charmap.htm.svn-base @@ -0,0 +1,54 @@ + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + + +
    {#advanced_dlg.charmap_title}
    + + + + + + + + + +
     
     
    +
    + + + + + + + + + + + + + + + + +
    HTML-Code
     
     
    NUM-Code
     
    +
    + + + diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/color_picker.htm.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/color_picker.htm.svn-base new file mode 100644 index 0000000..4cab768 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/color_picker.htm.svn-base @@ -0,0 +1,76 @@ + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
    + + +
    +
    +
    + {#advanced_dlg.colorpicker_picker_title} +
    + + +
    + +
    + +
    +
    +
    +
    + +
    +
    + {#advanced_dlg.colorpicker_palette_title} +
    + +
    + +
    +
    +
    + +
    +
    + {#advanced_dlg.colorpicker_named_title} +
    + +
    + +
    + +
    + {#advanced_dlg.colorpicker_name} +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/editor_template.js.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/editor_template.js.svn-base new file mode 100644 index 0000000..d72d542 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/editor_template.js.svn-base @@ -0,0 +1 @@ +(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.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(ed,url){var t=this,s,v,o;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({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:ed.settings.readonly},ed.settings);if(!s.font_size_style_values)s.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt";if(tinymce.is(s.theme_advanced_font_sizes,'string')){s.font_size_style_values=tinymce.explode(s.font_size_style_values);s.font_size_classes=tinymce.explode(s.font_size_classes||'');o={};ed.settings.theme_advanced_font_sizes=s.theme_advanced_font_sizes;each(ed.getParam('theme_advanced_font_sizes','','hash'),function(v,k){var cl;if(k==v&&v>=1&&v<=7){k=v+' ('+t.sizes[v-1]+'pt)';if(ed.settings.convert_fonts_to_spans){cl=s.font_size_classes[v-1];v=s.font_size_style_values[v-1]||(t.sizes[v-1]+'pt');}}if(/\s*\./.test(v))cl=v.replace(/\./g,'');o[k]=cl?{'class':cl}:{fontSize:v};});s.theme_advanced_font_sizes=o;}if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):url+"/skins/"+ed.settings.skin+"/ui.css");if(s.skin_variant)DOM.loadCSS(url+"/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css");},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){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((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){if(!c.NativeListBox){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);Event.add(n.id+'_open','focus',t._importClasses,t);Event.add(n.id+'_open','mousedown',t._importClasses,t);}else Event.add(n.id,'focus',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,i=0,cl=[];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',onselect:function(v){if(v.fontSize)ed.execCommand('FontSize',false,v.fontSize);else{each(t.settings.theme_advanced_font_sizes,function(v,k){if(v['class'])cl.push(v['class']);});ed.editorCommands._applyInlineStyle('span',{'class':v['class']},{check_classes:cl});}}});if(c){each(t.settings.theme_advanced_font_sizes,function(v,k){var fz=v.fontSize;if(fz>=1&&fz<=7)fz=t.sizes[parseInt(fz)-1]+'pt';c.add(k,v,{'style':'font-size:'+fz,'class':'mceFontSize'+(i++)+(' '+(v['class']||''))});});}return c;},_createBlockFormats:function(){var c,fmts={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'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;if(s.theme_advanced_default_foreground_color)o.default_color=s.theme_advanced_default_foreground_color;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;if(s.theme_advanced_default_background_color)o.default_color=s.theme_advanced_default_background_color;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;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):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},''),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(s.readonly){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});return ic;}if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},''));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},''));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},''));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings,cl,fz,fn;if(s.readonly)return;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(ed.settings.convert_fonts_to_spans){ed.dom.getParent(n,function(n){if(n.nodeName==='SPAN'){if(!cl&&n.className)cl=n.className;if(!fz&&n.style.fontSize)fz=n.style.fontSize;if(!fn&&n.style.fontFamily)fn=n.style.fontFamily.replace(/[\"\']+/g,'').replace(/^([^,]+).*/,'$1').toLowerCase();}return false;});if(c=cm.get('fontselect')){c.select(function(v){return v.replace(/^([^,]+).*/,'$1').toLowerCase()==fn;});}if(c=cm.get('fontsizeselect')){c.select(function(v){if(v.fontSize&&v.fontSize===fz)return true;if(v['class']&&v['class']===cl)return true;});}}else{if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect')){v=ed.queryCommandValue('FontSize');c.select(function(iv){return iv.fontSize==v;});}}if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||n.nodeName==='BR'||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}()); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/editor_template_src.js.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/editor_template_src.js.svn-base new file mode 100644 index 0000000..2d5a4ed --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/editor_template_src.js.svn-base @@ -0,0 +1,1153 @@ +/** + * $Id: editor_template_src.js 960 2008-11-12 18:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + 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(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + + // Default settings + t.settings = s = extend({ + 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 : ed.settings.readonly + }, ed.settings); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + + if (ed.settings.convert_fonts_to_spans) { + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + } + + if (/\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + // Init editor + ed.onInit.add(function() { + ed.onNodeChange.add(t._nodeChanged, t); + + if (ed.settings.content_css !== false) + ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + 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 ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, c = ed.controlManager.get('styleselect'); + + if (c.getLength() == 0) { + each(ed.dom.getClasses(), function(o) { + c.add(o['class'], o['class']); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(v) { + if (c.selectedValue === v) { + ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); + c.select(); + return false; + } else + ed.execCommand('mceSetCSSClass', 0, v); + } + }); + + if (c) { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(v, k) { + if (v) + c.add(t.editor.translate(k), v); + }); + + c.onPostRender.add(function(ed, n) { + if (!c.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return c; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + if (v.fontSize) + ed.execCommand('FontSize', false, v.fontSize); + else { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + if (v['class']) + cl.push(v['class']); + }); + + ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl}); + } + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + 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' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + 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) : '')}); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + + return Event.cancel(e); + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_tbl'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h) { + var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh; + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Calc difference between iframe and container + dh = e.clientHeight - ifr.clientHeight; + + // Resize iframe and container + DOM.setStyle(ifr, 'height', h - dh); + DOM.setStyles(e, {width : w, height : h}); + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (v.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); + + if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) + h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); + + h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + + //n.appendChild(n = tb.render()); + h.push(tb.renderHTML()); + + o.deltaHeight -= s.theme_advanced_row_height; + } + + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); + DOM.add(n, 'a', {href : '#', accesskey : 'x'}); + + if (s.theme_advanced_resizing && !tinymce.isOldWebKit) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + if (s.theme_advanced_resize_horizontal) + c.style.width = Math.max(10, o.cw) + 'px'; + + c.style.height = Math.max(10, o.ch) + 'px'; + DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px'; + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var c, p, w, h, n, pa; + + // Measure container + c = DOM.get(ed.id + '_tbl'); + w = c.clientWidth; + h = c.clientHeight; + + miw = s.theme_advanced_resizing_min_width || 100; + mih = s.theme_advanced_resizing_min_height || 100; + maw = s.theme_advanced_resizing_max_width || 0xFFFF; + mah = s.theme_advanced_resizing_max_height || 0xFFFF; + + // Setup placeholder + p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); + DOM.setStyles(p, {width : w, height : h}); + + // Replace with placeholder + DOM.hide(c); + DOM.show(p); + + // Create internal resize obj + r = { + x : e.screenX, + y : e.screenY, + w : w, + h : h, + dx : null, + dy : null + }; + + // Start listening + mf = Event.add(DOM.doc, 'mousemove', function(e) { + var w, h; + + // Calc delta values + r.dx = e.screenX - r.x; + r.dy = e.screenY - r.y; + + // Boundery fix box + w = Math.max(miw, r.w + r.dx); + h = Math.max(mih, r.h + r.dy); + w = Math.min(maw, w); + h = Math.min(mah, h); + + // Resize placeholder + if (s.theme_advanced_resize_horizontal) + p.style.width = w + 'px'; + + p.style.height = h + 'px'; + + return Event.cancel(e); + }); + + me = Event.add(DOM.doc, 'mouseup', function(e) { + var ifr; + + // Stop listening + Event.remove(DOM.doc, 'mousemove', mf); + Event.remove(DOM.doc, 'mouseup', me); + + c.style.display = ''; + DOM.remove(p); + + if (r.dx === null) + return; + + ifr = DOM.get(ed.id + '_ifr'); + + if (s.theme_advanced_resize_horizontal) + c.style.width = Math.max(10, r.w + r.dx) + 'px'; + + c.style.height = Math.max(10, r.h + r.dy) + 'px'; + ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px'; + + if (s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : r.w + r.dx, + ch : r.h + r.dy + }); + } + }); + + return Event.cancel(e); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _nodeChanged : function(ed, cm, n, co) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn; + + if (s.readonly) + return; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + cm.setActive('visualaid', ed.hasVisual); + cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); + cm.setDisabled('redo', !ed.undoManager.hasRedo()); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = DOM.getParent(n, 'A'); + if (c = cm.get('link')) { + if (!p || !p.name) { + c.setDisabled(!p && co); + c.setActive(!!p); + } + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name); + } + + if (c = cm.get('anchor')) { + c.setActive(!!p && p.name); + + if (tinymce.isWebKit) { + p = DOM.getParent(n, 'IMG'); + c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); + } + } + + p = DOM.getParent(n, 'IMG'); + if (c = cm.get('image')) + c.setActive(!!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + if (n.className) { + t._importClasses(); + c.select(n.className); + } else + c.select(); + } + + if (c = cm.get('formatselect')) { + p = DOM.getParent(n, DOM.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + if (ed.settings.convert_fonts_to_spans) { + ed.dom.getParent(n, function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + if (c = cm.get('fontsizeselect')) { + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + } else { + if (c = cm.get('fontselect')) + c.select(ed.queryCommandValue('FontName')); + + if (c = cm.get('fontsizeselect')) { + v = ed.queryCommandValue('FontSize'); + c.select(function(iv) { + return iv.fontSize == v; + }); + } + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + DOM.setHTML(p, ''); + + ed.dom.getParent(n, function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and hidden elements + if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) + return; + + // Fake name + if (v = DOM.getAttrib(n, 'mce_name')) + na = v; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML') + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (s.convert_fonts_to_spans) + na = 'span'; + + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); + + if (v && v.indexOf('mceItem') == -1) { + ti += 'class: ' + v + ' '; + + if (DOM.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}()); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/image.htm.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/image.htm.svn-base new file mode 100644 index 0000000..bd92b00 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/image.htm.svn-base @@ -0,0 +1,86 @@ + + + + {#advanced_dlg.image_title} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + x +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/link.htm.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/link.htm.svn-base new file mode 100644 index 0000000..b647eed --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/link.htm.svn-base @@ -0,0 +1,64 @@ + + + + {#advanced_dlg.link_title} + + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/.svn/text-base/source_editor.htm.svn-base b/thirdparty/tiny/themes/advanced/.svn/text-base/source_editor.htm.svn-base new file mode 100644 index 0000000..5f047dc --- /dev/null +++ b/thirdparty/tiny/themes/advanced/.svn/text-base/source_editor.htm.svn-base @@ -0,0 +1,32 @@ + + + + {#advanced_dlg.code_title} + + + + + +
    +
    {#advanced_dlg.code_title}
    + +
    + +
    + +
    + + + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/about.htm b/thirdparty/tiny/themes/advanced/about.htm new file mode 100644 index 0000000..4e73b14 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/about.htm @@ -0,0 +1,56 @@ + + + + {#advanced_dlg.about_title} + + + + + + + +
    +
    +

    {#advanced_dlg.about_title}

    +

    Version: ()

    +

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    +

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    +

    For more information about this software visit the TinyMCE website.

    + +
    + Got Moxie? + Hosted By Sourceforge + Also on freshmeat +
    +
    + +
    +
    +

    {#advanced_dlg.about_loaded}

    + +
    +
    + +

     

    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/anchor.htm b/thirdparty/tiny/themes/advanced/anchor.htm new file mode 100644 index 0000000..054cde5 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/anchor.htm @@ -0,0 +1,32 @@ + + + + {#advanced_dlg.anchor_title} + + + + + +
    + + + + + + + + +
    {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_name}:
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/charmap.htm b/thirdparty/tiny/themes/advanced/charmap.htm new file mode 100644 index 0000000..8ca0113 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/charmap.htm @@ -0,0 +1,54 @@ + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + + +
    {#advanced_dlg.charmap_title}
    + + + + + + + + + +
     
     
    +
    + + + + + + + + + + + + + + + + +
    HTML-Code
     
     
    NUM-Code
     
    +
    + + + diff --git a/thirdparty/tiny/themes/advanced/color_picker.htm b/thirdparty/tiny/themes/advanced/color_picker.htm new file mode 100644 index 0000000..4cab768 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/color_picker.htm @@ -0,0 +1,76 @@ + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
    + + +
    +
    +
    + {#advanced_dlg.colorpicker_picker_title} +
    + + +
    + +
    + +
    +
    +
    +
    + +
    +
    + {#advanced_dlg.colorpicker_palette_title} +
    + +
    + +
    +
    +
    + +
    +
    + {#advanced_dlg.colorpicker_named_title} +
    + +
    + +
    + +
    + {#advanced_dlg.colorpicker_name} +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/editor_template.js b/thirdparty/tiny/themes/advanced/editor_template.js new file mode 100644 index 0000000..d72d542 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/editor_template.js @@ -0,0 +1 @@ +(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID,explode=tinymce.explode;tinymce.ThemeManager.requireLangPack('advanced');tinymce.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(ed,url){var t=this,s,v,o;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({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:ed.settings.readonly},ed.settings);if(!s.font_size_style_values)s.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt";if(tinymce.is(s.theme_advanced_font_sizes,'string')){s.font_size_style_values=tinymce.explode(s.font_size_style_values);s.font_size_classes=tinymce.explode(s.font_size_classes||'');o={};ed.settings.theme_advanced_font_sizes=s.theme_advanced_font_sizes;each(ed.getParam('theme_advanced_font_sizes','','hash'),function(v,k){var cl;if(k==v&&v>=1&&v<=7){k=v+' ('+t.sizes[v-1]+'pt)';if(ed.settings.convert_fonts_to_spans){cl=s.font_size_classes[v-1];v=s.font_size_style_values[v-1]||(t.sizes[v-1]+'pt');}}if(/\s*\./.test(v))cl=v.replace(/\./g,'');o[k]=cl?{'class':cl}:{fontSize:v};});s.theme_advanced_font_sizes=o;}if((v=s.theme_advanced_path_location)&&v!='none')s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);if(ed.settings.content_css!==false)ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):url+"/skins/"+ed.settings.skin+"/ui.css");if(s.skin_variant)DOM.loadCSS(url+"/skins/"+ed.settings.skin+"/ui_"+s.skin_variant+".css");},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){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((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(e){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});if(c){each(ed.getParam('theme_advanced_styles','','hash'),function(v,k){if(v)c.add(t.editor.translate(k),v);});c.onPostRender.add(function(ed,n){if(!c.NativeListBox){Event.add(n.id+'_text','focus',t._importClasses,t);Event.add(n.id+'_text','mousedown',t._importClasses,t);Event.add(n.id+'_open','focus',t._importClasses,t);Event.add(n.id+'_open','mousedown',t._importClasses,t);}else Event.add(n.id,'focus',t._importClasses,t);});}return c;},_createFontSelect:function(){var c,t=this,ed=t.editor;c=ed.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});if(c){each(ed.getParam('theme_advanced_fonts',t.settings.theme_advanced_fonts,'hash'),function(v,k){c.add(ed.translate(k),v,{style:v.indexOf('dings')==-1?'font-family:'+v:''});});}return c;},_createFontSizeSelect:function(){var t=this,ed=t.editor,c,i=0,cl=[];c=ed.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',onselect:function(v){if(v.fontSize)ed.execCommand('FontSize',false,v.fontSize);else{each(t.settings.theme_advanced_font_sizes,function(v,k){if(v['class'])cl.push(v['class']);});ed.editorCommands._applyInlineStyle('span',{'class':v['class']},{check_classes:cl});}}});if(c){each(t.settings.theme_advanced_font_sizes,function(v,k){var fz=v.fontSize;if(fz>=1&&fz<=7)fz=t.sizes[parseInt(fz)-1]+'pt';c.add(k,v,{'style':'font-size:'+fz,'class':'mceFontSize'+(i++)+(' '+(v['class']||''))});});}return c;},_createBlockFormats:function(){var c,fmts={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'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});if(c){each(t.editor.getParam('theme_advanced_blockformats',t.settings.theme_advanced_blockformats,'hash'),function(v,k){c.add(t.editor.translate(k!=v?k:fmts[v]),v,{'class':'mce_formatPreview mce_'+v});});}return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;if(s.theme_advanced_default_foreground_color)o.default_color=s.theme_advanced_default_foreground_color;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;if(s.theme_advanced_default_background_color)o.default_color=s.theme_advanced_default_background_color;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;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):'')});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=DOM.stdMode?sc.getElementsByTagName('tr'):sc.rows;DOM.addClass(nl[0],'mceFirst');DOM.addClass(nl[nl.length-1],'mceLast');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'mceFirst');DOM.addClass(n.childNodes[n.childNodes.length-1],'mceLast');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/,'$1'));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},''),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Advanced theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},resizeBy:function(dw,dh){var e=DOM.get(this.editor.id+'_tbl');this.resizeTo(e.clientWidth+dw,e.clientHeight+dh);},resizeTo:function(w,h){var ed=this.editor,s=ed.settings,e=DOM.get(ed.id+'_tbl'),ifr=DOM.get(ed.id+'_ifr'),dh;w=Math.max(s.theme_advanced_resizing_min_width||100,w);h=Math.max(s.theme_advanced_resizing_min_height||100,h);w=Math.min(s.theme_advanced_resizing_max_width||0xFFFF,w);h=Math.min(s.theme_advanced_resizing_max_height||0xFFFF,h);dh=e.clientHeight-ifr.clientHeight;DOM.setStyle(ifr,'height',h-dh);DOM.setStyles(e,{width:w,height:h});},destroy:function(){var id=this.editor.id;Event.clear(id+'_resize');Event.clear(id+'_path_row');Event.clear(id+'_external_close');},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(s.readonly){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});return ic;}if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to,a;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each(explode(s.theme_advanced_containers||''),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(v.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:a=(s['theme_advanced_container_'+c+'_align']||da).toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc)+' '+a||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(explode(s.theme_advanced_disable),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(explode(v),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[],a;a=s.theme_advanced_toolbar_align.toLowerCase();a='mce'+t._ufirst(a);n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar '+a});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},''));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},''));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},''));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'mceResize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,o.cw)+'px';c.style.height=Math.max(10,o.ch)+'px';DOM.get(ed.id+'_ifr').style.height=Math.max(10,parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(DOM.doc,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(DOM.doc,'mouseup',function(e){var ifr;Event.remove(DOM.doc,'mousemove',mf);Event.remove(DOM.doc,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=Math.max(10,r.w+r.dx)+'px';c.style.height=Math.max(10,r.h+r.dy)+'px';ifr.style.height=Math.max(10,ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings,cl,fz,fn;if(s.readonly)return;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(ed.settings.convert_fonts_to_spans){ed.dom.getParent(n,function(n){if(n.nodeName==='SPAN'){if(!cl&&n.className)cl=n.className;if(!fz&&n.style.fontSize)fz=n.style.fontSize;if(!fn&&n.style.fontFamily)fn=n.style.fontFamily.replace(/[\"\']+/g,'').replace(/^([^,]+).*/,'$1').toLowerCase();}return false;});if(c=cm.get('fontselect')){c.select(function(v){return v.replace(/^([^,]+).*/,'$1').toLowerCase()==fn;});}if(c=cm.get('fontsizeselect')){c.select(function(v){if(v.fontSize&&v.fontSize===fz)return true;if(v['class']&&v['class']===cl)return true;});}}else{if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect')){v=ed.queryCommandValue('FontSize');c.select(function(iv){return iv.fontSize==v;});}}if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||n.nodeName==='BR'||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"javascript:;",onmousedown:"return false;",title:ti,'class':'mcePath_'+(de++)},na);if(p.hasChildNodes()){p.insertBefore(DOM.doc.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;if(ed.dom.getAttrib(ed.selection.getNode(),'class').indexOf('mceItem')!=-1)return;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{color:t.fgColor,func:function(co){t.fgColor=co;t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{color:t.bgColor,func:function(co){t.bgColor=co;t.editor.execCommand('HiliteColor',false,co);}});},_ufirst:function(s){return s.substring(0,1).toUpperCase()+s.substring(1);}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}()); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/editor_template_src.js b/thirdparty/tiny/themes/advanced/editor_template_src.js new file mode 100644 index 0000000..2d5a4ed --- /dev/null +++ b/thirdparty/tiny/themes/advanced/editor_template_src.js @@ -0,0 +1,1153 @@ +/** + * $Id: editor_template_src.js 960 2008-11-12 18:30:32Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + 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(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + + // Default settings + t.settings = s = extend({ + 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 : ed.settings.readonly + }, ed.settings); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + + if (ed.settings.convert_fonts_to_spans) { + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + } + + if (/\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + // Init editor + ed.onInit.add(function() { + ed.onNodeChange.add(t._nodeChanged, t); + + if (ed.settings.content_css !== false) + ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + 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 ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, c = ed.controlManager.get('styleselect'); + + if (c.getLength() == 0) { + each(ed.dom.getClasses(), function(o) { + c.add(o['class'], o['class']); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(v) { + if (c.selectedValue === v) { + ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); + c.select(); + return false; + } else + ed.execCommand('mceSetCSSClass', 0, v); + } + }); + + if (c) { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(v, k) { + if (v) + c.add(t.editor.translate(k), v); + }); + + c.onPostRender.add(function(ed, n) { + if (!c.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return c; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + if (v.fontSize) + ed.execCommand('FontSize', false, v.fontSize); + else { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + if (v['class']) + cl.push(v['class']); + }); + + ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl}); + } + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + 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' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + 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) : '')}); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + + return Event.cancel(e); + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_tbl'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h) { + var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh; + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Calc difference between iframe and container + dh = e.clientHeight - ifr.clientHeight; + + // Resize iframe and container + DOM.setStyle(ifr, 'height', h - dh); + DOM.setStyles(e, {width : w, height : h}); + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (v.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); + + if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) + h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); + + h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + + //n.appendChild(n = tb.render()); + h.push(tb.renderHTML()); + + o.deltaHeight -= s.theme_advanced_row_height; + } + + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); + DOM.add(n, 'a', {href : '#', accesskey : 'x'}); + + if (s.theme_advanced_resizing && !tinymce.isOldWebKit) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + if (s.theme_advanced_resize_horizontal) + c.style.width = Math.max(10, o.cw) + 'px'; + + c.style.height = Math.max(10, o.ch) + 'px'; + DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px'; + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var c, p, w, h, n, pa; + + // Measure container + c = DOM.get(ed.id + '_tbl'); + w = c.clientWidth; + h = c.clientHeight; + + miw = s.theme_advanced_resizing_min_width || 100; + mih = s.theme_advanced_resizing_min_height || 100; + maw = s.theme_advanced_resizing_max_width || 0xFFFF; + mah = s.theme_advanced_resizing_max_height || 0xFFFF; + + // Setup placeholder + p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); + DOM.setStyles(p, {width : w, height : h}); + + // Replace with placeholder + DOM.hide(c); + DOM.show(p); + + // Create internal resize obj + r = { + x : e.screenX, + y : e.screenY, + w : w, + h : h, + dx : null, + dy : null + }; + + // Start listening + mf = Event.add(DOM.doc, 'mousemove', function(e) { + var w, h; + + // Calc delta values + r.dx = e.screenX - r.x; + r.dy = e.screenY - r.y; + + // Boundery fix box + w = Math.max(miw, r.w + r.dx); + h = Math.max(mih, r.h + r.dy); + w = Math.min(maw, w); + h = Math.min(mah, h); + + // Resize placeholder + if (s.theme_advanced_resize_horizontal) + p.style.width = w + 'px'; + + p.style.height = h + 'px'; + + return Event.cancel(e); + }); + + me = Event.add(DOM.doc, 'mouseup', function(e) { + var ifr; + + // Stop listening + Event.remove(DOM.doc, 'mousemove', mf); + Event.remove(DOM.doc, 'mouseup', me); + + c.style.display = ''; + DOM.remove(p); + + if (r.dx === null) + return; + + ifr = DOM.get(ed.id + '_ifr'); + + if (s.theme_advanced_resize_horizontal) + c.style.width = Math.max(10, r.w + r.dx) + 'px'; + + c.style.height = Math.max(10, r.h + r.dy) + 'px'; + ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px'; + + if (s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : r.w + r.dx, + ch : r.h + r.dy + }); + } + }); + + return Event.cancel(e); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _nodeChanged : function(ed, cm, n, co) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn; + + if (s.readonly) + return; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + cm.setActive('visualaid', ed.hasVisual); + cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); + cm.setDisabled('redo', !ed.undoManager.hasRedo()); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = DOM.getParent(n, 'A'); + if (c = cm.get('link')) { + if (!p || !p.name) { + c.setDisabled(!p && co); + c.setActive(!!p); + } + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name); + } + + if (c = cm.get('anchor')) { + c.setActive(!!p && p.name); + + if (tinymce.isWebKit) { + p = DOM.getParent(n, 'IMG'); + c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); + } + } + + p = DOM.getParent(n, 'IMG'); + if (c = cm.get('image')) + c.setActive(!!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + if (n.className) { + t._importClasses(); + c.select(n.className); + } else + c.select(); + } + + if (c = cm.get('formatselect')) { + p = DOM.getParent(n, DOM.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + if (ed.settings.convert_fonts_to_spans) { + ed.dom.getParent(n, function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + if (c = cm.get('fontsizeselect')) { + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + } else { + if (c = cm.get('fontselect')) + c.select(ed.queryCommandValue('FontName')); + + if (c = cm.get('fontsizeselect')) { + v = ed.queryCommandValue('FontSize'); + c.select(function(iv) { + return iv.fontSize == v; + }); + } + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + DOM.setHTML(p, ''); + + ed.dom.getParent(n, function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and hidden elements + if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) + return; + + // Fake name + if (v = DOM.getAttrib(n, 'mce_name')) + na = v; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML') + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (s.convert_fonts_to_spans) + na = 'span'; + + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); + + if (v && v.indexOf('mceItem') == -1) { + ti += 'class: ' + v + ' '; + + if (DOM.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +}()); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/image.htm b/thirdparty/tiny/themes/advanced/image.htm new file mode 100644 index 0000000..bd92b00 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/image.htm @@ -0,0 +1,86 @@ + + + + {#advanced_dlg.image_title} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + x +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/img/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/img/.svn/all-wcprops new file mode 100644 index 0000000..9829e5c --- /dev/null +++ b/thirdparty/tiny/themes/advanced/img/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/img +END +icons.gif +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/img/icons.gif +END +colorpicker.jpg +K 25 +svn:wc:ra_dav:version-url +V 75 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/img/colorpicker.jpg +END diff --git a/thirdparty/tiny/themes/advanced/img/.svn/entries b/thirdparty/tiny/themes/advanced/img/.svn/entries new file mode 100644 index 0000000..39bd2a1 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/img/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/img +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +icons.gif +file + + + + +2009-06-08T19:44:28.000000Z +e893a1f9e0c9c6240ba28756cf838f5f +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +11505 + +colorpicker.jpg +file + + + + +2009-06-08T19:44:28.000000Z +02ae48639aa5729e6a40fb64455c32a2 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +3189 + diff --git a/thirdparty/tiny/themes/advanced/img/.svn/format b/thirdparty/tiny/themes/advanced/img/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/img/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/img/.svn/prop-base/colorpicker.jpg.svn-base b/thirdparty/tiny/themes/advanced/img/.svn/prop-base/colorpicker.jpg.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/img/.svn/prop-base/colorpicker.jpg.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/img/.svn/prop-base/icons.gif.svn-base b/thirdparty/tiny/themes/advanced/img/.svn/prop-base/icons.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/img/.svn/prop-base/icons.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/img/.svn/text-base/colorpicker.jpg.svn-base b/thirdparty/tiny/themes/advanced/img/.svn/text-base/colorpicker.jpg.svn-base new file mode 100644 index 0000000..b4c542d Binary files /dev/null and b/thirdparty/tiny/themes/advanced/img/.svn/text-base/colorpicker.jpg.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/img/.svn/text-base/icons.gif.svn-base b/thirdparty/tiny/themes/advanced/img/.svn/text-base/icons.gif.svn-base new file mode 100644 index 0000000..ccac36f Binary files /dev/null and b/thirdparty/tiny/themes/advanced/img/.svn/text-base/icons.gif.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/img/colorpicker.jpg b/thirdparty/tiny/themes/advanced/img/colorpicker.jpg new file mode 100644 index 0000000..b4c542d Binary files /dev/null and b/thirdparty/tiny/themes/advanced/img/colorpicker.jpg differ diff --git a/thirdparty/tiny/themes/advanced/img/icons.gif b/thirdparty/tiny/themes/advanced/img/icons.gif new file mode 100644 index 0000000..ccac36f Binary files /dev/null and b/thirdparty/tiny/themes/advanced/img/icons.gif differ diff --git a/thirdparty/tiny/themes/advanced/js/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/js/.svn/all-wcprops new file mode 100644 index 0000000..0124130 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 58 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js +END +source_editor.js +K 25 +svn:wc:ra_dav:version-url +V 75 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/source_editor.js +END +about.js +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/about.js +END +anchor.js +K 25 +svn:wc:ra_dav:version-url +V 68 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/anchor.js +END +charmap.js +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/charmap.js +END +color_picker.js +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/color_picker.js +END +link.js +K 25 +svn:wc:ra_dav:version-url +V 66 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/link.js +END +image.js +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/js/image.js +END diff --git a/thirdparty/tiny/themes/advanced/js/.svn/entries b/thirdparty/tiny/themes/advanced/js/.svn/entries new file mode 100644 index 0000000..96bcb19 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/entries @@ -0,0 +1,266 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/js +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +source_editor.js +file + + + + +2009-06-08T19:44:28.000000Z +2fcdcb37221fc2123e08967deddce77f +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1463 + +about.js +file + + + + +2009-06-08T19:44:28.000000Z +73308b59a9305e9e2f9a4a9c1b538442 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2126 + +anchor.js +file + + + + +2009-06-08T19:44:28.000000Z +b7a24eab2f033a1f5a5e5a1a3038f82c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1066 + +charmap.js +file + + + + +2009-06-08T19:44:28.000000Z +0c12182af62b43dd83b9309a05d08664 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +14840 + +color_picker.js +file + + + + +2009-06-08T19:44:28.000000Z +560e2bd8c4b72557ed2a71a04ff7d39a +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +11270 + +link.js +file + + + + +2009-06-08T19:44:28.000000Z +ddc32af7d8452b53676b8fec54c2d162 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +5000 + +image.js +file + + + + +2009-06-08T19:44:28.000000Z +1f4e125261b06f33d0cb33e6ab4b2565 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +6077 + diff --git a/thirdparty/tiny/themes/advanced/js/.svn/format b/thirdparty/tiny/themes/advanced/js/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/js/.svn/text-base/about.js.svn-base b/thirdparty/tiny/themes/advanced/js/.svn/text-base/about.js.svn-base new file mode 100644 index 0000000..7fc8ba2 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/text-base/about.js.svn-base @@ -0,0 +1,72 @@ +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
    ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
    ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/themes/advanced/js/.svn/text-base/anchor.js.svn-base b/thirdparty/tiny/themes/advanced/js/.svn/text-base/anchor.js.svn-base new file mode 100644 index 0000000..76f4f7d --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/text-base/anchor.js.svn-base @@ -0,0 +1,37 @@ +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor; + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + // Webkit acts weird if empty inline element is inserted so we need to use a image instead + if (tinymce.isWebKit) + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); + else + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/thirdparty/tiny/themes/advanced/js/.svn/text-base/charmap.js.svn-base b/thirdparty/tiny/themes/advanced/js/.svn/text-base/charmap.js.svn-base new file mode 100644 index 0000000..d9fd8d3 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/text-base/charmap.js.svn-base @@ -0,0 +1,325 @@ +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true,'lozenge'], + ['♠', '♠', false,'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); +}); + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
    '; + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/thirdparty/tiny/themes/advanced/js/.svn/text-base/color_picker.js.svn-base b/thirdparty/tiny/themes/advanced/js/.svn/text-base/color_picker.js.svn-base new file mode 100644 index 0000000..c1a65db --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/text-base/color_picker.js.svn-base @@ -0,0 +1,253 @@ +tinyMCEPopup.requireLangPack(); + +var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; + +var colors = [ + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +]; + +var named = { + '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', + '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', + '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', + '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', + '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', + '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', + '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', + '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', + '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', + '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', + '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', + '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', + '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', + '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' +}; + +function init() { + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); + + tinyMCEPopup.resizeToInnerSize(); + + generatePicker(); + + if (inputColor) { + changeFinalColor(inputColor); + + col = convertHexToRGB(inputColor); + + if (col) + updateLight(col.r, col.g, col.b); + } +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + tinyMCEPopup.restoreSelection(); + + if (f) + f(color); + + tinyMCEPopup.close(); +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toLowerCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
    '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + h += '' + + ''; + + for (i=0; i' + + '' + + ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
    '; + + el.innerHTML = h; + el.className = 'generated'; +} + +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += '' + } + + el.innerHTML = h; + el.className = 'generated'; +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + 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; + 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); + 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); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', 'tinyMCEImageList'); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value, + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); + this.styleVal = dom.serializeStyle(st); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/thirdparty/tiny/themes/advanced/js/.svn/text-base/link.js.svn-base b/thirdparty/tiny/themes/advanced/js/.svn/text-base/link.js.svn-base new file mode 100644 index 0000000..c8cb642 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/text-base/link.js.svn-base @@ -0,0 +1,155 @@ +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + // Create new anchor elements + if (e == null) { + tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : f.href.value, + title : f.linktitle.value, + target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, + 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : f.href.value, + title : f.linktitle.value, + target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, + 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/thirdparty/tiny/themes/advanced/js/.svn/text-base/source_editor.js.svn-base b/thirdparty/tiny/themes/advanced/js/.svn/text-base/source_editor.js.svn-base new file mode 100644 index 0000000..a6235a3 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/.svn/text-base/source_editor.js.svn-base @@ -0,0 +1,62 @@ +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent(); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function toggleWordWrap(elm) { + if (elm.checked) + setWrap('soft'); + else + setWrap('off'); +} + +var wHeight=0, wWidth=0, owHeight=0, owWidth=0; + +function resizeInputs() { + var el = document.getElementById('htmlSource'); + + if (!tinymce.isIE) { + wHeight = self.innerHeight - 65; + wWidth = self.innerWidth - 16; + } else { + wHeight = document.body.clientHeight - 70; + wWidth = document.body.clientWidth - 16; + } + + el.style.height = Math.abs(wHeight) + 'px'; + el.style.width = Math.abs(wWidth) + 'px'; +} diff --git a/thirdparty/tiny/themes/advanced/js/about.js b/thirdparty/tiny/themes/advanced/js/about.js new file mode 100644 index 0000000..7fc8ba2 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/about.js @@ -0,0 +1,72 @@ +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
    ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
    ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/thirdparty/tiny/themes/advanced/js/anchor.js b/thirdparty/tiny/themes/advanced/js/anchor.js new file mode 100644 index 0000000..76f4f7d --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/anchor.js @@ -0,0 +1,37 @@ +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor; + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + // Webkit acts weird if empty inline element is inserted so we need to use a image instead + if (tinymce.isWebKit) + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); + else + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/thirdparty/tiny/themes/advanced/js/charmap.js b/thirdparty/tiny/themes/advanced/js/charmap.js new file mode 100644 index 0000000..d9fd8d3 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/charmap.js @@ -0,0 +1,325 @@ +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true,'lozenge'], + ['♠', '♠', false,'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); +}); + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
    '; + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/thirdparty/tiny/themes/advanced/js/color_picker.js b/thirdparty/tiny/themes/advanced/js/color_picker.js new file mode 100644 index 0000000..c1a65db --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/color_picker.js @@ -0,0 +1,253 @@ +tinyMCEPopup.requireLangPack(); + +var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; + +var colors = [ + "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", + "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", + "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", + "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", + "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", + "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", + "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", + "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", + "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", + "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", + "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", + "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", + "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", + "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", + "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", + "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", + "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", + "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", + "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", + "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", + "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", + "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", + "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", + "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", + "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", + "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", + "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" +]; + +var named = { + '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', + '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', + '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', + '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', + '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', + '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', + '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', + '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', + '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', + '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', + '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', + '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', + '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', + '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', + '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', + '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', + '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', + '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', + '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', + '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', + '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', + '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', + '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' +}; + +function init() { + var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); + + tinyMCEPopup.resizeToInnerSize(); + + generatePicker(); + + if (inputColor) { + changeFinalColor(inputColor); + + col = convertHexToRGB(inputColor); + + if (col) + updateLight(col.r, col.g, col.b); + } +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + tinyMCEPopup.restoreSelection(); + + if (f) + f(color); + + tinyMCEPopup.close(); +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toLowerCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
    '; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + h += '' + + ''; + + for (i=0; i' + + '' + + ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
    '; + + el.innerHTML = h; + el.className = 'generated'; +} + +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += '' + } + + el.innerHTML = h; + el.className = 'generated'; +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + 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; + 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); + 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); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', 'tinyMCEImageList'); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value, + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); + this.styleVal = dom.serializeStyle(st); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/thirdparty/tiny/themes/advanced/js/link.js b/thirdparty/tiny/themes/advanced/js/link.js new file mode 100644 index 0000000..c8cb642 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/link.js @@ -0,0 +1,155 @@ +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + // Create new anchor elements + if (e == null) { + tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : f.href.value, + title : f.linktitle.value, + target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, + 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : f.href.value, + title : f.linktitle.value, + target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, + 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/thirdparty/tiny/themes/advanced/js/source_editor.js b/thirdparty/tiny/themes/advanced/js/source_editor.js new file mode 100644 index 0000000..a6235a3 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/js/source_editor.js @@ -0,0 +1,62 @@ +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent(); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function toggleWordWrap(elm) { + if (elm.checked) + setWrap('soft'); + else + setWrap('off'); +} + +var wHeight=0, wWidth=0, owHeight=0, owWidth=0; + +function resizeInputs() { + var el = document.getElementById('htmlSource'); + + if (!tinymce.isIE) { + wHeight = self.innerHeight - 65; + wWidth = self.innerWidth - 16; + } else { + wHeight = document.body.clientHeight - 70; + wWidth = document.body.clientWidth - 16; + } + + el.style.height = Math.abs(wHeight) + 'px'; + el.style.width = Math.abs(wWidth) + 'px'; +} diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/langs/.svn/all-wcprops new file mode 100644 index 0000000..66e4e8e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/langs +END +de.js +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/langs/de.js +END +en_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 71 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/langs/en_dlg.js +END +de_dlg.js +K 25 +svn:wc:ra_dav:version-url +V 71 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/langs/de_dlg.js +END +en.js +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/langs/en.js +END diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/entries b/thirdparty/tiny/themes/advanced/langs/.svn/entries new file mode 100644 index 0000000..51bbb26 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/entries @@ -0,0 +1,164 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/langs +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +de.js +file + + + + +2009-06-08T19:44:28.000000Z +0672bbf89996f75d5a742b2cc95ec90f +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2266 + +en_dlg.js +file + + + + +2009-06-08T19:44:28.000000Z +c855d4c47b333fb42727cc5634d72d49 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1724 + +de_dlg.js +file + + + + +2009-06-08T19:44:28.000000Z +bd3ff549797fe800abdda11f03652175 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1906 + +en.js +file + + + + +2009-06-08T19:44:28.000000Z +91c93bcdb9bad88b46b0f9be597e4dab +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1896 + diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/format b/thirdparty/tiny/themes/advanced/langs/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/text-base/de.js.svn-base b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/de.js.svn-base new file mode 100644 index 0000000..37c92ec --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/de.js.svn-base @@ -0,0 +1,63 @@ +tinyMCE.addI18n('de.advanced',{ +style_select:"Format", +font_size:"Schriftgr\u00F6\u00DFe", +fontdefault:"Schriftart", +block:"Vorlage", +paragraph:"Absatz", +div:"Zusammenh\u00E4ngender Bereich", +address:"Addresse", +pre:"Rohdaten", +h1:"\u00DCberschrift 1", +h2:"\u00DCberschrift 2", +h3:"\u00DCberschrift 3", +h4:"\u00DCberschrift 4", +h5:"\u00DCberschrift 5", +h6:"\u00DCberschrift 6", +blockquote:"Zitatblock", +code:"Code", +samp:"Beispiel", +dt:"Definitionsbegriff", +dd:"Definitionsbeschreibung", +bold_desc:"Fett (Strg+B)", +italic_desc:"Kursiv (Strg+I)", +underline_desc:"Unterstrichen (Strg+U)", +striketrough_desc:"Durchgestrichen", +justifyleft_desc:"Links ausgerichtet", +justifycenter_desc:"Mittig ausgerichtet", +justifyright_desc:"Rechts ausgerichtet", +justifyfull_desc:"Blocksatz", +bullist_desc:"Unsortierte Liste", +numlist_desc:"Sortierte Liste", +outdent_desc:"Ausr\u00FCcken", +indent_desc:"Einr\u00FCcken", +undo_desc:"R\u00FCckg\u00E4ngig (Strg+Z)", +redo_desc:"Wiederholen (Strg+Y)", +link_desc:"Link einf\u00FCgen/ver\u00E4ndern", +unlink_desc:"Link entfernen", +image_desc:"Bild einf\u00FCgen/ver\u00E4ndern", +cleanup_desc:"Quellcode aufr\u00E4umen", +code_desc:"HTML-Quellcode bearbeiten", +sub_desc:"Tiefgestellt", +sup_desc:"Hochgestellt", +hr_desc:"Trennlinie einf\u00FCgen", +removeformat_desc:"Formatierungen zur\u00FCcksetzen", +custom1_desc:"Benutzerdefinierte Beschreibung", +forecolor_desc:"Textfarbe", +backcolor_desc:"Hintergrundfarbe", +charmap_desc:"Sonderzeichen einf\u00FCgen", +visualaid_desc:"Hilfslinien und unsichtbare Elemente ein-/ausblenden", +anchor_desc:"Anker einf\u00FCgen/ver\u00E4ndern", +cut_desc:"Ausschneiden", +copy_desc:"Kopieren", +paste_desc:"Einf\u00FCgen", +image_props_desc:"Bildeigenschaften", +newdocument_desc:"Neues Dokument", +help_desc:"Hilfe", +blockquote_desc:"Zitatblock", +clipboard_msg:"Kopieren, Ausschneiden und Einf\u00FCgen sind im Mozilla Firefox nicht m\u00F6glich.\r\nWollen Sie mehr \u00FCber dieses Problem erfahren?", +path:"Pfad", +newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00F6schen?", +toolbar_focus:"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X", +more_colors:"Weitere Farben", +anchor_delta_width:"13" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/text-base/de_dlg.js.svn-base b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/de_dlg.js.svn-base new file mode 100644 index 0000000..f23f7da --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/de_dlg.js.svn-base @@ -0,0 +1,51 @@ +tinyMCE.addI18n('de.advanced_dlg',{ +about_title:"\u00DCber TinyMCE", +about_general:"\u00DCber\u2026", +about_help:"Hilfe", +about_license:"Lizenzbedingungen", +about_plugins:"Plugins", +about_plugin:"Plugin", +about_author:"Urheber", +about_version:"Version", +about_loaded:"Geladene Plugins", +anchor_title:"Anker einf\u00FCgen/ver\u00E4ndern", +anchor_name:"Name des Ankers", +code_title:"HTML-Quellcode bearbeiten", +code_wordwrap:"Automatischer Zeilenumbruch", +colorpicker_title:"Farbe", +colorpicker_picker_tab:"Farbwahl", +colorpicker_picker_title:"Farbwahl", +colorpicker_palette_tab:"Palette", +colorpicker_palette_title:"Farbpalette", +colorpicker_named_tab:"Benannte Farben", +colorpicker_named_title:"Benannte Farben", +colorpicker_color:"Farbe:", +colorpicker_name:"Name:", +charmap_title:"Sonderzeichen", +image_title:"Bild einf\u00FCgen/bearbeiten", +image_src:"Adresse", +image_alt:"Alternativtext", +image_list:"Bilderliste", +image_border:"Rahmen", +image_dimensions:"Ausma\u00DFe", +image_vspace:"Vertikaler Abstand", +image_hspace:"Horizontaler Abstand", +image_align:"Ausrichtung", +image_align_baseline:"Zeile", +image_align_top:"Oben", +image_align_middle:"Mittig", +image_align_bottom:"Unten", +image_align_texttop:"Oben im Text", +image_align_textbottom:"Unten im Text", +image_align_left:"Links", +image_align_right:"Rechts", +link_title:"Link einf\u00FCgen/bearbeiten", +link_url:"Adresse", +link_target:"Fenster", +link_target_same:"Im selben Fenster \u00F6ffnen", +link_target_blank:"Neues Fenster \u00F6ffnen", +link_titlefield:"Titel", +link_is_email:"Bei der Adresse scheint es sich um eine E-Mail-Adresse zu handeln. Wollen Sie das dazu ben\u00F6tigte mailto: voranstellen?", +link_is_external:"Bei der Adresse scheint es sich um einen externen Link zu handeln. M\u00F6chten Sie, dass zur korrekten Verlinkung ein http:// vorangestellt wird?", +link_list:"Linkliste" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/text-base/en.js.svn-base b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/en.js.svn-base new file mode 100644 index 0000000..52989e3 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/en.js.svn-base @@ -0,0 +1,62 @@ +tinyMCE.addI18n('en.advanced',{ +style_select:"Styles", +font_size:"Font size", +fontdefault:"Font family", +block:"Format", +paragraph:"Paragraph", +div:"Div", +address:"Address", +pre:"Preformatted", +h1:"Heading 1", +h2:"Heading 2", +h3:"Heading 3", +h4:"Heading 4", +h5:"Heading 5", +h6:"Heading 6", +blockquote:"Blockquote", +code:"Code", +samp:"Code sample", +dt:"Definition term ", +dd:"Definition description", +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +justifyleft_desc:"Align left", +justifycenter_desc:"Align center", +justifyright_desc:"Align right", +justifyfull_desc:"Align full", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +outdent_desc:"Outdent", +indent_desc:"Indent", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +link_desc:"Insert/edit link", +unlink_desc:"Unlink", +image_desc:"Insert/edit image", +cleanup_desc:"Cleanup messy code", +code_desc:"Edit HTML Source", +sub_desc:"Subscript", +sup_desc:"Superscript", +hr_desc:"Insert horizontal ruler", +removeformat_desc:"Remove formatting", +custom1_desc:"Your custom description here", +forecolor_desc:"Select text color", +backcolor_desc:"Select background color", +charmap_desc:"Insert custom character", +visualaid_desc:"Toggle guidelines/invisible elements", +anchor_desc:"Insert/edit anchor", +cut_desc:"Cut", +copy_desc:"Copy", +paste_desc:"Paste", +image_props_desc:"Image properties", +newdocument_desc:"New document", +help_desc:"Help", +blockquote_desc:"Blockquote", +clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", +path:"Path", +newdocument:"Are you sure you want clear all contents?", +toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", +more_colors:"More colors" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/.svn/text-base/en_dlg.js.svn-base b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/en_dlg.js.svn-base new file mode 100644 index 0000000..80e4941 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/.svn/text-base/en_dlg.js.svn-base @@ -0,0 +1,51 @@ +tinyMCE.addI18n('en.advanced_dlg',{ +about_title:"About TinyMCE", +about_general:"About", +about_help:"Help", +about_license:"License", +about_plugins:"Plugins", +about_plugin:"Plugin", +about_author:"Author", +about_version:"Version", +about_loaded:"Loaded plugins", +anchor_title:"Insert/edit anchor", +anchor_name:"Anchor name", +code_title:"HTML Source Editor", +code_wordwrap:"Word wrap", +colorpicker_title:"Select a color", +colorpicker_picker_tab:"Picker", +colorpicker_picker_title:"Color picker", +colorpicker_palette_tab:"Palette", +colorpicker_palette_title:"Palette colors", +colorpicker_named_tab:"Named", +colorpicker_named_title:"Named colors", +colorpicker_color:"Color:", +colorpicker_name:"Name:", +charmap_title:"Select custom character", +image_title:"Insert/edit image", +image_src:"Image URL", +image_alt:"Image description", +image_list:"Image list", +image_border:"Border", +image_dimensions:"Dimensions", +image_vspace:"Vertical space", +image_hspace:"Horizontal space", +image_align:"Alignment", +image_align_baseline:"Baseline", +image_align_top:"Top", +image_align_middle:"Middle", +image_align_bottom:"Bottom", +image_align_texttop:"Text top", +image_align_textbottom:"Text bottom", +image_align_left:"Left", +image_align_right:"Right", +link_title:"Insert/edit link", +link_url:"Link URL", +link_target:"Target", +link_target_same:"Open link in the same window", +link_target_blank:"Open link in a new window", +link_titlefield:"Title", +link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", +link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", +link_list:"Link list" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/de.js b/thirdparty/tiny/themes/advanced/langs/de.js new file mode 100644 index 0000000..37c92ec --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/de.js @@ -0,0 +1,63 @@ +tinyMCE.addI18n('de.advanced',{ +style_select:"Format", +font_size:"Schriftgr\u00F6\u00DFe", +fontdefault:"Schriftart", +block:"Vorlage", +paragraph:"Absatz", +div:"Zusammenh\u00E4ngender Bereich", +address:"Addresse", +pre:"Rohdaten", +h1:"\u00DCberschrift 1", +h2:"\u00DCberschrift 2", +h3:"\u00DCberschrift 3", +h4:"\u00DCberschrift 4", +h5:"\u00DCberschrift 5", +h6:"\u00DCberschrift 6", +blockquote:"Zitatblock", +code:"Code", +samp:"Beispiel", +dt:"Definitionsbegriff", +dd:"Definitionsbeschreibung", +bold_desc:"Fett (Strg+B)", +italic_desc:"Kursiv (Strg+I)", +underline_desc:"Unterstrichen (Strg+U)", +striketrough_desc:"Durchgestrichen", +justifyleft_desc:"Links ausgerichtet", +justifycenter_desc:"Mittig ausgerichtet", +justifyright_desc:"Rechts ausgerichtet", +justifyfull_desc:"Blocksatz", +bullist_desc:"Unsortierte Liste", +numlist_desc:"Sortierte Liste", +outdent_desc:"Ausr\u00FCcken", +indent_desc:"Einr\u00FCcken", +undo_desc:"R\u00FCckg\u00E4ngig (Strg+Z)", +redo_desc:"Wiederholen (Strg+Y)", +link_desc:"Link einf\u00FCgen/ver\u00E4ndern", +unlink_desc:"Link entfernen", +image_desc:"Bild einf\u00FCgen/ver\u00E4ndern", +cleanup_desc:"Quellcode aufr\u00E4umen", +code_desc:"HTML-Quellcode bearbeiten", +sub_desc:"Tiefgestellt", +sup_desc:"Hochgestellt", +hr_desc:"Trennlinie einf\u00FCgen", +removeformat_desc:"Formatierungen zur\u00FCcksetzen", +custom1_desc:"Benutzerdefinierte Beschreibung", +forecolor_desc:"Textfarbe", +backcolor_desc:"Hintergrundfarbe", +charmap_desc:"Sonderzeichen einf\u00FCgen", +visualaid_desc:"Hilfslinien und unsichtbare Elemente ein-/ausblenden", +anchor_desc:"Anker einf\u00FCgen/ver\u00E4ndern", +cut_desc:"Ausschneiden", +copy_desc:"Kopieren", +paste_desc:"Einf\u00FCgen", +image_props_desc:"Bildeigenschaften", +newdocument_desc:"Neues Dokument", +help_desc:"Hilfe", +blockquote_desc:"Zitatblock", +clipboard_msg:"Kopieren, Ausschneiden und Einf\u00FCgen sind im Mozilla Firefox nicht m\u00F6glich.\r\nWollen Sie mehr \u00FCber dieses Problem erfahren?", +path:"Pfad", +newdocument:"Wollen Sie wirklich den ganzen Inhalt l\u00F6schen?", +toolbar_focus:"Zur Werkzeugleiste springen: Alt+Q; Zum Editor springen: Alt-Z; Zum Elementpfad springen: Alt-X", +more_colors:"Weitere Farben", +anchor_delta_width:"13" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/de_dlg.js b/thirdparty/tiny/themes/advanced/langs/de_dlg.js new file mode 100644 index 0000000..f23f7da --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/de_dlg.js @@ -0,0 +1,51 @@ +tinyMCE.addI18n('de.advanced_dlg',{ +about_title:"\u00DCber TinyMCE", +about_general:"\u00DCber\u2026", +about_help:"Hilfe", +about_license:"Lizenzbedingungen", +about_plugins:"Plugins", +about_plugin:"Plugin", +about_author:"Urheber", +about_version:"Version", +about_loaded:"Geladene Plugins", +anchor_title:"Anker einf\u00FCgen/ver\u00E4ndern", +anchor_name:"Name des Ankers", +code_title:"HTML-Quellcode bearbeiten", +code_wordwrap:"Automatischer Zeilenumbruch", +colorpicker_title:"Farbe", +colorpicker_picker_tab:"Farbwahl", +colorpicker_picker_title:"Farbwahl", +colorpicker_palette_tab:"Palette", +colorpicker_palette_title:"Farbpalette", +colorpicker_named_tab:"Benannte Farben", +colorpicker_named_title:"Benannte Farben", +colorpicker_color:"Farbe:", +colorpicker_name:"Name:", +charmap_title:"Sonderzeichen", +image_title:"Bild einf\u00FCgen/bearbeiten", +image_src:"Adresse", +image_alt:"Alternativtext", +image_list:"Bilderliste", +image_border:"Rahmen", +image_dimensions:"Ausma\u00DFe", +image_vspace:"Vertikaler Abstand", +image_hspace:"Horizontaler Abstand", +image_align:"Ausrichtung", +image_align_baseline:"Zeile", +image_align_top:"Oben", +image_align_middle:"Mittig", +image_align_bottom:"Unten", +image_align_texttop:"Oben im Text", +image_align_textbottom:"Unten im Text", +image_align_left:"Links", +image_align_right:"Rechts", +link_title:"Link einf\u00FCgen/bearbeiten", +link_url:"Adresse", +link_target:"Fenster", +link_target_same:"Im selben Fenster \u00F6ffnen", +link_target_blank:"Neues Fenster \u00F6ffnen", +link_titlefield:"Titel", +link_is_email:"Bei der Adresse scheint es sich um eine E-Mail-Adresse zu handeln. Wollen Sie das dazu ben\u00F6tigte mailto: voranstellen?", +link_is_external:"Bei der Adresse scheint es sich um einen externen Link zu handeln. M\u00F6chten Sie, dass zur korrekten Verlinkung ein http:// vorangestellt wird?", +link_list:"Linkliste" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/en.js b/thirdparty/tiny/themes/advanced/langs/en.js new file mode 100644 index 0000000..52989e3 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/en.js @@ -0,0 +1,62 @@ +tinyMCE.addI18n('en.advanced',{ +style_select:"Styles", +font_size:"Font size", +fontdefault:"Font family", +block:"Format", +paragraph:"Paragraph", +div:"Div", +address:"Address", +pre:"Preformatted", +h1:"Heading 1", +h2:"Heading 2", +h3:"Heading 3", +h4:"Heading 4", +h5:"Heading 5", +h6:"Heading 6", +blockquote:"Blockquote", +code:"Code", +samp:"Code sample", +dt:"Definition term ", +dd:"Definition description", +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +justifyleft_desc:"Align left", +justifycenter_desc:"Align center", +justifyright_desc:"Align right", +justifyfull_desc:"Align full", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +outdent_desc:"Outdent", +indent_desc:"Indent", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +link_desc:"Insert/edit link", +unlink_desc:"Unlink", +image_desc:"Insert/edit image", +cleanup_desc:"Cleanup messy code", +code_desc:"Edit HTML Source", +sub_desc:"Subscript", +sup_desc:"Superscript", +hr_desc:"Insert horizontal ruler", +removeformat_desc:"Remove formatting", +custom1_desc:"Your custom description here", +forecolor_desc:"Select text color", +backcolor_desc:"Select background color", +charmap_desc:"Insert custom character", +visualaid_desc:"Toggle guidelines/invisible elements", +anchor_desc:"Insert/edit anchor", +cut_desc:"Cut", +copy_desc:"Copy", +paste_desc:"Paste", +image_props_desc:"Image properties", +newdocument_desc:"New document", +help_desc:"Help", +blockquote_desc:"Blockquote", +clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", +path:"Path", +newdocument:"Are you sure you want clear all contents?", +toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", +more_colors:"More colors" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/langs/en_dlg.js b/thirdparty/tiny/themes/advanced/langs/en_dlg.js new file mode 100644 index 0000000..80e4941 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/langs/en_dlg.js @@ -0,0 +1,51 @@ +tinyMCE.addI18n('en.advanced_dlg',{ +about_title:"About TinyMCE", +about_general:"About", +about_help:"Help", +about_license:"License", +about_plugins:"Plugins", +about_plugin:"Plugin", +about_author:"Author", +about_version:"Version", +about_loaded:"Loaded plugins", +anchor_title:"Insert/edit anchor", +anchor_name:"Anchor name", +code_title:"HTML Source Editor", +code_wordwrap:"Word wrap", +colorpicker_title:"Select a color", +colorpicker_picker_tab:"Picker", +colorpicker_picker_title:"Color picker", +colorpicker_palette_tab:"Palette", +colorpicker_palette_title:"Palette colors", +colorpicker_named_tab:"Named", +colorpicker_named_title:"Named colors", +colorpicker_color:"Color:", +colorpicker_name:"Name:", +charmap_title:"Select custom character", +image_title:"Insert/edit image", +image_src:"Image URL", +image_alt:"Image description", +image_list:"Image list", +image_border:"Border", +image_dimensions:"Dimensions", +image_vspace:"Vertical space", +image_hspace:"Horizontal space", +image_align:"Alignment", +image_align_baseline:"Baseline", +image_align_top:"Top", +image_align_middle:"Middle", +image_align_bottom:"Bottom", +image_align_texttop:"Text top", +image_align_textbottom:"Text bottom", +image_align_left:"Left", +image_align_right:"Right", +link_title:"Insert/edit link", +link_url:"Link URL", +link_target:"Target", +link_target_same:"Open link in the same window", +link_target_blank:"Open link in a new window", +link_titlefield:"Title", +link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", +link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", +link_list:"Link list" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/link.htm b/thirdparty/tiny/themes/advanced/link.htm new file mode 100644 index 0000000..b647eed --- /dev/null +++ b/thirdparty/tiny/themes/advanced/link.htm @@ -0,0 +1,64 @@ + + + + {#advanced_dlg.link_title} + + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/advanced/skins/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/skins/.svn/all-wcprops new file mode 100644 index 0000000..f5cdc7b --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins +END diff --git a/thirdparty/tiny/themes/advanced/skins/.svn/entries b/thirdparty/tiny/themes/advanced/skins/.svn/entries new file mode 100644 index 0000000..e5b0737 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/.svn/entries @@ -0,0 +1,34 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/skins +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +o2k7 +dir + +default +dir + diff --git a/thirdparty/tiny/themes/advanced/skins/.svn/format b/thirdparty/tiny/themes/advanced/skins/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/skins/default/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/skins/default/.svn/all-wcprops new file mode 100644 index 0000000..4039fb6 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default +END +content.css +K 25 +svn:wc:ra_dav:version-url +V 81 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/content.css +END +ui.css +K 25 +svn:wc:ra_dav:version-url +V 76 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/ui.css +END +dialog.css +K 25 +svn:wc:ra_dav:version-url +V 80 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/dialog.css +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/.svn/entries b/thirdparty/tiny/themes/advanced/skins/default/.svn/entries new file mode 100644 index 0000000..25f275b --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/.svn/entries @@ -0,0 +1,133 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/skins/default +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +content.css +file + + + + +2009-06-08T19:44:28.000000Z +fb2bb5e8f61d4d67b616e6311d22c7fb +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1307 + +ui.css +file + + + + +2009-06-08T19:44:28.000000Z +9a2947c679d9bc94eee77c38874527ce +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +15646 + +dialog.css +file + + + + +2009-06-08T19:44:28.000000Z +fc4041c075fb5d93d20db3251d4bba04 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +5513 + +img +dir + diff --git a/thirdparty/tiny/themes/advanced/skins/default/.svn/format b/thirdparty/tiny/themes/advanced/skins/default/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/content.css.svn-base b/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/content.css.svn-base new file mode 100644 index 0000000..cb7604e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/content.css.svn-base @@ -0,0 +1,32 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/dialog.css.svn-base b/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/dialog.css.svn-base new file mode 100644 index 0000000..8b21c02 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/dialog.css.svn-base @@ -0,0 +1,114 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +} + +#insert {background:url(img/buttons.png) 0 -52px;} +#cancel {background:url(img/buttons.png) 0 0;} + +/* Browse */ +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +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;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.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;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/ui.css.svn-base b/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/ui.css.svn-base new file mode 100644 index 0000000..2c90d49 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/.svn/text-base/ui.css.svn-base @@ -0,0 +1,214 @@ +/* Reset */ +.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} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {background:#F0F0EE} +.defaultSkin iframe {display:block; background:#FFF} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.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} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox {direction:ltr} +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.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} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.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} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.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} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.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} +.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} +.defaultSkin .mcePlaceHolder {border:1px dotted gray} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px} diff --git a/thirdparty/tiny/themes/advanced/skins/default/content.css b/thirdparty/tiny/themes/advanced/skins/default/content.css new file mode 100644 index 0000000..cb7604e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/content.css @@ -0,0 +1,32 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/thirdparty/tiny/themes/advanced/skins/default/dialog.css b/thirdparty/tiny/themes/advanced/skins/default/dialog.css new file mode 100644 index 0000000..8b21c02 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/dialog.css @@ -0,0 +1,114 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +} + +#insert {background:url(img/buttons.png) 0 -52px;} +#cancel {background:url(img/buttons.png) 0 0;} + +/* Browse */ +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +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;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.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;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/all-wcprops new file mode 100644 index 0000000..d7a1ca8 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/all-wcprops @@ -0,0 +1,41 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img +END +buttons.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img/buttons.png +END +menu_arrow.gif +K 25 +svn:wc:ra_dav:version-url +V 88 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img/menu_arrow.gif +END +items.gif +K 25 +svn:wc:ra_dav:version-url +V 83 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img/items.gif +END +menu_check.gif +K 25 +svn:wc:ra_dav:version-url +V 88 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img/menu_check.gif +END +progress.gif +K 25 +svn:wc:ra_dav:version-url +V 86 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img/progress.gif +END +tabs.gif +K 25 +svn:wc:ra_dav:version-url +V 82 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/default/img/tabs.gif +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/entries b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/entries new file mode 100644 index 0000000..a38649e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/entries @@ -0,0 +1,232 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/skins/default/img +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +buttons.png +file + + + + +2009-06-08T19:44:28.000000Z +1e0acdc2135897e6a95bb40cfde2fbc6 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +3274 + +menu_arrow.gif +file + + + + +2009-06-08T19:44:28.000000Z +e21752451a9d80e276fef7b602bdbdba +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +68 + +items.gif +file + + + + +2009-06-08T19:44:28.000000Z +5cb42865ce70a58d420786854fed4ae1 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +70 + +menu_check.gif +file + + + + +2009-06-08T19:44:28.000000Z +c7d003885737f94768eecae49dcbca63 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +70 + +progress.gif +file + + + + +2009-06-08T19:44:28.000000Z +50c5e3e79b276c92df6cc52caeb464f0 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +1787 + +tabs.gif +file + + + + +2009-06-08T19:44:28.000000Z +93f97588a35da1f45fdcb975d4380913 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +1326 + diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/format b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/buttons.png.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/buttons.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/buttons.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/items.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/items.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/items.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/menu_arrow.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/menu_arrow.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/menu_arrow.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/menu_check.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/menu_check.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/menu_check.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/progress.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/progress.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/progress.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/tabs.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/tabs.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/prop-base/tabs.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/buttons.png.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/buttons.png.svn-base new file mode 100644 index 0000000..7dd5841 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/buttons.png.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/items.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/items.gif.svn-base new file mode 100644 index 0000000..2eafd79 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/items.gif.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/menu_arrow.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/menu_arrow.gif.svn-base new file mode 100644 index 0000000..85e31df Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/menu_arrow.gif.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/menu_check.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/menu_check.gif.svn-base new file mode 100644 index 0000000..adfdddc Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/menu_check.gif.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/progress.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/progress.gif.svn-base new file mode 100644 index 0000000..5bb90fd Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/progress.gif.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/tabs.gif.svn-base b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/tabs.gif.svn-base new file mode 100644 index 0000000..ce4be63 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/.svn/text-base/tabs.gif.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/buttons.png b/thirdparty/tiny/themes/advanced/skins/default/img/buttons.png new file mode 100644 index 0000000..7dd5841 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/buttons.png differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/items.gif b/thirdparty/tiny/themes/advanced/skins/default/img/items.gif new file mode 100644 index 0000000..2eafd79 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/items.gif differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/menu_arrow.gif b/thirdparty/tiny/themes/advanced/skins/default/img/menu_arrow.gif new file mode 100644 index 0000000..85e31df Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/menu_arrow.gif differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/menu_check.gif b/thirdparty/tiny/themes/advanced/skins/default/img/menu_check.gif new file mode 100644 index 0000000..adfdddc Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/menu_check.gif differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/progress.gif b/thirdparty/tiny/themes/advanced/skins/default/img/progress.gif new file mode 100644 index 0000000..5bb90fd Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/progress.gif differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/img/tabs.gif b/thirdparty/tiny/themes/advanced/skins/default/img/tabs.gif new file mode 100644 index 0000000..ce4be63 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/default/img/tabs.gif differ diff --git a/thirdparty/tiny/themes/advanced/skins/default/ui.css b/thirdparty/tiny/themes/advanced/skins/default/ui.css new file mode 100644 index 0000000..2c90d49 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/default/ui.css @@ -0,0 +1,214 @@ +/* Reset */ +.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} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {background:#F0F0EE} +.defaultSkin iframe {display:block; background:#FFF} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.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} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox {direction:ltr} +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.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} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.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} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.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} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.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} +.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} +.defaultSkin .mcePlaceHolder {border:1px dotted gray} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/all-wcprops new file mode 100644 index 0000000..e17e767 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7 +END +ui_black.css +K 25 +svn:wc:ra_dav:version-url +V 79 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/ui_black.css +END +content.css +K 25 +svn:wc:ra_dav:version-url +V 78 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/content.css +END +ui.css +K 25 +svn:wc:ra_dav:version-url +V 73 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/ui.css +END +dialog.css +K 25 +svn:wc:ra_dav:version-url +V 77 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/dialog.css +END +ui_silver.css +K 25 +svn:wc:ra_dav:version-url +V 80 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/ui_silver.css +END diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/entries b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/entries new file mode 100644 index 0000000..0fa541b --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/entries @@ -0,0 +1,201 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/skins/o2k7 +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +ui_black.css +file + + + + +2009-06-08T19:44:28.000000Z +524c71b474032566e351397cab161fba +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1655 + +content.css +file + + + + +2009-06-08T19:44:28.000000Z +00e45968e57c21eaeb47a4822edeed2a +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1329 + +ui.css +file + + + + +2009-06-08T19:44:28.000000Z +8c3938d9afc1c43c4e3edf3e98a2fe6a +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +15013 + +dialog.css +file + + + + +2009-06-08T19:44:28.000000Z +92d711c60ac46e123bace1ce700e1b70 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +5539 + +ui_silver.css +file + + + + +2009-06-08T19:44:28.000000Z +bbf2b4fcf6dbfb4afb23c1b88ae60b29 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +819 + +img +dir + diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/format b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/content.css.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/content.css.svn-base new file mode 100644 index 0000000..a404931 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/content.css.svn-base @@ -0,0 +1,32 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/dialog.css.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/dialog.css.svn-base new file mode 100644 index 0000000..4f61882 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/dialog.css.svn-base @@ -0,0 +1,113 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px;} +#cancel {background:url(../default/img/buttons.png) 0 0;} + +/* Browse */ +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +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;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.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;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui.css.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui.css.svn-base new file mode 100644 index 0000000..0f8d5c2 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui.css.svn-base @@ -0,0 +1,215 @@ +/* Reset */ +.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} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:#E5EFFD} +.o2k7Skin iframe {display:block; background:#FFF} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.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} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.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} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.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} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.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} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.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} +.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} +.o2k7Skin .mcePlaceHolder {border:1px dotted gray} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui_black.css.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui_black.css.svn-base new file mode 100644 index 0000000..81dbfe4 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui_black.css.svn-base @@ -0,0 +1,8 @@ +/* Black */ +.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)} +.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.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;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui_silver.css.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui_silver.css.svn-base new file mode 100644 index 0000000..e8ae844 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/.svn/text-base/ui_silver.css.svn-base @@ -0,0 +1,5 @@ +/* Silver */ +.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)} +.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.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} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/content.css b/thirdparty/tiny/themes/advanced/skins/o2k7/content.css new file mode 100644 index 0000000..a404931 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/content.css @@ -0,0 +1,32 @@ +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/dialog.css b/thirdparty/tiny/themes/advanced/skins/o2k7/dialog.css new file mode 100644 index 0000000..4f61882 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/dialog.css @@ -0,0 +1,113 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px;} +#cancel {background:url(../default/img/buttons.png) 0 0;} + +/* Browse */ +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +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;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.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;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/all-wcprops b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/all-wcprops new file mode 100644 index 0000000..78281c9 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/img +END +button_bg_black.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_black.png +END +button_bg.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg.png +END +button_bg_silver.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_silver.png +END diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/entries b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/entries new file mode 100644 index 0000000..9c620b2 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/entries @@ -0,0 +1,130 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/advanced/skins/o2k7/img +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +button_bg_black.png +file + + + + +2009-06-08T19:44:28.000000Z +a5ad448e9c25120cb7e05fffe4a6234f +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +3736 + +button_bg.png +file + + + + +2009-06-08T19:44:28.000000Z +8c9b1f0ee9deb6374983650edbd6ddfc +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +5859 + +button_bg_silver.png +file + + + + +2009-06-08T19:44:28.000000Z +5690ef573f4dc74ec3eb4d101806976e +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +5358 + diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/format b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg.png.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg_black.png.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg_black.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg_black.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg_silver.png.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg_silver.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/prop-base/button_bg_silver.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg.png.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg.png.svn-base new file mode 100644 index 0000000..12cfb41 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg.png.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg_black.png.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg_black.png.svn-base new file mode 100644 index 0000000..8996c74 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg_black.png.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg_silver.png.svn-base b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg_silver.png.svn-base new file mode 100644 index 0000000..bd5d255 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/o2k7/img/.svn/text-base/button_bg_silver.png.svn-base differ diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg.png b/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg.png new file mode 100644 index 0000000..12cfb41 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg.png differ diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_black.png b/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_black.png new file mode 100644 index 0000000..8996c74 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_black.png differ diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_silver.png b/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_silver.png new file mode 100644 index 0000000..bd5d255 Binary files /dev/null and b/thirdparty/tiny/themes/advanced/skins/o2k7/img/button_bg_silver.png differ diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/ui.css b/thirdparty/tiny/themes/advanced/skins/o2k7/ui.css new file mode 100644 index 0000000..0f8d5c2 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/ui.css @@ -0,0 +1,215 @@ +/* Reset */ +.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} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:#E5EFFD} +.o2k7Skin iframe {display:block; background:#FFF} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.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} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.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} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.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} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.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} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.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} +.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} +.o2k7Skin .mcePlaceHolder {border:1px dotted gray} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/ui_black.css b/thirdparty/tiny/themes/advanced/skins/o2k7/ui_black.css new file mode 100644 index 0000000..81dbfe4 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/ui_black.css @@ -0,0 +1,8 @@ +/* Black */ +.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)} +.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.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;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/thirdparty/tiny/themes/advanced/skins/o2k7/ui_silver.css b/thirdparty/tiny/themes/advanced/skins/o2k7/ui_silver.css new file mode 100644 index 0000000..e8ae844 --- /dev/null +++ b/thirdparty/tiny/themes/advanced/skins/o2k7/ui_silver.css @@ -0,0 +1,5 @@ +/* Silver */ +.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)} +.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.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} diff --git a/thirdparty/tiny/themes/advanced/source_editor.htm b/thirdparty/tiny/themes/advanced/source_editor.htm new file mode 100644 index 0000000..5f047dc --- /dev/null +++ b/thirdparty/tiny/themes/advanced/source_editor.htm @@ -0,0 +1,32 @@ + + + + {#advanced_dlg.code_title} + + + + + +
    +
    {#advanced_dlg.code_title}
    + +
    + +
    + +
    + + + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/thirdparty/tiny/themes/simple/.svn/all-wcprops b/thirdparty/tiny/themes/simple/.svn/all-wcprops new file mode 100644 index 0000000..82a424a --- /dev/null +++ b/thirdparty/tiny/themes/simple/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple +END +editor_template_src.js +K 25 +svn:wc:ra_dav:version-url +V 76 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/editor_template_src.js +END +editor_template.js +K 25 +svn:wc:ra_dav:version-url +V 72 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/editor_template.js +END diff --git a/thirdparty/tiny/themes/simple/.svn/entries b/thirdparty/tiny/themes/simple/.svn/entries new file mode 100644 index 0000000..ec72a20 --- /dev/null +++ b/thirdparty/tiny/themes/simple/.svn/entries @@ -0,0 +1,105 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +editor_template_src.js +file + + + + +2009-06-08T19:44:28.000000Z +96ac16dda25e9e09ef85682a8377104c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +3287 + +langs +dir + +skins +dir + +img +dir + +editor_template.js +file + + + + +2009-06-08T19:44:28.000000Z +45f4d2bf0007e3f8fef1e8bdccff214c +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2320 + diff --git a/thirdparty/tiny/themes/simple/.svn/format b/thirdparty/tiny/themes/simple/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/.svn/text-base/editor_template.js.svn-base b/thirdparty/tiny/themes/simple/.svn/text-base/editor_template.js.svn-base new file mode 100644 index 0000000..d19fb53 --- /dev/null +++ b/thirdparty/tiny/themes/simple/.svn/text-base/editor_template.js.svn-base @@ -0,0 +1 @@ +(function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS((s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):'')||url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('span',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar mceLast',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,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 diff --git a/thirdparty/tiny/themes/simple/.svn/text-base/editor_template_src.js.svn-base b/thirdparty/tiny/themes/simple/.svn/text-base/editor_template_src.js.svn-base new file mode 100644 index 0000000..75927e0 --- /dev/null +++ b/thirdparty/tiny/themes/simple/.svn/text-base/editor_template_src.js.svn-base @@ -0,0 +1,85 @@ +/** + * $Id: editor_template_src.js 920 2008-09-09 14:05:33Z spocke $ + * + * This file is meant to showcase how to create a simple theme. The advanced + * theme is more suitable for production use. + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + + ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + 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 diff --git a/thirdparty/tiny/themes/simple/editor_template.js b/thirdparty/tiny/themes/simple/editor_template.js new file mode 100644 index 0000000..d19fb53 --- /dev/null +++ b/thirdparty/tiny/themes/simple/editor_template.js @@ -0,0 +1 @@ +(function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS((s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):'')||url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('span',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar mceLast',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,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 diff --git a/thirdparty/tiny/themes/simple/editor_template_src.js b/thirdparty/tiny/themes/simple/editor_template_src.js new file mode 100644 index 0000000..75927e0 --- /dev/null +++ b/thirdparty/tiny/themes/simple/editor_template_src.js @@ -0,0 +1,85 @@ +/** + * $Id: editor_template_src.js 920 2008-09-09 14:05:33Z spocke $ + * + * This file is meant to showcase how to create a simple theme. The advanced + * theme is more suitable for production use. + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + + ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + 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 diff --git a/thirdparty/tiny/themes/simple/img/.svn/all-wcprops b/thirdparty/tiny/themes/simple/img/.svn/all-wcprops new file mode 100644 index 0000000..512e357 --- /dev/null +++ b/thirdparty/tiny/themes/simple/img/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/img +END +icons.gif +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/img/icons.gif +END diff --git a/thirdparty/tiny/themes/simple/img/.svn/entries b/thirdparty/tiny/themes/simple/img/.svn/entries new file mode 100644 index 0000000..b203d8e --- /dev/null +++ b/thirdparty/tiny/themes/simple/img/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple/img +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +icons.gif +file + + + + +2009-06-08T19:44:28.000000Z +749151955998f915596270f8c452af6e +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +1440 + diff --git a/thirdparty/tiny/themes/simple/img/.svn/format b/thirdparty/tiny/themes/simple/img/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/img/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/img/.svn/prop-base/icons.gif.svn-base b/thirdparty/tiny/themes/simple/img/.svn/prop-base/icons.gif.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/simple/img/.svn/prop-base/icons.gif.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/simple/img/.svn/text-base/icons.gif.svn-base b/thirdparty/tiny/themes/simple/img/.svn/text-base/icons.gif.svn-base new file mode 100644 index 0000000..16af141 Binary files /dev/null and b/thirdparty/tiny/themes/simple/img/.svn/text-base/icons.gif.svn-base differ diff --git a/thirdparty/tiny/themes/simple/img/icons.gif b/thirdparty/tiny/themes/simple/img/icons.gif new file mode 100644 index 0000000..16af141 Binary files /dev/null and b/thirdparty/tiny/themes/simple/img/icons.gif differ diff --git a/thirdparty/tiny/themes/simple/langs/.svn/all-wcprops b/thirdparty/tiny/themes/simple/langs/.svn/all-wcprops new file mode 100644 index 0000000..92684d8 --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/langs +END +de.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/langs/de.js +END +en.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/langs/en.js +END diff --git a/thirdparty/tiny/themes/simple/langs/.svn/entries b/thirdparty/tiny/themes/simple/langs/.svn/entries new file mode 100644 index 0000000..3e33440 --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple/langs +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +de.js +file + + + + +2009-06-08T19:44:28.000000Z +28a9408ebbf96188d0df59f5b47d9e56 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +360 + +en.js +file + + + + +2009-06-08T19:44:28.000000Z +658825dba927895369581022c3594b85 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +321 + diff --git a/thirdparty/tiny/themes/simple/langs/.svn/format b/thirdparty/tiny/themes/simple/langs/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/langs/.svn/text-base/de.js.svn-base b/thirdparty/tiny/themes/simple/langs/.svn/text-base/de.js.svn-base new file mode 100644 index 0000000..411c53b --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/.svn/text-base/de.js.svn-base @@ -0,0 +1,11 @@ +tinyMCE.addI18n('de.simple',{ +bold_desc:"Fett (Strg+B)", +italic_desc:"Kursiv (Strg+I)", +underline_desc:"Unterstrichen (Strg+U)", +striketrough_desc:"Durchgestrichen", +bullist_desc:"Unsortierte Liste", +numlist_desc:"Sortierte Liste", +undo_desc:"R\u00FCckg\u00E4ngig (Strg+Z)", +redo_desc:"Wiederholen (Strg+Y)", +cleanup_desc:"Quellcode s\u00E4ubern" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/simple/langs/.svn/text-base/en.js.svn-base b/thirdparty/tiny/themes/simple/langs/.svn/text-base/en.js.svn-base new file mode 100644 index 0000000..6f09531 --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/.svn/text-base/en.js.svn-base @@ -0,0 +1,11 @@ +tinyMCE.addI18n('en.simple',{ +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +cleanup_desc:"Cleanup messy code" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/simple/langs/de.js b/thirdparty/tiny/themes/simple/langs/de.js new file mode 100644 index 0000000..411c53b --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/de.js @@ -0,0 +1,11 @@ +tinyMCE.addI18n('de.simple',{ +bold_desc:"Fett (Strg+B)", +italic_desc:"Kursiv (Strg+I)", +underline_desc:"Unterstrichen (Strg+U)", +striketrough_desc:"Durchgestrichen", +bullist_desc:"Unsortierte Liste", +numlist_desc:"Sortierte Liste", +undo_desc:"R\u00FCckg\u00E4ngig (Strg+Z)", +redo_desc:"Wiederholen (Strg+Y)", +cleanup_desc:"Quellcode s\u00E4ubern" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/simple/langs/en.js b/thirdparty/tiny/themes/simple/langs/en.js new file mode 100644 index 0000000..6f09531 --- /dev/null +++ b/thirdparty/tiny/themes/simple/langs/en.js @@ -0,0 +1,11 @@ +tinyMCE.addI18n('en.simple',{ +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +cleanup_desc:"Cleanup messy code" +}); \ No newline at end of file diff --git a/thirdparty/tiny/themes/simple/skins/.svn/all-wcprops b/thirdparty/tiny/themes/simple/skins/.svn/all-wcprops new file mode 100644 index 0000000..61b9a79 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins +END diff --git a/thirdparty/tiny/themes/simple/skins/.svn/entries b/thirdparty/tiny/themes/simple/skins/.svn/entries new file mode 100644 index 0000000..e223891 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/.svn/entries @@ -0,0 +1,34 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple/skins +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +o2k7 +dir + +default +dir + diff --git a/thirdparty/tiny/themes/simple/skins/.svn/format b/thirdparty/tiny/themes/simple/skins/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/skins/default/.svn/all-wcprops b/thirdparty/tiny/themes/simple/skins/default/.svn/all-wcprops new file mode 100644 index 0000000..32e5648 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/default +END +content.css +K 25 +svn:wc:ra_dav:version-url +V 79 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/default/content.css +END +ui.css +K 25 +svn:wc:ra_dav:version-url +V 74 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/default/ui.css +END diff --git a/thirdparty/tiny/themes/simple/skins/default/.svn/entries b/thirdparty/tiny/themes/simple/skins/default/.svn/entries new file mode 100644 index 0000000..fd70375 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/.svn/entries @@ -0,0 +1,96 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple/skins/default +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +content.css +file + + + + +2009-06-08T19:44:28.000000Z +0f70f3ca9624e252d1c41ea064fc65e7 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +513 + +ui.css +file + + + + +2009-06-08T19:44:28.000000Z +c46c68283c617bb61dada1cd2494dd9f +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2105 + diff --git a/thirdparty/tiny/themes/simple/skins/default/.svn/format b/thirdparty/tiny/themes/simple/skins/default/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/skins/default/.svn/text-base/content.css.svn-base b/thirdparty/tiny/themes/simple/skins/default/.svn/text-base/content.css.svn-base new file mode 100644 index 0000000..783b170 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/.svn/text-base/content.css.svn-base @@ -0,0 +1,25 @@ +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/thirdparty/tiny/themes/simple/skins/default/.svn/text-base/ui.css.svn-base b/thirdparty/tiny/themes/simple/skins/default/.svn/text-base/ui.css.svn-base new file mode 100644 index 0000000..32feae6 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/.svn/text-base/ui.css.svn-base @@ -0,0 +1,32 @@ +/* Reset */ +.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} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/thirdparty/tiny/themes/simple/skins/default/content.css b/thirdparty/tiny/themes/simple/skins/default/content.css new file mode 100644 index 0000000..783b170 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/content.css @@ -0,0 +1,25 @@ +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/thirdparty/tiny/themes/simple/skins/default/ui.css b/thirdparty/tiny/themes/simple/skins/default/ui.css new file mode 100644 index 0000000..32feae6 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/default/ui.css @@ -0,0 +1,32 @@ +/* Reset */ +.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} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/.svn/all-wcprops b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/all-wcprops new file mode 100644 index 0000000..390d460 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/o2k7 +END +content.css +K 25 +svn:wc:ra_dav:version-url +V 76 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/o2k7/content.css +END +ui.css +K 25 +svn:wc:ra_dav:version-url +V 71 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/o2k7/ui.css +END diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/.svn/entries b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/entries new file mode 100644 index 0000000..60fc24f --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/entries @@ -0,0 +1,99 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple/skins/o2k7 +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +content.css +file + + + + +2009-06-08T19:44:28.000000Z +eb7a087c67578b6e3b5e0987caa4ba64 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +461 + +ui.css +file + + + + +2009-06-08T19:44:28.000000Z +f0ec0273462e01b81e1dfd292f64451e +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2340 + +img +dir + diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/.svn/format b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/.svn/text-base/content.css.svn-base b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/text-base/content.css.svn-base new file mode 100644 index 0000000..e10558f --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/text-base/content.css.svn-base @@ -0,0 +1,17 @@ +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/.svn/text-base/ui.css.svn-base b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/text-base/ui.css.svn-base new file mode 100644 index 0000000..021d650 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/.svn/text-base/ui.css.svn-base @@ -0,0 +1,35 @@ +/* Reset */ +.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} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/content.css b/thirdparty/tiny/themes/simple/skins/o2k7/content.css new file mode 100644 index 0000000..e10558f --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/content.css @@ -0,0 +1,17 @@ +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/all-wcprops b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/all-wcprops new file mode 100644 index 0000000..dee2f78 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/o2k7/img +END +button_bg.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/astat/!svn/ver/1/trunk/thirdparty/tiny/themes/simple/skins/o2k7/img/button_bg.png +END diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/entries b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/entries new file mode 100644 index 0000000..892afdd --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/entries @@ -0,0 +1,62 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/themes/simple/skins/o2k7/img +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +button_bg.png +file + + + + +2009-06-08T19:44:28.000000Z +405ca3d63b48667ef485553192507f59 +2009-06-07T19:12:55.973801Z +1 +genuineparts +has-props + + + + + + + + + + + + + + + + + + + + +5102 + diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/format b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/prop-base/button_bg.png.svn-base b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/prop-base/button_bg.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/prop-base/button_bg.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/text-base/button_bg.png.svn-base b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/text-base/button_bg.png.svn-base new file mode 100644 index 0000000..527e349 Binary files /dev/null and b/thirdparty/tiny/themes/simple/skins/o2k7/img/.svn/text-base/button_bg.png.svn-base differ diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/img/button_bg.png b/thirdparty/tiny/themes/simple/skins/o2k7/img/button_bg.png new file mode 100644 index 0000000..527e349 Binary files /dev/null and b/thirdparty/tiny/themes/simple/skins/o2k7/img/button_bg.png differ diff --git a/thirdparty/tiny/themes/simple/skins/o2k7/ui.css b/thirdparty/tiny/themes/simple/skins/o2k7/ui.css new file mode 100644 index 0000000..021d650 --- /dev/null +++ b/thirdparty/tiny/themes/simple/skins/o2k7/ui.css @@ -0,0 +1,35 @@ +/* Reset */ +.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} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/thirdparty/tiny/tiny_mce.js b/thirdparty/tiny/tiny_mce.js new file mode 100644 index 0000000..55aba6e --- /dev/null +++ b/thirdparty/tiny/tiny_mce.js @@ -0,0 +1 @@ +var tinymce={majorVersion:'3',minorVersion:'2.1.1',releaseDate:'2008-11-27',_init:function(){var t=this,d=document,w=window,na=navigator,ua=na.userAgent,i,nl,n,base,p,v;t.isOpera=w.opera&&opera.buildNumber;t.isWebKit=/WebKit/.test(ua);t.isOldWebKit=t.isWebKit&&!w.getSelection().getRangeAt;t.isIE=!t.isWebKit&&!t.isOpera&&(/MSIE/gi).test(ua)&&(/Explorer/gi).test(na.appName);t.isIE6=t.isIE&&/MSIE [56]/.test(ua);t.isGecko=!t.isWebKit&&/Gecko/.test(ua);t.isMac=ua.indexOf('Mac')!=-1;t.isAir=/adobeair/i.test(ua);if(w.tinyMCEPreInit){t.suffix=tinyMCEPreInit.suffix;t.baseURL=tinyMCEPreInit.base;t.query=tinyMCEPreInit.query;return;}t.suffix='';nl=d.getElementsByTagName('base');for(i=0;i=items.length){for(i=0,l=base.length;i=items.length||base[i]!=items[i]){bp=i+1;break;}}}if(base.length=base.length||base[i]!=items[i]){bp=i+1;break;}}}if(bp==1)return path;for(i=0,l=base.length-(bp-1);i=0;i--){if(path[i].length==0||path[i]==".")continue;if(path[i]=='..'){nb++;continue;}if(nb>0){nb--;continue;}o.push(path[i]);}i=base.length-nb;if(i<=0)return'/'+o.reverse().join('/');return'/'+base.slice(0,i).join('/')+'/'+o.reverse().join('/');},getURI:function(nh){var s,t=this;if(!t.source||nh){s='';if(!nh){if(t.protocol)s+=t.protocol+'://';if(t.userInfo)s+=t.userInfo+'@';if(t.host)s+=t.host;if(t.port)s+=':'+t.port;}if(t.path)s+=t.path;if(t.query)s+='?'+t.query;if(t.anchor)s+='#'+t.anchor;t.source=s;}return t.source;}});})();(function(){var each=tinymce.each;tinymce.create('static tinymce.util.Cookie',{getHash:function(n){var v=this.get(n),h;if(v){each(v.split('&'),function(v){v=v.split('=');h=h||{};h[unescape(v[0])]=unescape(v[1]);});}return h;},setHash:function(n,v,e,p,d,s){var o='';each(v,function(v,k){o+=(!o?'':'&')+escape(k)+'='+escape(v);});this.set(n,o,e,p,d,s);},get:function(n){var c=document.cookie,e,p=n+"=",b;if(!c)return;b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0)return null;}else b+=2;e=c.indexOf(";",b);if(e==-1)e=c.length;return unescape(c.substring(b+p.length,e));},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+((e)?"; expires="+e.toGMTString():"")+((p)?"; path="+escape(p):"")+((d)?"; domain="+d:"")+((s)?"; secure":"");},remove:function(n,p){var d=new Date();d.setTime(d.getTime()-1000);this.set(n,'',d,p,d);}});})();tinymce.create('static tinymce.util.JSON',{serialize:function(o){var i,v,s=tinymce.util.JSON.serialize,t;if(o==null)return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(a,b){i=v.indexOf(b);if(i+1)return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}if(t=='object'){if(o instanceof Array){for(i=0,v='[';i0?',':'')+s(o[i]);return v+']';}v='{';for(i in o)v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';return v+'}';}return''+o;},parse:function(s){try{return eval('('+s+')');}catch(ex){}}});tinymce.create('static tinymce.util.XHR',{send:function(o){var x,t,w=window,c=0;o.scope=o.scope||this;o.success_scope=o.success_scope||o.scope;o.error_scope=o.error_scope||o.scope;o.async=o.async===false?false:true;o.data=o.data||'';function get(s){x=0;try{x=new ActiveXObject(s);}catch(ex){}return x;};x=w.XMLHttpRequest?new XMLHttpRequest():get('Microsoft.XMLHTTP')||get('Msxml2.XMLHTTP');if(x){if(x.overrideMimeType)x.overrideMimeType(o.content_type);x.open(o.type||(o.data?'POST':'GET'),o.url,o.async);if(o.content_type)x.setRequestHeader('Content-Type',o.content_type);x.send(o.data);function ready(){if(!o.async||x.readyState==4||c++>10000){if(o.success&&c<10000&&x.status==200)o.success.call(o.success_scope,''+x.responseText,x,o);else if(o.error)o.error.call(o.error_scope,c>10000?'TIMED_OUT':'GENERAL',x,o);x=null;}else w.setTimeout(ready,10);};if(!o.async)return ready();t=w.setTimeout(ready,10);}}});(function(){var extend=tinymce.extend,JSON=tinymce.util.JSON,XHR=tinymce.util.XHR;tinymce.create('tinymce.util.JSONRequest',{JSONRequest:function(s){this.settings=extend({},s);this.count=0;},send:function(o){var ecb=o.error,scb=o.success;o=extend(this.settings,o);o.success=function(c,x){c=JSON.parse(c);if(typeof(c)=='undefined'){c={error:'JSON Parse error.'};}if(c.error)ecb.call(o.error_scope||o.scope,c.error,x);else scb.call(o.success_scope||o.scope,c.result);};o.error=function(ty,x){ecb.call(o.error_scope||o.scope,ty,x);};o.data=JSON.serialize({id:o.id||'c'+(this.count++),method:o.method,params:o.params});o.content_type='application/json';XHR.send(o);},'static':{sendRPC:function(o){return new tinymce.util.JSONRequest().send(o);}}});}());(function(){var each=tinymce.each,is=tinymce.is;var isWebKit=tinymce.isWebKit,isIE=tinymce.isIE;tinymce.create('tinymce.dom.DOMUtils',{doc:null,root:null,files:null,listeners:{},pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,cache:{},idPattern:/^#[\w]+$/,elmPattern:/^[\w_*]+$/,elmClassPattern:/^([\w_]*)\.([\w_]+)$/,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(d,s){var t=this;t.doc=d;t.win=window;t.files={};t.cssFlicker=false;t.counter=0;t.boxModel=!tinymce.isIE||d.compatMode=="CSS1Compat";t.stdMode=d.documentMode===8;this.settings=s=tinymce.extend({keep_values:false,hex_colors:1,process_html:1},s);if(tinymce.isIE6){try{d.execCommand('BackgroundImageCache',false,true);}catch(e){t.cssFlicker=true;}}tinymce.addUnload(t.destroy,t);},getRoot:function(){var t=this,s=t.settings;return(s&&t.get(s.root_element))||t.doc.body;},getViewPort:function(w){var d,b;w=!w?this.win:w;d=w.document;b=this.boxModel?d.documentElement:d.body;return{x:w.pageXOffset||b.scrollLeft,y:w.pageYOffset||b.scrollTop,w:w.innerWidth||b.clientWidth,h:w.innerHeight||b.clientHeight};},getRect:function(e){var p,t=this,sr;e=t.get(e);p=t.getPos(e);sr=t.getSize(e);return{x:p.x,y:p.y,w:sr.w,h:sr.h};},getSize:function(e){var t=this,w,h;e=t.get(e);w=t.getStyle(e,'width');h=t.getStyle(e,'height');if(w.indexOf('px')===-1)w=0;if(h.indexOf('px')===-1)h=0;return{w:parseInt(w)||e.offsetWidth||e.clientWidth,h:parseInt(h)||e.offsetHeight||e.clientHeight};},getParent:function(n,f,r){var na,se=this.settings;n=this.get(n);if(se.strict_root)r=r||this.getRoot();if(is(f,'string')){na=f.toUpperCase();f=function(n){var s=false;if(n.nodeType==1&&na==='*'){s=true;return false;}each(na.split(','),function(v){if(n.nodeType==1&&((se.strict&&n.nodeName.toUpperCase()==v)||n.nodeName.toUpperCase()==v)){s=true;return false;}});return s;};}while(n){if(n==r)return null;if(f(n))return n;n=n.parentNode;}return null;},get:function(e){var n;if(e&&this.doc&&typeof(e)=='string'){n=e;e=this.doc.getElementById(e);if(e&&e.id!==n)return this.doc.getElementsByName(n)[1];}return e;},select:function(pa,s){var t=this,cs,c,pl,o=[],x,i,l,n,xp;s=t.get(s)||t.doc;if(s.querySelectorAll){if(s!=t.doc){i=s.id;s.id='_mc_tmp';pa='#_mc_tmp '+pa;}l=tinymce.grep(s.querySelectorAll(pa));s.id=i;return l;}if(!t.selectorRe)t.selectorRe=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@([\w\\]+)([\^\$\*!]?=)([\w\\]+)\])?(?:\:([\w\\]+))?/i;;if(tinymce.isAir){each(tinymce.explode(pa),function(v){if(!(xp=t.cache[v])){xp='';each(v.split(' '),function(v){v=t.selectorRe.exec(v);xp+=v[1]?'//'+v[1]:'//*';if(v[2])xp+="[@id='"+v[2]+"']";if(v[3]){each(v[3].split('.'),function(n){xp+="[@class = '"+n+"' or contains(concat(' ', @class, ' '), ' "+n+" ')]";});}});t.cache[v]=xp;}xp=t.doc.evaluate(xp,s,null,4,null);while(n=xp.iterateNext())o.push(n);});return o;}if(t.settings.strict){function get(s,n){return s.getElementsByTagName(n.toLowerCase());};}else{function get(s,n){return s.getElementsByTagName(n);};}if(t.elmPattern.test(pa)){x=get(s,pa);for(i=0,l=x.length;i=0;i--)cs+='}, '+(i?'n':'s')+');';cs+='})';t.cache[pa]=cs=eval(cs);}cs(isIE?collectIE:collect,s);});each(o,function(n){if(isIE)n.removeAttribute('mce_save');else delete n.mce_save;});return o;},add:function(p,n,a,h,c){var t=this;return this.run(p,function(p){var e,k;e=is(n,'string')?t.doc.createElement(n):n;t.setAttribs(e,a);if(h){if(h.nodeType)e.appendChild(h);else t.setHTML(e,h);}return!c?p.appendChild(e):e;});},create:function(n,a,h){return this.add(this.doc.createElement(n),n,a,h,1);},createHTML:function(n,a,h){var o='',t=this,k;o+='<'+n;for(k in a){if(a.hasOwnProperty(k))o+=' '+k+'="'+t.encode(a[k])+'"';}if(tinymce.is(h))return o+'>'+h+'';return o+' />';},remove:function(n,k){return this.run(n,function(n){var p,g;p=n.parentNode;if(!p)return null;if(k){each(n.childNodes,function(c){p.insertBefore(c.cloneNode(true),n);});}return p.removeChild(n);});},setStyle:function(n,na,v){var t=this;return t.run(n,function(e){var s,i;s=e.style;na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(t.pixelStyles.test(na)&&(tinymce.is(v,'number')||/^[\-0-9\.]+$/.test(v)))v+='px';switch(na){case'opacity':if(isIE){s.filter=v===''?'':"alpha(opacity="+(v*100)+")";if(!n.currentStyle||!n.currentStyle.hasLayout)s.display='inline-block';}s[na]=s['-moz-opacity']=s['-khtml-opacity']=v||'';break;case'float':isIE?s.styleFloat=v:s.cssFloat=v;break;default:s[na]=v||'';}if(t.settings.update_styles)t.setAttrib(e,'mce_style');});},getStyle:function(n,na,c){n=this.get(n);if(!n)return false;if(this.doc.defaultView&&c){na=na.replace(/[A-Z]/g,function(a){return'-'+a;});try{return this.doc.defaultView.getComputedStyle(n,null).getPropertyValue(na);}catch(ex){return null;}}na=na.replace(/-(\D)/g,function(a,b){return b.toUpperCase();});if(na=='float')na=isIE?'styleFloat':'cssFloat';if(n.currentStyle&&c)return n.currentStyle[na];return n.style[na];},setStyles:function(e,o){var t=this,s=t.settings,ol;ol=s.update_styles;s.update_styles=0;each(o,function(v,n){t.setStyle(e,n,v);});s.update_styles=ol;if(s.update_styles)t.setAttrib(e,s.cssText);},setAttrib:function(e,n,v){var t=this;if(!e||!n)return;if(t.settings.strict)n=n.toLowerCase();return this.run(e,function(e){var s=t.settings;switch(n){case"style":if(!is(v,'string')){each(v,function(v,n){t.setStyle(e,n,v);});return;}if(s.keep_values){if(v&&!t._isRes(v))e.setAttribute('mce_style',v,2);else e.removeAttribute('mce_style',2);}e.style.cssText=v;break;case"class":e.className=v||'';break;case"src":case"href":if(s.keep_values){if(s.url_converter)v=s.url_converter.call(s.url_converter_scope||t,v,n,e);t.setAttrib(e,'mce_'+n,v,2);}break;case"shape":e.setAttribute('mce_style',v);break;}if(is(v)&&v!==null&&v.length!==0)e.setAttribute(n,''+v,2);else e.removeAttribute(n,2);});},setAttribs:function(e,o){var t=this;return this.run(e,function(e){each(o,function(v,n){t.setAttrib(e,n,v);});});},getAttrib:function(e,n,dv){var v,t=this;e=t.get(e);if(!e||e.nodeType!==1)return false;if(!is(dv))dv='';if(/^(src|href|style|coords|shape)$/.test(n)){v=e.getAttribute("mce_"+n);if(v)return v;}if(isIE&&t.props[n]){v=e[t.props[n]];v=v&&v.nodeValue?v.nodeValue:v;}if(!v)v=e.getAttribute(n,2);if(n==='style'){v=v||e.style.cssText;if(v){v=t.serializeStyle(t.parseStyle(v));if(t.settings.keep_values&&!t._isRes(v))e.setAttribute('mce_style',v);}}if(isWebKit&&n==="class"&&v)v=v.replace(/(apple|webkit)\-[a-z\-]+/gi,'');if(isIE){switch(n){case'rowspan':case'colspan':if(v===1)v='';break;case'size':if(v==='+0'||v===20)v='';break;case'width':case'height':case'vspace':case'checked':case'disabled':case'readonly':if(v===0)v='';break;case'hspace':if(v===-1)v='';break;case'maxlength':case'tabindex':if(v===32768||v===2147483647||v==='32768')v='';break;case'compact':case'noshade':case'nowrap':if(v===65535)return n;return dv;case'shape':v=v.toLowerCase();break;default:if(n.indexOf('on')===0&&v)v=(''+v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/,'$1');}}return(v!==undefined&&v!==null&&v!=='')?''+v:dv;},getPos:function(n){var t=this,x=0,y=0,e,d=t.doc,r;n=t.get(n);if(n&&isIE){n=n.getBoundingClientRect();e=t.boxModel?d.documentElement:d.body;x=t.getStyle(t.select('html')[0],'borderWidth');x=(x=='medium'||t.boxModel&&!t.isIE6)&&2||x;n.top+=t.win.self!=t.win.top?2:0;return{x:n.left+e.scrollLeft-x,y:n.top+e.scrollTop-x};}r=n;while(r){x+=r.offsetLeft||0;y+=r.offsetTop||0;r=r.offsetParent;}r=n;while(r){if(!/^table-row|inline.*/i.test(t.getStyle(r,"display",1))){x-=r.scrollLeft||0;y-=r.scrollTop||0;}r=r.parentNode;if(r==d.body)break;}return{x:x,y:y};},parseStyle:function(st){var t=this,s=t.settings,o={};if(!st)return o;function compress(p,s,ot){var t,r,b,l;t=o[p+'-top'+s];if(!t)return;r=o[p+'-right'+s];if(t!=r)return;b=o[p+'-bottom'+s];if(r!=b)return;l=o[p+'-left'+s];if(b!=l)return;o[ot]=l;delete o[p+'-top'+s];delete o[p+'-right'+s];delete o[p+'-bottom'+s];delete o[p+'-left'+s];};function compress2(ta,a,b,c){var t;t=o[a];if(!t)return;t=o[b];if(!t)return;t=o[c];if(!t)return;o[ta]=o[a]+' '+o[b]+' '+o[c];delete o[a];delete o[b];delete o[c];};st=st.replace(/&(#?[a-z0-9]+);/g,'&$1_MCE_SEMI_');each(st.split(';'),function(v){var sv,ur=[];if(v){v=v.replace(/_MCE_SEMI_/g,';');v=v.replace(/url\([^\)]+\)/g,function(v){ur.push(v);return'url('+ur.length+')';});v=v.split(':');sv=tinymce.trim(v[1]);sv=sv.replace(/url\(([^\)]+)\)/g,function(a,b){return ur[parseInt(b)-1];});sv=sv.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});if(s.url_converter){sv=sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(x,c){return'url('+s.url_converter.call(s.url_converter_scope||t,t.decode(c),'style',null)+')';});}o[tinymce.trim(v[0]).toLowerCase()]=sv;}});compress("border","","border");compress("border","-width","border-width");compress("border","-color","border-color");compress("border","-style","border-style");compress("padding","","padding");compress("margin","","margin");compress2('border','border-width','border-style','border-color');if(isIE){if(o.border=='medium none')o.border='';}return o;},serializeStyle:function(o){var s='';each(o,function(v,k){if(k&&v){if(tinymce.isGecko&&k.indexOf('-moz-')===0)return;switch(k){case'color':case'background-color':v=v.toLowerCase();break;}s+=(s?' ':'')+k+': '+v+';';}});return s;},loadCSS:function(u){var t=this,d=t.doc;if(!u)u='';each(u.split(','),function(u){if(t.files[u])return;t.files[u]=true;t.add(t.select('head')[0],'link',{rel:'stylesheet',href:tinymce._addVer(u)});});},addClass:function(e,c){return this.run(e,function(e){var o;if(!c)return 0;if(this.hasClass(e,c))return e.className;o=this.removeClass(e,c);return e.className=(o!=''?(o+' '):'')+c;});},removeClass:function(e,c){var t=this,re;return t.run(e,function(e){var v;if(t.hasClass(e,c)){if(!re)re=new RegExp("(^|\\s+)"+c+"(\\s+|$)","g");v=e.className.replace(re,' ');return e.className=tinymce.trim(v!=' '?v:'');}return e.className;});},hasClass:function(n,c){n=this.get(n);if(!n||!c)return false;return(' '+n.className+' ').indexOf(' '+c+' ')!==-1;},show:function(e){return this.setStyle(e,'display','block');},hide:function(e){return this.setStyle(e,'display','none');},isHidden:function(e){e=this.get(e);return!e||e.style.display=='none'||this.getStyle(e,'display')=='none';},uniqueId:function(p){return(!p?'mce_':p)+(this.counter++);},setHTML:function(e,h){var t=this;return this.run(e,function(e){var x,i,nl,n,p,x;h=t.processHTML(h);if(isIE){function set(){try{e.innerHTML='
    '+h;e.removeChild(e.firstChild);}catch(ex){while(e.firstChild)e.firstChild.removeNode();x=t.create('div');x.innerHTML='
    '+h;each(x.childNodes,function(n,i){if(i)e.appendChild(n);});}};if(t.settings.fix_ie_paragraphs)h=h.replace(/

    <\/p>|]+)><\/p>|/gi,' 

    ');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("p");for(i=nl.length-1,x=0;i>=0;i--){n=nl[i];if(!n.hasChildNodes()){if(!n.mce_keep){x=1;break;}n.removeAttribute('mce_keep');}}}if(x){h=h.replace(/

    ]+)>|

    /g,'

    ');h=h.replace(/<\/p>/g,'
    ');set();if(t.settings.fix_ie_paragraphs){nl=e.getElementsByTagName("DIV");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.mce_tmp){p=t.doc.createElement('p');n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(a,b){var v;if(b!=='mce_tmp'){v=n.getAttribute(b);if(!v&&b==='class')v=n.className;p.setAttribute(b,v);}});for(x=0;x|]+)>/gi,'<$1b$2>');h=h.replace(/<(\/?)em>|]+)>/gi,'<$1i$2>');}else if(isIE){h=h.replace(/'/g,''');h=h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,'');}h=h.replace(/]+)\/>|/gi,'');if(s.keep_values){if(/)/g,'\n');s=s.replace(/^[\r\n]*|[\r\n]*$/g,'');s=s.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,'');return s;};h=h.replace(/]+|)>([\s\S]*?)<\/script>/g,function(v,a,b){b=trim(b);if(!a)a=' type="text/javascript"';if(b)b='';return''+b+'';});h=h.replace(/]+|)>([\s\S]*?)<\/style>/g,function(v,a,b){b=trim(b);return''+b+'';});}h=h.replace(//g,'');h=h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(a,n){function handle(m,b,c){var u=c;if(a.indexOf('mce_'+b)!=-1)return m;if(b=='style'){if(t._isRes(c))return m;if(s.hex_colors){u=u.replace(/rgb\([^\)]+\)/g,function(v){return t.toHex(v);});}if(s.url_converter){u=u.replace(/url\([\'\"]?([^\)\'\"]+)\)/g,function(x,c){return'url('+t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n))+')';});}}else if(b!='coords'&&b!='shape'){if(s.url_converter)u=t.encode(s.url_converter.call(s.url_converter_scope||t,t.decode(c),b,n));}return' '+b+'="'+c+'" mce_'+b+'="'+u+'"';};a=a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,handle);a=a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,handle);return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,handle);});}return h;},getOuterHTML:function(e){var d;e=this.get(e);if(!e)return null;if(isIE)return e.outerHTML;d=(e.ownerDocument||this.doc).createElement("body");d.appendChild(e.cloneNode(true));return d.innerHTML;},setOuterHTML:function(e,h,d){var t=this;return this.run(e,function(e){var n,tp;e=t.get(e);d=d||e.ownerDocument||t.doc;if(isIE&&e.nodeType==1)e.outerHTML=h;else{tp=d.createElement("body");tp.innerHTML=h;n=tp.lastChild;while(n){t.insertAfter(n.cloneNode(true),e);n=n.previousSibling;}t.remove(e);}});},decode:function(s){var e,n,v;if(/&[^;]+;/.test(s)){e=this.doc.createElement("div");e.innerHTML=s;n=e.firstChild;v='';if(n){do{v+=n.nodeValue;}while(n.nextSibling);}return v||s;}return s;},encode:function(s){return s?(''+s).replace(/[<>&\"]/g,function(c,b){switch(c){case'&':return'&';case'"':return'"';case'<':return'<';case'>':return'>';}return c;}):s;},insertAfter:function(n,r){var t=this;r=t.get(r);return this.run(n,function(n){var p,ns;p=r.parentNode;ns=r.nextSibling;if(ns)p.insertBefore(n,ns);else p.appendChild(n);return n;});},isBlock:function(n){if(n.nodeType&&n.nodeType!==1)return false;n=n.nodeName||n;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n);},replace:function(n,o,k){if(is(o,'array'))n=n.cloneNode(true);return this.run(o,function(o){if(k){each(o.childNodes,function(c){n.appendChild(c.cloneNode(true));});}return o.parentNode.replaceChild(n,o);});},toHex:function(s){var c=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s);function hex(s){s=parseInt(s).toString(16);return s.length>1?s:'0'+s;};if(c){s='#'+hex(c[1])+hex(c[2])+hex(c[3]);return s;}return s;},getClasses:function(){var t=this,cl=[],i,lo={},f=t.settings.class_filter,ov;if(t.classes)return t.classes;function addClasses(s){each(s.imports,function(r){addClasses(r);});each(s.cssRules||s.rules,function(r){switch(r.type||1){case 1:if(r.selectorText){each(r.selectorText.split(','),function(v){v=v.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(v)||!/\.[\w\-]+$/.test(v))return;ov=v;v=v.replace(/.*\.([a-z0-9_\-]+).*/i,'$1');if(f&&!(v=f(v,ov)))return;if(!lo[v]){cl.push({'class':v});lo[v]=1;}});}break;case 3:addClasses(r.styleSheet);break;}});};try{each(t.doc.styleSheets,addClasses);}catch(ex){}if(cl.length>0)t.classes=cl;return cl;},run:function(e,f,s){var t=this,o;if(t.doc&&typeof(e)==='string')e=t.get(e);if(!e)return false;s=s||this;if(!e.nodeType&&(e.length||e.length===0)){o=[];each(e,function(e,i){if(e){if(typeof(e)=='string')e=t.doc.getElementById(e);o.push(f.call(s,e,i));}});return o;}return f.call(s,e);},getAttribs:function(n){var o;n=this.get(n);if(!n)return[];if(isIE){o=[];if(n.nodeName=='OBJECT')return n.attributes;n.cloneNode(false).outerHTML.replace(/([a-z0-9\:\-_]+)=/gi,function(a,b){o.push({specified:1,nodeName:b});});return o;}return n.attributes;},destroy:function(s){var t=this;t.win=t.doc=t.root=null;if(!s)tinymce.removeUnload(t.destroy);},_isRes:function(c){return/^(top|left|bottom|right|width|height)/i.test(c)||/;\s*(top|left|bottom|right|width|height)/i.test(c);}});tinymce.DOM=new tinymce.dom.DOMUtils(document,{process_html:0});})();(function(){var each=tinymce.each,DOM=tinymce.DOM,isIE=tinymce.isIE,isWebKit=tinymce.isWebKit,Event;tinymce.create('static tinymce.dom.Event',{inits:[],events:[],add:function(o,n,f,s){var cb,t=this,el=t.events,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.add(o,n,f,s));});return r;}o=DOM.get(o);if(!o)return;cb=function(e){e=e||window.event;if(e&&!e.target&&isIE)e.target=e.srcElement;if(!s)return f(e);return f.call(s,e);};if(n=='unload'){tinymce.unloads.unshift({func:cb});return cb;}if(n=='init'){if(t.domLoaded)cb();else t.inits.push(cb);return cb;}el.push({obj:o,name:n,func:f,cfunc:cb,scope:s});t._add(o,n,cb);return f;},remove:function(o,n,f){var t=this,a=t.events,s=false,r;if(o&&o instanceof Array){r=[];each(o,function(o){o=DOM.get(o);r.push(t.remove(o,n,f));});return r;}o=DOM.get(o);each(a,function(e,i){if(e.obj==o&&e.name==n&&(!f||(e.func==f||e.cfunc==f))){a.splice(i,1);t._remove(o,n,e.cfunc);s=true;return false;}});return s;},clear:function(o){var t=this,a=t.events,i,e;if(o){o=DOM.get(o);for(i=a.length-1;i>=0;i--){e=a[i];if(e.obj===o){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;a.splice(i,1);}}}},cancel:function(e){if(!e)return false;this.stop(e);return this.prevent(e);},stop:function(e){if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true;return false;},prevent:function(e){if(e.preventDefault)e.preventDefault();else e.returnValue=false;return false;},_unload:function(){var t=Event;each(t.events,function(e,i){t._remove(e.obj,e.name,e.cfunc);e.obj=e.cfunc=null;});t.events=[];t=null;},_add:function(o,n,f){if(o.attachEvent)o.attachEvent('on'+n,f);else if(o.addEventListener)o.addEventListener(n,f,false);else o['on'+n]=f;},_remove:function(o,n,f){if(o){try{if(o.detachEvent)o.detachEvent('on'+n,f);else if(o.removeEventListener)o.removeEventListener(n,f,false);else o['on'+n]=null;}catch(ex){}}},_pageInit:function(){var e=Event;if(e.domLoaded)return;e._remove(window,'DOMContentLoaded',e._pageInit);e.domLoaded=true;each(e.inits,function(c){c();});e.inits=[];},_wait:function(){var t;if(window.tinyMCE_GZ&&tinyMCE_GZ.loaded){Event.domLoaded=1;return;}if(isIE&&document.location.protocol!='https:'){document.write('';bi=s.body_id||'tinymce';if(bi.indexOf('=')!=-1){bi=t.getParam('body_id','','hash');bi=bi[t.id]||bi;}bc=s.body_class||'';if(bc.indexOf('=')!=-1){bc=t.getParam('body_class','','hash');bc=bc[t.id]||'';}t.iframeHTML+='';if(tinymce.relaxedDomain){if(isIE||(tinymce.isOpera&&parseFloat(opera.version())>=9.5))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();})()';else if(tinymce.isOpera)u='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()';}n=DOM.add(o.iframeContainer,'iframe',{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:'0',style:{width:'100%',height:h}});t.contentAreaContainer=o.iframeContainer;DOM.get(o.editorContainer).style.display=t.orgDisplay;DOM.get(t.id).style.display='none';if(tinymce.isOldWebKit){Event.add(n,'load',t.setupIframe,t);n.src=tinymce.baseURL+'/plugins/safari/blank.htm';}else{if(!isIE||!tinymce.relaxedDomain)t.setupIframe();e=n=o=null;}},setupIframe:function(){var t=this,s=t.settings,e=DOM.get(t.id),d=t.getDoc(),h,b;if(!isIE||!tinymce.relaxedDomain){d.open();d.write(t.iframeHTML);d.close();}if(!isIE){try{if(!s.readonly)d.designMode='On';}catch(ex){}}if(isIE){b=t.getBody();DOM.hide(b);if(!s.readonly)b.contentEditable=true;DOM.show(b);}t.dom=new tinymce.DOM.DOMUtils(t.getDoc(),{keep_values:true,url_converter:t.convertURL,url_converter_scope:t,hex_colors:s.force_hex_style_colors,class_filter:s.class_filter,update_styles:1,fix_ie_paragraphs:1});t.serializer=new tinymce.dom.Serializer({entity_encoding:s.entity_encoding,entities:s.entities,valid_elements:s.verify_html===false?'*[*]':s.valid_elements,extended_valid_elements:s.extended_valid_elements,valid_child_elements:s.valid_child_elements,invalid_elements:s.invalid_elements,fix_table_elements:s.fix_table_elements,fix_list_elements:s.fix_list_elements,fix_content_duplication:s.fix_content_duplication,convert_fonts_to_spans:s.convert_fonts_to_spans,font_size_classes:s.font_size_classes,font_size_style_values:s.font_size_style_values,apply_source_formatting:s.apply_source_formatting,remove_linebreaks:s.remove_linebreaks,element_format:s.element_format,dom:t.dom});t.selection=new tinymce.dom.Selection(t.dom,t.getWin(),t.serializer);t.forceBlocks=new tinymce.ForceBlocks(t,{forced_root_block:s.forced_root_block});t.editorCommands=new tinymce.EditorCommands(t);t.serializer.onPreProcess.add(function(se,o){return t.onPreProcess.dispatch(t,o,se);});t.serializer.onPostProcess.add(function(se,o){return t.onPostProcess.dispatch(t,o,se);});t.onPreInit.dispatch(t);if(!s.gecko_spellcheck)t.getBody().spellcheck=0;if(!s.readonly)t._addEvents();t.controlManager.onPostRender.dispatch(t,t.controlManager);t.onPostRender.dispatch(t);if(s.directionality)t.getBody().dir=s.directionality;if(s.nowrap)t.getBody().style.whiteSpace="nowrap";if(s.auto_resize)t.onNodeChange.add(t.resizeToContent,t);if(s.custom_elements){function handleCustom(ed,o){each(explode(s.custom_elements),function(v){var n;if(v.indexOf('~')===0){v=v.substring(1);n='span';}else n='div';o.content=o.content.replace(new RegExp('<('+v+')([^>]*)>','g'),'<'+n+' mce_name="$1"$2>');o.content=o.content.replace(new RegExp('','g'),'');});};t.onBeforeSetContent.add(handleCustom);t.onPostProcess.add(function(ed,o){if(o.set)handleCustom(ed,o)});}if(s.handle_node_change_callback){t.onNodeChange.add(function(ed,cm,n){t.execCallback('handle_node_change_callback',t.id,n,-1,-1,true,t.selection.isCollapsed());});}if(s.save_callback){t.onSaveContent.add(function(ed,o){var h=t.execCallback('save_callback',t.id,o.content,t.getBody());if(h)o.content=h;});}if(s.onchange_callback){t.onChange.add(function(ed,l){t.execCallback('onchange_callback',t,l);});}if(s.convert_newlines_to_brs){t.onBeforeSetContent.add(function(ed,o){if(o.initial)o.content=o.content.replace(/\r?\n/g,'
    ');});}if(s.fix_nesting&&isIE){t.onBeforeSetContent.add(function(ed,o){o.content=t._fixNesting(o.content);});}if(s.preformatted){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^\s*/,'');o.content=o.content.replace(/<\/pre>\s*$/,'');if(o.set)o.content='
    '+o.content+'
    ';});}if(s.verify_css_classes){t.serializer.attribValueFilter=function(n,v){var s,cl;if(n=='class'){if(!t.classesRE){cl=t.dom.getClasses();if(cl.length>0){s='';each(cl,function(o){s+=(s?'|':'')+o['class'];});t.classesRE=new RegExp('('+s+')','gi');}}return!t.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v)||t.classesRE.test(v)?v:'';}return v;};}if(s.convert_fonts_to_spans)t._convertFonts();if(s.inline_styles)t._convertInlineElements();if(s.cleanup_callback){t.onBeforeSetContent.add(function(ed,o){o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);});t.onPreProcess.add(function(ed,o){if(o.set)t.execCallback('cleanup_callback','insert_to_editor_dom',o.node,o);if(o.get)t.execCallback('cleanup_callback','get_from_editor_dom',o.node,o);});t.onPostProcess.add(function(ed,o){if(o.set)o.content=t.execCallback('cleanup_callback','insert_to_editor',o.content,o);if(o.get)o.content=t.execCallback('cleanup_callback','get_from_editor',o.content,o);});}if(s.save_callback){t.onGetContent.add(function(ed,o){if(o.save)o.content=t.execCallback('save_callback',t.id,o.content,t.getBody());});}if(s.handle_event_callback){t.onEvent.add(function(ed,e,o){if(t.execCallback('handle_event_callback',e,ed,o)===false)Event.cancel(e);});}t.onSetContent.add(function(){t.addVisual(t.getBody());});if(s.padd_empty_editor){t.onPostProcess.add(function(ed,o){o.content=o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,'');});}if(isGecko&&!s.readonly){try{d.designMode='Off';d.designMode='On';}catch(ex){}}setTimeout(function(){if(t.removed)return;t.load({initial:true,format:(s.cleanup_on_startup?'html':'raw')});t.startContent=t.getContent({format:'raw'});t.undoManager.add({initial:true});t.initialized=true;t.onInit.dispatch(t);t.execCallback('setupcontent_callback',t.id,t.getBody(),t.getDoc());t.execCallback('init_instance_callback',t);t.focus(true);t.nodeChanged({initial:1});if(s.content_css){tinymce.each(explode(s.content_css),function(u){t.dom.loadCSS(t.documentBaseURI.toAbsolute(u));});}if(s.auto_focus){setTimeout(function(){var ed=EditorManager.get(s.auto_focus);ed.selection.select(ed.getBody(),1);ed.selection.collapse(1);ed.getWin().focus();},100);}},1);e=null;},focus:function(sf){var oed,t=this,ce=t.settings.content_editable;if(!sf){if(!ce&&(!isIE||t.selection.getNode().ownerDocument!=t.getDoc()))t.getWin().focus();}if(EditorManager.activeEditor!=t){if((oed=EditorManager.activeEditor)!=null)oed.onDeactivate.dispatch(oed,t);t.onActivate.dispatch(t,oed);}EditorManager._setActive(t);},execCallback:function(n){var t=this,f=t.settings[n],s;if(!f)return;if(t.callbackLookup&&(s=t.callbackLookup[n])){f=s.func;s=s.scope;}if(is(f,'string')){s=f.replace(/\.\w+$/,'');s=s?tinymce.resolve(s):0;f=tinymce.resolve(f);t.callbackLookup=t.callbackLookup||{};t.callbackLookup[n]={func:f,scope:s};}return f.apply(s||t,Array.prototype.slice.call(arguments,1));},translate:function(s){var c=this.settings.language||'en',i18n=EditorManager.i18n;if(!s)return'';return i18n[c+'.'+s]||s.replace(/{\#([^}]+)\}/g,function(a,b){return i18n[c+'.'+b]||'{#'+b+'}';});},getLang:function(n,dv){return EditorManager.i18n[(this.settings.language||'en')+'.'+n]||(is(dv)?dv:'{#'+n+'}');},getParam:function(n,dv,ty){var tr=tinymce.trim,v=is(this.settings[n])?this.settings[n]:dv,o;if(ty==='hash'){o={};if(is(v,'string')){each(v.indexOf('=')>0?v.split(/[;,](?![^=;,]*(?:[;,]|$))/):v.split(','),function(v){v=v.split('=');if(v.length>1)o[tr(v[0])]=tr(v[1]);else o[tr(v[0])]=tr(v);});}else o=v;return o;}return v;},nodeChanged:function(o){var t=this,s=t.selection,n=s.getNode()||t.getBody();if(t.initialized){t.onNodeChange.dispatch(t,o?o.controlManager||t.controlManager:t.controlManager,isIE&&n.ownerDocument!=t.getDoc()?t.getBody():n,s.isCollapsed(),o);}},addButton:function(n,s){var t=this;t.buttons=t.buttons||{};t.buttons[n]=s;},addCommand:function(n,f,s){this.execCommands[n]={func:f,scope:s||this};},addQueryStateHandler:function(n,f,s){this.queryStateCommands[n]={func:f,scope:s||this};},addQueryValueHandler:function(n,f,s){this.queryValueCommands[n]={func:f,scope:s||this};},addShortcut:function(pa,desc,cmd_func,sc){var t=this,c;if(!t.settings.custom_shortcuts)return false;t.shortcuts=t.shortcuts||{};if(is(cmd_func,'string')){c=cmd_func;cmd_func=function(){t.execCommand(c,false,null);};}if(is(cmd_func,'object')){c=cmd_func;cmd_func=function(){t.execCommand(c[0],c[1],c[2]);};}each(explode(pa),function(pa){var o={func:cmd_func,scope:sc||this,desc:desc,alt:false,ctrl:false,shift:false};each(explode(pa,'+'),function(v){switch(v){case'alt':case'ctrl':case'shift':o[v]=true;break;default:o.charCode=v.charCodeAt(0);o.keyCode=v.toUpperCase().charCodeAt(0);}});t.shortcuts[(o.ctrl?'ctrl':'')+','+(o.alt?'alt':'')+','+(o.shift?'shift':'')+','+o.keyCode]=o;});return true;},execCommand:function(cmd,ui,val,a){var t=this,s=0,o,st;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd)&&(!a||!a.skip_focus))t.focus();o={};t.onBeforeExecCommand.dispatch(t,cmd,ui,val,o);if(o.terminate)return false;if(t.execCallback('execcommand_callback',t.id,t.selection.getNode(),cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(o=t.execCommands[cmd]){st=o.func.call(o.scope,ui,val);if(st!==true){t.onExecCommand.dispatch(t,cmd,ui,val,a);return st;}}each(t.plugins,function(p){if(p.execCommand&&p.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);s=1;return false;}});if(s)return true;if(t.theme.execCommand&&t.theme.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}if(t.editorCommands.execCommand(cmd,ui,val)){t.onExecCommand.dispatch(t,cmd,ui,val,a);return true;}t.getDoc().execCommand(cmd,ui,val);t.onExecCommand.dispatch(t,cmd,ui,val,a);},queryCommandState:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryStateCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandState(c);if(o!==-1)return o;try{return this.getDoc().queryCommandState(c);}catch(ex){}},queryCommandValue:function(c){var t=this,o,s;if(t._isHidden())return;if(o=t.queryValueCommands[c]){s=o.func.call(o.scope);if(s!==true)return s;}o=t.editorCommands.queryCommandValue(c);if(is(o))return o;try{return this.getDoc().queryCommandValue(c);}catch(ex){}},show:function(){var t=this;DOM.show(t.getContainer());DOM.hide(t.id);t.load();},hide:function(){var t=this,d=t.getDoc();if(isIE&&d)d.execCommand('SelectAll');t.save();DOM.hide(t.getContainer());DOM.setStyle(t.id,'display',t.orgDisplay);},isHidden:function(){return!DOM.isHidden(this.id);},setProgressState:function(b,ti,o){this.onSetProgressState.dispatch(this,b,ti,o);return b;},resizeToContent:function(){var t=this;DOM.setStyle(t.id+"_ifr",'height',t.getBody().scrollHeight);},load:function(o){var t=this,e=t.getElement(),h;if(e){o=o||{};o.load=true;h=t.setContent(is(e.value)?e.value:e.innerHTML,o);o.element=e;if(!o.no_events)t.onLoadContent.dispatch(t,o);o.element=e=null;return h;}},save:function(o){var t=this,e=t.getElement(),h,f;if(!e||!t.initialized)return;o=o||{};o.save=true;if(!o.no_events){t.undoManager.typing=0;t.undoManager.add();}o.element=e;h=o.content=t.getContent(o);if(!o.no_events)t.onSaveContent.dispatch(t,o);h=o.content;if(!/TEXTAREA|INPUT/i.test(e.nodeName)){e.innerHTML=h;if(f=DOM.getParent(t.id,'form')){each(f.elements,function(e){if(e.name==t.id){e.value=h;return false;}});}}else e.value=h;o.element=e=null;return h;},setContent:function(h,o){var t=this;o=o||{};o.format=o.format||'html';o.set=true;o.content=h;if(!o.no_events)t.onBeforeSetContent.dispatch(t,o);if(!tinymce.isIE&&(h.length===0||/^\s+$/.test(h))){o.content=t.dom.setHTML(t.getBody(),'
    ');o.format='raw';}o.content=t.dom.setHTML(t.getBody(),tinymce.trim(o.content));if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;o.content=t.dom.setHTML(t.getBody(),t.serializer.serialize(t.getBody(),o));}if(!o.no_events)t.onSetContent.dispatch(t,o);return o.content;},getContent:function(o){var t=this,h;o=o||{};o.format=o.format||'html';o.get=true;if(!o.no_events)t.onBeforeGetContent.dispatch(t,o);if(o.format!='raw'&&t.settings.cleanup){o.getInner=true;h=t.serializer.serialize(t.getBody(),o);}else h=t.getBody().innerHTML;h=h.replace(/^\s*|\s*$/g,'');o.content=h;if(!o.no_events)t.onGetContent.dispatch(t,o);return o.content;},isDirty:function(){var t=this;return tinymce.trim(t.startContent)!=tinymce.trim(t.getContent({format:'raw',no_events:1}))&&!t.isNotDirty;},getContainer:function(){var t=this;if(!t.container)t.container=DOM.get(t.editorContainer||t.id+'_parent');return t.container;},getContentAreaContainer:function(){return this.contentAreaContainer;},getElement:function(){return DOM.get(this.settings.content_element||this.id);},getWin:function(){var t=this,e;if(!t.contentWindow){e=DOM.get(t.id+"_ifr");if(e)t.contentWindow=e.contentWindow;}return t.contentWindow;},getDoc:function(){var t=this,w;if(!t.contentDocument){w=t.getWin();if(w)t.contentDocument=w.document;}return t.contentDocument;},getBody:function(){return this.bodyElement||this.getDoc().body;},convertURL:function(u,n,e){var t=this,s=t.settings;if(s.urlconverter_callback)return t.execCallback('urlconverter_callback',u,e,true,n);if(!s.convert_urls||(e&&e.nodeName=='LINK')||u.indexOf('file:')===0)return u;if(s.relative_urls)return t.documentBaseURI.toRelative(u);u=t.documentBaseURI.toAbsolute(u,s.remove_script_host);return u;},addVisual:function(e){var t=this,s=t.settings;e=e||t.getBody();if(!is(t.hasVisual))t.hasVisual=s.visual;each(t.dom.select('table,a',e),function(e){var v;switch(e.nodeName){case'TABLE':v=t.dom.getAttrib(e,'border');if(!v||v=='0'){if(t.hasVisual)t.dom.addClass(e,s.visual_table_class);else t.dom.removeClass(e,s.visual_table_class);}return;case'A':v=t.dom.getAttrib(e,'name');if(v){if(t.hasVisual)t.dom.addClass(e,'mceItemAnchor');else t.dom.removeClass(e,'mceItemAnchor');}return;}});t.onVisualAid.dispatch(t,e,t.hasVisual);},remove:function(){var t=this,e=t.getContainer();t.removed=1;t.hide();t.execCallback('remove_instance_callback',t);t.onRemove.dispatch(t);t.onExecCommand.listeners=[];EditorManager.remove(t);DOM.remove(e);},destroy:function(s){var t=this;if(t.destroyed)return;if(!s){tinymce.removeUnload(t.destroy);tinyMCE.onBeforeUnload.remove(t._beforeUnload);if(t.theme.destroy)t.theme.destroy();t.controlManager.destroy();t.selection.destroy();t.dom.destroy();if(!t.settings.content_editable){Event.clear(t.getWin());Event.clear(t.getDoc());}Event.clear(t.getBody());Event.clear(t.formElement);}if(t.formElement){t.formElement.submit=t.formElement._mceOldSubmit;t.formElement._mceOldSubmit=null;}t.contentAreaContainer=t.formElement=t.container=t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null;if(t.selection)t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null;t.destroyed=1;},_addEvents:function(){var t=this,i,s=t.settings,lo={mouseup:'onMouseUp',mousedown:'onMouseDown',click:'onClick',keyup:'onKeyUp',keydown:'onKeyDown',keypress:'onKeyPress',submit:'onSubmit',reset:'onReset',contextmenu:'onContextMenu',dblclick:'onDblClick',paste:'onPaste'};function eventHandler(e,o){var ty=e.type;if(t.removed)return;if(t.onEvent.dispatch(t,e,o)!==false){t[lo[e.fakeType||e.type]].dispatch(t,e,o);}};each(lo,function(v,k){switch(k){case'contextmenu':if(tinymce.isOpera){Event.add(t.getBody(),'mousedown',function(e){if(e.ctrlKey){e.fakeType='contextmenu';eventHandler(e);}});}else Event.add(t.getBody(),k,eventHandler);break;case'paste':Event.add(t.getBody(),k,function(e){var tx,h,el,r;if(e.clipboardData)tx=e.clipboardData.getData('text/plain');else if(tinymce.isIE)tx=t.getWin().clipboardData.getData('Text');eventHandler(e,{text:tx,html:h});});break;case'submit':case'reset':Event.add(t.getElement().form||DOM.getParent(t.id,'form'),k,eventHandler);break;default:Event.add(s.content_editable?t.getBody():t.getDoc(),k,eventHandler);}});Event.add(s.content_editable?t.getBody():(isGecko?t.getDoc():t.getWin()),'focus',function(e){t.focus(true);});if(tinymce.isGecko){Event.add(t.getDoc(),'DOMNodeInserted',function(e){var v;e=e.target;if(e.nodeType===1&&e.nodeName==='IMG'&&(v=e.getAttribute('mce_src')))e.src=t.documentBaseURI.toAbsolute(v);});}if(isGecko){function setOpts(){var t=this,d=t.getDoc(),s=t.settings;if(isGecko&&!s.readonly){if(t._isHidden()){try{if(!s.content_editable)d.designMode='On';}catch(ex){}}try{d.execCommand("styleWithCSS",0,false);}catch(ex){if(!t._isHidden())try{d.execCommand("useCSS",0,true);}catch(ex){}}if(!s.table_inline_editing)try{d.execCommand('enableInlineTableEditing',false,false);}catch(ex){}if(!s.object_resizing)try{d.execCommand('enableObjectResizing',false,false);}catch(ex){}}};t.onBeforeExecCommand.add(setOpts);t.onMouseDown.add(setOpts);}t.onMouseUp.add(t.nodeChanged);t.onClick.add(t.nodeChanged);t.onKeyUp.add(function(ed,e){var c=e.keyCode;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)t.nodeChanged();});t.onReset.add(function(){t.setContent(t.startContent,{format:'raw'});});if(t.getParam('tab_focus')){function tabCancel(ed,e){if(e.keyCode===9)return Event.cancel(e);};function tabHandler(ed,e){var x,i,f,el,v;function find(d){f=DOM.getParent(ed.id,'form');el=f.elements;if(f){each(el,function(e,i){if(e.id==ed.id){x=i;return false;}});if(d>0){for(i=x+1;i=0;i--){if(el[i].type!='hidden')return el[i];}}}return null;};if(e.keyCode===9){v=explode(ed.getParam('tab_focus'));if(v.length==1){v[1]=v[0];v[0]=':prev';}if(e.shiftKey){if(v[0]==':prev')el=find(-1);else el=DOM.get(v[0]);}else{if(v[1]==':next')el=find(1);else el=DOM.get(v[1]);}if(el){if(ed=EditorManager.get(el.id||el.name))ed.focus();else window.setTimeout(function(){window.focus();el.focus();},10);return Event.cancel(e);}}};t.onKeyUp.add(tabCancel);if(isGecko){t.onKeyPress.add(tabHandler);t.onKeyDown.add(tabCancel);}else t.onKeyDown.add(tabHandler);}if(s.custom_shortcuts){if(s.custom_undo_redo_keyboard_shortcuts){t.addShortcut('ctrl+z',t.getLang('undo_desc'),'Undo');t.addShortcut('ctrl+y',t.getLang('redo_desc'),'Redo');}if(isGecko){t.addShortcut('ctrl+b',t.getLang('bold_desc'),'Bold');t.addShortcut('ctrl+i',t.getLang('italic_desc'),'Italic');t.addShortcut('ctrl+u',t.getLang('underline_desc'),'Underline');}for(i=1;i<=6;i++)t.addShortcut('ctrl+'+i,'',['FormatBlock',false,'']);t.addShortcut('ctrl+7','',['FormatBlock',false,'

    ']);t.addShortcut('ctrl+8','',['FormatBlock',false,'

    ']);t.addShortcut('ctrl+9','',['FormatBlock',false,'
    ']);function find(e){var v=null;if(!e.altKey&&!e.ctrlKey&&!e.metaKey)return v;each(t.shortcuts,function(o){if(tinymce.isMac&&o.ctrl!=e.metaKey)return;else if(!tinymce.isMac&&o.ctrl!=e.ctrlKey)return;if(o.alt!=e.altKey)return;if(o.shift!=e.shiftKey)return;if(e.keyCode==o.keyCode||(e.charCode&&e.charCode==o.charCode)){v=o;return false;}});return v;};t.onKeyUp.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyPress.add(function(ed,e){var o=find(e);if(o)return Event.cancel(e);});t.onKeyDown.add(function(ed,e){var o=find(e);if(o){o.func.call(o.scope);return Event.cancel(e);}});}if(tinymce.isIE){Event.add(t.getDoc(),'controlselect',function(e){var re=t.resizeInfo,cb;e=e.target;if(e.nodeName!=='IMG')return;if(re)Event.remove(re.node,re.ev,re.cb);if(!t.dom.hasClass(e,'mceItemNoResize')){ev='resizeend';cb=Event.add(e,ev,function(e){var v;e=e.target;if(v=t.dom.getStyle(e,'width')){t.dom.setAttrib(e,'width',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'width','');}if(v=t.dom.getStyle(e,'height')){t.dom.setAttrib(e,'height',v.replace(/[^0-9%]+/g,''));t.dom.setStyle(e,'height','');}});}else{ev='resizestart';cb=Event.add(e,'resizestart',Event.cancel,Event);}re=t.resizeInfo={node:e,ev:ev,cb:cb};});t.onKeyDown.add(function(ed,e){switch(e.keyCode){case 8:if(t.selection.getRng().item){t.selection.getRng().item(0).removeNode();return Event.cancel(e);}}});}if(tinymce.isOpera){t.onClick.add(function(ed,e){Event.prevent(e);});}if(s.custom_undo_redo){function addUndo(){t.undoManager.typing=0;t.undoManager.add();};if(tinymce.isIE){Event.add(t.getWin(),'blur',function(e){var n;if(t.selection){n=t.selection.getNode();if(!t.removed&&n.ownerDocument&&n.ownerDocument!=t.getDoc())addUndo();}});}else{Event.add(t.getDoc(),'blur',function(){if(t.selection&&!t.removed)addUndo();});}t.onMouseDown.add(addUndo);t.onKeyUp.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45||e.ctrlKey){t.undoManager.typing=0;t.undoManager.add();}});t.onKeyDown.add(function(ed,e){if((e.keyCode>=33&&e.keyCode<=36)||(e.keyCode>=37&&e.keyCode<=40)||e.keyCode==13||e.keyCode==45){if(t.undoManager.typing){t.undoManager.add();t.undoManager.typing=0;}return;}if(!t.undoManager.typing){t.undoManager.add();t.undoManager.typing=1;}});}},_convertInlineElements:function(){var t=this,s=t.settings,dom=t.dom,v,e,na,st,sp;function convert(ed,o){if(!s.inline_styles)return;if(o.get){each(t.dom.select('table,u,strike',o.node),function(n){switch(n.nodeName){case'TABLE':if(v=dom.getAttrib(n,'height')){dom.setStyle(n,'height',v);dom.setAttrib(n,'height','');}break;case'U':case'STRIKE':n.style.textDecoration=n.nodeName=='U'?'underline':'line-through';dom.setAttrib(n,'mce_style','');dom.setAttrib(n,'mce_name','span');break;}});}else if(o.set){each(t.dom.select('table,span',o.node).reverse(),function(n){if(n.nodeName=='TABLE'){if(v=dom.getStyle(n,'height'))dom.setAttrib(n,'height',v.replace(/[^0-9%]+/g,''));}else{if(n.style.textDecoration=='underline')na='u';else if(n.style.textDecoration=='line-through')na='strike';else na='';if(na){n.style.textDecoration='';dom.setAttrib(n,'mce_style','');e=dom.create(na,{style:dom.getAttrib(n,'style')});dom.replace(e,n,1);}}});}};t.onPreProcess.add(convert);if(!s.cleanup_on_startup){t.onSetContent.add(function(ed,o){if(o.initial)convert(t,{node:t.getBody(),set:1});});}},_convertFonts:function(){var t=this,s=t.settings,dom=t.dom,fz,fzn,sl,cl;if(!s.inline_styles)return;fz=[8,10,12,14,18,24,36];fzn=['xx-small','x-small','small','medium','large','x-large','xx-large'];if(sl=s.font_size_style_values)sl=explode(sl);if(cl=s.font_size_classes)cl=explode(cl);function process(no){var n,sp,nl,x;if(!s.inline_styles)return;nl=t.dom.select('font',no);for(x=nl.length-1;x>=0;x--){n=nl[x];sp=dom.create('span',{style:dom.getAttrib(n,'style'),'class':dom.getAttrib(n,'class')});dom.setStyles(sp,{fontFamily:dom.getAttrib(n,'face'),color:dom.getAttrib(n,'color'),backgroundColor:n.style.backgroundColor});if(n.size){if(sl)dom.setStyle(sp,'fontSize',sl[parseInt(n.size)-1]);else dom.setAttrib(sp,'class',cl[parseInt(n.size)-1]);}dom.setAttrib(sp,'mce_style','');dom.replace(sp,n,1);}};t.onPreProcess.add(function(ed,o){if(o.get)process(o.node);});t.onSetContent.add(function(ed,o){if(o.initial)process(o.node);});},_isHidden:function(){var s;if(!isGecko)return 0;s=this.selection.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},_fixNesting:function(s){var d=[],i;s=s.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(a,b,c){var e;if(b==='/'){if(!d.length)return'';if(c!==d[d.length-1].tag){for(i=d.length-1;i>=0;i--){if(d[i].tag===c){d[i].close=1;break;}}return'';}else{d.pop();if(d.length&&d[d.length-1].close){a=a+'';d.pop();}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(c))return a;if(/\/>$/.test(a))return a;d.push({tag:c});}return a;});for(i=d.length-1;i>=0;i--)s+='';return s;}});})();(function(){var each=tinymce.each,isIE=tinymce.isIE,isGecko=tinymce.isGecko,isOpera=tinymce.isOpera,isWebKit=tinymce.isWebKit;function isBlock(n){return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n.nodeName);};tinymce.create('tinymce.EditorCommands',{EditorCommands:function(ed){this.editor=ed;},execCommand:function(cmd,ui,val){var t=this,ed=t.editor,f;switch(cmd){case'Cut':case'Copy':case'Paste':try{ed.getDoc().execCommand(cmd,ui,val);}catch(ex){if(isGecko){ed.windowManager.confirm(ed.getLang('clipboard_msg'),function(s){if(s)window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');});}else ed.windowManager.alert(ed.getLang('clipboard_no_support'));}return true;case'mceResetDesignMode':case'mceBeginUndoLevel':return true;case'unlink':t.UnLink();return true;case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':t.mceJustify(cmd,cmd.substring(7).toLowerCase());return true;case'mceEndUndoLevel':case'mceAddUndoLevel':ed.undoManager.add();return true;default:f=this[cmd];if(f){f.call(this,ui,val);return true;}}return false;},Indent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){d.setStyle(e,'paddingLeft',(parseInt(e.style.paddingLeft||0)+iv)+iu);});return;}ed.getDoc().execCommand('Indent',false,null);if(isIE){d.getParent(s.getNode(),function(n){if(n.nodeName=='BLOCKQUOTE'){n.dir=n.style.cssText='';}});}},Outdent:function(){var ed=this.editor,d=ed.dom,s=ed.selection,e,v,iv,iu;iv=ed.settings.indentation;iu=/[a-z%]+$/i.exec(iv);iv=parseInt(iv);if(ed.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){each(this._getSelectedBlocks(),function(e){v=Math.max(0,parseInt(e.style.paddingLeft||0)-iv);d.setStyle(e,'paddingLeft',v?v+iu:'');});return;}ed.getDoc().execCommand('Outdent',false,null);},mceSetAttribute:function(u,v){var ed=this.editor,d=ed.dom,e;if(e=d.getParent(ed.selection.getNode(),d.isBlock))d.setAttrib(e,v.name,v.value);},mceSetContent:function(u,v){this.editor.setContent(v);},mceToggleVisualAid:function(){var ed=this.editor;ed.hasVisual=!ed.hasVisual;ed.addVisual();},mceReplaceContent:function(u,v){var s=this.editor.selection;s.setContent(v.replace(/\{\$selection\}/g,s.getContent({format:'text'})));},mceInsertLink:function(u,v){var ed=this.editor,s=ed.selection,e=ed.dom.getParent(s.getNode(),'A');if(tinymce.is(v,'string'))v={href:v};function set(e){each(v,function(v,k){ed.dom.setAttrib(e,k,v);});};if(!e){ed.execCommand('CreateLink',false,'javascript:mctmp(0);');each(ed.dom.select('a'),function(e){if(e.href=='javascript:mctmp(0);')set(e);});}else{if(v.href)set(e);else ed.dom.remove(e,1);}},UnLink:function(){var ed=this.editor,s=ed.selection;if(s.isCollapsed())s.select(s.getNode());ed.getDoc().execCommand('unlink',false,null);s.collapse(0);},FontName:function(u,v){var t=this,ed=t.editor,s=ed.selection,e;if(!v){if(s.isCollapsed())s.select(s.getNode());t.RemoveFormat();}else{if(ed.settings.convert_fonts_to_spans)t._applyInlineStyle('span',{style:{fontFamily:v}});else ed.getDoc().execCommand('FontName',false,v);}},FontSize:function(u,v){var ed=this.editor,s=ed.settings,fc,fs;if(s.convert_fonts_to_spans&&v>=1&&v<=7){fs=tinymce.explode(s.font_size_style_values);fc=tinymce.explode(s.font_size_classes);if(fc)v=fc[v-1]||v;else v=fs[v-1]||v;}if(v>=1&&v<=7)ed.getDoc().execCommand('FontSize',false,v);else this._applyInlineStyle('span',{style:{fontSize:v}});},queryCommandValue:function(c){var f=this['queryValue'+c];if(f)return f.call(this,c);return false;},queryCommandState:function(cmd){var f;switch(cmd){case'JustifyLeft':case'JustifyCenter':case'JustifyRight':case'JustifyFull':return this.queryStateJustify(cmd,cmd.substring(7).toLowerCase());default:if(f=this['queryState'+cmd])return f.call(this,cmd);}return-1;},_queryState:function(c){try{return this.editor.getDoc().queryCommandState(c);}catch(ex){}},_queryVal:function(c){try{return this.editor.getDoc().queryCommandValue(c);}catch(ex){}},queryValueFontSize:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'SPAN'))v=p.style.fontSize;if(!v&&(isOpera||isWebKit)){if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.size;return v;}return v||this._queryVal('FontSize');},queryValueFontName:function(){var ed=this.editor,v=0,p;if(p=ed.dom.getParent(ed.selection.getNode(),'FONT'))v=p.face;if(p=ed.dom.getParent(ed.selection.getNode(),'SPAN'))v=p.style.fontFamily.replace(/, /g,',').replace(/[\'\"]/g,'').toLowerCase();if(!v)v=this._queryVal('FontName');return v;},mceJustify:function(c,v){var ed=this.editor,se=ed.selection,n=se.getNode(),nn=n.nodeName,bl,nb,dom=ed.dom,rm;if(ed.settings.inline_styles&&this.queryStateJustify(c,v))rm=1;bl=dom.getParent(n,ed.dom.isBlock);if(nn=='IMG'){if(v=='full')return;if(rm){if(v=='center')dom.setStyle(bl||n.parentNode,'textAlign','');dom.setStyle(n,'float','');this.mceRepaint();return;}if(v=='center'){if(bl&&/^(TD|TH)$/.test(bl.nodeName))bl=0;if(!bl||bl.childNodes.length>1){nb=dom.create('p');nb.appendChild(n.cloneNode(false));if(bl)dom.insertAfter(nb,bl);else dom.insertAfter(nb,n);dom.remove(n);n=nb.firstChild;bl=nb;}dom.setStyle(bl,'textAlign',v);dom.setStyle(n,'float','');}else{dom.setStyle(n,'float',v);dom.setStyle(bl||n.parentNode,'textAlign','');}this.mceRepaint();return;}if(ed.settings.inline_styles&&ed.settings.forced_root_block){if(rm)v='';each(this._getSelectedBlocks(dom.getParent(se.getStart(),dom.isBlock),dom.getParent(se.getEnd(),dom.isBlock)),function(e){dom.setAttrib(e,'align','');dom.setStyle(e,'textAlign',v=='full'?'justify':v);});return;}else if(!rm)ed.getDoc().execCommand(c,false,null);if(ed.settings.inline_styles){if(rm){dom.getParent(ed.selection.getNode(),function(n){if(n.style&&n.style.textAlign)dom.setStyle(n,'textAlign','');});return;}each(dom.select('*'),function(n){var v=n.align;if(v){if(v=='full')v='justify';dom.setStyle(n,'textAlign',v);dom.setAttrib(n,'align','');}});}},mceSetCSSClass:function(u,v){this.mceSetStyleInfo(0,{command:'setattrib',name:'class',value:v});},getSelectedElement:function(){var t=this,ed=t.editor,dom=ed.dom,se=ed.selection,r=se.getRng(),r1,r2,sc,ec,so,eo,e,sp,ep,re;if(se.isCollapsed()||r.item)return se.getNode();re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if(isIE){r1=r.duplicate();r1.collapse(true);sc=r1.parentElement();r2=r.duplicate();r2.collapse(false);ec=r2.parentElement();if(sc!=ec){r1.move('character',1);sc=r1.parentElement();}if(sc==ec){r1=r.duplicate();r1.moveToElementText(sc);if(r1.compareEndPoints('StartToStart',r)==0&&r1.compareEndPoints('EndToEnd',r)==0)return re&&re.test(sc.nodeName)?null:sc;}}else{function getParent(n){return dom.getParent(n,function(n){return n.nodeType==1;});};sc=r.startContainer;ec=r.endContainer;so=r.startOffset;eo=r.endOffset;if(!r.collapsed){if(sc==ec){if(so-eo<2){if(sc.hasChildNodes()){sp=sc.childNodes[so];return re&&re.test(sp.nodeName)?null:sp;}}}}if(sc.nodeType!=3||ec.nodeType!=3)return null;if(so==0){sp=getParent(sc);if(sp&&sp.firstChild!=sc)sp=null;}if(so==sc.nodeValue.length){e=sc.nextSibling;if(e&&e.nodeType==1)sp=sc.nextSibling;}if(eo==0){e=ec.previousSibling;if(e&&e.nodeType==1)ep=e;}if(eo==ec.nodeValue.length){ep=getParent(ec);if(ep&&ep.lastChild!=ec)ep=null;}if(sp==ep)return re&&sp&&re.test(sp.nodeName)?null:sp;}return null;},InsertHorizontalRule:function(){if(isGecko||isIE)this.editor.selection.setContent('
    ');else this.editor.getDoc().execCommand('InsertHorizontalRule',false,'');},RemoveFormat:function(){var t=this,ed=t.editor,s=ed.selection,b;if(isWebKit)s.setContent(s.getContent({format:'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g,''),{format:'raw'});else ed.getDoc().execCommand('RemoveFormat',false,null);t.mceSetStyleInfo(0,{command:'removeformat'});ed.addVisual();},mceSetStyleInfo:function(u,v){var t=this,ed=t.editor,d=ed.getDoc(),dom=ed.dom,e,b,s=ed.selection,nn=v.wrapper||'span',b=s.getBookmark(),re;function set(n,e){if(n.nodeType==1){switch(v.command){case'setattrib':return dom.setAttrib(n,v.name,v.value);case'setstyle':return dom.setStyle(n,v.name,v.value);case'removeformat':return dom.setAttrib(n,'class','');}}};re=ed.settings.merge_styles_invalid_parents;if(tinymce.is(re,'string'))re=new RegExp(re,'i');if((e=t.getSelectedElement())&&!ed.settings.force_span_wrappers)set(e,1);else{d.execCommand('FontName',false,'__');each(isWebKit?dom.select('span'):dom.select('font'),function(n){var sp,e;if(dom.getAttrib(n,'face')=='__'||n.style.fontFamily==='__'){sp=dom.create(nn,{mce_new:'1'});set(sp);each(n.childNodes,function(n){sp.appendChild(n.cloneNode(true));});dom.replace(sp,n);}});}each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!dom.getAttrib(n,'mce_new')){p=dom.getParent(n,function(n){return n.nodeType==1&&dom.getAttrib(n,'mce_new');});if(p)dom.remove(n,1);}});each(dom.select(nn).reverse(),function(n){var p=n.parentNode;if(!p||!dom.getAttrib(n,'mce_new'))return;if(ed.settings.force_span_wrappers&&p.nodeName!='SPAN')return;if(p.nodeName==nn.toUpperCase()&&p.childNodes.length==1)return dom.remove(p,1);if(n.nodeType==1&&(!re||!re.test(p.nodeName))&&p.childNodes.length==1){set(p);dom.setAttrib(n,'class','');}});each(dom.select(nn).reverse(),function(n){if(dom.getAttrib(n,'mce_new')||(dom.getAttribs(n).length<=1&&n.className==='')){if(!dom.getAttrib(n,'class')&&!dom.getAttrib(n,'style'))return dom.remove(n,1);dom.setAttrib(n,'mce_new','');}});s.moveToBookmark(b);},queryStateJustify:function(c,v){var ed=this.editor,n=ed.selection.getNode(),dom=ed.dom;if(n&&n.nodeName=='IMG'){if(dom.getStyle(n,'float')==v)return 1;return n.parentNode.style.textAlign==v;}n=dom.getParent(ed.selection.getStart(),function(n){return n.nodeType==1&&n.style.textAlign;});if(v=='full')v='justify';if(ed.settings.inline_styles)return(n&&n.style.textAlign==v);return this._queryState(c);},ForeColor:function(ui,v){var ed=this.editor;if(ed.settings.convert_fonts_to_spans){this._applyInlineStyle('span',{style:{color:v}});return;}else ed.getDoc().execCommand('ForeColor',false,v);},HiliteColor:function(ui,val){var t=this,ed=t.editor,d=ed.getDoc();if(ed.settings.convert_fonts_to_spans){this._applyInlineStyle('span',{style:{backgroundColor:val}});return;}function set(s){if(!isGecko)return;try{d.execCommand("styleWithCSS",0,s);}catch(ex){d.execCommand("useCSS",0,!s);}};if(isGecko||isOpera){set(true);d.execCommand('hilitecolor',false,val);set(false);}else d.execCommand('BackColor',false,val);},Undo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.undo();ed.nodeChanged();}else ed.getDoc().execCommand('Undo',false,null);},Redo:function(){var ed=this.editor;if(ed.settings.custom_undo_redo){ed.undoManager.redo();ed.nodeChanged();}else ed.getDoc().execCommand('Redo',false,null);},FormatBlock:function(ui,val){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,bl,nb,b;function isBlock(n){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName);};bl=dom.getParent(s.getNode(),function(n){return isBlock(n);});if(bl){if((isIE&&isBlock(bl.parentNode))||bl.nodeName=='DIV'){nb=ed.dom.create(val);each(dom.getAttribs(bl),function(v){dom.setAttrib(nb,v.nodeName,dom.getAttrib(bl,v.nodeName));});b=s.getBookmark();dom.replace(nb,bl,1);s.moveToBookmark(b);ed.nodeChanged();return;}}val=ed.settings.forced_root_block?(val||'

    '):val;if(val.indexOf('<')==-1)val='<'+val+'>';if(tinymce.isGecko)val=val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,'$1');ed.getDoc().execCommand('FormatBlock',false,val);},mceCleanup:function(){var ed=this.editor,s=ed.selection,b=s.getBookmark();ed.setContent(ed.getContent());s.moveToBookmark(b);},mceRemoveNode:function(ui,val){var ed=this.editor,s=ed.selection,b,n=val||s.getNode();if(n==ed.getBody())return;b=s.getBookmark();ed.dom.remove(n,1);s.moveToBookmark(b);ed.nodeChanged();},mceSelectNodeDepth:function(ui,val){var ed=this.editor,s=ed.selection,c=0;ed.dom.getParent(s.getNode(),function(n){if(n.nodeType==1&&c++==val){s.select(n);ed.nodeChanged();return false;}},ed.getBody());},mceSelectNode:function(u,v){this.editor.selection.select(v);},mceInsertContent:function(ui,val){this.editor.selection.setContent(val);},mceInsertRawHTML:function(ui,val){var ed=this.editor;ed.selection.setContent('tiny_mce_marker');ed.setContent(ed.getContent().replace(/tiny_mce_marker/g,val));},mceRepaint:function(){var s,b,e=this.editor;if(tinymce.isGecko){try{s=e.selection;b=s.getBookmark(true);if(s.getSel())s.getSel().selectAllChildren(e.getBody());s.collapse(true);s.moveToBookmark(b);}catch(ex){}}},queryStateUnderline:function(){var ed=this.editor,n=ed.selection.getNode();if(n&&n.nodeName=='A')return false;return this._queryState('Underline');},queryStateOutdent:function(){var ed=this.editor,n;if(ed.settings.inline_styles){if((n=ed.dom.getParent(ed.selection.getStart(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;if((n=ed.dom.getParent(ed.selection.getEnd(),ed.dom.isBlock))&&parseInt(n.style.paddingLeft)>0)return true;}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!ed.settings.inline_styles&&!!ed.dom.getParent(ed.selection.getNode(),'BLOCKQUOTE'));},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'UL');},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),'OL');},queryStatemceBlockQuote:function(){return!!this.editor.dom.getParent(this.editor.selection.getStart(),function(n){return n.nodeName==='BLOCKQUOTE';});},mceBlockQuote:function(){var t=this,ed=t.editor,s=ed.selection,dom=ed.dom,sb,eb,n,bm,bq,r,bq2,i,nl;function getBQ(e){return dom.getParent(e,function(n){return n.nodeName==='BLOCKQUOTE';});};sb=dom.getParent(s.getStart(),isBlock);eb=dom.getParent(s.getEnd(),isBlock);if(bq=getBQ(sb)){if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();if(getBQ(eb)){bq2=bq.cloneNode(false);while(n=eb.nextSibling)bq2.appendChild(n.parentNode.removeChild(n));}if(bq2)dom.insertAfter(bq2,bq);nl=t._getSelectedBlocks(sb,eb);for(i=nl.length-1;i>=0;i--){dom.insertAfter(nl[i],bq);}if(/^\s*$/.test(bq.innerHTML))dom.remove(bq,1);if(bq2&&/^\s*$/.test(bq2.innerHTML))dom.remove(bq2,1);if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(0);if(dom.getParent(s.getStart(),isBlock)!=sb){r=s.getRng();r.move('character',-1);r.select();}}}else t.editor.selection.moveToBookmark(bm);return;}if(isIE&&!sb&&!eb){t.editor.getDoc().execCommand('Indent');n=getBQ(s.getNode());n.style.margin=n.dir='';return;}if(!sb||!eb)return;if(sb!=eb||sb.childNodes.length>1||(sb.childNodes.length==1&&sb.firstChild.nodeName!='BR'))bm=s.getBookmark();each(t._getSelectedBlocks(getBQ(s.getStart()),getBQ(s.getEnd())),function(e){if(e.nodeName=='BLOCKQUOTE'&&!bq){bq=e;return;}if(!bq){bq=dom.create('blockquote');e.parentNode.insertBefore(bq,e);}if(e.nodeName=='BLOCKQUOTE'&&bq){n=e.firstChild;while(n){bq.appendChild(n.cloneNode(true));n=n.nextSibling;}dom.remove(e);return;}bq.appendChild(dom.remove(e));});if(!bm){if(!isIE){r=ed.getDoc().createRange();r.setStart(sb,0);r.setEnd(sb,0);s.setRng(r);}else{s.select(sb);s.collapse(1);}}else s.moveToBookmark(bm);},_applyInlineStyle:function(na,at,op){var t=this,ed=t.editor,dom=ed.dom,bm,lo={},kh;na=na.toUpperCase();if(op&&op.check_classes&&at['class'])op.check_classes.push(at['class']);function replaceFonts(){var bm;each(dom.select(tinymce.isWebKit&&!tinymce.isAir?'span':'font'),function(n){if(n.style.fontFamily=='mceinline'||n.face=='mceinline'){if(!bm)bm=ed.selection.getBookmark();at._mce_new='1';dom.replace(dom.create(na,at),n,1);}});each(dom.select(na),function(n){if(n.getAttribute('_mce_new')){function removeStyle(n){if(n.nodeType==1){each(at.style,function(v,k){dom.setStyle(n,k,'');});if(at['class']&&n.className&&op){each(op.check_classes,function(c){if(dom.hasClass(n,c))dom.removeClass(n,c);});}}};each(dom.select(na,n),removeStyle);if(n.parentNode&&n.parentNode.nodeType==1&&n.parentNode.childNodes.length==1)removeStyle(n.parentNode);dom.getParent(n.parentNode,function(pn){if(pn.nodeType==1){if(at.style){each(at.style,function(v,k){var sv;if(!lo[k]&&(sv=dom.getStyle(pn,k))){if(sv===v)dom.setStyle(n,k,'');lo[k]=1;}});}if(at['class']&&pn.className&&op){each(op.check_classes,function(c){if(dom.hasClass(pn,c))dom.removeClass(n,c);});}}return false;});n.removeAttribute('_mce_new');}});each(dom.select(na).reverse(),function(n){var c=0;each(dom.getAttribs(n),function(an){if(an.nodeName.substring(0,1)!='_'&&dom.getAttrib(n,an.nodeName)!=''){c++;}});if(c==0)dom.remove(n,1);});ed.selection.moveToBookmark(bm);return!!bm;};ed.focus();ed.getDoc().execCommand('FontName',false,'mceinline');replaceFonts();if(kh=t._applyInlineStyle.keyhandler){ed.onKeyUp.remove(kh);ed.onKeyPress.remove(kh);ed.onKeyDown.remove(kh);ed.onSetContent.remove(t._applyInlineStyle.chandler);}if(ed.selection.isCollapsed()){t._pendingStyles=tinymce.extend(t._pendingStyles||{},at.style);t._applyInlineStyle.chandler=ed.onSetContent.add(function(){delete t._pendingStyles;});t._applyInlineStyle.keyhandler=kh=function(e){if(t._pendingStyles){at.style=t._pendingStyles;delete t._pendingStyles;}if(replaceFonts()){ed.onKeyDown.remove(t._applyInlineStyle.keyhandler);ed.onKeyPress.remove(t._applyInlineStyle.keyhandler);}if(e.type=='keyup')ed.onKeyUp.remove(t._applyInlineStyle.keyhandler);};ed.onKeyDown.add(kh);ed.onKeyPress.add(kh);ed.onKeyUp.add(kh);}else t._pendingStyles=0;},_getSelectedBlocks:function(st,en){var ed=this.editor,dom=ed.dom,s=ed.selection,sb,eb,n,bl=[];sb=dom.getParent(st||s.getStart(),isBlock);eb=dom.getParent(en||s.getEnd(),isBlock);if(sb)bl.push(sb);if(sb&&eb&&sb!=eb){n=sb;while((n=n.nextSibling)&&n!=eb){if(isBlock(n))bl.push(n);}}if(eb&&sb!=eb)bl.push(eb);return bl;}});})();tinymce.create('tinymce.UndoManager',{index:0,data:null,typing:0,UndoManager:function(ed){var t=this,Dispatcher=tinymce.util.Dispatcher;t.editor=ed;t.data=[];t.onAdd=new Dispatcher(this);t.onUndo=new Dispatcher(this);t.onRedo=new Dispatcher(this);},add:function(l){var t=this,i,ed=t.editor,b,s=ed.settings,la;l=l||{};l.content=l.content||ed.getContent({format:'raw',no_events:1});l.content=l.content.replace(/^\s*|\s*$/g,'');la=t.data[t.index>0&&(t.index==0||t.index==t.data.length)?t.index-1:t.index];if(!l.initial&&la&&l.content==la.content)return null;if(s.custom_undo_redo_levels){if(t.data.length>s.custom_undo_redo_levels){for(i=0;i0){if(t.index==t.data.length&&t.index>1){i=t.index;t.typing=0;if(!t.add())t.index=i;--t.index;}l=t.data[--t.index];ed.setContent(l.content,{format:'raw'});ed.selection.moveToBookmark(l.bookmark);t.onUndo.dispatch(t,l);}return l;},redo:function(){var t=this,ed=t.editor,l=null;if(t.index','gi');t.rePadd=new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

    <\\\/p>||

    \\s+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR1=new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

    [\\s\\u00a0]+<\\\/p>'.replace(/p/g,elm),'gi');t.reNbsp2BR2=new RegExp(']+)>( | )<\\\/p>|

    ( | )<\\\/p>'.replace(/p/g,elm),'gi');t.reBR2Nbsp=new RegExp(']+)>\\s*
    \\s*<\\\/p>|

    \\s*
    \\s*<\\\/p>'.replace(/p/g,elm),'gi');t.reTrailBr=new RegExp('\\s*
    \\s*<\\\/p>'.replace(/p/g,elm),'gi');function padd(ed,o){if(isOpera)o.content=o.content.replace(t.reOpera,'');o.content=o.content.replace(t.rePadd,'<'+elm+'$1$2$3$4$5$6>\u00a0');if(!isIE&&!isOpera&&o.set){o.content=o.content.replace(t.reNbsp2BR1,'<'+elm+'$1$2>
    ');o.content=o.content.replace(t.reNbsp2BR2,'<'+elm+'$1$2>
    ');}else{o.content=o.content.replace(t.reBR2Nbsp,'<'+elm+'$1$2>\u00a0');o.content=o.content.replace(t.reTrailBr,'');}};ed.onBeforeSetContent.add(padd);ed.onPostProcess.add(padd);if(s.forced_root_block){ed.onInit.add(t.forceRoots,t);ed.onSetContent.add(t.forceRoots,t);ed.onBeforeGetContent.add(t.forceRoots,t);}},setup:function(){var t=this,ed=t.editor,s=ed.settings;if(s.forced_root_block){ed.onKeyUp.add(t.forceRoots,t);ed.onPreProcess.add(t.forceRoots,t);}if(s.force_br_newlines){if(isIE){ed.onKeyPress.add(function(ed,e){var n,s=ed.selection;if(e.keyCode==13&&s.getNode().nodeName!='LI'){s.setContent('
    ',{format:'raw'});n=ed.dom.get('__');n.removeAttribute('id');s.select(n);s.collapse();return Event.cancel(e);}});}return;}if(!isIE&&s.force_p_newlines){ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&!e.shiftKey){if(!t.insertPara(e))Event.cancel(e);}});if(isGecko){ed.onKeyDown.add(function(ed,e){if((e.keyCode==8||e.keyCode==46)&&!e.shiftKey)t.backspaceDelete(e,e.keyCode==8);});}}function ren(rn,na){var ne=ed.dom.create(na);each(rn.attributes,function(a){if(a.specified&&a.nodeValue)ne.setAttribute(a.nodeName.toLowerCase(),a.nodeValue);});each(rn.childNodes,function(n){ne.appendChild(n.cloneNode(true));});rn.parentNode.replaceChild(ne,rn);return ne;};if(isIE&&s.element!='P'){ed.onKeyPress.add(function(ed,e){t.lastElm=ed.selection.getNode().nodeName;});ed.onKeyUp.add(function(ed,e){var bl,sel=ed.selection,n=sel.getNode(),b=ed.getBody();if(b.childNodes.length===1&&n.nodeName=='P'){n=ren(n,s.element);sel.select(n);sel.collapse();ed.nodeChanged();}else if(e.keyCode==13&&!e.shiftKey&&t.lastElm!='P'){bl=ed.dom.getParent(n,'P');if(bl){ren(bl,s.element);ed.nodeChanged();}}});}},find:function(n,t,s){var ed=this.editor,w=ed.getDoc().createTreeWalker(n,4,null,false),c=-1;while(n=w.nextNode()){c++;if(t==0&&n==s)return c;if(t==1&&c==s)return n;}return-1;},forceRoots:function(ed,e){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;var nx,bl,bp,sp,le,nl=b.childNodes,i,n,eid;for(i=nl.length-1;i>=0;i--){nx=nl[i];if(nx.nodeType==3||(!t.dom.isBlock(nx)&&nx.nodeType!=8)){if(!bl){if(nx.nodeType!=3||/[^\s]/g.test(nx.nodeValue)){if(si==-2&&r){if(!isIE){if(r.startContainer.nodeType==1&&(n=r.startContainer.childNodes[r.startOffset])&&n.nodeType==1){eid=n.getAttribute("id");n.setAttribute("id","__mce");}else{if(ed.dom.getParent(r.startContainer,function(e){return e===b;})){so=r.startOffset;eo=r.endOffset;si=t.find(b,0,r.startContainer);ei=t.find(b,0,r.endContainer);}}}else{tr=d.body.createTextRange();tr.moveToElementText(b);tr.collapse(1);bp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(1);sp=tr.move('character',c)*-1;tr=r.duplicate();tr.collapse(0);le=(tr.move('character',c)*-1)-sp;si=sp-bp;ei=le;}}bl=ed.dom.create(ed.settings.forced_root_block);bl.appendChild(nx.cloneNode(1));nx.parentNode.replaceChild(bl,nx);}}else{if(bl.hasChildNodes())bl.insertBefore(nx,bl.firstChild);else bl.appendChild(nx);}}else bl=null;}if(si!=-2){if(!isIE){bl=b.getElementsByTagName(ed.settings.element)[0];r=d.createRange();if(si!=-1)r.setStart(t.find(b,1,si),so);else r.setStart(bl,0);if(ei!=-1)r.setEnd(t.find(b,1,ei),eo);else r.setEnd(bl,0);if(s){s.removeAllRanges();s.addRange(r);}}else{try{r=s.createRange();r.moveToElementText(b);r.collapse(1);r.moveStart('character',si);r.moveEnd('character',ei);r.select();}catch(ex){}}}else if(!isIE&&(n=ed.dom.get('__mce'))){if(eid)n.setAttribute('id',eid);else n.removeAttribute('id');r=d.createRange();r.setStartBefore(n);r.setEndBefore(n);se.setRng(r);}},getParentBlock:function(n){var d=this.dom;return d.getParent(n,d.isBlock);},insertPara:function(e){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;var rb,ra,dir,sn,so,en,eo,sb,eb,bn,bef,aft,sc,ec,n,vp=dom.getViewPort(ed.getWin()),y,ch,car;function isEmpty(n){n=n.innerHTML;n=n.replace(/<(img|hr|table)/gi,'-');n=n.replace(/<[^>]+>/g,'');return n.replace(/[ \t\r\n]+/g,'')=='';};rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(true);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(true);dir=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;sn=dir?s.anchorNode:s.focusNode;so=dir?s.anchorOffset:s.focusOffset;en=dir?s.focusNode:s.anchorNode;eo=dir?s.focusOffset:s.anchorOffset;if(sn===en&&/^(TD|TH)$/.test(sn.nodeName)){dom.remove(sn.firstChild);ed.dom.add(sn,se.element,null,'
    ');aft=ed.dom.add(sn,se.element,null,'
    ');r=d.createRange();r.selectNodeContents(aft);r.collapse(1);ed.selection.setRng(r);return false;}if(sn==b&&en==b&&b.firstChild&&ed.dom.isBlock(b.firstChild)){sn=en=sn.firstChild;so=eo=0;rb=d.createRange();rb.setStart(sn,0);ra=d.createRange();ra.setStart(en,0);}sn=sn.nodeName=="HTML"?d.body:sn;sn=sn.nodeName=="BODY"?sn.firstChild:sn;en=en.nodeName=="HTML"?d.body:en;en=en.nodeName=="BODY"?en.firstChild:en;sb=t.getParentBlock(sn);eb=t.getParentBlock(en);bn=sb?sb.nodeName:se.element;if(t.dom.getParent(sb,function(n){return/OL|UL|PRE/.test(n.nodeName);}))return true;if(sb&&(sb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(sb.style.position))){bn=se.element;sb=null;}if(eb&&(eb.nodeName=='CAPTION'||/absolute|relative|static/gi.test(eb.style.position))){bn=se.element;eb=null;}if(/(TD|TABLE|TH|CAPTION)/.test(bn)||(sb&&bn=="DIV"&&/left|right/gi.test(sb.style.cssFloat))){bn=se.element;sb=eb=null;}bef=(sb&&sb.nodeName==bn)?sb.cloneNode(0):ed.dom.create(bn);aft=(eb&&eb.nodeName==bn)?eb.cloneNode(0):ed.dom.create(bn);aft.removeAttribute('id');if(/^(H[1-6])$/.test(bn)&&sn.nodeValue&&so==sn.nodeValue.length)aft=ed.dom.create(se.element);n=sc=sn;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;sc=n;}while((n=n.previousSibling?n.previousSibling:n.parentNode));n=ec=en;do{if(n==b||n.nodeType==9||t.dom.isBlock(n)||/(TD|TABLE|TH|CAPTION)/.test(n.nodeName))break;ec=n;}while((n=n.nextSibling?n.nextSibling:n.parentNode));if(sc.nodeName==bn)rb.setStart(sc,0);else rb.setStartBefore(sc);rb.setEnd(sn,so);bef.appendChild(rb.cloneContents()||d.createTextNode(''));try{ra.setEndAfter(ec);}catch(ex){}ra.setStart(en,eo);aft.appendChild(ra.cloneContents()||d.createTextNode(''));r=d.createRange();if(!sc.previousSibling&&sc.parentNode.nodeName==bn){r.setStartBefore(sc.parentNode);}else{if(rb.startContainer.nodeName==bn&&rb.startOffset==0)r.setStartBefore(rb.startContainer);else r.setStart(rb.startContainer,rb.startOffset);}if(!ec.nextSibling&&ec.parentNode.nodeName==bn)r.setEndAfter(ec.parentNode);else r.setEnd(ra.endContainer,ra.endOffset);r.deleteContents();if(isOpera)ed.getWin().scrollTo(0,vp.y);if(bef.firstChild&&bef.firstChild.nodeName==bn)bef.innerHTML=bef.firstChild.innerHTML;if(aft.firstChild&&aft.firstChild.nodeName==bn)aft.innerHTML=aft.firstChild.innerHTML;if(isEmpty(bef))bef.innerHTML='
    ';function appendStyles(e,en){var nl=[],nn,n,i;e.innerHTML='';if(se.keep_styles){n=en;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)){nn=n.cloneNode(false);dom.setAttrib(nn,'id','');nl.push(nn);}}while(n=n.parentNode);}if(nl.length>0){for(i=nl.length-1,nn=e;i>=0;i--)nn=nn.appendChild(nl[i]);nl[0].innerHTML=isOpera?' ':'
    ';return nl[0];}else e.innerHTML=isOpera?' ':'
    ';};if(isEmpty(aft))car=appendStyles(aft,en);if(isOpera&&parseFloat(opera.version())<9.5){r.insertNode(bef);r.insertNode(aft);}else{r.insertNode(aft);r.insertNode(bef);}aft.normalize();bef.normalize();function first(n){return d.createTreeWalker(n,NodeFilter.SHOW_TEXT,null,false).nextNode()||n;};r=d.createRange();r.selectNodeContents(isGecko?first(car||aft):car||aft);r.collapse(1);s.removeAllRanges();s.addRange(r);y=ed.dom.getPos(aft).y;ch=aft.clientHeight;if(yvp.y+vp.h){ed.getWin().scrollTo(0,y 10000) { + w.clearInterval(ti); + + if (c < 10000 && x.status == 200) { + t.loaded = 1; + t.eval(x.responseText); + tinymce.dom.Event.domLoaded = true; + cb.call(sc || t, x); + } + + ti = x = null; + } + }, 10); + } else + t.eval(x.responseText); + }, + + start : function() { + var t = this, each = tinymce.each, s = t.settings, ln = s.languages.split(','); + + tinymce.suffix = s.suffix; + + function load(u) { + tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(u)); + }; + + // Add core languages + each(ln, function(c) { + if (c) + load('langs/' + c + '.js'); + }); + + // Add themes with languages + each(s.themes.split(','), function(n) { + if (n) { + load('themes/' + n + '/editor_template' + s.suffix + '.js'); + + each (ln, function(c) { + if (c) + load('themes/' + n + '/langs/' + c + '.js'); + }); + } + }); + + // Add plugins with languages + each(s.plugins.split(','), function(n) { + if (n) { + load('plugins/' + n + '/editor_plugin' + s.suffix + '.js'); + + each(ln, function(c) { + if (c) + load('plugins/' + n + '/langs/' + c + '.js'); + }); + } + }); + }, + + end : function() { + }, + + eval : function(co) { + var w = window; + + // Evaluate script + if (!w.execScript) { + if (/Gecko/.test(navigator.userAgent)) + eval(co, w); // Firefox 3.0 + else + eval.call(w, co); + } else + w.execScript(co); // IE + } +}; diff --git a/thirdparty/tiny/tiny_mce_gzip.php b/thirdparty/tiny/tiny_mce_gzip.php new file mode 100644 index 0000000..6be46b6 --- /dev/null +++ b/thirdparty/tiny/tiny_mce_gzip.php @@ -0,0 +1,183 @@ + \ No newline at end of file diff --git a/thirdparty/tiny/tiny_mce_popup.js b/thirdparty/tiny/tiny_mce_popup.js new file mode 100644 index 0000000..d5d88e2 --- /dev/null +++ b/thirdparty/tiny/tiny_mce_popup.js @@ -0,0 +1,294 @@ +// Some global instances +var tinymce = null, tinyMCEPopup, tinyMCE; + +tinyMCEPopup = { + init : function() { + var t = this, w, ti, li, q, i, it; + + li = ('' + document.location.search).replace(/^\?/, '').split('&'); + q = {}; + for (i=0; i'); + tinymce.ScriptLoader.markDone(u); + } + } + }, + + pickColor : function(e, element_id) { + this.execCommand('mceColorPicker', true, { + color : document.getElementById(element_id).value, + func : function(c) { + document.getElementById(element_id).value = c; + + try { + document.getElementById(element_id).onchange(); + } catch (ex) { + // Try fire event, ignore errors + } + } + }); + }, + + openBrowser : function(element_id, type, option) { + tinyMCEPopup.restoreSelection(); + this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); + }, + + confirm : function(t, cb, s) { + this.editor.windowManager.confirm(t, cb, s, window); + }, + + alert : function(tx, cb, s) { + this.editor.windowManager.alert(tx, cb, s, window); + }, + + close : function() { + var t = this; + + // To avoid domain relaxing issue in Opera + function close() { + t.editor.windowManager.close(window); + tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup + }; + + if (tinymce.isOpera) + t.getWin().setTimeout(close, 0); + else + close(); + }, + + // Internal functions + + _restoreSelection : function() { + var e = window.event.srcElement; + + if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) + tinyMCEPopup.restoreSelection(); + }, + +/* _restoreSelection : function() { + var e = window.event.srcElement; + + // If user focus a non text input or textarea + if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') + tinyMCEPopup.restoreSelection(); + },*/ + + _onDOMLoaded : function() { + var t = this, ti = document.title, bm, h, nv; + + // Translate page + if (t.features.translate_i18n !== false) { + h = document.body.innerHTML; + + // Replace a=x with a="x" in IE + if (tinymce.isIE) + h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') + + document.dir = t.editor.getParam('directionality',''); + + if ((nv = t.editor.translate(h)) && nv != h) + document.body.innerHTML = nv; + + if ((nv = t.editor.translate(ti)) && nv != ti) + document.title = ti = nv; + } + + document.body.style.display = ''; + + // Restore selection in IE when focus is placed on a non textarea or input element of the type text + if (tinymce.isIE) + document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); + + t.restoreSelection(); + t.resizeToInnerSize(); + + // Set inline title + if (!t.isWindow) + t.editor.windowManager.setTitle(window, ti); + else + window.focus(); + + if (!tinymce.isIE && !t.isWindow) { + tinymce.dom.Event._add(document, 'focus', function() { + t.editor.windowManager.focus(t.id) + }); + } + + // Patch for accessibility + tinymce.each(t.dom.select('select'), function(e) { + e.onkeydown = tinyMCEPopup._accessHandler; + }); + + // Call onInit + // Init must be called before focus so the selection won't get lost by the focus call + tinymce.each(t.listeners, function(o) { + o.func.call(o.scope, t.editor); + }); + + // Move focus to window + if (t.getWindowArg('mce_auto_focus', true)) { + window.focus(); + + // Focus element with mceFocus class + tinymce.each(document.forms, function(f) { + tinymce.each(f.elements, function(e) { + if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { + e.focus(); + return false; // Break loop + } + }); + }); + } + + document.onkeyup = tinyMCEPopup._closeWinKeyHandler; + }, + + _accessHandler : function(e) { + e = e || window.event; + + if (e.keyCode == 13 || e.keyCode == 32) { + e = e.target || e.srcElement; + + if (e.onchange) + e.onchange(); + + return tinymce.dom.Event.cancel(e); + } + }, + + _closeWinKeyHandler : function(e) { + e = e || window.event; + + if (e.keyCode == 27) + tinyMCEPopup.close(); + }, + + _wait : function() { + var t = this, ti; + + if (tinymce.isIE && document.location.protocol != 'https:') { + // Fake DOMContentLoaded on IE + document.write(''; + + bi = s.body_id || 'tinymce'; + if (bi.indexOf('=') != -1) { + bi = t.getParam('body_id', '', 'hash'); + bi = bi[t.id] || bi; + } + + bc = s.body_class || ''; + if (bc.indexOf('=') != -1) { + bc = t.getParam('body_class', '', 'hash'); + bc = bc[t.id] || ''; + } + + t.iframeHTML += ''; + + // Domain relaxing enabled, then set document domain + if (tinymce.relaxedDomain) { + // We need to write the contents here in IE since multiple writes messes up refresh button and back button + if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5)) + 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();})()'; + else if (tinymce.isOpera) + u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; + } + + // Create iframe + n = DOM.add(o.iframeContainer, 'iframe', { + id : t.id + "_ifr", + src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 + frameBorder : '0', + style : { + width : '100%', + height : h + } + }); + + t.contentAreaContainer = o.iframeContainer; + DOM.get(o.editorContainer).style.display = t.orgDisplay; + DOM.get(t.id).style.display = 'none'; + + // Safari 2.x requires us to wait for the load event and load a real HTML doc + if (tinymce.isOldWebKit) { + Event.add(n, 'load', t.setupIframe, t); + n.src = tinymce.baseURL + '/plugins/safari/blank.htm'; + } else { + if (!isIE || !tinymce.relaxedDomain) + t.setupIframe(); + + e = n = o = null; // Cleanup + } + }, + + setupIframe : function() { + var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; + + // Setup iframe body + if (!isIE || !tinymce.relaxedDomain) { + d.open(); + d.write(t.iframeHTML); + d.close(); + } + + // Design mode needs to be added here Ctrl+A will fail otherwise + if (!isIE) { + try { + if (!s.readonly) + d.designMode = 'On'; + } catch (ex) { + // Will fail on Gecko if the editor is placed in an hidden container element + // The design mode will be set ones the editor is focused + } + } + + // IE needs to use contentEditable or it will display non secure items for HTTPS + if (isIE) { + // It will not steal focus if we hide it while setting contentEditable + b = t.getBody(); + DOM.hide(b); + + if (!s.readonly) + b.contentEditable = true; + + DOM.show(b); + } + + // Setup objects + t.dom = new tinymce.DOM.DOMUtils(t.getDoc(), { + keep_values : true, + url_converter : t.convertURL, + url_converter_scope : t, + hex_colors : s.force_hex_style_colors, + class_filter : s.class_filter, + update_styles : 1, + fix_ie_paragraphs : 1 + }); + + t.serializer = new tinymce.dom.Serializer({ + entity_encoding : s.entity_encoding, + entities : s.entities, + valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements, + extended_valid_elements : s.extended_valid_elements, + valid_child_elements : s.valid_child_elements, + invalid_elements : s.invalid_elements, + fix_table_elements : s.fix_table_elements, + fix_list_elements : s.fix_list_elements, + fix_content_duplication : s.fix_content_duplication, + convert_fonts_to_spans : s.convert_fonts_to_spans, + font_size_classes : s.font_size_classes, + font_size_style_values : s.font_size_style_values, + apply_source_formatting : s.apply_source_formatting, + remove_linebreaks : s.remove_linebreaks, + element_format : s.element_format, + dom : t.dom + }); + + t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); + t.forceBlocks = new tinymce.ForceBlocks(t, { + forced_root_block : s.forced_root_block + }); + t.editorCommands = new tinymce.EditorCommands(t); + + // Pass through + t.serializer.onPreProcess.add(function(se, o) { + return t.onPreProcess.dispatch(t, o, se); + }); + + t.serializer.onPostProcess.add(function(se, o) { + return t.onPostProcess.dispatch(t, o, se); + }); + + t.onPreInit.dispatch(t); + + if (!s.gecko_spellcheck) + t.getBody().spellcheck = 0; + + if (!s.readonly) + t._addEvents(); + + t.controlManager.onPostRender.dispatch(t, t.controlManager); + t.onPostRender.dispatch(t); + + if (s.directionality) + t.getBody().dir = s.directionality; + + if (s.nowrap) + t.getBody().style.whiteSpace = "nowrap"; + + if (s.auto_resize) + t.onNodeChange.add(t.resizeToContent, t); + + if (s.custom_elements) { + function handleCustom(ed, o) { + each(explode(s.custom_elements), function(v) { + var n; + + if (v.indexOf('~') === 0) { + v = v.substring(1); + n = 'span'; + } else + n = 'div'; + + o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' mce_name="$1"$2>'); + o.content = o.content.replace(new RegExp('', 'g'), ''); + }); + }; + + t.onBeforeSetContent.add(handleCustom); + t.onPostProcess.add(function(ed, o) { + if (o.set) + handleCustom(ed, o) + }); + } + + if (s.handle_node_change_callback) { + t.onNodeChange.add(function(ed, cm, n) { + t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); + }); + } + + if (s.save_callback) { + t.onSaveContent.add(function(ed, o) { + var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); + + if (h) + o.content = h; + }); + } + + if (s.onchange_callback) { + t.onChange.add(function(ed, l) { + t.execCallback('onchange_callback', t, l); + }); + } + + if (s.convert_newlines_to_brs) { + t.onBeforeSetContent.add(function(ed, o) { + if (o.initial) + o.content = o.content.replace(/\r?\n/g, '
    '); + }); + } + + if (s.fix_nesting && isIE) { + t.onBeforeSetContent.add(function(ed, o) { + o.content = t._fixNesting(o.content); + }); + } + + if (s.preformatted) { + t.onPostProcess.add(function(ed, o) { + o.content = o.content.replace(/^\s*/, ''); + o.content = o.content.replace(/<\/pre>\s*$/, ''); + + if (o.set) + o.content = '

    ' + o.content + '
    '; + }); + } + + if (s.verify_css_classes) { + t.serializer.attribValueFilter = function(n, v) { + var s, cl; + + if (n == 'class') { + // Build regexp for classes + if (!t.classesRE) { + cl = t.dom.getClasses(); + + if (cl.length > 0) { + s = ''; + + each (cl, function(o) { + s += (s ? '|' : '') + o['class']; + }); + + t.classesRE = new RegExp('(' + s + ')', 'gi'); + } + } + + return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; + } + + return v; + }; + } + + if (s.convert_fonts_to_spans) + t._convertFonts(); + + if (s.inline_styles) + t._convertInlineElements(); + + if (s.cleanup_callback) { + t.onBeforeSetContent.add(function(ed, o) { + o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + }); + + t.onPreProcess.add(function(ed, o) { + if (o.set) + t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); + + if (o.get) + t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); + }); + + t.onPostProcess.add(function(ed, o) { + if (o.set) + o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); + + if (o.get) + o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); + }); + } + + if (s.save_callback) { + t.onGetContent.add(function(ed, o) { + if (o.save) + o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); + }); + } + + if (s.handle_event_callback) { + t.onEvent.add(function(ed, e, o) { + if (t.execCallback('handle_event_callback', e, ed, o) === false) + Event.cancel(e); + }); + } + + t.onSetContent.add(function() { + // Safari needs some time, it will crash the browser when a link is created otherwise + // I think this crash issue is resolved in the latest 3.0.4 + //window.setTimeout(function() { + t.addVisual(t.getBody()); + //}, 1); + }); + + // Remove empty contents + if (s.padd_empty_editor) { + t.onPostProcess.add(function(ed, o) { + o.content = o.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/, ''); + }); + } + + if (isGecko && !s.readonly) { + try { + // Design mode must be set here once again to fix a bug where + // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again + d.designMode = 'Off'; + d.designMode = 'On'; + } catch (ex) { + // Will fail on Gecko if the editor is placed in an hidden container element + // The design mode will be set ones the editor is focused + } + } + + // A small timeout was needed since firefox will remove. Bug: #1838304 + setTimeout(function () { + if (t.removed) + return; + + t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); + t.startContent = t.getContent({format : 'raw'}); + t.undoManager.add({initial : true}); + t.initialized = true; + + t.onInit.dispatch(t); + t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); + t.execCallback('init_instance_callback', t); + t.focus(true); + t.nodeChanged({initial : 1}); + + // Load specified content CSS last + if (s.content_css) { + tinymce.each(explode(s.content_css), function(u) { + t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); + }); + } + + // Handle auto focus + if (s.auto_focus) { + setTimeout(function () { + var ed = EditorManager.get(s.auto_focus); + + ed.selection.select(ed.getBody(), 1); + ed.selection.collapse(1); + ed.getWin().focus(); + }, 100); + } + }, 1); + + e = null; + }, + + + focus : function(sf) { + var oed, t = this, ce = t.settings.content_editable; + + if (!sf) { + // Is not content editable or the selection is outside the area in IE + // the IE statement is needed to avoid bluring if element selections inside layers since + // the layer is like it's own document in IE + if (!ce && (!isIE || t.selection.getNode().ownerDocument != t.getDoc())) + t.getWin().focus(); + + } + + if (EditorManager.activeEditor != t) { + if ((oed = EditorManager.activeEditor) != null) + oed.onDeactivate.dispatch(oed, t); + + t.onActivate.dispatch(t, oed); + } + + EditorManager._setActive(t); + }, + + execCallback : function(n) { + var t = this, f = t.settings[n], s; + + if (!f) + return; + + // Look through lookup + if (t.callbackLookup && (s = t.callbackLookup[n])) { + f = s.func; + s = s.scope; + } + + if (is(f, 'string')) { + s = f.replace(/\.\w+$/, ''); + s = s ? tinymce.resolve(s) : 0; + f = tinymce.resolve(f); + t.callbackLookup = t.callbackLookup || {}; + t.callbackLookup[n] = {func : f, scope : s}; + } + + return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); + }, + + translate : function(s) { + var c = this.settings.language || 'en', i18n = EditorManager.i18n; + + if (!s) + return ''; + + return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { + return i18n[c + '.' + b] || '{#' + b + '}'; + }); + }, + + getLang : function(n, dv) { + return EditorManager.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); + }, + + getParam : function(n, dv, ty) { + var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; + + if (ty === 'hash') { + o = {}; + + if (is(v, 'string')) { + each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { + v = v.split('='); + + if (v.length > 1) + o[tr(v[0])] = tr(v[1]); + else + o[tr(v[0])] = tr(v); + }); + } else + o = v; + + return o; + } + + return v; + }, + + nodeChanged : function(o) { + var t = this, s = t.selection, n = s.getNode() || t.getBody(); + + // Fix for bug #1896577 it seems that this can not be fired while the editor is loading + if (t.initialized) { + t.onNodeChange.dispatch( + t, + o ? o.controlManager || t.controlManager : t.controlManager, + isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n, // Fix for IE initial state + s.isCollapsed(), + o + ); + } + }, + + addButton : function(n, s) { + var t = this; + + t.buttons = t.buttons || {}; + t.buttons[n] = s; + }, + + addCommand : function(n, f, s) { + this.execCommands[n] = {func : f, scope : s || this}; + }, + + addQueryStateHandler : function(n, f, s) { + this.queryStateCommands[n] = {func : f, scope : s || this}; + }, + + addQueryValueHandler : function(n, f, s) { + this.queryValueCommands[n] = {func : f, scope : s || this}; + }, + + addShortcut : function(pa, desc, cmd_func, sc) { + var t = this, c; + + if (!t.settings.custom_shortcuts) + return false; + + t.shortcuts = t.shortcuts || {}; + + if (is(cmd_func, 'string')) { + c = cmd_func; + + cmd_func = function() { + t.execCommand(c, false, null); + }; + } + + if (is(cmd_func, 'object')) { + c = cmd_func; + + cmd_func = function() { + t.execCommand(c[0], c[1], c[2]); + }; + } + + each(explode(pa), function(pa) { + var o = { + func : cmd_func, + scope : sc || this, + desc : desc, + alt : false, + ctrl : false, + shift : false + }; + + each(explode(pa, '+'), function(v) { + switch (v) { + case 'alt': + case 'ctrl': + case 'shift': + o[v] = true; + break; + + default: + o.charCode = v.charCodeAt(0); + o.keyCode = v.toUpperCase().charCodeAt(0); + } + }); + + t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; + }); + + return true; + }, + + execCommand : function(cmd, ui, val, a) { + var t = this, s = 0, o, st; + + if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) + t.focus(); + + o = {}; + t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o); + if (o.terminate) + return false; + + // Command callback + if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } + + // Registred commands + if (o = t.execCommands[cmd]) { + st = o.func.call(o.scope, ui, val); + + // Fall through on true + if (st !== true) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return st; + } + } + + // Plugin commands + each(t.plugins, function(p) { + if (p.execCommand && p.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + s = 1; + return false; + } + }); + + if (s) + return true; + + // Theme commands + if (t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } + + // Editor commands + if (t.editorCommands.execCommand(cmd, ui, val)) { + t.onExecCommand.dispatch(t, cmd, ui, val, a); + return true; + } + + // Browser commands + t.getDoc().execCommand(cmd, ui, val); + t.onExecCommand.dispatch(t, cmd, ui, val, a); + }, + + queryCommandState : function(c) { + var t = this, o, s; + + // Is hidden then return undefined + if (t._isHidden()) + return; + + // Registred commands + if (o = t.queryStateCommands[c]) { + s = o.func.call(o.scope); + + // Fall though on true + if (s !== true) + return s; + } + + // Registred commands + o = t.editorCommands.queryCommandState(c); + if (o !== -1) + return o; + + // Browser commands + try { + return this.getDoc().queryCommandState(c); + } catch (ex) { + // Fails sometimes see bug: 1896577 + } + }, + + queryCommandValue : function(c) { + var t = this, o, s; + + // Is hidden then return undefined + if (t._isHidden()) + return; + + // Registred commands + if (o = t.queryValueCommands[c]) { + s = o.func.call(o.scope); + + // Fall though on true + if (s !== true) + return s; + } + + // Registred commands + o = t.editorCommands.queryCommandValue(c); + if (is(o)) + return o; + + // Browser commands + try { + return this.getDoc().queryCommandValue(c); + } catch (ex) { + // Fails sometimes see bug: 1896577 + } + }, + + show : function() { + var t = this; + + DOM.show(t.getContainer()); + DOM.hide(t.id); + t.load(); + }, + + hide : function() { + var t = this, d = t.getDoc(); + + // Fixed bug where IE has a blinking cursor left from the editor + if (isIE && d) + d.execCommand('SelectAll'); + + // We must save before we hide so Safari doesn't crash + t.save(); + DOM.hide(t.getContainer()); + DOM.setStyle(t.id, 'display', t.orgDisplay); + }, + + isHidden : function() { + return !DOM.isHidden(this.id); + }, + + setProgressState : function(b, ti, o) { + this.onSetProgressState.dispatch(this, b, ti, o); + + return b; + }, + + resizeToContent : function() { + var t = this; + + DOM.setStyle(t.id + "_ifr", 'height', t.getBody().scrollHeight); + }, + + load : function(o) { + var t = this, e = t.getElement(), h; + + if (e) { + o = o || {}; + o.load = true; + + h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); + o.element = e; + + if (!o.no_events) + t.onLoadContent.dispatch(t, o); + + o.element = e = null; + + return h; + } + }, + + save : function(o) { + var t = this, e = t.getElement(), h, f; + + if (!e || !t.initialized) + return; + + o = o || {}; + o.save = true; + + // Add undo level will trigger onchange event + if (!o.no_events) { + t.undoManager.typing = 0; + t.undoManager.add(); + } + + o.element = e; + h = o.content = t.getContent(o); + + if (!o.no_events) + t.onSaveContent.dispatch(t, o); + + h = o.content; + + if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { + e.innerHTML = h; + + // Update hidden form element + if (f = DOM.getParent(t.id, 'form')) { + each(f.elements, function(e) { + if (e.name == t.id) { + e.value = h; + return false; + } + }); + } + } else + e.value = h; + + o.element = e = null; + + return h; + }, + + setContent : function(h, o) { + var t = this; + + o = o || {}; + o.format = o.format || 'html'; + o.set = true; + o.content = h; + + if (!o.no_events) + t.onBeforeSetContent.dispatch(t, o); + + // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content + // It will also be impossible to place the caret in the editor unless there is a BR element present + if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) { + o.content = t.dom.setHTML(t.getBody(), '
    '); + o.format = 'raw'; + } + + o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content)); + + if (o.format != 'raw' && t.settings.cleanup) { + o.getInner = true; + o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o)); + } + + if (!o.no_events) + t.onSetContent.dispatch(t, o); + + return o.content; + }, + + getContent : function(o) { + var t = this, h; + + o = o || {}; + o.format = o.format || 'html'; + o.get = true; + + if (!o.no_events) + t.onBeforeGetContent.dispatch(t, o); + + if (o.format != 'raw' && t.settings.cleanup) { + o.getInner = true; + h = t.serializer.serialize(t.getBody(), o); + } else + h = t.getBody().innerHTML; + + h = h.replace(/^\s*|\s*$/g, ''); + o.content = h; + + if (!o.no_events) + t.onGetContent.dispatch(t, o); + + return o.content; + }, + + isDirty : function() { + var t = this; + + return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty; + }, + + getContainer : function() { + var t = this; + + if (!t.container) + t.container = DOM.get(t.editorContainer || t.id + '_parent'); + + return t.container; + }, + + getContentAreaContainer : function() { + return this.contentAreaContainer; + }, + + getElement : function() { + return DOM.get(this.settings.content_element || this.id); + }, + + getWin : function() { + var t = this, e; + + if (!t.contentWindow) { + e = DOM.get(t.id + "_ifr"); + + if (e) + t.contentWindow = e.contentWindow; + } + + return t.contentWindow; + }, + + getDoc : function() { + var t = this, w; + + if (!t.contentDocument) { + w = t.getWin(); + + if (w) + t.contentDocument = w.document; + } + + return t.contentDocument; + }, + + getBody : function() { + return this.bodyElement || this.getDoc().body; + }, + + convertURL : function(u, n, e) { + var t = this, s = t.settings; + + // Use callback instead + if (s.urlconverter_callback) + return t.execCallback('urlconverter_callback', u, e, true, n); + + // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs + if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) + return u; + + // Convert to relative + if (s.relative_urls) + return t.documentBaseURI.toRelative(u); + + // Convert to absolute + u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); + + return u; + }, + + addVisual : function(e) { + var t = this, s = t.settings; + + e = e || t.getBody(); + + if (!is(t.hasVisual)) + t.hasVisual = s.visual; + + each(t.dom.select('table,a', e), function(e) { + var v; + + switch (e.nodeName) { + case 'TABLE': + v = t.dom.getAttrib(e, 'border'); + + if (!v || v == '0') { + if (t.hasVisual) + t.dom.addClass(e, s.visual_table_class); + else + t.dom.removeClass(e, s.visual_table_class); + } + + return; + + case 'A': + v = t.dom.getAttrib(e, 'name'); + + if (v) { + if (t.hasVisual) + t.dom.addClass(e, 'mceItemAnchor'); + else + t.dom.removeClass(e, 'mceItemAnchor'); + } + + return; + } + }); + + t.onVisualAid.dispatch(t, e, t.hasVisual); + }, + + remove : function() { + var t = this, e = t.getContainer(); + + t.removed = 1; // Cancels post remove event execution + t.hide(); + + t.execCallback('remove_instance_callback', t); + t.onRemove.dispatch(t); + + // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command + t.onExecCommand.listeners = []; + + EditorManager.remove(t); + DOM.remove(e); + }, + + destroy : function(s) { + var t = this; + + // One time is enough + if (t.destroyed) + return; + + if (!s) { + tinymce.removeUnload(t.destroy); + tinyMCE.onBeforeUnload.remove(t._beforeUnload); + + // Manual destroy + if (t.theme.destroy) + t.theme.destroy(); + + // Destroy controls, selection and dom + t.controlManager.destroy(); + t.selection.destroy(); + t.dom.destroy(); + + // Remove all events + + // Don't clear the window or document if content editable + // is enabled since other instances might still be present + if (!t.settings.content_editable) { + Event.clear(t.getWin()); + Event.clear(t.getDoc()); + } + + Event.clear(t.getBody()); + Event.clear(t.formElement); + } + + if (t.formElement) { + t.formElement.submit = t.formElement._mceOldSubmit; + t.formElement._mceOldSubmit = null; + } + + t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; + + if (t.selection) + t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; + + t.destroyed = 1; + }, + + // Internal functions + + _addEvents : function() { + // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset + var t = this, i, s = t.settings, lo = { + mouseup : 'onMouseUp', + mousedown : 'onMouseDown', + click : 'onClick', + keyup : 'onKeyUp', + keydown : 'onKeyDown', + keypress : 'onKeyPress', + submit : 'onSubmit', + reset : 'onReset', + contextmenu : 'onContextMenu', + dblclick : 'onDblClick', + paste : 'onPaste' // Doesn't work in all browsers yet + }; + + function eventHandler(e, o) { + var ty = e.type; + + // Don't fire events when it's removed + if (t.removed) + return; + + // Generic event handler + if (t.onEvent.dispatch(t, e, o) !== false) { + // Specific event handler + t[lo[e.fakeType || e.type]].dispatch(t, e, o); + } + }; + + // Add DOM events + each(lo, function(v, k) { + switch (k) { + case 'contextmenu': + if (tinymce.isOpera) { + // Fake contextmenu on Opera + Event.add(t.getBody(), 'mousedown', function(e) { + if (e.ctrlKey) { + e.fakeType = 'contextmenu'; + eventHandler(e); + } + }); + } else + Event.add(t.getBody(), k, eventHandler); + break; + + case 'paste': + Event.add(t.getBody(), k, function(e) { + var tx, h, el, r; + + // Get plain text data + if (e.clipboardData) + tx = e.clipboardData.getData('text/plain'); + else if (tinymce.isIE) + tx = t.getWin().clipboardData.getData('Text'); + + // Get HTML data + /*if (tinymce.isIE) { + el = DOM.add(DOM.doc.body, 'div', {style : 'visibility:hidden;overflow:hidden;position:absolute;width:1px;height:1px'}); + r = DOM.doc.body.createTextRange(); + r.moveToElementText(el); + r.execCommand('Paste'); + h = el.innerHTML; + DOM.remove(el); + }*/ + + eventHandler(e, {text : tx, html : h}); + }); + break; + + case 'submit': + case 'reset': + Event.add(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); + break; + + default: + Event.add(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); + } + }); + + Event.add(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { + t.focus(true); + }); + + + // Fixes bug where a specified document_base_uri could result in broken images + // This will also fix drag drop of images in Gecko + if (tinymce.isGecko) { + // Convert all images to absolute URLs +/* t.onSetContent.add(function(ed, o) { + each(ed.dom.select('img'), function(e) { + var v; + + if (v = e.getAttribute('mce_src')) + e.src = t.documentBaseURI.toAbsolute(v); + }) + });*/ + + Event.add(t.getDoc(), 'DOMNodeInserted', function(e) { + var v; + + e = e.target; + + if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('mce_src'))) + e.src = t.documentBaseURI.toAbsolute(v); + }); + } + + // Set various midas options in Gecko + if (isGecko) { + function setOpts() { + var t = this, d = t.getDoc(), s = t.settings; + + if (isGecko && !s.readonly) { + if (t._isHidden()) { + try { + if (!s.content_editable) + d.designMode = 'On'; + } catch (ex) { + // Fails if it's hidden + } + } + + try { + // Try new Gecko method + d.execCommand("styleWithCSS", 0, false); + } catch (ex) { + // Use old method + if (!t._isHidden()) + try {d.execCommand("useCSS", 0, true);} catch (ex) {} + } + + if (!s.table_inline_editing) + try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} + + if (!s.object_resizing) + try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} + } + }; + + t.onBeforeExecCommand.add(setOpts); + t.onMouseDown.add(setOpts); + } + + // Add node change handlers + t.onMouseUp.add(t.nodeChanged); + t.onClick.add(t.nodeChanged); + t.onKeyUp.add(function(ed, e) { + var c = e.keyCode; + + 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) + t.nodeChanged(); + }); + + // Add reset handler + t.onReset.add(function() { + t.setContent(t.startContent, {format : 'raw'}); + }); + + if (t.getParam('tab_focus')) { + function tabCancel(ed, e) { + if (e.keyCode === 9) + return Event.cancel(e); + }; + + function tabHandler(ed, e) { + var x, i, f, el, v; + + function find(d) { + f = DOM.getParent(ed.id, 'form'); + el = f.elements; + + if (f) { + each(el, function(e, i) { + if (e.id == ed.id) { + x = i; + return false; + } + }); + + if (d > 0) { + for (i = x + 1; i < el.length; i++) { + if (el[i].type != 'hidden') + return el[i]; + } + } else { + for (i = x - 1; i >= 0; i--) { + if (el[i].type != 'hidden') + return el[i]; + } + } + } + + return null; + }; + + if (e.keyCode === 9) { + v = explode(ed.getParam('tab_focus')); + + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') + el = find(-1); + else + el = DOM.get(v[0]); + } else { + if (v[1] == ':next') + el = find(1); + else + el = DOM.get(v[1]); + } + + if (el) { + if (ed = EditorManager.get(el.id || el.name)) + ed.focus(); + else + window.setTimeout(function() {window.focus();el.focus();}, 10); + + return Event.cancel(e); + } + } + }; + + t.onKeyUp.add(tabCancel); + + if (isGecko) { + t.onKeyPress.add(tabHandler); + t.onKeyDown.add(tabCancel); + } else + t.onKeyDown.add(tabHandler); + } + + // Add shortcuts + if (s.custom_shortcuts) { + if (s.custom_undo_redo_keyboard_shortcuts) { + t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); + t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); + } + + // Add default shortcuts for gecko + if (isGecko) { + t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); + t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); + t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); + } + + // BlockFormat shortcuts keys + for (i=1; i<=6; i++) + t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, '']); + + t.addShortcut('ctrl+7', '', ['FormatBlock', false, '

    ']); + t.addShortcut('ctrl+8', '', ['FormatBlock', false, '

    ']); + t.addShortcut('ctrl+9', '', ['FormatBlock', false, '
    ']); + + function find(e) { + var v = null; + + if (!e.altKey && !e.ctrlKey && !e.metaKey) + return v; + + each(t.shortcuts, function(o) { + if (tinymce.isMac && o.ctrl != e.metaKey) + return; + else if (!tinymce.isMac && o.ctrl != e.ctrlKey) + return; + + if (o.alt != e.altKey) + return; + + if (o.shift != e.shiftKey) + return; + + if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { + v = o; + return false; + } + }); + + return v; + }; + + t.onKeyUp.add(function(ed, e) { + var o = find(e); + + if (o) + return Event.cancel(e); + }); + + t.onKeyPress.add(function(ed, e) { + var o = find(e); + + if (o) + return Event.cancel(e); + }); + + t.onKeyDown.add(function(ed, e) { + var o = find(e); + + if (o) { + o.func.call(o.scope); + return Event.cancel(e); + } + }); + } + + if (tinymce.isIE) { + // Fix so resize will only update the width and height attributes not the styles of an image + // It will also block mceItemNoResize items + Event.add(t.getDoc(), 'controlselect', function(e) { + var re = t.resizeInfo, cb; + + e = e.target; + + // Don't do this action for non image elements + if (e.nodeName !== 'IMG') + return; + + if (re) + Event.remove(re.node, re.ev, re.cb); + + if (!t.dom.hasClass(e, 'mceItemNoResize')) { + ev = 'resizeend'; + cb = Event.add(e, ev, function(e) { + var v; + + e = e.target; + + if (v = t.dom.getStyle(e, 'width')) { + t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); + t.dom.setStyle(e, 'width', ''); + } + + if (v = t.dom.getStyle(e, 'height')) { + t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); + t.dom.setStyle(e, 'height', ''); + } + }); + } else { + ev = 'resizestart'; + cb = Event.add(e, 'resizestart', Event.cancel, Event); + } + + re = t.resizeInfo = { + node : e, + ev : ev, + cb : cb + }; + }); + + t.onKeyDown.add(function(ed, e) { + switch (e.keyCode) { + case 8: + // Fix IE control + backspace browser bug + if (t.selection.getRng().item) { + t.selection.getRng().item(0).removeNode(); + return Event.cancel(e); + } + } + }); + } + + if (tinymce.isOpera) { + t.onClick.add(function(ed, e) { + Event.prevent(e); + }); + } + + // Add custom undo/redo handlers + if (s.custom_undo_redo) { + function addUndo() { + t.undoManager.typing = 0; + t.undoManager.add(); + }; + + // Add undo level on editor blur + if (tinymce.isIE) { + Event.add(t.getWin(), 'blur', function(e) { + var n; + + // Check added for fullscreen bug + if (t.selection) { + n = t.selection.getNode(); + + // Add undo level is selection was lost to another document + if (!t.removed && n.ownerDocument && n.ownerDocument != t.getDoc()) + addUndo(); + } + }); + } else { + Event.add(t.getDoc(), 'blur', function() { + if (t.selection && !t.removed) + addUndo(); + }); + } + + t.onMouseDown.add(addUndo); + + t.onKeyUp.add(function(ed, e) { + if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) { + t.undoManager.typing = 0; + t.undoManager.add(); + } + }); + + t.onKeyDown.add(function(ed, e) { + // Is caracter positon keys + if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) { + if (t.undoManager.typing) { + t.undoManager.add(); + t.undoManager.typing = 0; + } + + return; + } + + if (!t.undoManager.typing) { + t.undoManager.add(); + t.undoManager.typing = 1; + } + }); + } + }, + + _convertInlineElements : function() { + var t = this, s = t.settings, dom = t.dom, v, e, na, st, sp; + + function convert(ed, o) { + if (!s.inline_styles) + return; + + if (o.get) { + each(t.dom.select('table,u,strike', o.node), function(n) { + switch (n.nodeName) { + case 'TABLE': + if (v = dom.getAttrib(n, 'height')) { + dom.setStyle(n, 'height', v); + dom.setAttrib(n, 'height', ''); + } + break; + + case 'U': + case 'STRIKE': + //sp = dom.create('span', {style : dom.getAttrib(n, 'style')}); + n.style.textDecoration = n.nodeName == 'U' ? 'underline' : 'line-through'; + dom.setAttrib(n, 'mce_style', ''); + dom.setAttrib(n, 'mce_name', 'span'); + break; + } + }); + } else if (o.set) { + each(t.dom.select('table,span', o.node).reverse(), function(n) { + if (n.nodeName == 'TABLE') { + if (v = dom.getStyle(n, 'height')) + dom.setAttrib(n, 'height', v.replace(/[^0-9%]+/g, '')); + } else { + // Convert spans to elements + if (n.style.textDecoration == 'underline') + na = 'u'; + else if (n.style.textDecoration == 'line-through') + na = 'strike'; + else + na = ''; + + if (na) { + n.style.textDecoration = ''; + dom.setAttrib(n, 'mce_style', ''); + + e = dom.create(na, { + style : dom.getAttrib(n, 'style') + }); + + dom.replace(e, n, 1); + } + } + }); + } + }; + + t.onPreProcess.add(convert); + + if (!s.cleanup_on_startup) { + t.onSetContent.add(function(ed, o) { + if (o.initial) + convert(t, {node : t.getBody(), set : 1}); + }); + } + }, + + _convertFonts : function() { + var t = this, s = t.settings, dom = t.dom, fz, fzn, sl, cl; + + // No need + if (!s.inline_styles) + return; + + // Font pt values and font size names + fz = [8, 10, 12, 14, 18, 24, 36]; + fzn = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; + + if (sl = s.font_size_style_values) + sl = explode(sl); + + if (cl = s.font_size_classes) + cl = explode(cl); + + function process(no) { + var n, sp, nl, x; + + // Keep unit tests happy + if (!s.inline_styles) + return; + + nl = t.dom.select('font', no); + for (x = nl.length - 1; x >= 0; x--) { + n = nl[x]; + + sp = dom.create('span', { + style : dom.getAttrib(n, 'style'), + 'class' : dom.getAttrib(n, 'class') + }); + + dom.setStyles(sp, { + fontFamily : dom.getAttrib(n, 'face'), + color : dom.getAttrib(n, 'color'), + backgroundColor : n.style.backgroundColor + }); + + if (n.size) { + if (sl) + dom.setStyle(sp, 'fontSize', sl[parseInt(n.size) - 1]); + else + dom.setAttrib(sp, 'class', cl[parseInt(n.size) - 1]); + } + + dom.setAttrib(sp, 'mce_style', ''); + dom.replace(sp, n, 1); + } + }; + + // Run on cleanup + t.onPreProcess.add(function(ed, o) { + if (o.get) + process(o.node); + }); + + t.onSetContent.add(function(ed, o) { + if (o.initial) + process(o.node); + }); + }, + + _isHidden : function() { + var s; + + if (!isGecko) + return 0; + + // Weird, wheres that cursor selection? + s = this.selection.getSel(); + return (!s || !s.rangeCount || s.rangeCount == 0); + }, + + // Fix for bug #1867292 + _fixNesting : function(s) { + var d = [], i; + + s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) { + var e; + + // Handle end element + if (b === '/') { + if (!d.length) + return ''; + + if (c !== d[d.length - 1].tag) { + for (i=d.length - 1; i>=0; i--) { + if (d[i].tag === c) { + d[i].close = 1; + break; + } + } + + return ''; + } else { + d.pop(); + + if (d.length && d[d.length - 1].close) { + a = a + ''; + d.pop(); + } + } + } else { + // Ignore these + if (/^(br|hr|input|meta|img|link|param)$/i.test(c)) + return a; + + // Ignore closed ones + if (/\/>$/.test(a)) + return a; + + d.push({tag : c}); // Push start element + } + + return a; + }); + + // End all open tags + for (i=d.length - 1; i>=0; i--) + s += ''; + + return s; + } + + }); +})(); + +/* file:jscripts/tiny_mce/classes/EditorCommands.js */ + +(function() { + var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit; + + function isBlock(n) { + return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n.nodeName); + }; + + tinymce.create('tinymce.EditorCommands', { + EditorCommands : function(ed) { + this.editor = ed; + }, + + execCommand : function(cmd, ui, val) { + var t = this, ed = t.editor, f; + + switch (cmd) { + case 'Cut': + case 'Copy': + case 'Paste': + try { + ed.getDoc().execCommand(cmd, ui, val); + } catch (ex) { + if (isGecko) { + ed.windowManager.confirm(ed.getLang('clipboard_msg'), function(s) { + if (s) + window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal'); + }); + } else + ed.windowManager.alert(ed.getLang('clipboard_no_support')); + } + + return true; + + // Ignore these + case 'mceResetDesignMode': + case 'mceBeginUndoLevel': + return true; + + // Ignore these + case 'unlink': + t.UnLink(); + return true; + + // Bundle these together + case 'JustifyLeft': + case 'JustifyCenter': + case 'JustifyRight': + case 'JustifyFull': + t.mceJustify(cmd, cmd.substring(7).toLowerCase()); + return true; + + case 'mceEndUndoLevel': + case 'mceAddUndoLevel': + ed.undoManager.add(); + return true; + + default: + f = this[cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + } + + return false; + }, + + Indent : function() { + var ed = this.editor, d = ed.dom, s = ed.selection, e, iv, iu; + + // Setup indent level + iv = ed.settings.indentation; + iu = /[a-z%]+$/i.exec(iv); + iv = parseInt(iv); + + if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) { + each(this._getSelectedBlocks(), function(e) { + d.setStyle(e, 'paddingLeft', (parseInt(e.style.paddingLeft || 0) + iv) + iu); + }); + + return; + } + + ed.getDoc().execCommand('Indent', false, null); + + if (isIE) { + d.getParent(s.getNode(), function(n) { + if (n.nodeName == 'BLOCKQUOTE') { + n.dir = n.style.cssText = ''; + } + }); + } + }, + + Outdent : function() { + var ed = this.editor, d = ed.dom, s = ed.selection, e, v, iv, iu; + + // Setup indent level + iv = ed.settings.indentation; + iu = /[a-z%]+$/i.exec(iv); + iv = parseInt(iv); + + if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) { + each(this._getSelectedBlocks(), function(e) { + v = Math.max(0, parseInt(e.style.paddingLeft || 0) - iv); + d.setStyle(e, 'paddingLeft', v ? v + iu : ''); + }); + + return; + } + + ed.getDoc().execCommand('Outdent', false, null); + }, + + mceSetAttribute : function(u, v) { + var ed = this.editor, d = ed.dom, e; + + if (e = d.getParent(ed.selection.getNode(), d.isBlock)) + d.setAttrib(e, v.name, v.value); + }, + + mceSetContent : function(u, v) { + this.editor.setContent(v); + }, + + mceToggleVisualAid : function() { + var ed = this.editor; + + ed.hasVisual = !ed.hasVisual; + ed.addVisual(); + }, + + mceReplaceContent : function(u, v) { + var s = this.editor.selection; + + s.setContent(v.replace(/\{\$selection\}/g, s.getContent({format : 'text'}))); + }, + + mceInsertLink : function(u, v) { + var ed = this.editor, s = ed.selection, e = ed.dom.getParent(s.getNode(), 'A'); + + if (tinymce.is(v, 'string')) + v = {href : v}; + + function set(e) { + each(v, function(v, k) { + ed.dom.setAttrib(e, k, v); + }); + }; + + if (!e) { + ed.execCommand('CreateLink', false, 'javascript:mctmp(0);'); + each(ed.dom.select('a'), function(e) { + if (e.href == 'javascript:mctmp(0);') + set(e); + }); + } else { + if (v.href) + set(e); + else + ed.dom.remove(e, 1); + } + }, + + UnLink : function() { + var ed = this.editor, s = ed.selection; + + if (s.isCollapsed()) + s.select(s.getNode()); + + ed.getDoc().execCommand('unlink', false, null); + s.collapse(0); + }, + + FontName : function(u, v) { + var t = this, ed = t.editor, s = ed.selection, e; + + if (!v) { + if (s.isCollapsed()) + s.select(s.getNode()); + + t.RemoveFormat(); + } else { + if (ed.settings.convert_fonts_to_spans) + t._applyInlineStyle('span', {style : {fontFamily : v}}); + else + ed.getDoc().execCommand('FontName', false, v); + } + }, + + FontSize : function(u, v) { + var ed = this.editor, s = ed.settings, fc, fs; + + // Use style options instead + if (s.convert_fonts_to_spans && v >= 1 && v <= 7) { + fs = tinymce.explode(s.font_size_style_values); + fc = tinymce.explode(s.font_size_classes); + + if (fc) + v = fc[v - 1] || v; + else + v = fs[v - 1] || v; + } + + if (v >= 1 && v <= 7) + ed.getDoc().execCommand('FontSize', false, v); + else + this._applyInlineStyle('span', {style : {fontSize : v}}); + }, + + queryCommandValue : function(c) { + var f = this['queryValue' + c]; + + if (f) + return f.call(this, c); + + return false; + }, + + queryCommandState : function(cmd) { + var f; + + switch (cmd) { + // Bundle these together + case 'JustifyLeft': + case 'JustifyCenter': + case 'JustifyRight': + case 'JustifyFull': + return this.queryStateJustify(cmd, cmd.substring(7).toLowerCase()); + + default: + if (f = this['queryState' + cmd]) + return f.call(this, cmd); + } + + return -1; + }, + + _queryState : function(c) { + try { + return this.editor.getDoc().queryCommandState(c); + } catch (ex) { + // Ignore exception + } + }, + + _queryVal : function(c) { + try { + return this.editor.getDoc().queryCommandValue(c); + } catch (ex) { + // Ignore exception + } + }, + + queryValueFontSize : function() { + var ed = this.editor, v = 0, p; + + if (p = ed.dom.getParent(ed.selection.getNode(), 'SPAN')) + v = p.style.fontSize; + + if (!v && (isOpera || isWebKit)) { + if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT')) + v = p.size; + + return v; + } + + return v || this._queryVal('FontSize'); + }, + + queryValueFontName : function() { + var ed = this.editor, v = 0, p; + + if (p = ed.dom.getParent(ed.selection.getNode(), 'FONT')) + v = p.face; + + if (p = ed.dom.getParent(ed.selection.getNode(), 'SPAN')) + v = p.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); + + if (!v) + v = this._queryVal('FontName'); + + return v; + }, + + mceJustify : function(c, v) { + var ed = this.editor, se = ed.selection, n = se.getNode(), nn = n.nodeName, bl, nb, dom = ed.dom, rm; + + if (ed.settings.inline_styles && this.queryStateJustify(c, v)) + rm = 1; + + bl = dom.getParent(n, ed.dom.isBlock); + + if (nn == 'IMG') { + if (v == 'full') + return; + + if (rm) { + if (v == 'center') + dom.setStyle(bl || n.parentNode, 'textAlign', ''); + + dom.setStyle(n, 'float', ''); + this.mceRepaint(); + return; + } + + if (v == 'center') { + // Do not change table elements + if (bl && /^(TD|TH)$/.test(bl.nodeName)) + bl = 0; + + if (!bl || bl.childNodes.length > 1) { + nb = dom.create('p'); + nb.appendChild(n.cloneNode(false)); + + if (bl) + dom.insertAfter(nb, bl); + else + dom.insertAfter(nb, n); + + dom.remove(n); + n = nb.firstChild; + bl = nb; + } + + dom.setStyle(bl, 'textAlign', v); + dom.setStyle(n, 'float', ''); + } else { + dom.setStyle(n, 'float', v); + dom.setStyle(bl || n.parentNode, 'textAlign', ''); + } + + this.mceRepaint(); + return; + } + + // Handle the alignment outselfs, less quirks in all browsers + if (ed.settings.inline_styles && ed.settings.forced_root_block) { + if (rm) + v = ''; + + each(this._getSelectedBlocks(dom.getParent(se.getStart(), dom.isBlock), dom.getParent(se.getEnd(), dom.isBlock)), function(e) { + dom.setAttrib(e, 'align', ''); + dom.setStyle(e, 'textAlign', v == 'full' ? 'justify' : v); + }); + + return; + } else if (!rm) + ed.getDoc().execCommand(c, false, null); + + if (ed.settings.inline_styles) { + if (rm) { + dom.getParent(ed.selection.getNode(), function(n) { + if (n.style && n.style.textAlign) + dom.setStyle(n, 'textAlign', ''); + }); + + return; + } + + each(dom.select('*'), function(n) { + var v = n.align; + + if (v) { + if (v == 'full') + v = 'justify'; + + dom.setStyle(n, 'textAlign', v); + dom.setAttrib(n, 'align', ''); + } + }); + } + }, + + mceSetCSSClass : function(u, v) { + this.mceSetStyleInfo(0, {command : 'setattrib', name : 'class', value : v}); + }, + + getSelectedElement : function() { + var t = this, ed = t.editor, dom = ed.dom, se = ed.selection, r = se.getRng(), r1, r2, sc, ec, so, eo, e, sp, ep, re; + + if (se.isCollapsed() || r.item) + return se.getNode(); + + // Setup regexp + re = ed.settings.merge_styles_invalid_parents; + if (tinymce.is(re, 'string')) + re = new RegExp(re, 'i'); + + if (isIE) { + r1 = r.duplicate(); + r1.collapse(true); + sc = r1.parentElement(); + + r2 = r.duplicate(); + r2.collapse(false); + ec = r2.parentElement(); + + if (sc != ec) { + r1.move('character', 1); + sc = r1.parentElement(); + } + + if (sc == ec) { + r1 = r.duplicate(); + r1.moveToElementText(sc); + + if (r1.compareEndPoints('StartToStart', r) == 0 && r1.compareEndPoints('EndToEnd', r) == 0) + return re && re.test(sc.nodeName) ? null : sc; + } + } else { + function getParent(n) { + return dom.getParent(n, function(n) {return n.nodeType == 1;}); + }; + + sc = r.startContainer; + ec = r.endContainer; + so = r.startOffset; + eo = r.endOffset; + + if (!r.collapsed) { + if (sc == ec) { + if (so - eo < 2) { + if (sc.hasChildNodes()) { + sp = sc.childNodes[so]; + return re && re.test(sp.nodeName) ? null : sp; + } + } + } + } + + if (sc.nodeType != 3 || ec.nodeType != 3) + return null; + + if (so == 0) { + sp = getParent(sc); + + if (sp && sp.firstChild != sc) + sp = null; + } + + if (so == sc.nodeValue.length) { + e = sc.nextSibling; + + if (e && e.nodeType == 1) + sp = sc.nextSibling; + } + + if (eo == 0) { + e = ec.previousSibling; + + if (e && e.nodeType == 1) + ep = e; + } + + if (eo == ec.nodeValue.length) { + ep = getParent(ec); + + if (ep && ep.lastChild != ec) + ep = null; + } + + // Same element + if (sp == ep) + return re && sp && re.test(sp.nodeName) ? null : sp; + } + + return null; + }, + + InsertHorizontalRule : function() { + // Fix for Gecko
    issue and IE bug rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); + if (isGecko || isIE) + this.editor.selection.setContent('
    '); + else + this.editor.getDoc().execCommand('InsertHorizontalRule', false, ''); + }, + + RemoveFormat : function() { + var t = this, ed = t.editor, s = ed.selection, b; + + // Safari breaks tables + if (isWebKit) + s.setContent(s.getContent({format : 'raw'}).replace(/(<(span|b|i|strong|em|strike) [^>]+>|<(span|b|i|strong|em|strike)>|<\/(span|b|i|strong|em|strike)>|)/g, ''), {format : 'raw'}); + else + ed.getDoc().execCommand('RemoveFormat', false, null); + + t.mceSetStyleInfo(0, {command : 'removeformat'}); + ed.addVisual(); + }, + + mceSetStyleInfo : function(u, v) { + var t = this, ed = t.editor, d = ed.getDoc(), dom = ed.dom, e, b, s = ed.selection, nn = v.wrapper || 'span', b = s.getBookmark(), re; + + function set(n, e) { + if (n.nodeType == 1) { + switch (v.command) { + case 'setattrib': + return dom.setAttrib(n, v.name, v.value); + + case 'setstyle': + return dom.setStyle(n, v.name, v.value); + + case 'removeformat': + return dom.setAttrib(n, 'class', ''); + } + } + }; + + // Setup regexp + re = ed.settings.merge_styles_invalid_parents; + if (tinymce.is(re, 'string')) + re = new RegExp(re, 'i'); + + // Set style info on selected element + if ((e = t.getSelectedElement()) && !ed.settings.force_span_wrappers) + set(e, 1); + else { + // Generate wrappers and set styles on them + d.execCommand('FontName', false, '__'); + each(isWebKit ? dom.select('span') : dom.select('font'), function(n) { + var sp, e; + + if (dom.getAttrib(n, 'face') == '__' || n.style.fontFamily === '__') { + sp = dom.create(nn, {mce_new : '1'}); + + set(sp); + + each (n.childNodes, function(n) { + sp.appendChild(n.cloneNode(true)); + }); + + dom.replace(sp, n); + } + }); + } + + // Remove wrappers inside new ones + each(dom.select(nn).reverse(), function(n) { + var p = n.parentNode; + + // Check if it's an old span in a new wrapper + if (!dom.getAttrib(n, 'mce_new')) { + // Find new wrapper + p = dom.getParent(n, function(n) { + return n.nodeType == 1 && dom.getAttrib(n, 'mce_new'); + }); + + if (p) + dom.remove(n, 1); + } + }); + + // Merge wrappers with parent wrappers + each(dom.select(nn).reverse(), function(n) { + var p = n.parentNode; + + if (!p || !dom.getAttrib(n, 'mce_new')) + return; + + if (ed.settings.force_span_wrappers && p.nodeName != 'SPAN') + return; + + // Has parent of the same type and only child + if (p.nodeName == nn.toUpperCase() && p.childNodes.length == 1) + return dom.remove(p, 1); + + // Has parent that is more suitable to have the class and only child + if (n.nodeType == 1 && (!re || !re.test(p.nodeName)) && p.childNodes.length == 1) { + set(p); // Set style info on parent instead + dom.setAttrib(n, 'class', ''); + } + }); + + // Remove empty wrappers + each(dom.select(nn).reverse(), function(n) { + if (dom.getAttrib(n, 'mce_new') || (dom.getAttribs(n).length <= 1 && n.className === '')) { + if (!dom.getAttrib(n, 'class') && !dom.getAttrib(n, 'style')) + return dom.remove(n, 1); + + dom.setAttrib(n, 'mce_new', ''); // Remove mce_new marker + } + }); + + s.moveToBookmark(b); + }, + + queryStateJustify : function(c, v) { + var ed = this.editor, n = ed.selection.getNode(), dom = ed.dom; + + if (n && n.nodeName == 'IMG') { + if (dom.getStyle(n, 'float') == v) + return 1; + + return n.parentNode.style.textAlign == v; + } + + n = dom.getParent(ed.selection.getStart(), function(n) { + return n.nodeType == 1 && n.style.textAlign; + }); + + if (v == 'full') + v = 'justify'; + + if (ed.settings.inline_styles) + return (n && n.style.textAlign == v); + + return this._queryState(c); + }, + + ForeColor : function(ui, v) { + var ed = this.editor; + + if (ed.settings.convert_fonts_to_spans) { + this._applyInlineStyle('span', {style : {color : v}}); + return; + } else + ed.getDoc().execCommand('ForeColor', false, v); + }, + + HiliteColor : function(ui, val) { + var t = this, ed = t.editor, d = ed.getDoc(); + + if (ed.settings.convert_fonts_to_spans) { + this._applyInlineStyle('span', {style : {backgroundColor : val}}); + return; + } + + function set(s) { + if (!isGecko) + return; + + try { + // Try new Gecko method + d.execCommand("styleWithCSS", 0, s); + } catch (ex) { + // Use old + d.execCommand("useCSS", 0, !s); + } + }; + + if (isGecko || isOpera) { + set(true); + d.execCommand('hilitecolor', false, val); + set(false); + } else + d.execCommand('BackColor', false, val); + }, + + Undo : function() { + var ed = this.editor; + + if (ed.settings.custom_undo_redo) { + ed.undoManager.undo(); + ed.nodeChanged(); + } else + ed.getDoc().execCommand('Undo', false, null); + }, + + Redo : function() { + var ed = this.editor; + + if (ed.settings.custom_undo_redo) { + ed.undoManager.redo(); + ed.nodeChanged(); + } else + ed.getDoc().execCommand('Redo', false, null); + }, + + FormatBlock : function(ui, val) { + var t = this, ed = t.editor, s = ed.selection, dom = ed.dom, bl, nb, b; + + function isBlock(n) { + return /^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName); + }; + + bl = dom.getParent(s.getNode(), function(n) { + return isBlock(n); + }); + + // IE has an issue where it removes the parent div if you change format on the paragrah in

    Content

    + // FF and Opera doesn't change parent DIV elements if you switch format + if (bl) { + if ((isIE && isBlock(bl.parentNode)) || bl.nodeName == 'DIV') { + // Rename block element + nb = ed.dom.create(val); + + each(dom.getAttribs(bl), function(v) { + dom.setAttrib(nb, v.nodeName, dom.getAttrib(bl, v.nodeName)); + }); + + b = s.getBookmark(); + dom.replace(nb, bl, 1); + s.moveToBookmark(b); + ed.nodeChanged(); + return; + } + } + + val = ed.settings.forced_root_block ? (val || '

    ') : val; + + if (val.indexOf('<') == -1) + val = '<' + val + '>'; + + if (tinymce.isGecko) + val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1'); + + ed.getDoc().execCommand('FormatBlock', false, val); + }, + + mceCleanup : function() { + var ed = this.editor, s = ed.selection, b = s.getBookmark(); + ed.setContent(ed.getContent()); + s.moveToBookmark(b); + }, + + mceRemoveNode : function(ui, val) { + var ed = this.editor, s = ed.selection, b, n = val || s.getNode(); + + // Make sure that the body node isn't removed + if (n == ed.getBody()) + return; + + b = s.getBookmark(); + ed.dom.remove(n, 1); + s.moveToBookmark(b); + ed.nodeChanged(); + }, + + mceSelectNodeDepth : function(ui, val) { + var ed = this.editor, s = ed.selection, c = 0; + + ed.dom.getParent(s.getNode(), function(n) { + if (n.nodeType == 1 && c++ == val) { + s.select(n); + ed.nodeChanged(); + return false; + } + }, ed.getBody()); + }, + + mceSelectNode : function(u, v) { + this.editor.selection.select(v); + }, + + mceInsertContent : function(ui, val) { + this.editor.selection.setContent(val); + }, + + mceInsertRawHTML : function(ui, val) { + var ed = this.editor; + + ed.selection.setContent('tiny_mce_marker'); + ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val)); + }, + + mceRepaint : function() { + var s, b, e = this.editor; + + if (tinymce.isGecko) { + try { + s = e.selection; + b = s.getBookmark(true); + + if (s.getSel()) + s.getSel().selectAllChildren(e.getBody()); + + s.collapse(true); + s.moveToBookmark(b); + } catch (ex) { + // Ignore + } + } + }, + + queryStateUnderline : function() { + var ed = this.editor, n = ed.selection.getNode(); + + if (n && n.nodeName == 'A') + return false; + + return this._queryState('Underline'); + }, + + queryStateOutdent : function() { + var ed = this.editor, n; + + if (ed.settings.inline_styles) { + if ((n = ed.dom.getParent(ed.selection.getStart(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) + return true; + + if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) + return true; + } + + return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE')); + }, + + queryStateInsertUnorderedList : function() { + return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL'); + }, + + queryStateInsertOrderedList : function() { + return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL'); + }, + + queryStatemceBlockQuote : function() { + return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';}); + }, + + mceBlockQuote : function() { + var t = this, ed = t.editor, s = ed.selection, dom = ed.dom, sb, eb, n, bm, bq, r, bq2, i, nl; + + function getBQ(e) { + return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';}); + }; + + // Get start/end block + sb = dom.getParent(s.getStart(), isBlock); + eb = dom.getParent(s.getEnd(), isBlock); + + // Remove blockquote(s) + if (bq = getBQ(sb)) { + if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR')) + bm = s.getBookmark(); + + // Move all elements after the end block into new bq + if (getBQ(eb)) { + bq2 = bq.cloneNode(false); + + while (n = eb.nextSibling) + bq2.appendChild(n.parentNode.removeChild(n)); + } + + // Add new bq after + if (bq2) + dom.insertAfter(bq2, bq); + + // Move all selected blocks after the current bq + nl = t._getSelectedBlocks(sb, eb); + for (i = nl.length - 1; i >= 0; i--) { + dom.insertAfter(nl[i], bq); + } + + // Empty bq, then remove it + if (/^\s*$/.test(bq.innerHTML)) + dom.remove(bq, 1); // Keep children so boomark restoration works correctly + + // Empty bq, then remote it + if (bq2 && /^\s*$/.test(bq2.innerHTML)) + dom.remove(bq2, 1); // Keep children so boomark restoration works correctly + + if (!bm) { + // Move caret inside empty block element + if (!isIE) { + r = ed.getDoc().createRange(); + r.setStart(sb, 0); + r.setEnd(sb, 0); + s.setRng(r); + } else { + s.select(sb); + s.collapse(0); + + // IE misses the empty block some times element so we must move back the caret + if (dom.getParent(s.getStart(), isBlock) != sb) { + r = s.getRng(); + r.move('character', -1); + r.select(); + } + } + } else + t.editor.selection.moveToBookmark(bm); + + return; + } + + // Since IE can start with a totally empty document we need to add the first bq and paragraph + if (isIE && !sb && !eb) { + t.editor.getDoc().execCommand('Indent'); + n = getBQ(s.getNode()); + n.style.margin = n.dir = ''; // IE adds margin and dir to bq + return; + } + + if (!sb || !eb) + return; + + // If empty paragraph node then do not use bookmark + if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR')) + bm = s.getBookmark(); + + // Move selected block elements into a bq + each(t._getSelectedBlocks(getBQ(s.getStart()), getBQ(s.getEnd())), function(e) { + // Found existing BQ add to this one + if (e.nodeName == 'BLOCKQUOTE' && !bq) { + bq = e; + return; + } + + // No BQ found, create one + if (!bq) { + bq = dom.create('blockquote'); + e.parentNode.insertBefore(bq, e); + } + + // Add children from existing BQ + if (e.nodeName == 'BLOCKQUOTE' && bq) { + n = e.firstChild; + + while (n) { + bq.appendChild(n.cloneNode(true)); + n = n.nextSibling; + } + + dom.remove(e); + return; + } + + // Add non BQ element to BQ + bq.appendChild(dom.remove(e)); + }); + + if (!bm) { + // Move caret inside empty block element + if (!isIE) { + r = ed.getDoc().createRange(); + r.setStart(sb, 0); + r.setEnd(sb, 0); + s.setRng(r); + } else { + s.select(sb); + s.collapse(1); + } + } else + s.moveToBookmark(bm); + }, + + _applyInlineStyle : function(na, at, op) { + var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh; + + na = na.toUpperCase(); + + if (op && op.check_classes && at['class']) + op.check_classes.push(at['class']); + + function replaceFonts() { + var bm; + + each(dom.select(tinymce.isWebKit && !tinymce.isAir ? 'span' : 'font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') { + if (!bm) + bm = ed.selection.getBookmark(); + + at._mce_new = '1'; + dom.replace(dom.create(na, at), n, 1); + } + }); + + // Remove redundant elements + each(dom.select(na), function(n) { + if (n.getAttribute('_mce_new')) { + function removeStyle(n) { + if (n.nodeType == 1) { + each(at.style, function(v, k) { + dom.setStyle(n, k, ''); + }); + + // Remove spans with the same class or marked classes + if (at['class'] && n.className && op) { + each(op.check_classes, function(c) { + if (dom.hasClass(n, c)) + dom.removeClass(n, c); + }); + } + } + }; + + // Remove specified style information from child elements + each(dom.select(na, n), removeStyle); + + // Remove the specified style information on parent if current node is only child (IE) + if (n.parentNode && n.parentNode.nodeType == 1 && n.parentNode.childNodes.length == 1) + removeStyle(n.parentNode); + + // Remove the child elements style info if a parent already has it + dom.getParent(n.parentNode, function(pn) { + if (pn.nodeType == 1) { + if (at.style) { + each(at.style, function(v, k) { + var sv; + + if (!lo[k] && (sv = dom.getStyle(pn, k))) { + if (sv === v) + dom.setStyle(n, k, ''); + + lo[k] = 1; + } + }); + } + + // Remove spans with the same class or marked classes + if (at['class'] && pn.className && op) { + each(op.check_classes, function(c) { + if (dom.hasClass(pn, c)) + dom.removeClass(n, c); + }); + } + } + + return false; + }); + + n.removeAttribute('_mce_new'); + } + }); + + // Remove empty span elements + each(dom.select(na).reverse(), function(n) { + var c = 0; + + // Check if there is any attributes + each(dom.getAttribs(n), function(an) { + if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') { + //console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName)); + c++; + } + }); + + // No attributes then remove the element and keep the children + if (c == 0) + dom.remove(n, 1); + }); + + ed.selection.moveToBookmark(bm); + + return !!bm; + }; + + // Create inline elements + ed.focus(); + ed.getDoc().execCommand('FontName', false, 'mceinline'); + replaceFonts(); + + if (kh = t._applyInlineStyle.keyhandler) { + ed.onKeyUp.remove(kh); + ed.onKeyPress.remove(kh); + ed.onKeyDown.remove(kh); + ed.onSetContent.remove(t._applyInlineStyle.chandler); + } + + if (ed.selection.isCollapsed()) { + // Start collecting styles + t._pendingStyles = tinymce.extend(t._pendingStyles || {}, at.style); + + t._applyInlineStyle.chandler = ed.onSetContent.add(function() { + delete t._pendingStyles; + }); + + t._applyInlineStyle.keyhandler = kh = function(e) { + // Use pending styles + if (t._pendingStyles) { + at.style = t._pendingStyles; + delete t._pendingStyles; + } + + if (replaceFonts()) { + ed.onKeyDown.remove(t._applyInlineStyle.keyhandler); + ed.onKeyPress.remove(t._applyInlineStyle.keyhandler); + } + + if (e.type == 'keyup') + ed.onKeyUp.remove(t._applyInlineStyle.keyhandler); + }; + + ed.onKeyDown.add(kh); + ed.onKeyPress.add(kh); + ed.onKeyUp.add(kh); + } else + t._pendingStyles = 0; + }, + +/* + _mceBlockQuote : function() { + var t = this, s = t.editor.selection, b = s.getBookmark(), bq, dom = t.editor.dom; + + function findBQ(e) { + return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';}); + }; + + // Remove blockquote(s) + if (findBQ(s.getStart())) { + each(t._getSelectedBlocks(findBQ(s.getStart()), findBQ(s.getEnd())), function(e) { + // Found BQ lets remove it + if (e.nodeName == 'BLOCKQUOTE') + dom.remove(e, 1); + }); + + t.editor.selection.moveToBookmark(b); + return; + } + + each(t._getSelectedBlocks(findBQ(s.getStart()), findBQ(s.getEnd())), function(e) { + var n; + + // Found existing BQ add to this one + if (e.nodeName == 'BLOCKQUOTE' && !bq) { + bq = e; + return; + } + + // No BQ found, create one + if (!bq) { + bq = dom.create('blockquote'); + e.parentNode.insertBefore(bq, e); + } + + // Add children from existing BQ + if (e.nodeName == 'BLOCKQUOTE' && bq) { + n = e.firstChild; + + while (n) { + bq.appendChild(n.cloneNode(true)); + n = n.nextSibling; + } + + dom.remove(e); + + return; + } + + // Add non BQ element to BQ + bq.appendChild(dom.remove(e)); + }); + + t.editor.selection.moveToBookmark(b); + }, +*/ + _getSelectedBlocks : function(st, en) { + var ed = this.editor, dom = ed.dom, s = ed.selection, sb, eb, n, bl = []; + + sb = dom.getParent(st || s.getStart(), isBlock); + eb = dom.getParent(en || s.getEnd(), isBlock); + + if (sb) + bl.push(sb); + + if (sb && eb && sb != eb) { + n = sb; + + while ((n = n.nextSibling) && n != eb) { + if (isBlock(n)) + bl.push(n); + } + } + + if (eb && sb != eb) + bl.push(eb); + + return bl; + } + }); +})(); + + +/* file:jscripts/tiny_mce/classes/UndoManager.js */ + +tinymce.create('tinymce.UndoManager', { + index : 0, + data : null, + typing : 0, + + UndoManager : function(ed) { + var t = this, Dispatcher = tinymce.util.Dispatcher; + + t.editor = ed; + t.data = []; + t.onAdd = new Dispatcher(this); + t.onUndo = new Dispatcher(this); + t.onRedo = new Dispatcher(this); + }, + + add : function(l) { + var t = this, i, ed = t.editor, b, s = ed.settings, la; + + l = l || {}; + l.content = l.content || ed.getContent({format : 'raw', no_events : 1}); + + // Add undo level if needed + l.content = l.content.replace(/^\s*|\s*$/g, ''); + la = t.data[t.index > 0 && (t.index == 0 || t.index == t.data.length) ? t.index - 1 : t.index]; + if (!l.initial && la && l.content == la.content) + return null; + + // Time to compress + if (s.custom_undo_redo_levels) { + if (t.data.length > s.custom_undo_redo_levels) { + for (i = 0; i < t.data.length - 1; i++) + t.data[i] = t.data[i + 1]; + + t.data.length--; + t.index = t.data.length; + } + } + + if (s.custom_undo_redo_restore_selection && !l.initial) + l.bookmark = b = l.bookmark || ed.selection.getBookmark(); + + if (t.index < t.data.length) + t.index++; + + // Only initial marked undo levels should be allowed as first item + // This to workaround a bug with Firefox and the blur event + if (t.data.length === 0 && !l.initial) + return null; + + // Add level + t.data.length = t.index + 1; + t.data[t.index++] = l; + + if (l.initial) + t.index = 0; + + // Set initial bookmark use first real undo level + if (t.data.length == 2 && t.data[0].initial) + t.data[0].bookmark = b; + + t.onAdd.dispatch(t, l); + ed.isNotDirty = 0; + + //console.dir(t.data); + + return l; + }, + + undo : function() { + var t = this, ed = t.editor, l = l, i; + + if (t.typing) { + t.add(); + t.typing = 0; + } + + if (t.index > 0) { + // If undo on last index then take snapshot + if (t.index == t.data.length && t.index > 1) { + i = t.index; + t.typing = 0; + + if (!t.add()) + t.index = i; + + --t.index; + } + + l = t.data[--t.index]; + ed.setContent(l.content, {format : 'raw'}); + ed.selection.moveToBookmark(l.bookmark); + + t.onUndo.dispatch(t, l); + } + + return l; + }, + + redo : function() { + var t = this, ed = t.editor, l = null; + + if (t.index < t.data.length - 1) { + l = t.data[++t.index]; + ed.setContent(l.content, {format : 'raw'}); + ed.selection.moveToBookmark(l.bookmark); + + t.onRedo.dispatch(t, l); + } + + return l; + }, + + clear : function() { + var t = this; + + t.data = []; + t.index = 0; + t.typing = 0; + t.add({initial : true}); + }, + + hasUndo : function() { + return this.index != 0 || this.typing; + }, + + hasRedo : function() { + return this.index < this.data.length - 1; + } + + }); +/* file:jscripts/tiny_mce/classes/ForceBlocks.js */ + +(function() { + // Shorten names + var Event, isIE, isGecko, isOpera, each, extend; + + Event = tinymce.dom.Event; + isIE = tinymce.isIE; + isGecko = tinymce.isGecko; + isOpera = tinymce.isOpera; + each = tinymce.each; + extend = tinymce.extend; + + tinymce.create('tinymce.ForceBlocks', { + ForceBlocks : function(ed) { + var t = this, s = ed.settings, elm; + + t.editor = ed; + t.dom = ed.dom; + elm = (s.forced_root_block || 'p').toLowerCase(); + s.element = elm.toUpperCase(); + + ed.onPreInit.add(t.setup, t); + + t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi'); + t.rePadd = new RegExp(']+)><\\\/p>|]+)\\\/>|]+)>\\s+<\\\/p>|

    <\\\/p>||

    \\s+<\\\/p>'.replace(/p/g, elm), 'gi'); + t.reNbsp2BR1 = new RegExp(']+)>[\\s\\u00a0]+<\\\/p>|

    [\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi'); + t.reNbsp2BR2 = new RegExp(']+)>( | )<\\\/p>|

    ( | )<\\\/p>'.replace(/p/g, elm), 'gi'); + t.reBR2Nbsp = new RegExp(']+)>\\s*
    \\s*<\\\/p>|

    \\s*
    \\s*<\\\/p>'.replace(/p/g, elm), 'gi'); + t.reTrailBr = new RegExp('\\s*
    \\s*<\\\/p>'.replace(/p/g, elm), 'gi'); + + function padd(ed, o) { + if (isOpera) + o.content = o.content.replace(t.reOpera, ''); + + o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0'); + + if (!isIE && !isOpera && o.set) { + // Use   instead of BR in padded paragraphs + o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2>
    '); + o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2>
    '); + } else { + o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0'); + o.content = o.content.replace(t.reTrailBr, ''); + } + }; + + ed.onBeforeSetContent.add(padd); + ed.onPostProcess.add(padd); + + if (s.forced_root_block) { + ed.onInit.add(t.forceRoots, t); + ed.onSetContent.add(t.forceRoots, t); + ed.onBeforeGetContent.add(t.forceRoots, t); + } + }, + + setup : function() { + var t = this, ed = t.editor, s = ed.settings; + + // Force root blocks when typing and when getting output + if (s.forced_root_block) { + ed.onKeyUp.add(t.forceRoots, t); + ed.onPreProcess.add(t.forceRoots, t); + } + + if (s.force_br_newlines) { + // Force IE to produce BRs on enter + if (isIE) { + ed.onKeyPress.add(function(ed, e) { + var n, s = ed.selection; + + if (e.keyCode == 13 && s.getNode().nodeName != 'LI') { + s.setContent('
    ', {format : 'raw'}); + n = ed.dom.get('__'); + n.removeAttribute('id'); + s.select(n); + s.collapse(); + return Event.cancel(e); + } + }); + } + + return; + } + + if (!isIE && s.force_p_newlines) { +/* ed.onPreProcess.add(function(ed, o) { + each(ed.dom.select('br', o.node), function(n) { + var p = n.parentNode; + + // Replace


    with

     

    + if (p && p.nodeName == 'p' && (p.childNodes.length == 1 || p.lastChild == n)) { + p.replaceChild(ed.getDoc().createTextNode('\u00a0'), n); + } + }); + });*/ + + ed.onKeyPress.add(function(ed, e) { + if (e.keyCode == 13 && !e.shiftKey) { + if (!t.insertPara(e)) + Event.cancel(e); + } + }); + + if (isGecko) { + ed.onKeyDown.add(function(ed, e) { + if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) + t.backspaceDelete(e, e.keyCode == 8); + }); + } + } + + function ren(rn, na) { + var ne = ed.dom.create(na); + + each(rn.attributes, function(a) { + if (a.specified && a.nodeValue) + ne.setAttribute(a.nodeName.toLowerCase(), a.nodeValue); + }); + + each(rn.childNodes, function(n) { + ne.appendChild(n.cloneNode(true)); + }); + + rn.parentNode.replaceChild(ne, rn); + + return ne; + }; + + // Replaces IE:s auto generated paragraphs with the specified element name + if (isIE && s.element != 'P') { + ed.onKeyPress.add(function(ed, e) { + t.lastElm = ed.selection.getNode().nodeName; + }); + + ed.onKeyUp.add(function(ed, e) { + var bl, sel = ed.selection, n = sel.getNode(), b = ed.getBody(); + + if (b.childNodes.length === 1 && n.nodeName == 'P') { + n = ren(n, s.element); + sel.select(n); + sel.collapse(); + ed.nodeChanged(); + } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { + bl = ed.dom.getParent(n, 'P'); + + if (bl) { + ren(bl, s.element); + ed.nodeChanged(); + } + } + }); + } + }, + + find : function(n, t, s) { + var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, false), c = -1; + + while (n = w.nextNode()) { + c++; + + // Index by node + if (t == 0 && n == s) + return c; + + // Node by index + if (t == 1 && c == s) + return n; + } + + return -1; + }, + + forceRoots : function(ed, e) { + 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; + var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid; + + // Fix for bug #1863847 + //if (e && e.keyCode == 13) + // return true; + + // Wrap non blocks into blocks + for (i = nl.length - 1; i >= 0; i--) { + nx = nl[i]; + + // Is text or non block element + if (nx.nodeType == 3 || (!t.dom.isBlock(nx) && nx.nodeType != 8)) { + if (!bl) { + // Create new block but ignore whitespace + if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) { + // Store selection + if (si == -2 && r) { + if (!isIE) { + // If selection is element then mark it + if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) { + // Save the id of the selected element + eid = n.getAttribute("id"); + n.setAttribute("id", "__mce"); + } else { + // If element is inside body, might not be the case in contentEdiable mode + if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) { + so = r.startOffset; + eo = r.endOffset; + si = t.find(b, 0, r.startContainer); + ei = t.find(b, 0, r.endContainer); + } + } + } else { + tr = d.body.createTextRange(); + tr.moveToElementText(b); + tr.collapse(1); + bp = tr.move('character', c) * -1; + + tr = r.duplicate(); + tr.collapse(1); + sp = tr.move('character', c) * -1; + + tr = r.duplicate(); + tr.collapse(0); + le = (tr.move('character', c) * -1) - sp; + + si = sp - bp; + ei = le; + } + } + + bl = ed.dom.create(ed.settings.forced_root_block); + bl.appendChild(nx.cloneNode(1)); + nx.parentNode.replaceChild(bl, nx); + } + } else { + if (bl.hasChildNodes()) + bl.insertBefore(nx, bl.firstChild); + else + bl.appendChild(nx); + } + } else + bl = null; // Time to create new block + } + + // Restore selection + if (si != -2) { + if (!isIE) { + bl = b.getElementsByTagName(ed.settings.element)[0]; + r = d.createRange(); + + // Select last location or generated block + if (si != -1) + r.setStart(t.find(b, 1, si), so); + else + r.setStart(bl, 0); + + // Select last location or generated block + if (ei != -1) + r.setEnd(t.find(b, 1, ei), eo); + else + r.setEnd(bl, 0); + + if (s) { + s.removeAllRanges(); + s.addRange(r); + } + } else { + try { + r = s.createRange(); + r.moveToElementText(b); + r.collapse(1); + r.moveStart('character', si); + r.moveEnd('character', ei); + r.select(); + } catch (ex) { + // Ignore + } + } + } else if (!isIE && (n = ed.dom.get('__mce'))) { + // Restore the id of the selected element + if (eid) + n.setAttribute('id', eid); + else + n.removeAttribute('id'); + + // Move caret before selected element + r = d.createRange(); + r.setStartBefore(n); + r.setEndBefore(n); + se.setRng(r); + } + }, + + getParentBlock : function(n) { + var d = this.dom; + + return d.getParent(n, d.isBlock); + }, + + insertPara : function(e) { + 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; + var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; + + function isEmpty(n) { + n = n.innerHTML; + n = n.replace(/<(img|hr|table)/gi, '-'); // Keep these convert them to - chars + n = n.replace(/<[^>]+>/g, ''); // Remove all tags + + return n.replace(/[ \t\r\n]+/g, '') == ''; + }; + + // If root blocks are forced then use Operas default behavior since it's really good +// Removed due to bug: #1853816 +// if (se.forced_root_block && isOpera) +// return true; + + // Setup before range + rb = d.createRange(); + + // If is before the first block element and in body, then move it into first block element + rb.setStart(s.anchorNode, s.anchorOffset); + rb.collapse(true); + + // Setup after range + ra = d.createRange(); + + // If is before the first block element and in body, then move it into first block element + ra.setStart(s.focusNode, s.focusOffset); + ra.collapse(true); + + // Setup start/end points + dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; + sn = dir ? s.anchorNode : s.focusNode; + so = dir ? s.anchorOffset : s.focusOffset; + en = dir ? s.focusNode : s.anchorNode; + eo = dir ? s.focusOffset : s.anchorOffset; + + // If selection is in empty table cell + if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { + dom.remove(sn.firstChild); // Remove BR + + // Create two new block elements + ed.dom.add(sn, se.element, null, '
    '); + aft = ed.dom.add(sn, se.element, null, '
    '); + + // Move caret into the last one + r = d.createRange(); + r.selectNodeContents(aft); + r.collapse(1); + ed.selection.setRng(r); + + return false; + } + + // If the caret is in an invalid location in FF we need to move it into the first block + if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { + sn = en = sn.firstChild; + so = eo = 0; + rb = d.createRange(); + rb.setStart(sn, 0); + ra = d.createRange(); + ra.setStart(en, 0); + } + + // Never use body as start or end node + sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes + sn = sn.nodeName == "BODY" ? sn.firstChild : sn; + en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes + en = en.nodeName == "BODY" ? en.firstChild : en; + + // Get start and end blocks + sb = t.getParentBlock(sn); + eb = t.getParentBlock(en); + bn = sb ? sb.nodeName : se.element; // Get block name to create + + // Return inside list use default browser behavior + if (t.dom.getParent(sb, function(n) { return /OL|UL|PRE/.test(n.nodeName); })) + return true; + + // If caption or absolute layers then always generate new blocks within + if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(sb.style.position))) { + bn = se.element; + sb = null; + } + + // If caption or absolute layers then always generate new blocks within + if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|static/gi.test(eb.style.position))) { + bn = se.element; + eb = null; + } + + // Use P instead + if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(sb.style.cssFloat))) { + bn = se.element; + sb = eb = null; + } + + // Setup new before and after blocks + bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); + aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); + + // Remove id from after clone + aft.removeAttribute('id'); + + // Is header and cursor is at the end, then force paragraph under + if (/^(H[1-6])$/.test(bn) && sn.nodeValue && so == sn.nodeValue.length) + aft = ed.dom.create(se.element); + + // Find start chop node + n = sc = sn; + do { + if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) + break; + + sc = n; + } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); + + // Find end chop node + n = ec = en; + do { + if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) + break; + + ec = n; + } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); + + // Place first chop part into before block element + if (sc.nodeName == bn) + rb.setStart(sc, 0); + else + rb.setStartBefore(sc); + + rb.setEnd(sn, so); + bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari + + // Place secnd chop part within new block element + try { + ra.setEndAfter(ec); + } catch(ex) { + //console.debug(s.focusNode, s.focusOffset); + } + + ra.setStart(en, eo); + aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari + + // Create range around everything + r = d.createRange(); + if (!sc.previousSibling && sc.parentNode.nodeName == bn) { + r.setStartBefore(sc.parentNode); + } else { + if (rb.startContainer.nodeName == bn && rb.startOffset == 0) + r.setStartBefore(rb.startContainer); + else + r.setStart(rb.startContainer, rb.startOffset); + } + + if (!ec.nextSibling && ec.parentNode.nodeName == bn) + r.setEndAfter(ec.parentNode); + else + r.setEnd(ra.endContainer, ra.endOffset); + + // Delete and replace it with new block elements + r.deleteContents(); + + if (isOpera) + ed.getWin().scrollTo(0, vp.y); + + // Never wrap blocks in blocks + if (bef.firstChild && bef.firstChild.nodeName == bn) + bef.innerHTML = bef.firstChild.innerHTML; + + if (aft.firstChild && aft.firstChild.nodeName == bn) + aft.innerHTML = aft.firstChild.innerHTML; + + // Padd empty blocks + if (isEmpty(bef)) + bef.innerHTML = '
    '; + + function appendStyles(e, en) { + var nl = [], nn, n, i; + + e.innerHTML = ''; + + // Make clones of style elements + if (se.keep_styles) { + n = en; + do { + // We only want style specific elements + if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { + nn = n.cloneNode(false); + dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique + nl.push(nn); + } + } while (n = n.parentNode); + } + + // Append style elements to aft + if (nl.length > 0) { + for (i = nl.length - 1, nn = e; i >= 0; i--) + nn = nn.appendChild(nl[i]); + + // Padd most inner style element + nl[0].innerHTML = isOpera ? ' ' : '
    '; // Extra space for Opera so that the caret can move there + return nl[0]; // Move caret to most inner element + } else + e.innerHTML = isOpera ? ' ' : '
    '; // Extra space for Opera so that the caret can move there + }; + + // Fill empty afterblook with current style + if (isEmpty(aft)) + car = appendStyles(aft, en); + + // Opera needs this one backwards for older versions + if (isOpera && parseFloat(opera.version()) < 9.5) { + r.insertNode(bef); + r.insertNode(aft); + } else { + r.insertNode(aft); + r.insertNode(bef); + } + + // Normalize + aft.normalize(); + bef.normalize(); + + function first(n) { + return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() || n; + }; + + // Move cursor and scroll into view + r = d.createRange(); + r.selectNodeContents(isGecko ? first(car || aft) : car || aft); + r.collapse(1); + s.removeAllRanges(); + s.addRange(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 + y = ed.dom.getPos(aft).y; + ch = aft.clientHeight; + + // Is element within viewport + if (y < vp.y || y + ch > vp.y + vp.h) { + 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 + //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)); + } + + return false; + }, + + backspaceDelete : function(e, bs) { + var t = this, ed = t.editor, b = ed.getBody(), n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn; + + // The caret sometimes gets stuck in Gecko if you delete empty paragraphs + // This workaround removes the element by hand and moves the caret to the previous element + if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { + if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { + // Find previous block element + n = sc; + while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; + + if (n) { + if (sc != b.firstChild) { + // Find last text node + w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + while (tn = w.nextNode()) + n = tn; + + // Place caret at the end of last text node + r = ed.getDoc().createRange(); + r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); + r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); + se.setRng(r); + + // Remove the target container + ed.dom.remove(sc); + } + + return Event.cancel(e); + } + } + } + + // Gecko generates BR elements here and there, we don't like those so lets remove them + function handler(e) { + var pr; + + e = e.target; + + // A new BR was created in a block element, remove it + if (e && e.parentNode && e.nodeName == 'BR' && (n = t.getParentBlock(e))) { + pr = e.previousSibling; + + Event.remove(b, 'DOMNodeInserted', handler); + + // Is there whitespace at the end of the node before then we might need the pesky BR + // to place the caret at a correct location see bug: #2013943 + if (pr && pr.nodeType == 3 && /\s+$/.test(pr.nodeValue)) + return; + + // Only remove BR elements that got inserted in the middle of the text + if (e.previousSibling || e.nextSibling) + ed.dom.remove(e); + } + }; + + // Listen for new nodes + Event._add(b, 'DOMNodeInserted', handler); + + // Remove listener + window.setTimeout(function() { + Event._remove(b, 'DOMNodeInserted', handler); + }, 1); + } + }); +})(); + +/* file:jscripts/tiny_mce/classes/ControlManager.js */ + +(function() { + // Shorten names + var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; + + tinymce.create('tinymce.ControlManager', { + ControlManager : function(ed, s) { + var t = this, i; + + s = s || {}; + t.editor = ed; + t.controls = {}; + t.onAdd = new tinymce.util.Dispatcher(t); + t.onPostRender = new tinymce.util.Dispatcher(t); + t.prefix = s.prefix || ed.id + '_'; + t._cls = {}; + + t.onPostRender.add(function() { + each(t.controls, function(c) { + c.postRender(); + }); + }); + }, + + get : function(id) { + return this.controls[this.prefix + id] || this.controls[id]; + }, + + setActive : function(id, s) { + var c = null; + + if (c = this.get(id)) + c.setActive(s); + + return c; + }, + + setDisabled : function(id, s) { + var c = null; + + if (c = this.get(id)) + c.setDisabled(s); + + return c; + }, + + add : function(c) { + var t = this; + + if (c) { + t.controls[c.id] = c; + t.onAdd.dispatch(c, t); + } + + return c; + }, + + createControl : function(n) { + var c, t = this, ed = t.editor; + + each(ed.plugins, function(p) { + if (p.createControl) { + c = p.createControl(n, t); + + if (c) + return false; + } + }); + + switch (n) { + case "|": + case "separator": + return t.createSeparator(); + } + + if (!c && ed.buttons && (c = ed.buttons[n])) + return t.createButton(n, c); + + return t.add(c); + }, + + createDropMenu : function(id, s, cc) { + var t = this, ed = t.editor, c, bm, v, cls; + + s = extend({ + 'class' : 'mceDropDown', + constrain : ed.settings.constrain_menus + }, s); + + s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; + if (v = ed.getParam('skin_variant')) + s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); + + id = t.prefix + id; + cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; + c = t.controls[id] = new cls(id, s); + c.onAddItem.add(function(c, o) { + var s = o.settings; + + s.title = ed.getLang(s.title, s.title); + + if (!s.onclick) { + s.onclick = function(v) { + ed.execCommand(s.cmd, s.ui || false, s.value); + }; + } + }); + + ed.onRemove.add(function() { + c.destroy(); + }); + + // Fix for bug #1897785, #1898007 + if (tinymce.isIE) { + c.onShowMenu.add(function() { + bm = ed.selection.getBookmark(1); + }); + + c.onHideMenu.add(function() { + if (bm) + ed.selection.moveToBookmark(bm); + }); + } + + return t.add(c); + }, + + createListBox : function(id, s, cc) { + var t = this, ed = t.editor, cmd, c, cls; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.scope = s.scope || ed; + + if (!s.onselect) { + s.onselect = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + scope : s.scope, + control_manager : t + }, s); + + id = t.prefix + id; + + if (ed.settings.use_native_selects) + c = new tinymce.ui.NativeListBox(id, s); + else { + cls = cc || t._cls.listbox || tinymce.ui.ListBox; + c = new cls(id, s); + } + + t.controls[id] = c; + + // Fix focus problem in Safari + if (tinymce.isWebKit) { + c.onPostRender.add(function(c, n) { + // Store bookmark on mousedown + Event.add(n, 'mousedown', function() { + ed.bookmark = ed.selection.getBookmark('simple'); + }); + + // Restore on focus, since it might be lost + Event.add(n, 'focus', function() { + ed.selection.moveToBookmark(ed.bookmark); + ed.bookmark = null; + }); + }); + } + + if (c.hideMenu) + ed.onMouseDown.add(c.hideMenu, c); + + return t.add(c); + }, + + createButton : function(id, s, cc) { + var t = this, ed = t.editor, o, c, cls; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.label = ed.translate(s.label); + s.scope = s.scope || ed; + + if (!s.onclick && !s.menu_button) { + s.onclick = function() { + ed.execCommand(s.cmd, s.ui || false, s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + unavailable_prefix : ed.getLang('unavailable', ''), + scope : s.scope, + control_manager : t + }, s); + + id = t.prefix + id; + + if (s.menu_button) { + cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; + c = new cls(id, s); + ed.onMouseDown.add(c.hideMenu, c); + } else { + cls = t._cls.button || tinymce.ui.Button; + c = new cls(id, s); + } + + return t.add(c); + }, + + createMenuButton : function(id, s, cc) { + s = s || {}; + s.menu_button = 1; + + return this.createButton(id, s, cc); + }, + + createSplitButton : function(id, s, cc) { + var t = this, ed = t.editor, cmd, c, cls; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.scope = s.scope || ed; + + if (!s.onclick) { + s.onclick = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + if (!s.onselect) { + s.onselect = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + scope : s.scope, + control_manager : t + }, s); + + id = t.prefix + id; + cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; + c = t.add(new cls(id, s)); + ed.onMouseDown.add(c.hideMenu, c); + + return c; + }, + + createColorSplitButton : function(id, s, cc) { + var t = this, ed = t.editor, cmd, c, cls, bm; + + if (t.get(id)) + return null; + + s.title = ed.translate(s.title); + s.scope = s.scope || ed; + + if (!s.onclick) { + s.onclick = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + if (!s.onselect) { + s.onselect = function(v) { + ed.execCommand(s.cmd, s.ui || false, v || s.value); + }; + } + + s = extend({ + title : s.title, + 'class' : 'mce_' + id, + 'menu_class' : ed.getParam('skin') + 'Skin', + scope : s.scope, + more_colors_title : ed.getLang('more_colors') + }, s); + + id = t.prefix + id; + cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; + c = new cls(id, s); + ed.onMouseDown.add(c.hideMenu, c); + + // Remove the menu element when the editor is removed + ed.onRemove.add(function() { + c.destroy(); + }); + + // Fix for bug #1897785, #1898007 + if (tinymce.isIE) { + c.onShowMenu.add(function() { + bm = ed.selection.getBookmark(1); + }); + + c.onHideMenu.add(function() { + if (bm) { + ed.selection.moveToBookmark(bm); + bm = 0; + } + }); + } + + return t.add(c); + }, + + createToolbar : function(id, s, cc) { + var c, t = this, cls; + + id = t.prefix + id; + cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; + c = new cls(id, s); + + if (t.get(id)) + return null; + + return t.add(c); + }, + + createSeparator : function(cc) { + var cls = cc || this._cls.separator || tinymce.ui.Separator; + + return new cls(); + }, + + setControlType : function(n, c) { + return this._cls[n.toLowerCase()] = c; + }, + + destroy : function() { + each(this.controls, function(c) { + c.destroy(); + }); + + this.controls = null; + } + + }); +})(); + +/* file:jscripts/tiny_mce/classes/WindowManager.js */ + +(function() { + var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; + + tinymce.create('tinymce.WindowManager', { + WindowManager : function(ed) { + var t = this; + + t.editor = ed; + t.onOpen = new Dispatcher(t); + t.onClose = new Dispatcher(t); + t.params = {}; + t.features = {}; + }, + + open : function(s, p) { + var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; + + // Default some options + s = s || {}; + p = p || {}; + sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window + sh = isOpera ? vp.h : screen.height; + s.name = s.name || 'mc_' + new Date().getTime(); + s.width = parseInt(s.width || 320); + s.height = parseInt(s.height || 240); + s.resizable = true; + s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); + s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); + p.inline = false; + p.mce_width = s.width; + p.mce_height = s.height; + p.mce_auto_focus = s.auto_focus; + + if (mo) { + if (isIE) { + s.center = true; + s.help = false; + s.dialogWidth = s.width + 'px'; + s.dialogHeight = s.height + 'px'; + s.scroll = s.scrollbars || false; + } + } + + // Build features string + each(s, function(v, k) { + if (tinymce.is(v, 'boolean')) + v = v ? 'yes' : 'no'; + + if (!/^(name|url)$/.test(k)) { + if (isIE && mo) + f += (f ? ';' : '') + k + ':' + v; + else + f += (f ? ',' : '') + k + '=' + v; + } + }); + + t.features = s; + t.params = p; + t.onOpen.dispatch(t, s, p); + + u = s.url || s.file; + if (tinymce.relaxedDomain) + u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; + + u = tinymce._addVer(u); + + try { + if (isIE && mo) { + w = 1; + window.showModalDialog(u, window, f); + } else + w = window.open(u, s.name, f); + } catch (ex) { + // Ignore + } + + if (!w) + alert(t.editor.getLang('popup_blocked')); + }, + + close : function(w) { + w.close(); + this.onClose.dispatch(this); + }, + + createInstance : function(cl, a, b, c, d, e) { + var f = tinymce.resolve(cl); + + return new f(a, b, c, d, e); + }, + + confirm : function(t, cb, s, w) { + w = w || window; + + cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); + }, + + alert : function(tx, cb, s, w) { + var t = this; + + w = w || window; + w.alert(t._decode(t.editor.getLang(tx, tx))); + + if (cb) + cb.call(s || t); + }, + + // Internal functions + + _decode : function(s) { + return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); + } + + }); +}()); \ No newline at end of file diff --git a/thirdparty/tiny/utils/.svn/all-wcprops b/thirdparty/tiny/utils/.svn/all-wcprops new file mode 100644 index 0000000..1dead6e --- /dev/null +++ b/thirdparty/tiny/utils/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 45 +/astat/!svn/ver/1/trunk/thirdparty/tiny/utils +END +mctabs.js +K 25 +svn:wc:ra_dav:version-url +V 55 +/astat/!svn/ver/1/trunk/thirdparty/tiny/utils/mctabs.js +END +validate.js +K 25 +svn:wc:ra_dav:version-url +V 57 +/astat/!svn/ver/1/trunk/thirdparty/tiny/utils/validate.js +END +editable_selects.js +K 25 +svn:wc:ra_dav:version-url +V 65 +/astat/!svn/ver/1/trunk/thirdparty/tiny/utils/editable_selects.js +END +form_utils.js +K 25 +svn:wc:ra_dav:version-url +V 59 +/astat/!svn/ver/1/trunk/thirdparty/tiny/utils/form_utils.js +END diff --git a/thirdparty/tiny/utils/.svn/entries b/thirdparty/tiny/utils/.svn/entries new file mode 100644 index 0000000..f07846c --- /dev/null +++ b/thirdparty/tiny/utils/.svn/entries @@ -0,0 +1,164 @@ +9 + +dir +34 +http://svn.astat.org/astat/trunk/thirdparty/tiny/utils +http://svn.astat.org/astat + + + +2009-06-07T19:12:55.973801Z +1 +genuineparts + + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +bb7ccd2a-c66b-0410-9765-967ca6f03dfc + +mctabs.js +file + + + + +2009-06-08T19:44:26.000000Z +faadc70e7762379eb111fa537bf4b79f +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +1862 + +validate.js +file + + + + +2009-06-08T19:44:26.000000Z +a1ce8fb2ac6f2f53f0410b72ce73f08e +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +4983 + +editable_selects.js +file + + + + +2009-06-08T19:44:26.000000Z +367ff3edc51df6a60432de597e04113d +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +2008 + +form_utils.js +file + + + + +2009-06-08T19:44:26.000000Z +3b6bb58102e2c27366701f804dde0ac3 +2009-06-07T19:12:55.973801Z +1 +genuineparts + + + + + + + + + + + + + + + + + + + + + +5461 + diff --git a/thirdparty/tiny/utils/.svn/format b/thirdparty/tiny/utils/.svn/format new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/thirdparty/tiny/utils/.svn/format @@ -0,0 +1 @@ +9 diff --git a/thirdparty/tiny/utils/.svn/text-base/editable_selects.js.svn-base b/thirdparty/tiny/utils/.svn/text-base/editable_selects.js.svn-base new file mode 100644 index 0000000..c1bfa73 --- /dev/null +++ b/thirdparty/tiny/utils/.svn/text-base/editable_selects.js.svn-base @@ -0,0 +1,69 @@ +/** + * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $ + * + * Makes select boxes editable. + * + * @author Moxiecode + * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +var TinyMCE_EditableSelects = { + editSelectElm : null, + + init : function() { + var nl = document.getElementsByTagName("select"), i, d = document, o; + + for (i=0; i'; + h += ''; + + return h; +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) + lnk.setAttribute("href", lnk.getAttribute("realhref")); + + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback", cb, html; + + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + + if (!cb) + return ""; + + html = ""; + html += ''; + html += ''; + + return html; +} + +function openBrowser(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i'; + h += ''; + + return h; +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) + lnk.setAttribute("href", lnk.getAttribute("realhref")); + + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback", cb, html; + + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + + if (!cb) + return ""; + + html = ""; + html += ''; + html += ''; + + return html; +} + +function openBrowser(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; ikey = $key; + $this->secret = $secret; + $this->callback_url = $callback_url; + } + + + function __toString() { + return "OAuthConsumer[key=$this->key,secret=$this->secret]"; + } +} + +class Twitter_OAuthToken +{ + // access tokens and request tokens + public $key; + public $secret; + + /** + * key = the token + * secret = the token secret + */ + function __construct($key, $secret) { + $this->key = $key; + $this->secret = $secret; + } + + + /** + * generates the basic string serialization of a token that a server + * would respond to request_token and access_token calls with + */ + function to_string() { + return "oauth_token=" . + Twitter_OAuthUtil::urlencode_rfc3986($this->key) . + "&oauth_token_secret=" . + Twitter_OAuthUtil::urlencode_rfc3986($this->secret); + } + + + function __toString() { + return $this->to_string(); + } +} + +/** + * A class for implementing a Signature Method + * See section 9 ("Signing Requests") in the spec + */ +abstract class Twitter_OAuthSignatureMethod +{ + /** + * Needs to return the name of the Signature Method (ie HMAC-SHA1) + * @return string + */ + abstract public function get_name(); + + /** + * Build up the signature + * NOTE: The output of this function MUST NOT be urlencoded. + * the encoding is handled in OAuthRequest when the final + * request is serialized + * @param Twitter_OAuthRequest $request + * @param Twitter_OAuthConsumer $consumer + * @param Twitter_OAuthToken $token + * @return string + */ + abstract public function build_signature($request, $consumer, $token); + + /** + * Verifies that a given signature is correct + * @param Twitter_OAuthRequest $request + * @param Twitter_OAuthConsumer $consumer + * @param Twitter_OAuthToken $token + * @param string $signature + * @return bool + */ + public function check_signature($request, $consumer, $token, $signature) { + $built = $this->build_signature($request, $consumer, $token); + return $built == $signature; + } +} + +/** + * The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104] + * where the Signature Base String is the text and the key is the concatenated values (each first + * encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&' + * character (ASCII code 38) even if empty. + * - Chapter 9.2 ("HMAC-SHA1") + */ +class Twitter_OAuthSignatureMethod_HMAC_SHA1 extends Twitter_OAuthSignatureMethod +{ + function get_name() { + return "HMAC-SHA1"; + } + + + public function build_signature($request, $consumer, $token) { + $base_string = $request->get_signature_base_string(); + $request->base_string = $base_string; + + $key_parts = array( + $consumer->secret, + ($token) ? $token->secret : "" + ); + + $key_parts = Twitter_OAuthUtil::urlencode_rfc3986($key_parts); + $key = implode('&', $key_parts); + + return base64_encode(hash_hmac('sha1', $base_string, $key, true)); + } +} + +/** + * The PLAINTEXT method does not provide any security protection and SHOULD only be used + * over a secure channel such as HTTPS. It does not use the Signature Base String. + * - Chapter 9.4 ("PLAINTEXT") + */ +class Twitter_OAuthSignatureMethod_PLAINTEXT extends Twitter_OAuthSignatureMethod +{ + public function get_name() { + return "PLAINTEXT"; + } + + + /** + * oauth_signature is set to the concatenated encoded values of the Consumer Secret and + * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is + * empty. The result MUST be encoded again. + * - Chapter 9.4.1 ("Generating Signatures") + * + * Please note that the second encoding MUST NOT happen in the SignatureMethod, as + * OAuthRequest handles this! + */ + public function build_signature($request, $consumer, $token) { + $key_parts = array( + $consumer->secret, + ($token) ? $token->secret : "" + ); + + $key_parts = Twitter_OAuthUtil::urlencode_rfc3986($key_parts); + $key = implode('&', $key_parts); + $request->base_string = $key; + + return $key; + } +} + +/** + * The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in + * [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for + * EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a + * verified way to the Service Provider, in a manner which is beyond the scope of this + * specification. + * - Chapter 9.3 ("RSA-SHA1") + */ +abstract class Twitter_OAuthSignatureMethod_RSA_SHA1 extends Twitter_OAuthSignatureMethod +{ + public function get_name() { + return "RSA-SHA1"; + } + + // Up to the SP to implement this lookup of keys. Possible ideas are: + // (1) do a lookup in a table of trusted certs keyed off of consumer + // (2) fetch via http using a url provided by the requester + // (3) some sort of specific discovery code based on request + // + // Either way should return a string representation of the certificate + protected abstract function fetch_public_cert(&$request); + + // Up to the SP to implement this lookup of keys. Possible ideas are: + // (1) do a lookup in a table of trusted certs keyed off of consumer + // + // Either way should return a string representation of the certificate + protected abstract function fetch_private_cert(&$request); + + public function build_signature($request, $consumer, $token) { + $base_string = $request->get_signature_base_string(); + $request->base_string = $base_string; + + // Fetch the private key cert based on the request + $cert = $this->fetch_private_cert($request); + + // Pull the private key ID from the certificate + $privatekeyid = openssl_get_privatekey($cert); + + // Sign using the key + $ok = openssl_sign($base_string, $signature, $privatekeyid); + + // Release the key resource + openssl_free_key($privatekeyid); + + return base64_encode($signature); + } + + + public function check_signature($request, $consumer, $token, $signature) { + $decoded_sig = base64_decode($signature); + + $base_string = $request->get_signature_base_string(); + + // Fetch the public key cert based on the request + $cert = $this->fetch_public_cert($request); + + // Pull the public key ID from the certificate + $publickeyid = openssl_get_publickey($cert); + + // Check the computed signature against the one passed in the query + $ok = openssl_verify($base_string, $decoded_sig, $publickeyid); + + // Release the key resource + openssl_free_key($publickeyid); + + return $ok == 1; + } +} + +class Twitter_OAuthRequest +{ + protected $parameters; + protected $http_method; + protected $http_url; + // for debug purposes + public $base_string; + public static $version = '1.0'; + public static $POST_INPUT = 'php://input'; + + function __construct($http_method, $http_url, $parameters=NULL) { + $parameters = ($parameters) ? $parameters : array(); + $parameters = array_merge( Twitter_OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters); + $this->parameters = $parameters; + $this->http_method = $http_method; + $this->http_url = $http_url; + } + + + /** + * attempt to build up a request from what was passed to the server + */ + public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) { + $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") + ? 'http' + : 'https'; + $http_url = ($http_url) ? $http_url : $scheme . + '://' . $_SERVER['HTTP_HOST'] . + ':' . + $_SERVER['SERVER_PORT'] . + $_SERVER['REQUEST_URI']; + $http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD']; + + // We weren't handed any parameters, so let's find the ones relevant to + // this request. + // If you run XML-RPC or similar you should use this to provide your own + // parsed parameter-list + if (!$parameters) { + // Find request headers + $request_headers = Twitter_OAuthUtil::get_headers(); + + // Parse the query-string to find GET parameters + $parameters = Twitter_OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']); + + // It's a POST request of the proper content-type, so parse POST + // parameters and add those overriding any duplicates from GET + if ($http_method == "POST" + && isset($request_headers['Content-Type']) + && strstr($request_headers['Content-Type'], + 'application/x-www-form-urlencoded') + ) { + $post_data = Twitter_OAuthUtil::parse_parameters( + file_get_contents(self::$POST_INPUT) + ); + $parameters = array_merge($parameters, $post_data); + } + + // We have a Authorization-header with OAuth data. Parse the header + // and add those overriding any duplicates from GET or POST + if (isset($request_headers['Authorization']) && substr($request_headers['Authorization'], 0, 6) == 'OAuth ') { + $header_parameters = Twitter_OAuthUtil::split_header( + $request_headers['Authorization'] + ); + $parameters = array_merge($parameters, $header_parameters); + } + + } + + return new Twitter_OAuthRequest($http_method, $http_url, $parameters); + } + + + /** + * pretty much a helper function to set up the request + */ + public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) { + $parameters = ($parameters) ? $parameters : array(); + $defaults = array("oauth_version" => Twitter_OAuthRequest::$version, + "oauth_nonce" => Twitter_OAuthRequest::generate_nonce(), + "oauth_timestamp" => Twitter_OAuthRequest::generate_timestamp(), + "oauth_consumer_key" => $consumer->key); + if ($token) + $defaults['oauth_token'] = $token->key; + + $parameters = array_merge($defaults, $parameters); + + return new Twitter_OAuthRequest($http_method, $http_url, $parameters); + } + + + public function set_parameter($name, $value, $allow_duplicates = true) { + if ($allow_duplicates && isset($this->parameters[$name])) { + // We have already added parameter(s) with this name, so add to the list + if (is_scalar($this->parameters[$name])) { + // This is the first duplicate, so transform scalar (string) + // into an array so we can add the duplicates + $this->parameters[$name] = array($this->parameters[$name]); + } + + $this->parameters[$name][] = $value; + } else { + $this->parameters[$name] = $value; + } + } + + + public function get_parameter($name) { + return isset($this->parameters[$name]) ? $this->parameters[$name] : null; + } + + + public function get_parameters() { + return $this->parameters; + } + + + public function unset_parameter($name) { + unset($this->parameters[$name]); + } + + + /** + * The request parameters, sorted and concatenated into a normalized string. + * @return string + */ + public function get_signable_parameters() { + // Grab all parameters + $params = $this->parameters; + + // Remove oauth_signature if present + // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") + if (isset($params['oauth_signature'])) { + unset($params['oauth_signature']); + } + + return Twitter_OAuthUtil::build_http_query($params); + } + + + /** + * Returns the base string of this request + * + * The base string defined as the method, the url + * and the parameters (normalized), each urlencoded + * and the concated with &. + */ + public function get_signature_base_string() { + $parts = array( + $this->get_normalized_http_method(), + $this->get_normalized_http_url(), + $this->get_signable_parameters() + ); + + $parts = Twitter_OAuthUtil::urlencode_rfc3986($parts); + + return implode('&', $parts); + } + + + /** + * just uppercases the http method + */ + public function get_normalized_http_method() { + return strtoupper($this->http_method); + } + + + /** + * parses the url and rebuilds it to be + * scheme://host/path + */ + public function get_normalized_http_url() { + $parts = parse_url($this->http_url); + + $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http'; + $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80'); + $host = (isset($parts['host'])) ? $parts['host'] : ''; + $path = (isset($parts['path'])) ? $parts['path'] : ''; + + if (($scheme == 'https' && $port != '443') + || ($scheme == 'http' && $port != '80')) { + $host = "$host:$port"; + } + return "$scheme://$host$path"; + } + + + /** + * builds a url usable for a GET request + */ + public function to_url() { + $post_data = $this->to_postdata(); + $out = $this->get_normalized_http_url(); + if ($post_data) { + $out .= '?'.$post_data; + } + return $out; + } + + + /** + * builds the data one would send in a POST request + */ + public function to_postdata() { + return Twitter_OAuthUtil::build_http_query($this->parameters); + } + + + /** + * builds the Authorization: header + */ + public function to_header($realm=null) { + $first = true; + if($realm) { + $out = 'Authorization: OAuth realm="' . Twitter_OAuthUtil::urlencode_rfc3986($realm) . '"'; + $first = false; + } else + $out = 'Authorization: OAuth'; + + $total = array(); + foreach ($this->parameters as $k => $v) { + if (substr($k, 0, 5) != "oauth") continue; + if (is_array($v)) { + throw new Twitter_OAuthException('Arrays not supported in headers'); + } + $out .= ($first) ? ' ' : ','; + $out .= Twitter_OAuthUtil::urlencode_rfc3986($k) . + '="' . + Twitter_OAuthUtil::urlencode_rfc3986($v) . + '"'; + $first = false; + } + return $out; + } + + + public function __toString() { + return $this->to_url(); + } + + + public function sign_request($signature_method, $consumer, $token) { + $this->set_parameter( + "oauth_signature_method", + $signature_method->get_name(), + false + ); + $signature = $this->build_signature($signature_method, $consumer, $token); + $this->set_parameter("oauth_signature", $signature, false); + } + + + public function build_signature($signature_method, $consumer, $token) { + $signature = $signature_method->build_signature($this, $consumer, $token); + return $signature; + } + + + /** + * util function: current timestamp + */ + private static function generate_timestamp() { + return time(); + } + + + /** + * util function: current nonce + */ + private static function generate_nonce() { + $mt = microtime(); + $rand = mt_rand(); + + return md5($mt . $rand); // md5s look nicer than numbers + } +} + +class Twitter_OAuthServer +{ + protected $timestamp_threshold = 300; // in seconds, five minutes + protected $version = '1.0'; // hi blaine + protected $signature_methods = array(); + + protected $data_store; + + function __construct($data_store) { + $this->data_store = $data_store; + } + + + public function add_signature_method($signature_method) { + $this->signature_methods[$signature_method->get_name()] = + $signature_method; + } + + // high level functions + + /** + * process a request_token request + * returns the request token on success + */ + public function fetch_request_token(&$request) { + $this->get_version($request); + + $consumer = $this->get_consumer($request); + + // no token required for the initial token request + $token = NULL; + + $this->check_signature($request, $consumer, $token); + + // Rev A change + $callback = $request->get_parameter('oauth_callback'); + $new_token = $this->data_store->new_request_token($consumer, $callback); + + return $new_token; + } + + + /** + * process an access_token request + * returns the access token on success + */ + public function fetch_access_token(&$request) { + $this->get_version($request); + + $consumer = $this->get_consumer($request); + + // requires authorized request token + $token = $this->get_token($request, $consumer, "request"); + + $this->check_signature($request, $consumer, $token); + + // Rev A change + $verifier = $request->get_parameter('oauth_verifier'); + $new_token = $this->data_store->new_access_token($token, $consumer, $verifier); + + return $new_token; + } + + + /** + * verify an api call, checks all the parameters + */ + public function verify_request(&$request) { + $this->get_version($request); + $consumer = $this->get_consumer($request); + $token = $this->get_token($request, $consumer, "access"); + $this->check_signature($request, $consumer, $token); + return array($consumer, $token); + } + + // Internals from here + /** + * version 1 + */ + private function get_version(&$request) { + $version = $request->get_parameter("oauth_version"); + if (!$version) { + // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present. + // Chapter 7.0 ("Accessing Protected Ressources") + $version = '1.0'; + } + if ($version !== $this->version) { + throw new Twitter_OAuthException("OAuth version '$version' not supported"); + } + return $version; + } + + + /** + * figure out the signature with some defaults + */ + private function get_signature_method($request) { + $signature_method = $request instanceof Twitter_OAuthRequest + ? $request->get_parameter("oauth_signature_method") + : NULL; + + if (!$signature_method) { + // According to chapter 7 ("Accessing Protected Ressources") the signature-method + // parameter is required, and we can't just fallback to PLAINTEXT + throw new Twitter_OAuthException('No signature method parameter. This parameter is required'); + } + + if (!in_array($signature_method, + array_keys($this->signature_methods))) { + throw new Twitter_OAuthException( + "Signature method '$signature_method' not supported " . + "try one of the following: " . + implode(", ", array_keys($this->signature_methods)) + ); + } + return $this->signature_methods[$signature_method]; + } + + + /** + * try to find the consumer for the provided request's consumer key + */ + private function get_consumer($request) { + $consumer_key = $request instanceof Twitter_OAuthRequest + ? $request->get_parameter("oauth_consumer_key") + : NULL; + + if (!$consumer_key) { + throw new Twitter_OAuthException("Invalid consumer key"); + } + + $consumer = $this->data_store->lookup_consumer($consumer_key); + if (!$consumer) { + throw new Twitter_OAuthException("Invalid consumer"); + } + + return $consumer; + } + + + /** + * try to find the token for the provided request's token key + */ + private function get_token($request, $consumer, $token_type="access") { + $token_field = $request instanceof Twitter_OAuthRequest + ? $request->get_parameter('oauth_token') + : NULL; + + $token = $this->data_store->lookup_token( + $consumer, $token_type, $token_field + ); + if (!$token) { + throw new Twitter_OAuthException("Invalid $token_type token: $token_field"); + } + return $token; + } + + + /** + * all-in-one function to check the signature on a request + * should guess the signature method appropriately + */ + private function check_signature($request, $consumer, $token) { + // this should probably be in a different method + $timestamp = $request instanceof Twitter_OAuthRequest + ? $request->get_parameter('oauth_timestamp') + : NULL; + $nonce = $request instanceof Twitter_OAuthRequest + ? $request->get_parameter('oauth_nonce') + : NULL; + + $this->check_timestamp($timestamp); + $this->check_nonce($consumer, $token, $nonce, $timestamp); + + $signature_method = $this->get_signature_method($request); + + $signature = $request->get_parameter('oauth_signature'); + $valid_sig = $signature_method->check_signature( + $request, + $consumer, + $token, + $signature + ); + + if (!$valid_sig) { + throw new Twitter_OAuthException("Invalid signature"); + } + } + + + /** + * check that the timestamp is new enough + */ + private function check_timestamp($timestamp) { + if( ! $timestamp ) + throw new Twitter_OAuthException( + 'Missing timestamp parameter. The parameter is required' + ); + + // verify that timestamp is recentish + $now = time(); + if (abs($now - $timestamp) > $this->timestamp_threshold) { + throw new Twitter_OAuthException( + "Expired timestamp, yours $timestamp, ours $now" + ); + } + } + + + /** + * check that the nonce is not repeated + */ + private function check_nonce($consumer, $token, $nonce, $timestamp) { + if( ! $nonce ) + throw new Twitter_OAuthException( + 'Missing nonce parameter. The parameter is required' + ); + + // verify that the nonce is uniqueish + $found = $this->data_store->lookup_nonce( + $consumer, + $token, + $nonce, + $timestamp + ); + if ($found) { + throw new Twitter_OAuthException("Nonce already used: $nonce"); + } + } + +} + +class Twitter_OAuthDataStore +{ + function lookup_consumer($consumer_key) { + // implement me + } + + + function lookup_token($consumer, $token_type, $token) { + // implement me + } + + + function lookup_nonce($consumer, $token, $nonce, $timestamp) { + // implement me + } + + + function new_request_token($consumer, $callback = null) { + // return a new token attached to this consumer + } + + + function new_access_token($token, $consumer, $verifier = null) { + // return a new access token attached to this consumer + // for the user associated with this token if the request token + // is authorized + // should also invalidate the request token + } + +} + +class Twitter_OAuthUtil +{ + public static function urlencode_rfc3986($input) { + if (is_array($input)) { + return array_map(array('Twitter_OAuthUtil', 'urlencode_rfc3986'), $input); + } else if (is_scalar($input)) { + return str_replace( + '+', + ' ', + str_replace('%7E', '~', rawurlencode($input)) + ); + } else { + return ''; + } + } + + + // This decode function isn't taking into consideration the above + // modifications to the encoding process. However, this method doesn't + // seem to be used anywhere so leaving it as is. + public static function urldecode_rfc3986($string) { + return urldecode($string); + } + + // Utility function for turning the Authorization: header into + // parameters, has to do some unescaping + // Can filter out any non-oauth parameters if needed (default behaviour) + // May 28th, 2010 - method updated to tjerk.meesters for a speed improvement. + // see http://code.google.com/p/oauth/issues/detail?id=163 + public static function split_header($header, $only_allow_oauth_parameters = true) { + $params = array(); + if (preg_match_all('/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches)) { + foreach ($matches[1] as $i => $h) { + $params[$h] = Twitter_OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]); + } + if (isset($params['realm'])) { + unset($params['realm']); + } + } + return $params; + } + + // helper to try to sort out headers for people who aren't running apache + public static function get_headers() { + if (function_exists('apache_request_headers')) { + // we need this to get the actual Authorization: header + // because apache tends to tell us it doesn't exist + $headers = apache_request_headers(); + + // sanitize the output of apache_request_headers because + // we always want the keys to be Cased-Like-This and arh() + // returns the headers in the same case as they are in the + // request + $out = array(); + foreach ($headers AS $key => $value) { + $key = str_replace( + " ", + "-", + ucwords(strtolower(str_replace("-", " ", $key))) + ); + $out[$key] = $value; + } + } else { + // otherwise we don't have apache and are just going to have to hope + // that $_SERVER actually contains what we need + $out = array(); + if( isset($_SERVER['CONTENT_TYPE']) ) + $out['Content-Type'] = $_SERVER['CONTENT_TYPE']; + if( isset($_ENV['CONTENT_TYPE']) ) + $out['Content-Type'] = $_ENV['CONTENT_TYPE']; + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) == "HTTP_") { + // this is chaos, basically it is just there to capitalize the first + // letter of every word that is not an initial HTTP and strip HTTP + // code from przemek + $key = str_replace( + " ", + "-", + ucwords(strtolower(str_replace("_", " ", substr($key, 5)))) + ); + $out[$key] = $value; + } + } + } + return $out; + } + + // This function takes a input like a=b&a=c&d=e and returns the parsed + // parameters like this + // array('a' => array('b','c'), 'd' => 'e') + public static function parse_parameters( $input ) { + if (!isset($input) || !$input) return array(); + + $pairs = explode('&', $input); + + $parsed_parameters = array(); + foreach ($pairs as $pair) { + $split = explode('=', $pair, 2); + $parameter = Twitter_OAuthUtil::urldecode_rfc3986($split[0]); + $value = isset($split[1]) ? Twitter_OAuthUtil::urldecode_rfc3986($split[1]) : ''; + + if (isset($parsed_parameters[$parameter])) { + // We have already recieved parameter(s) with this name, so add to the list + // of parameters with this name + + if (is_scalar($parsed_parameters[$parameter])) { + // This is the first duplicate, so transform scalar (string) into an array + // so we can add the duplicates + $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]); + } + + $parsed_parameters[$parameter][] = $value; + } else { + $parsed_parameters[$parameter] = $value; + } + } + return $parsed_parameters; + } + + + public static function build_http_query($params) { + if (!$params) return ''; + + // Urlencode both keys and values + $keys = Twitter_OAuthUtil::urlencode_rfc3986(array_keys($params)); + $values = Twitter_OAuthUtil::urlencode_rfc3986(array_values($params)); + $params = array_combine($keys, $values); + + // Parameters are sorted by name, using lexicographical byte value ordering. + // Ref: Spec: 9.1.1 (1) + uksort($params, 'strcmp'); + + $pairs = array(); + foreach ($params as $parameter => $value) { + if (is_array($value)) { + // If two or more parameters share the same name, they are sorted by their value + // Ref: Spec: 9.1.1 (1) + // June 12th, 2010 - changed to sort because of issue 164 by hidetaka + sort($value, SORT_STRING); + foreach ($value as $duplicate_value) { + $pairs[] = $parameter . '=' . $duplicate_value; + } + } else { + $pairs[] = $parameter . '=' . $value; + } + } + // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) + // Each name-value pair is separated by an '&' character (ASCII code 38) + return implode('&', $pairs); + } +} diff --git a/thirdparty/twitter/twitter.class.php b/thirdparty/twitter/twitter.class.php new file mode 100644 index 0000000..10e1eb1 --- /dev/null +++ b/thirdparty/twitter/twitter.class.php @@ -0,0 +1,355 @@ + 20, + CURLOPT_SSL_VERIFYPEER => 0, + CURLOPT_HTTPHEADER => array('Expect:'), + CURLOPT_USERAGENT => 'Twitter for PHP', + ); + + /** @var Twitter_OAuthSignatureMethod */ + private $signatureMethod; + + /** @var Twitter_OAuthConsumer */ + private $consumer; + + /** @var Twitter_OAuthConsumer */ + private $token; + + + + /** + * Creates object using consumer and access keys. + * @param string consumer key + * @param string app secret + * @param string optional access token + * @param string optinal access token secret + * @throws TwitterException when CURL extension is not loaded + */ + public function __construct($consumerKey, $consumerSecret, $accessToken = NULL, $accessTokenSecret = NULL) + { + if (!extension_loaded('curl')) { + throw new TwitterException('PHP extension CURL is not loaded.'); + } + + $this->signatureMethod = new Twitter_OAuthSignatureMethod_HMAC_SHA1(); + $this->consumer = new Twitter_OAuthConsumer($consumerKey, $consumerSecret); + $this->token = new Twitter_OAuthConsumer($accessToken, $accessTokenSecret); + } + + + /** + * Tests if user credentials are valid. + * @return boolean + * @throws TwitterException + */ + public function authenticate() + { + try { + $res = $this->request('account/verify_credentials', 'GET'); + return !empty($res->id); + + } catch (TwitterException $e) { + if ($e->getCode() === 401) { + return FALSE; + } + throw $e; + } + } + + + /** + * Sends message to the Twitter. + * @param string message encoded in UTF-8 + * @return object + * @throws TwitterException + */ + public function send($message) + { + return $this->request('statuses/update', 'POST', array('status' => $message)); + } + + + /** + * Returns the most recent statuses. + * @param int timeline (ME | ME_AND_FRIENDS | REPLIES) and optional (RETWEETS) + * @param int number of statuses to retrieve + * @param int page of results to retrieve + * @return mixed + * @throws TwitterException + */ + public function load($flags = self::ME, $count = 20, array $data = NULL) + { + static $timelines = array(self::ME => 'user_timeline', self::ME_AND_FRIENDS => 'home_timeline', self::REPLIES => 'mentions_timeline'); + if (!isset($timelines[$flags & 3])) { + throw new InvalidArgumentException; + } + + return $this->cachedRequest('statuses/' . $timelines[$flags & 3], (array) $data + array( + 'count' => $count, + 'include_rts' => $flags & self::RETWEETS ? 1 : 0, + )); + } + + + /** + * Returns information of a given user. + * @param string name + * @return mixed + * @throws TwitterException + */ + public function loadUserInfo($user) + { + return $this->cachedRequest('users/show', array('screen_name' => $user)); + } + + + /** + * Returns information of a given user by id. + * @param string name + * @return mixed + * @throws TwitterException + */ + public function loadUserInfoById($id) + { + return $this->cachedRequest('users/show', array('user_id' => $id)); + } + + + /** + * Returns followers of a given user. + * @param string name + * @return mixed + * @throws TwitterException + */ + public function loadUserFollowers($user, $count = 5000, $cursor = -1, $cacheExpiry = null) + { + return $this->cachedRequest('followers/ids', array('screen_name' => $user, 'count' => $count, 'cursor' => $cursor), $cacheExpiry); + } + + + /** + * Destroys status. + * @param int id of status to be destroyed + * @return mixed + * @throws TwitterException + */ + public function destroy($id) + { + $res = $this->request("statuses/destroy/$id", 'POST'); + return $res->id ? $res->id : FALSE; + } + + + /** + * Returns tweets that match a specified query. + * @param string|array query + * @return mixed + * @throws TwitterException + */ + public function search($query) + { + return $this->request('search/tweets', 'GET', is_array($query) ? $query : array('q' => $query))->statuses; + } + + + /** + * Process HTTP request. + * @param string URL or twitter command + * @param string HTTP method GET or POST + * @param array data + * @return mixed + * @throws TwitterException + */ + public function request($resource, $method, array $data = NULL) + { + if (!strpos($resource, '://')) { + if (!strpos($resource, '.')) { + $resource .= '.json'; + } + $resource = self::API_URL . $resource; + } + + foreach (array_keys((array) $data, NULL, TRUE) as $key) { + unset($data[$key]); + } + + $request = Twitter_OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $resource, $data); + $request->sign_request($this->signatureMethod, $this->consumer, $this->token); + + $options = array( + CURLOPT_HEADER => FALSE, + CURLOPT_RETURNTRANSFER => TRUE, + ) + ($method === 'POST' ? array( + CURLOPT_POST => TRUE, + CURLOPT_POSTFIELDS => $request->to_postdata(), + CURLOPT_URL => $request->get_normalized_http_url(), + ) : array( + CURLOPT_URL => $request->to_url(), + )) + $this->httpOptions; + + $curl = curl_init(); + curl_setopt_array($curl, $options); + $result = curl_exec($curl); + if (curl_errno($curl)) { + throw new TwitterException('Server error: ' . curl_error($curl)); + } + + $payload = version_compare(PHP_VERSION, '5.4.0') >= 0 ? + @json_decode($result, FALSE, 128, JSON_BIGINT_AS_STRING) : @json_decode($result); // intentionally @ + + if ($payload === FALSE) { + throw new TwitterException('Invalid server response'); + } + + $code = curl_getinfo($curl, CURLINFO_HTTP_CODE); + if ($code >= 400) { + throw new TwitterException(isset($payload->errors[0]->message) ? $payload->errors[0]->message : "Server error #$code", $code); + } + + return $payload; + } + + + /** + * Cached HTTP request. + * @param string URL or twitter command + * @param array + * @param int + * @return mixed + */ + public function cachedRequest($resource, array $data = NULL, $cacheExpire = NULL) + { + if (!self::$cacheDir) { + return $this->request($resource, 'GET', $data); + } + if ($cacheExpire === NULL) { + $cacheExpire = self::$cacheExpire; + } + + $cacheFile = self::$cacheDir . '/twitter.' . md5($resource . json_encode($data) . serialize(array($this->consumer, $this->token))); + $cache = @json_decode(@file_get_contents($cacheFile)); // intentionally @ + if ($cache && @filemtime($cacheFile) + $cacheExpire > time()) { // intentionally @ + return $cache; + } + + try { + $payload = $this->request($resource, 'GET', $data); + file_put_contents($cacheFile, json_encode($payload)); + return $payload; + + } catch (TwitterException $e) { + if ($cache) { + return $cache; + } + throw $e; + } + } + + + /** + * Makes twitter links, @usernames and #hashtags clickable. + * @param stdClass|string status + * @return string + */ + public static function clickable($status) + { + if (!is_object($status)) { // back compatibility + trigger_error(__METHOD__ . '() has been changed; pass as parameter status object, not just text.', E_USER_WARNING); + return preg_replace_callback( + '~(?&]~u', + array(__CLASS__, 'clickableCallback'), + html_entity_decode($status, ENT_QUOTES, 'UTF-8') + ); + } + + $all = array(); + foreach ($status->entities->hashtags as $item) { + $all[$item->indices[0]] = array("http://twitter.com/search?q=%23$item->text", "#$item->text", $item->indices[1]); + } + foreach ($status->entities->urls as $item) { + if (!isset($item->expanded_url)) { + $all[$item->indices[0]] = array($item->url, $item->url, $item->indices[1]); + } else { + $all[$item->indices[0]] = array($item->expanded_url, $item->display_url, $item->indices[1]); + } + } + foreach ($status->entities->user_mentions as $item) { + $all[$item->indices[0]] = array("http://twitter.com/$item->screen_name", "@$item->screen_name", $item->indices[1]); + } + if (isset($status->entities->media)) { + foreach ($status->entities->media as $item) { + $all[$item->indices[0]] = array($item->url, $item->display_url, $item->indices[1]); + } + } + + krsort($all); + $s = $status->text; + foreach ($all as $pos => $item) { + $s = iconv_substr($s, 0, $pos, 'UTF-8') + . '' . htmlspecialchars($item[1]) . '' + . iconv_substr($s, $item[2], iconv_strlen($s, 'UTF-8'), 'UTF-8'); + } + return $s; + } + + + private static function clickableCallback($m) + { + $m = htmlspecialchars($m[0]); + if ($m[0] === '#') { + $m = substr($m, 1); + return "#$m"; + } elseif ($m[0] === '@') { + $m = substr($m, 1); + return "@$m"; + } elseif ($m[0] === 'w') { + return "$m"; + } elseif ($m[0] === 'h') { + return "$m"; + } else { + return $m; + } + } + +} + + + +/** + * An exception generated by Twitter. + */ +class TwitterException extends Exception +{ +} diff --git a/usercp.php b/usercp.php new file mode 100644 index 0000000..e251acd --- /dev/null +++ b/usercp.php @@ -0,0 +1,114 @@ + + * @package astat core + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id: usercp.php 100 2010-02-20 14:42:30Z genuineparts $ +*/ + +/** +*Set error_reporting +* +*/ +error_reporting(E_ALL ^E_NOTICE); +$basepath=''; +require_once 'core/init_core.inc.php'; + +/** +* PLUGIN HOOK usercp_begin +* +*/ +$plugin->run_hook('usercp_begin'); +$session->page_begin('usercp', TRUE); +$emsg=false; +$cpwd=false; +If(isset($_POST['submit'])){ + if($_POST['password']!=''){ + $result = $db->query("SELECT `password`,`openid_identity` FROM `" . $config['prefix'] . "users` WHERE `uid`='".$session->userdata['uid']."' LIMIT 1"); + $data=$db->fetch_array($result); + if((!isset($_POST['oldpassword']) || $_POST['oldpassword']=='') && $data['password']!=''){ + $emsg.=''.$lang->_('OLDPASSWORDMISSING').'
    '; + }elseif((hash('sha256',$db->escape($_POST['oldpassword']))!=$data['password']) && $data['password']!=''){ + $emsg.=''.$lang->_('OLDPASSWORDWRONG').'
    '; + }elseif($_POST['password']!=$_POST['cpassword']){ + $emsg.=''.$lang->_('PASSWORDSNOTMATCH').'
    '; + }elseif(strlen($_POST['password'])<6){ + $emsg.=''.$lang->_('PASSWORDTOOSHORT').'
    '; + }elseif(strlen($_POST['password'])>20){ + $emsg.=''.$lang->_('PASSWORDTOOLONG').'
    '; + } + $loginkey=$session->generate_Key(50); + $pass =hash('sha256',$db->escape($_POST['password'])); + $pwd=",`password`='".$pass."', `loginkey`='".$loginkey."'"; + } + if(!preg_match('/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD',$_POST['email'])){ + $emsg.=''.$lang->_('EMAILINVALID').'
    '; + } + if(!$emsg){ + $sql="UPDATE `" . $config['prefix'] . "users` SET `openid_identity`='".$db->escape($_POST['openid_identity'])."',`realname`='".$db->escape($_POST['realname'])."',`email`='".$db->escape($_POST['email'])."',`gender`='".$db->escape($_POST['gender'])."',`allow_grimdark`='".intval($_POST['allow_gd'])."',`lang`='".$db->escape($_POST['lang'])."',`from`='".$db->escape($_POST['from'])."',`birthday`='".strtotime($db->escape($_POST['birthday']))."'".$pwd." WHERE `uid`='".$session->userdata['uid']."'"; + $result = $db->query($sql); + $sdata=array('uid'=>$session->userdata['uid'],'username'=>$session->userdata['username'],'pwd_md5'=>hash('md5',$_POST['password']),'pwd_sha2'=>$pass,'email'=>$db->escape($_POST['email']),'realname'=>$db->escape($_POST['realname']),'gender'=>$db->escape($_POST['gender']),'from'=>$db->escape($_POST['from']),'lang'=>$db->escape($_POST['lang']),'birthday'=>strtotime($db->escape($_POST['birthday']))); + + + /** + * PLUGIN HOOK usercp_end + * gets a array with some Userdata. + * + */ + + $plugin->run_hook('usercp_end',array('sdata'=>$sdata)); + $core->message($lang->_('SUCCESS'),$lang->_('DATASAVED'),TRUE,$config['path'].'/index.php',3); + + } +} + +$meta=' +'; +$tpl->assign('emsg',$emsg); +$langs=''; +$data[$session->userdata['gender']]='selected="selected"'; +$ln=$lang->getlanguages(); + +foreach($ln as $d){ + if($d['short']==$session->userdata['lang']){ + + $langs.=''; + }else{ + $langs.=''; + } +} +if($config['use_openid']==1 && $session->userdata['password']==''){ + $tpl->assign('oldpw','disabled="disabled"'); +} +if($session->userdata['allow_grimdark']==1){ + $tpl->assign('allow_gd','checked="checked"'); +} +$tpl->assign('connect_openid',$config['use_openid']); +$tpl->assign('gender',$data); +$tpl->assign('langs',$langs); +$tpl->assign('birthday',date('d.m.Y',$session->userdata['birthday'])); +$tpl->assign('data',$session->userdata); +$content=$tpl->fetch('usercp.tpl'); +$core->make_page($content); + +?>