From 7bfdec7993771b37e0e5d2f9045ba57cf3d18f7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jun 2013 18:01:10 +0200 Subject: [PATCH 1/8] Fix: css --- htdocs/theme/amarok/style.css.php | 34 +++++++------- htdocs/theme/auguria/style.css.php | 10 ++--- htdocs/theme/bureau2crea/style.css.php | 62 +++++++++++++------------- htdocs/theme/cameleo/style.css.php | 16 ++++--- htdocs/theme/eldy/style.css.php | 16 +++---- 5 files changed, 70 insertions(+), 68 deletions(-) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 5144137a8b9..8e6df230465 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -914,7 +914,7 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; } -.ui-button {margin-left:-1px;} -.ui-button-icon-only .ui-button-text {height:8px;} -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {padding:2px 0px 6px 0px;} -.ui-button-text {line-height:1em !important;} -.ui-autocomplete-input {margin:0; padding:1px;} +.ui-button { margin-left:-2px; padding-top: 1px; } +.ui-button-icon-only .ui-button-text { height:8px; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding:2px 0px 6px 0px; } +.ui-button-text { line-height:1em !important; } +.ui-autocomplete-input { margin:0; padding:1px; } /* ============================================================================== */ diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 28b4c4b4793..4727fa30a2c 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1284,7 +1284,7 @@ border-left: 1px solid #000000; /* Main boxes */ -table.noborder { +table.noborder, div.noborder { border-collapse: collapse; border-top-color: #FEFEFE; @@ -1310,7 +1310,7 @@ table.noborder { box-shadow: 4px 4px 4px #CCC; } -table.noborder tr { +table.noborder tr, div.noborder form { border-top-color: #FEFEFE; border-right-width: 1px; @@ -1323,7 +1323,7 @@ table.noborder tr { height: 20px; } -table.noborder td { +table.noborder td, div.noborder form div { padding: 1px 2px 2px 1px; /* t r b l */ } @@ -1421,7 +1421,7 @@ input.liste_titre { border: 0px; } -tr.liste_total td { +tr.liste_total td, form.liste_total div { border-top: 1px solid #DDDDDD; background: #F0F0F0; background-repeat: repeat-x; @@ -1983,7 +1983,7 @@ A.none, A.none:active, A.none:visited, A.none:hover { font-family:; font-size:px; } -.ui-button { margin-left: -1px; } +.ui-button { margin-left: -1px; padding-top: 1px; } .ui-button-icon-only .ui-button-text { height: 8px; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: 2px 0px 6px 0px; } .ui-button-text diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index f8b80a48b05..49943e38a20 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -241,9 +241,9 @@ div.inline-block .nowrap { white-space: ; } -.dolibarrcombobox { +/*.dolibarrcombobox { height: 22px; -} +}*/ /* ============================================================================== */ /* Styles to hide objects */ @@ -1437,7 +1437,7 @@ border-left: 1px solid #000000; /* Main boxes */ -table.noborder { +table.noborder, div.noborder form { /*box-shadow: 2px 4px 2px #CCCCCC; -moz-box-shadow: 2px 4px 2px #CCCCCC; -webkit-box-shadow: 2px 4px 2px #CCCCCC; */ @@ -1446,10 +1446,10 @@ table.noborder { } -table.noborder tr { +table.noborder tr, div.noborder form { } -table.noborder td { +table.noborder td, div.noborder div { } table.nobordernopadding { @@ -1508,9 +1508,9 @@ th.liste_titre_sel, td.liste_titre_sel, th.liste_titre { color: #FFFFFF !important; } -tr.liste_total { -height: 25px; -border-top: 1px solid #333; +tr.liste_total, form.liste_total { + height: 25px; + border-top: 1px solid #333; } div#stats { @@ -1547,7 +1547,7 @@ div.liste_titre input.button, tr.liste_titre input.button, form.liste_titre inpu /*margin: 30px 10px 10px 0px;*/ } -th.liste_titre_sel, td.liste_titre_sel +th.liste_titre_sel, td.liste_titre_sel, div.liste_titre_sel { background: #505050; background-repeat: repeat-x; @@ -1564,47 +1564,47 @@ input.liste_titre { border: 0px; } -tr.liste_total td { -border-top: 1px solid #DDDDDD; -background: #F0F0F0; -/* background-image: url(); */ -background-repeat: repeat-x; -color: #332266; -font-weight: normal; -padding: 5px; +tr.liste_total td, form.liste_total div { + border-top: 1px solid #DDDDDD; + background: #F0F0F0; + /* background-image: url(); */ + background-repeat: repeat-x; + color: #332266; + font-weight: normal; + padding: 5px; } .impair { -background: #eaeaea; -font-family: ; -border: 0px; + background: #eaeaea; + font-family: ; + border: 0px; } .impair:hover { -background: #c0c4c7; -border: 0px; + background: #c0c4c7; + border: 0px; } -tr.impair td.nohover { -background: #eaeaea; +tr.impair td.nohover, form.impair div.nohover { + background: #eaeaea; } .pair { -background: #FFFFFF; -font-family: ; -border: 0px; + background: #FFFFFF; + font-family: ; + border: 0px; } .pair:hover { -background: #c0c4c7; -border: 0px; + background: #c0c4c7; + border: 0px; } tr.pair td.nohover { background: #FFFFFF; } -.pair td, .impair td +.pair td, .impair td, .pair div, .impair div { padding: 2px 3px !important; } @@ -2145,7 +2145,7 @@ A.none, A.none:active, A.none:visited, A.none:hover { font-family:; font-size:px; } -.ui-button { margin-left: -1px; } +.ui-button { margin-left: -1px; padding-top: 1px; } .ui-button-icon-only .ui-button-text { height: 8px; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: 2px 0px 6px 0px; } .ui-button-text diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 51dba60756c..ea3b0b9df5c 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1391,7 +1391,7 @@ border-left: 1px solid #000000; /* Main boxes */ -table.noborder { +table.noborder, div.noborder { background: #FFF url(); background-repeat: repeat-x; background-position: top right; @@ -1409,10 +1409,10 @@ table.noborder { /*border-collapse: collapse;*/ } -table.noborder tr { +table.noborder tr, div.noborder form { } -table.noborder td { +table.noborder td, div.noborder form div { } #graph { @@ -1477,18 +1477,20 @@ div.liste_titre, tr.liste_titre, form.liste_titre { white-space: ; text-align: ; } -th.liste_titre, td.liste_titre +th.liste_titre, td.liste_titre, form.liste_titre div { padding-left: 6px; padding-right: 6px; white-space: ; + vertical-align: middle; } -th.liste_titre_sel, td.liste_titre_sel +th.liste_titre_sel, td.liste_titre_sel, form.liste_titre_sel div { background-position: top right; color: #A51B00; font-weight: bold; white-space: ; + vertical-align: middle; } input.liste_titre { @@ -1499,7 +1501,7 @@ background-position: top right;*/ border: 0px; } -tr.liste_total td { +tr.liste_total td, form.liste_total div { border-top: 1px solid #DDDDDD; background: #F0F0F0; /* background-image: url(); */ @@ -2099,7 +2101,7 @@ A.none, A.none:active, A.none:visited, A.none:hover { font-family:; font-size:px; } -.ui-button { margin-left: -1px; } +.ui-button { margin-left: -1px; padding-top: 1px; } .ui-button-icon-only .ui-button-text { height: 8px; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: 2px 0px 6px 0px; } .ui-button-text diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index cd97902b1db..2b55a6fb080 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1591,7 +1591,7 @@ td.border { /* Main boxes */ -table.noborder, table.formdoc { +table.noborder, table.formdoc, div.noborder { width: 100%; border-collapse: separate !important; @@ -1621,7 +1621,7 @@ table.noborder, table.formdoc { border-radius: 0.2em; } -table.noborder tr { +table.noborder tr, div.noborder form { border-top-color: #FEFEFE; border-right-width: 1px; @@ -1634,7 +1634,7 @@ table.noborder tr { height: 20px; } -table.noborder th, table.noborder td { +table.noborder th, table.noborder td, div.noborder form, div.noborder form div { padding: 1px 2px 1px 3px; /* t r b l */ } @@ -1709,7 +1709,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list white-space: ; text-align: ; } -tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre +tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div { font-family: ; /*font-weight: normal;*/ @@ -1717,7 +1717,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre white-space: ; text-shadow:1px 0px 1px #ffffff; } -tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel +tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel, form.liste_titre_sel div { font-family: ; font-weight: normal; @@ -1731,10 +1731,10 @@ input.liste_titre { border: 0px; } -tr.liste_total { +tr.liste_total, form.liste_total { background: #F0F0F0; } -tr.liste_total td { +tr.liste_total td, form.liste_total div { border-top: 1px solid #DDDDDD; color: #332266; font-weight: normal; @@ -2406,7 +2406,7 @@ A.none, A.none:active, A.none:visited, A.none:hover { font-family:; font-size:px; } -.ui-button { margin-left: -1px; } +.ui-button { margin-left: -2px; padding-top: 1px; } .ui-button-icon-only .ui-button-text { height: 8px; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: 2px 0px 6px 0px; } .ui-button-text From 7fb8a740e7bc50e3f6e1c274a76d9a6ad250bd87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jun 2013 18:54:18 +0200 Subject: [PATCH 2/8] Fix: bad function --- htdocs/core/tpl/contacts.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 33a488f5807..e085342cf19 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -62,7 +62,7 @@ $userstatic=new User($db); > trans("Users"); ?> global->MAIN_INFO_SOCIETE_NOM; ?> - select_users($user->id,'userid',0,(! empty($userAlreadySelected)?$userAlreadySelected:'')); ?> + select_dolusers($user->id,'userid',0,(! empty($userAlreadySelected)?$userAlreadySelected:'')); ?> selectTypeContact($object, '', 'type','internal'); ?> "> From aa7e61178a3c0f385b2cc71498fa25658d26c6ed Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Jun 2013 17:10:11 +0200 Subject: [PATCH 3/8] New: add product price sharing for multicompany --- htdocs/core/class/html.form.class.php | 1 + htdocs/product/ajax/products.php | 7 ++++--- htdocs/product/class/product.class.php | 11 +++++++---- htdocs/product/price.php | 3 ++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cb8bc2ee872..2f1cf0b45fc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1394,6 +1394,7 @@ class Form $sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; $sql.= " WHERE fk_product='".$objp->rowid."'"; + $sql.= " AND entity IN (".getEntity('productprice', 1).")"; $sql.= " AND price_level=".$price_level; $sql.= " ORDER BY date_price"; $sql.= " DESC LIMIT 1"; diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 3fed5d5152c..d27684b90aa 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2007-2011 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -70,7 +70,7 @@ if (! empty($action) && $action == 'fetch' && ! empty($id)) $outdiscount=0; $found=false; - + // Price by qty if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1) // If we need a particular price related to qty { @@ -101,6 +101,7 @@ if (! empty($action) && $action == 'fetch' && ! empty($id)) $sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price "; $sql.= " WHERE fk_product='".$id."'"; + $sql.= " AND entity IN (".getEntity('productprice', 1).")"; $sql.= " AND price_level=".$price_level; $sql.= " ORDER BY date_price"; $sql.= " DESC LIMIT 1"; @@ -169,4 +170,4 @@ else if ($outjson) print json_encode($arrayresult); } -?> \ No newline at end of file +?> diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 6888c144a7c..ea5121e7416 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger * Copyright (C) 2010-2011 Juanjo Menent @@ -831,13 +831,15 @@ class Product extends CommonObject */ function _log_price($user,$level=0) { + global $conf; + $now=dol_now(); // Add new price $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price(price_level,date_price,fk_product,fk_user_author,price,price_ttc,price_base_type,tosell,tva_tx,recuperableonly,"; - $sql.= " localtax1_tx, localtax2_tx, price_min,price_min_ttc,price_by_qty) "; + $sql.= " localtax1_tx, localtax2_tx, price_min,price_min_ttc,price_by_qty,entity) "; $sql.= " VALUES(".($level?$level:1).", '".$this->db->idate($now)."',".$this->id.",".$user->id.",".$this->price.",".$this->price_ttc.",'".$this->price_base_type."',".$this->status.",".$this->tva_tx.",".$this->tva_npr.","; - $sql.= " ".$this->localtax1_tx.",".$this->localtax2_tx.",".$this->price_min.",".$this->price_min_ttc.",".$this->price_by_qty; + $sql.= " ".$this->localtax1_tx.",".$this->localtax2_tx.",".$this->price_min.",".$this->price_min_ttc.",".$this->price_by_qty.",".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."_log_price sql=".$sql); @@ -1205,7 +1207,8 @@ class Product extends CommonObject $sql = "SELECT price, price_ttc, price_min, price_min_ttc,"; $sql.= " price_base_type, tva_tx, tosell, price_by_qty, rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price"; - $sql.= " WHERE price_level=".$i; + $sql.= " WHERE entity IN (".getEntity('productprice', 1).")"; + $sql.= " AND price_level=".$i; $sql.= " AND fk_product = '".$this->id."'"; $sql.= " ORDER BY date_price DESC"; $sql.= " LIMIT 1"; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 2d0a1816982..4b27e2f6960 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * * This program is free software; you can redistribute it and/or modify @@ -664,6 +664,7 @@ $sql.= " p.date_price as dp, u.rowid as user_id, u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price as p,"; $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE fk_product = ".$object->id; +$sql.= " AND p.entity IN (".getEntity('productprice', 1).")"; $sql.= " AND p.fk_user_author = u.rowid"; if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql.= " AND p.price_level = ".$soc->price_level; $sql.= " ORDER BY p.date_price DESC, p.price_level ASC"; From 05bd035488ef59221fdb1581b10fba7655e826e9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Jun 2013 17:34:22 +0200 Subject: [PATCH 4/8] Fix: convert line delimiters --- htdocs/adherents/class/adherent.class.php | 12 +- htdocs/adherents/fiche.php | 28 +- htdocs/adherents/stats/byproperties.php | 2 +- htdocs/adherents/stats/geo.php | 6 +- htdocs/adherents/stats/index.php | 4 +- htdocs/admin/boxes.php | 2 +- htdocs/admin/clicktodial.php | 16 +- htdocs/admin/commande.php | 4 +- htdocs/admin/system/phpinfo.php | 20 +- htdocs/admin/triggers.php | 40 +- htdocs/categories/index.php | 2 +- htdocs/categories/viewcat.php | 120 +++--- htdocs/comm/action/class/actioncomm.class.php | 4 +- htdocs/comm/action/fiche.php | 14 +- htdocs/comm/action/index.php | 26 +- htdocs/comm/index.php | 2 +- htdocs/comm/mailing/cibles.php | 18 +- htdocs/comm/propal/class/propal.class.php | 8 +- .../comm/propal/class/propalestats.class.php | 2 +- htdocs/commande/class/commande.class.php | 26 +- htdocs/commande/class/commandestats.class.php | 2 +- htdocs/compta/bank/account.php | 8 +- htdocs/compta/bank/annuel.php | 6 +- htdocs/compta/bank/bankid_fr.php | 8 +- htdocs/compta/bank/bilan.php | 8 +- htdocs/compta/bank/budget.php | 8 +- htdocs/compta/bank/categ.php | 8 +- htdocs/compta/bank/fiche.php | 8 +- htdocs/compta/bank/graph.php | 10 +- htdocs/compta/bank/index.php | 8 +- htdocs/compta/bank/info.php | 8 +- htdocs/compta/bank/rappro.php | 8 +- htdocs/compta/bank/releve.php | 8 +- htdocs/compta/bank/search.php | 4 +- htdocs/compta/bank/treso.php | 8 +- htdocs/compta/bank/virement.php | 8 +- htdocs/compta/deplacement/stats/index.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/compta/facture/class/facture.class.php | 144 +++---- htdocs/compta/paiement.php | 20 +- htdocs/compta/paiement/cheque/fiche.php | 6 +- htdocs/compta/paiement/cheque/index.php | 6 +- htdocs/compta/paiement/cheque/liste.php | 6 +- .../compta/paiement/class/paiement.class.php | 2 +- htdocs/compta/prelevement/bon.php | 8 +- htdocs/compta/prelevement/bons.php | 8 +- htdocs/compta/prelevement/create.php | 8 +- htdocs/compta/prelevement/demandes.php | 8 +- htdocs/compta/prelevement/factures.php | 8 +- htdocs/compta/prelevement/fiche-rejet.php | 8 +- htdocs/compta/prelevement/fiche-stat.php | 10 +- htdocs/compta/prelevement/fiche.php | 8 +- htdocs/compta/prelevement/index.php | 8 +- htdocs/compta/prelevement/ligne.php | 8 +- htdocs/compta/prelevement/lignes.php | 8 +- htdocs/compta/prelevement/liste.php | 6 +- htdocs/compta/prelevement/rejets.php | 8 +- htdocs/compta/prelevement/stats.php | 8 +- htdocs/compta/tva/fiche.php | 10 +- htdocs/contact/class/contact.class.php | 12 +- htdocs/core/boxes/box_activity.php | 24 +- .../boxes/box_graph_invoices_permonth.php | 20 +- htdocs/core/class/commonobject.class.php | 34 +- htdocs/core/class/conf.class.php | 10 +- htdocs/core/class/dolgraph.class.php | 2 +- htdocs/core/class/hookmanager.class.php | 6 +- htdocs/core/class/html.formactions.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 26 +- htdocs/core/class/html.formother.class.php | 34 +- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/lib/barcode.lib.php | 2 +- htdocs/core/lib/files.lib.php | 378 +++++++++--------- htdocs/core/lib/functions.lib.php | 22 +- htdocs/core/lib/functions2.lib.php | 28 +- htdocs/core/lib/invoice2.lib.php | 2 +- htdocs/core/lib/security2.lib.php | 6 +- htdocs/core/menus/standard/auguria.lib.php | 98 ++--- htdocs/core/menus/standard/auguria_menu.php | 24 +- htdocs/core/menus/standard/eldy_menu.php | 10 +- htdocs/core/menus/standard/empty.php | 52 +-- htdocs/core/modules/DolibarrModules.class.php | 2 +- .../modules/import/import_csv.modules.php | 6 +- .../livraison/pdf/pdf_typhon.modules.php | 168 ++++---- htdocs/core/modules/modOpenSurvey.class.php | 18 +- .../mod_facture_fournisseur_cactus.php | 106 ++--- htdocs/core/search_page.php | 4 +- htdocs/core/tpl/login.tpl.php | 4 +- htdocs/core/tpl/passwordforgotten.tpl.php | 22 +- htdocs/cron/list.php | 24 +- htdocs/document.php | 2 +- htdocs/exports/index.php | 4 +- htdocs/fichinter/fiche.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 62 +-- htdocs/fourn/facture/fiche.php | 16 +- htdocs/fourn/fiche.php | 2 +- htdocs/imports/import.php | 8 +- htdocs/imports/index.php | 4 +- htdocs/install/upgrade2.php | 16 +- .../mailmanspip/class/mailmanspip.class.php | 4 +- htdocs/main.inc.php | 116 +++--- htdocs/opensurvey/admin/index.php | 34 +- htdocs/opensurvey/adminstuds.php | 42 +- htdocs/opensurvey/adminstuds_preview.php | 112 +++--- .../class/opensurveysondage.class.php | 28 +- htdocs/opensurvey/fonctions.php | 318 +++++++-------- htdocs/opensurvey/index.php | 20 +- htdocs/opensurvey/list.php | 44 +- htdocs/opensurvey/public/choix_autre.php | 166 ++++---- htdocs/opensurvey/public/choix_date.php | 92 ++--- htdocs/opensurvey/public/create_survey.php | 26 +- htdocs/opensurvey/public/exportcsv.php | 48 +-- htdocs/opensurvey/public/index.php | 38 +- htdocs/opensurvey/public/studs.php | 234 +++++------ htdocs/product/admin/product_tools.php | 78 ++-- htdocs/product/class/product.class.php | 20 +- htdocs/product/liste.php | 2 +- htdocs/projet/activity/index.php | 2 +- htdocs/public/demo/index.php | 130 +++--- htdocs/public/emailing/mailing-read.php | 14 +- .../public/emailing/mailing-unsubscribe.php | 24 +- htdocs/public/paybox/paymentko.php | 38 +- htdocs/public/paybox/paymentok.php | 84 ++-- htdocs/public/paypal/paymentko.php | 42 +- htdocs/public/paypal/paymentok.php | 42 +- htdocs/societe/checkvat/checkVatPopup.php | 4 +- htdocs/societe/class/societe.class.php | 18 +- htdocs/societe/soc.php | 42 +- htdocs/support/index.php | 2 +- htdocs/theme/amarok/graph-color.php | 10 +- htdocs/theme/amarok/style.css.php | 206 +++++----- htdocs/theme/auguria/style.css.php | 8 +- htdocs/theme/bureau2crea/style.css.php | 14 +- htdocs/theme/cameleo/style.css.php | 8 +- htdocs/theme/eldy/style.css.php | 12 +- htdocs/user/class/user.class.php | 8 +- htdocs/user/clicktodial.php | 10 +- htdocs/user/logout.php | 6 +- htdocs/user/param_ihm.php | 8 +- htdocs/user/passwordforgotten.php | 10 +- htdocs/user/perms.php | 4 +- htdocs/viewimage.php | 12 +- .../webservices/server_supplier_invoice.php | 2 +- 142 files changed, 2115 insertions(+), 2115 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 344bf615f56..733e8cfdf74 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1504,7 +1504,7 @@ class Adherent extends CommonObject $langs->load("dict"); $code=$this->civilite_id; - return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); + return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } /** @@ -1531,11 +1531,11 @@ class Adherent extends CommonObject $lien = ''; $lienfin=''; } - if ($option == 'category') - { - $lien = ''; - $lienfin=''; - } + if ($option == 'category') + { + $lien = ''; + $lienfin=''; + } $picto='user'; $label=$langs->trans("ShowMember"); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 8c714ab7c67..a2a9211dfe5 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -49,8 +49,8 @@ $backtopage=GETPOST('backtopage','alpha'); $confirm=GETPOST('confirm','alpha'); $rowid=GETPOST('rowid','int'); $typeid=GETPOST('typeid','int'); -$userid=GETPOST('userid','int'); -$socid=GETPOST('socid','int'); +$userid=GETPOST('userid','int'); +$socid=GETPOST('socid','int'); if (! empty($conf->mailmanspip->enabled)) { @@ -249,16 +249,16 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $lastname=$_POST["lastname"]; $firstname=$_POST["firstname"]; $morphy=$morphy=$_POST["morphy"];; - if ($morphy != 'mor' && empty($lastname)) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; - } - if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; - } + if ($morphy != 'mor' && empty($lastname)) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; + } + if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; + } // Create new object if ($result > 0 && ! $error) @@ -383,7 +383,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) else { setEventMessage($object->mesgs, 'mesgs'); - } + } } $rowid=$object->id; @@ -715,7 +715,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object = new Adherent($db); $result=$object->fetch($rowid); - if ($result <= 0) dol_print_error('',$object->error); + if ($result <= 0) dol_print_error('',$object->error); } $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 7c1cc07ad69..b84350528d4 100755 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -44,7 +44,7 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); +$langs->load("members"); $langs->load("companies"); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 38a47555706..090e414c548 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -23,9 +23,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; -$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700); +$graphwidth=DolGraph::getDefaultGraphSizeForStats('width',700); $mapratio = 0.5; $graphheight = round($graphwidth * $mapratio); @@ -44,7 +44,7 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); +$langs->load("members"); $langs->load("companies"); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 7ca24d5bd4f..6d0fcf6bb9e 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -46,8 +46,8 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); -$langs->load("companies"); +$langs->load("members"); +$langs->load("companies"); /* diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index d5bdedc01d5..31d313b84e9 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -347,7 +347,7 @@ foreach($boxtoadd as $box) print ''; print ''; print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); - if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; print ''; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 726bd912964..41a3f02838d 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -84,11 +84,11 @@ print '
'; print $langs->trans("ClickToDialUrlDesc").'
'; print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; -//if (! empty($user->clicktodial_url)) -//{ - print '
'; - print info_admin($langs->trans("ValueOverwrittenByUserSetup")); -//} +//if (! empty($user->clicktodial_url)) +//{ + print '
'; + print info_admin($langs->trans("ValueOverwrittenByUserSetup")); +//} print ''; @@ -113,9 +113,9 @@ if (! empty($conf->global->CLICKTODIAL_URL)) print ''; $setupcomplete=1; - if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; - if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; - if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; + if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; + if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; + if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; if ($setupcomplete) { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index fc5c4ec68b2..a8c7f2ee2e7 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -44,8 +44,8 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scandir','alpha'); $type = 'order'; diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index c6e2819f5d7..bbb2c60e51f 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -23,8 +23,8 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->load("admin"); @@ -48,18 +48,18 @@ if (isset($title)) -print ''; -print ''; -print "\n"; - +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print ''; +print "\n"; + $var=false; -// Recupere la version de l'OS -$phpversion=version_php(); -print "\n"; +// Recupere la version de l'OS +$phpversion=version_php(); +print "\n"; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Version")."".$phpversion."
'.$langs->trans("Version")."".$phpversion."
'; -print '
'; +print '
'; diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 3d9ebbd1d29..980bd9ef4bb 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -52,27 +52,27 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/'; $interfaces = new Interfaces($db); $triggers = $interfaces->getTriggersList(0,'priority'); -print ' - - - - - +print '
'.$langs->trans("File").''.$langs->trans("Active").' 
+ + + + + '; - -$var=True; -foreach ($triggers as $trigger) -{ - $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; -} - -print '
'.$langs->trans("File").''.$langs->trans("Active").' 
'.$trigger['picto'].''.$trigger['file'].''.$trigger['status'].''.$form->textwithpicto('', $trigger['info']).'
'; + +$var=True; +foreach ($triggers as $trigger) +{ + $var=!$var; + print ''; + print ''.$trigger['picto'].''; + print ''.$trigger['file'].''; + print ''.$trigger['status'].''; + print ''.$form->textwithpicto('', $trigger['info']).''; + print ''; +} + +print ''; llxFooter(); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 4e9f376977c..bd293f9febb 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -127,7 +127,7 @@ else print ' '; //print ''; print ''; -print '

'; +print '

'; // Charge tableau des categories diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 36ed1bd4ded..3cdb5d516f1 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -36,7 +36,7 @@ $ref=GETPOST('ref'); $type=GETPOST('type'); $action=GETPOST('action'); $confirm=GETPOST('confirm'); -$removeelem = GETPOST('removeelem','int'); +$removeelem = GETPOST('removeelem','int'); if ($id == "") { @@ -62,39 +62,39 @@ $type=$object->type; * Actions */ -// Remove element from category -if ($id > 0 && $removeelem > 0) -{ - if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) - { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $tmpobject = new Product($db); - $result = $tmpobject->fetch($removeelem); - $elementtype = 'product'; - } - if ($type==1 && $user->rights->societe->creer) - { - $tmpobject = new Societe($db); - $result = $tmpobject->fetch($removeelem); - $elementtype = 'fournisseur'; - } - if ($type==2 && $user->rights->societe->creer) - { - $tmpobject = new Societe($db); - $result = $tmpobject->fetch($removeelem); - $elementtype = 'societe'; - } - if ($type == 3 && $user->rights->adherent->creer) +// Remove element from category +if ($id > 0 && $removeelem > 0) +{ + if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) { - require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $tmpobject = new Adherent($db); - $result = $tmpobject->fetch($removeelem); + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $tmpobject = new Product($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'product'; + } + if ($type==1 && $user->rights->societe->creer) + { + $tmpobject = new Societe($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'fournisseur'; + } + if ($type==2 && $user->rights->societe->creer) + { + $tmpobject = new Societe($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'societe'; + } + if ($type == 3 && $user->rights->adherent->creer) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $tmpobject = new Adherent($db); + $result = $tmpobject->fetch($removeelem); $elementtype = 'member'; - } - + } + $result=$object->del_type($tmpobject,$elementtype); - if ($result < 0) dol_print_error('',$object->error); -} + if ($result < 0) dol_print_error('',$object->error); +} if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confirm == 'yes') { @@ -312,21 +312,21 @@ if ($object->type == 1) print ''; print $soc->getNomUrl(1,'category_supplier'); print "\n"; - // Link to delete from category - print ''; - $typeid=$object->type; - $permission=0; - if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); - if ($typeid == 1) $permission=$user->rights->societe->creer; - if ($typeid == 2) $permission=$user->rights->societe->creer; - if ($typeid == 3) $permission=$user->rights->adherent->creer; - if ($permission) - { - print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; - } - print ''; + // Link to delete from category + print ''; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print ''; print "\n"; } @@ -364,20 +364,20 @@ if($object->type == 2) print ''; print $soc->getNomUrl(1,'category'); print "\n"; - // Link to delete from category - print ''; - $typeid=$object->type; - $permission=0; - if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); - if ($typeid == 1) $permission=$user->rights->societe->creer; - if ($typeid == 2) $permission=$user->rights->societe->creer; - if ($typeid == 3) $permission=$user->rights->adherent->creer; - if ($permission) - { - print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; - } + // Link to delete from category + print ''; + $typeid=$object->type; + $permission=0; + if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == 1) $permission=$user->rights->societe->creer; + if ($typeid == 2) $permission=$user->rights->societe->creer; + if ($typeid == 3) $permission=$user->rights->adherent->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } print ''; print "\n"; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index bb30efe8ef9..f4bb4542843 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -334,7 +334,7 @@ class ActionComm extends CommonObject $this->priority = $obj->priority; $this->fulldayevent = $obj->fulldayevent; $this->location = $obj->location; - $this->transparency = $obj->transparency; + $this->transparency = $obj->transparency; $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->societe->id = $obj->fk_soc; @@ -476,7 +476,7 @@ class ActionComm extends CommonObject $sql.= ", priority = '".$this->priority."'"; $sql.= ", fulldayevent = '".$this->fulldayevent."'"; $sql.= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'":"null"); - $sql.= ", transparency = '".$this->transparency."'"; + $sql.= ", transparency = '".$this->transparency."'"; $sql.= ", fk_user_mod = '".$user->id."'"; $sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null"); $sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null"); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 3fe597d5c66..a813a34135a 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -527,8 +527,8 @@ if ($action == 'create') // Busy print ''.$langs->trans("Busy").''; - print ''; - print ''; + print ''; + print ''; // Realised by if ($conf->global->AGENDA_ENABLE_DONEBY) @@ -768,13 +768,13 @@ if ($id > 0) print ''; // Busy - print ''.$langs->trans("Busy").''; + print ''.$langs->trans("Busy").''; print 'transparency?' checked="checked"':'').'">'; - print ''; - + print ''; + // Realised by - if ($conf->global->AGENDA_ENABLE_DONEBY) - { + if ($conf->global->AGENDA_ENABLE_DONEBY) + { print ''.$langs->trans("ActionDoneBy").''; print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); print ''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 705c7d6ff1c..e52615f6e59 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -76,7 +76,7 @@ $pid=GETPOST("projectid","int",3); $status=GETPOST("status"); $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); -$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); +$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=="0"?'':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); if (GETPOST('viewcal')) { $action='show_month'; $day=''; @@ -965,7 +965,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { - $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; + $newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; //$param='month='.$monthshown.'&year='.$year; $hourminsec='100000'; @@ -1022,17 +1022,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa { // Define color index if not yet defined $idusertouse=($event->usertodo->id?$event->usertodo->id:0); - if (isset($colorindexused[$idusertouse])) - { - $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user - } - else - { - $colorindex=$nextindextouse; - $colorindexused[$idusertouse]=$colorindex; - if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color - } - //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; + if (isset($colorindexused[$idusertouse])) + { + $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user + } + else + { + $colorindex=$nextindextouse; + $colorindexused[$idusertouse]=$colorindex; + if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color + } + //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; // Define color $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index fbc76d402e1..f32fa89b59b 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -249,7 +249,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) } -print '
'; +print '
'; $NBMAX=3; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 90c01d54725..3c7d425feb1 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -376,19 +376,19 @@ if ($object->fetch($id) >= 0) print ''; print ''; - $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; + $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,''); print ''; - print "\n\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - + print "\n\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($page) $param.= "&page=".$page; print ''; @@ -521,7 +521,7 @@ if ($object->fetch($id) >= 0) } print "

"; - print '
'; + print ''; $db->free($resql); } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c8d0bfeebde..db8dd255b6c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1797,10 +1797,10 @@ class Propal extends CommonObject $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " AND p.fk_soc = s.rowid"; $sql.= " AND p.fk_statut = c.id"; - if (! $user->rights->societe->client->voir && ! $socid) //restriction - { - $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } + if (! $user->rights->societe->client->voir && ! $socid) //restriction + { + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + } if ($socid) $sql.= " AND s.rowid = ".$socid; if ($draft) $sql.= " AND p.fk_statut = 0"; if ($notcurrentuser > 0) $sql.= " AND p.fk_user_author <> ".$user->id; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 54ddc846272..34584c7f99e 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -26,7 +26,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 508f9a70fc6..edfbb35f5cd 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2026,19 +2026,19 @@ class Commande extends CommonOrder { $obj = $this->db->fetch_object($result); - if ($shortlist == 1) - { - $ga[$obj->cid] = $obj->ref; - } - else if ($shortlist == 2) - { - $ga[$obj->cid] = $obj->ref.' ('.$obj->name.')'; - } - else - { - $ga[$i]['id'] = $obj->cid; - $ga[$i]['ref'] = $obj->ref; - $ga[$i]['name'] = $obj->name; + if ($shortlist == 1) + { + $ga[$obj->cid] = $obj->ref; + } + else if ($shortlist == 2) + { + $ga[$obj->cid] = $obj->ref.' ('.$obj->name.')'; + } + else + { + $ga[$i]['id'] = $obj->cid; + $ga[$i]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; } $i++; } diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 56c69d84541..40714e98811 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -26,7 +26,7 @@ include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; -include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; /** diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 5c15947d186..fe9cbdd0bfc 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -35,10 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index ada636adb33..3258adbb55d 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -26,9 +26,9 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); $id=GETPOST('account'); $ref=GETPOST('ref'); diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 402dbeda095..dbe67212f37 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -27,10 +27,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $action=GETPOST('action'); diff --git a/htdocs/compta/bank/bilan.php b/htdocs/compta/bank/bilan.php index 2224627cd94..a5e6605ad85 100644 --- a/htdocs/compta/bank/bilan.php +++ b/htdocs/compta/bank/bilan.php @@ -23,10 +23,10 @@ */ require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (!$user->rights->banque->lire) accessforbidden(); diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index e14b3e92df6..672e1363d3e 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -24,10 +24,10 @@ */ require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 9fcd579bc15..0ce66ded189 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -24,10 +24,10 @@ */ require('../../main.inc.php'); -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (!$user->rights->banque->configurer) accessforbidden(); diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index daee366ebdb..407a5398dc5 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $action=GETPOST("action"); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 932acf5dcb5..3954edf99ee 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -27,12 +27,12 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; - -$langs->load("banks"); -$langs->load("categories"); -$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); -$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); +$langs->load("banks"); +$langs->load("categories"); + +$WIDTH=DolGraph::getDefaultGraphSizeForStats('width',768); +$HEIGHT=DolGraph::getDefaultGraphSizeForStats('height',200); // Security check if (isset($_GET["account"]) || isset($_GET["ref"])) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 344231cea5d..51b7a4dc818 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -27,10 +27,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index a4a871cec93..a5a0cdf1677 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -24,10 +24,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index da28602314a..29a47a60e9b 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); if (! $user->rights->banque->consolidate) accessforbidden(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 2a6ddd762d3..e7b3b5ed917 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -25,10 +25,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $langs->load("bills"); diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index bdfda680d6d..ea7d29beb0f 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -27,8 +27,8 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; $langs->load("banks"); $langs->load("categories"); diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 91f05a2fdaa..af7078421a2 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index f770c5bc371..bea66e6a47d 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (! $user->rights->banque->transfer) accessforbidden(); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index eade2e3c13d..d6c1465937f 100755 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -205,7 +205,7 @@ complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats'); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); -print '
'; +print '
'; // Show filter box diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 250605f386b..3663e71ffde 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2687,7 +2687,7 @@ else if ($id > 0 || ! empty($ref)) print $formconfirm; - + // Invoice content diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c45e52bec39..bd0bbaf121e 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2660,77 +2660,77 @@ class Facture extends CommonInvoice } - /** - * Return list of invoices (eventually filtered on a user) into an array - * - * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) - * @param int $draft 0=not draft, 1=draft - * @param User $excluser Objet user to exclude - * @param int $socid Id third pary - * @param int $limit For pagination - * @param int $offset For pagination - * @param string $sortfield Sort criteria - * @param string $sortorder Sort order - * @return int -1 if KO, array with result if OK - */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') - { - global $conf,$user; - - $ga = array(); - - $sql = "SELECT s.rowid, s.nom as name, s.client,"; - $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) //restriction - { - $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } - if ($socid) $sql.= " AND s.rowid = ".$socid; - if ($draft) $sql.= " AND f.fk_statut = 0"; - if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; - $sql.= $this->db->order($sortfield,$sortorder); - $sql.= $this->db->plimit($limit,$offset); - - $result=$this->db->query($sql); - if ($result) - { - $numc = $this->db->num_rows($result); - if ($numc) - { - $i = 0; - while ($i < $numc) - { - $obj = $this->db->fetch_object($result); - - if ($shortlist == 1) - { - $ga[$obj->fid] = $obj->ref; - } - else if ($shortlist == 2) - { - $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; - } - else - { - $ga[$i]['id'] = $obj->fid; - $ga[$i]['ref'] = $obj->ref; - $ga[$i]['name'] = $obj->name; - } - $i++; - } - } - return $ga; - } - else - { - dol_print_error($this->db); - return -1; - } + /** + * Return list of invoices (eventually filtered on a user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param User $excluser Objet user to exclude + * @param int $socid Id third pary + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return int -1 if KO, array with result if OK + */ + function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') + { + global $conf,$user; + + $ga = array(); + + $sql = "SELECT s.rowid, s.nom as name, s.client,"; + $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_soc = s.rowid"; + if (! $user->rights->societe->client->voir && ! $socid) //restriction + { + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + } + if ($socid) $sql.= " AND s.rowid = ".$socid; + if ($draft) $sql.= " AND f.fk_statut = 0"; + if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; + $sql.= $this->db->order($sortfield,$sortorder); + $sql.= $this->db->plimit($limit,$offset); + + $result=$this->db->query($sql); + if ($result) + { + $numc = $this->db->num_rows($result); + if ($numc) + { + $i = 0; + while ($i < $numc) + { + $obj = $this->db->fetch_object($result); + + if ($shortlist == 1) + { + $ga[$obj->fid] = $obj->ref; + } + else if ($shortlist == 2) + { + $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; + } + else + { + $ga[$i]['id'] = $obj->fid; + $ga[$i]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; + } + $i++; + } + } + return $ga; + } + else + { + dol_print_error($this->db); + return -1; + } } @@ -3121,7 +3121,7 @@ class Facture extends CommonInvoice $this->total_tva += $line->total_tva; $this->total_ttc += $line->total_ttc; } - $this->revenuestamp = 0; + $this->revenuestamp = 0; // Add a line "offered" $line=new FactureLigne($this->db); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 232126d68e2..c8a2480155c 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -156,16 +156,16 @@ if ($action == 'confirm_paiement' && $confirm == 'yes') } } - if (! empty($conf->banque->enabled)) - { - // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement - if (GETPOST('accountid') <= 0) - { - $fiche_erreur_message = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')).'
'; - $error++; - } - } - + if (! empty($conf->banque->enabled)) + { + // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement + if (GETPOST('accountid') <= 0) + { + $fiche_erreur_message = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')).'
'; + $error++; + } + } + // Creation of payment line $paiement = new Paiement($db); $paiement->datepaye = $datepaye; diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 8a24ab3ce29..3251b4a1ab6 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -29,9 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); $langs->load('bills'); $langs->load('companies'); $langs->load('compta'); diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index cfde42a5cf3..80ea9ea6817 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -26,9 +26,9 @@ require('../../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php index 8370bd95551..705bc15eb88 100644 --- a/htdocs/compta/paiement/cheque/liste.php +++ b/htdocs/compta/paiement/cheque/liste.php @@ -26,9 +26,9 @@ require('../../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); // Security check diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e5dd9e60ea4..7ef5f44fb88 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -392,7 +392,7 @@ class Paiement extends CommonObject $this->error='Bad value for parameter accountid'; dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR); return -1; - } + } $this->db->begin(); diff --git a/htdocs/compta/prelevement/bon.php b/htdocs/compta/prelevement/bon.php index 89b40e095bc..b1bcbb3d04b 100644 --- a/htdocs/compta/prelevement/bon.php +++ b/htdocs/compta/prelevement/bon.php @@ -27,10 +27,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("bills"); $langs->load("categories"); diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index ce33322d03a..8f2d336defe 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); // Security check diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index f9d770111a7..ddf8a988b48 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); $langs->load("companies"); $langs->load("bills"); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 3012a70bd55..3ae2b850aac 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -28,10 +28,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/modules/modPrelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("widthdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index ec8eaa51479..115a7829374 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("companies"); $langs->load('withdrawals'); $langs->load('bills'); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index c77a0ab6682..87516c3ad65 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load('withdrawals'); $langs->load('bills'); diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 161df078aae..5fcd70b1a9b 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -27,11 +27,11 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); -$langs->load("withdrawals"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); +$langs->load("withdrawals"); // Security check if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index a7ebf00c950..22af3b3548d 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); if (!$user->rights->prelevement->bons->lire) accessforbidden(); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index d3823cc130e..56a7529fd9a 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); // Security check diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 55dd526bb2a..4ba08c10445 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php index 445f1e66755..c322142b6a9 100644 --- a/htdocs/compta/prelevement/lignes.php +++ b/htdocs/compta/prelevement/lignes.php @@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.p require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); // Security check if ($user->societe_id > 0) accessforbidden(); diff --git a/htdocs/compta/prelevement/liste.php b/htdocs/compta/prelevement/liste.php index d3d8634d64a..cd09dc6cf25 100644 --- a/htdocs/compta/prelevement/liste.php +++ b/htdocs/compta/prelevement/liste.php @@ -26,9 +26,9 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); $langs->load("withdrawals"); $langs->load("companies"); $langs->load("categories"); diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index b33a5fd2455..5744ab0eb7b 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -28,10 +28,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 34ffdb168b5..418d733dbd4 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -26,10 +26,10 @@ require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - -$langs->load("banks"); -$langs->load("categories"); +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + +$langs->load("banks"); +$langs->load("categories"); $langs->load("withdrawals"); $langs->load("companies"); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index a31b4030b65..f36fd0be5a5 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -41,7 +41,7 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); -$tva = new Tva($db); +$tva = new Tva($db); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('taxvatcard')); @@ -54,7 +54,7 @@ $hookmanager->initHooks(array('taxvatcard')); if ($_POST["cancel"] == $langs->trans("Cancel")) { - header("Location: reglement.php"); + header("Location: reglement.php"); exit; } @@ -231,9 +231,9 @@ if ($id) print $vatpayment->ref; print ''; - // Label - print ''.$langs->trans("Label").''.$vatpayment->label.''; - + // Label + print ''.$langs->trans("Label").''.$vatpayment->label.''; + print ""; print ''.$langs->trans("DatePayment").''; print dol_print_date($vatpayment->datep,'day'); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 749e2fa08ce..036b99f9ae3 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1010,13 +1010,13 @@ class Contact extends CommonObject $this->country = 'France'; $this->email = 'specimen@specimen.com'; - $this->phone_pro = '0909090901'; - $this->phone_perso = '0909090902'; - $this->phone_mobile = '0909090903'; - $this->fax = '0909090909'; + $this->phone_pro = '0909090901'; + $this->phone_perso = '0909090902'; + $this->phone_mobile = '0909090903'; + $this->fax = '0909090909'; - $this->note_public='This is a comment (public)'; - $this->note_private='This is a comment (private)'; + $this->note_public='This is a comment (public)'; + $this->note_private='This is a comment (private)'; $socid = rand(1, $num_socs); $this->socid = $socids[$socid]; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index ad0da9451e9..d0b59b67dd7 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -42,21 +42,21 @@ class box_activity extends ModeleBoxes var $info_box_contents = array(); - /** - * Constructor - * - * @param DoliDB $db Database handler - * @param string $param More parameters - */ - function __construct($db,$param) - { - global $conf; - - $this->db=$db; + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) + { + global $conf; + + $this->db=$db; // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software. // FIXME: Removed number_format (not compatible with all languages) // FIXME: Pb into some status - $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous FIXME) } /** diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 3ec5add8a05..5bce26306f3 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -39,18 +39,18 @@ class box_graph_invoices_permonth extends ModeleBoxes var $info_box_contents = array(); - /** - * Constructor - * - * @param DoliDB $db Database handler - * @param string $param More parameters - */ - function __construct($db,$param) + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param) { global $conf; - - $this->db=$db; - $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; + + $this->db=$db; + $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 75183c2448a..d8b3e923781 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -82,24 +82,24 @@ abstract class CommonObject return dol_trunc($ret,$maxlen); } - /** - * Return full address of contact - * - * @param int $withcountry 1=Add country into address string - * @param string $sep Separator to use to build string - * @return string Full address string - */ - function getFullAddress($withcountry=0,$sep="\n") - { - if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) - { - require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; - $tmparray=getCountry($this->country_id,'all'); - $this->country_code=$tmparray['code']; - $this->country =$tmparray['label']; - } + /** + * Return full address of contact + * + * @param int $withcountry 1=Add country into address string + * @param string $sep Separator to use to build string + * @return string Full address string + */ + function getFullAddress($withcountry=0,$sep="\n") + { + if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) + { + require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php'; + $tmparray=getCountry($this->country_id,'all'); + $this->country_code=$tmparray['code']; + $this->country =$tmparray['label']; + } - return dol_format_address($this, $withcountry, $sep); + return dol_format_address($this, $withcountry, $sep); } /** diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index a7a8fe04903..4ce1bbf8c3d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -63,11 +63,11 @@ class Conf //! Used to store list of entities to use for each element public $entities = array(); - public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url - public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url - public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone - public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone - public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url + public $dol_hide_topmenu; // Set if we force param dol_hide_topmenu into login url + public $dol_hide_leftmenu; // Set if we force param dol_hide_leftmenu into login url + public $dol_optimize_smallscreen; // Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone + public $dol_no_mouse_hover; // Set if we force param dol_no_mouse_hover into login url or if browser is smartphone + public $dol_use_jmobile; // Set if we force param dol_use_jmobile into login url /** diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ea1734353d3..529b420f961 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -907,7 +907,7 @@ class DolGraph if ($direction == 'width') return ($conf->dol_optimize_smallscreen?(empty($_SESSION['dol_screen_width'])?'280':$_SESSION['dol_screen_width']-40):($defaultsize?$defaultsize:'500')); if ($direction == 'height') return ($conf->dol_optimize_smallscreen?'160':($defaultsize?$defaultsize:'200')); - return 0; + return 0; } } diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index bfd8f63d9a4..2642fc7e165 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -143,7 +143,7 @@ class HookManager { foreach($modules as $module => $actionclassinstance) { - //print "Before hook ".get_class($actionclassinstance)." method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction."
\n"; + //print "Before hook ".get_class($actionclassinstance)." method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction."
\n"; //print 'class='.get_class($actionclassinstance).' method='.$method.' action='.$action; // jump to next class if method does not exists @@ -168,8 +168,8 @@ class HookManager } } - if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); - if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; + if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); + if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; } // Generic hooks that return a string or array (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) else diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index b7477c203f5..ef8422a7dbc 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -230,7 +230,7 @@ class FormActions //asort($arraylist); if ($selected == 'manual') $selected='AC_OTH'; - if ($selected == 'auto') $selected='AC_OTH_AUTO'; + if ($selected == 'auto') $selected='AC_OTH_AUTO'; print $form->selectarray($htmlname, $arraylist, $selected); if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 24707425cf4..b79b3ef22c6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -383,18 +383,18 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - -// Keep this. Used for test with jmobile -/*print ' -
- -
-';*/ + +// Keep this. Used for test with jmobile +/*print ' +
+ +
+';*/ if (empty($noform)) $out.= '
'; $out.= ''; @@ -451,7 +451,7 @@ class FormFile $langs->load("errors"); $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } - if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; + if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; $out.= $genbutton; $out.= ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c2d3a7c32c2..f5def186abb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -945,30 +945,30 @@ class FormOther if (! count($arrayboxtoactivatelabel)) print 'jQuery("#boxcombo").hide();'; print ' - jQuery("#left, #right").sortable({ - /* placeholder: \'ui-state-highlight\', */ - handle: \'.boxhandle\', - revert: \'invalid\', - items: \'.box\', - containment: \'.fiche\', - connectWith: \'.connectedSortable\', - stop: function(event, ui) { - updateBoxOrder(0); - } + jQuery("#left, #right").sortable({ + /* placeholder: \'ui-state-highlight\', */ + handle: \'.boxhandle\', + revert: \'invalid\', + items: \'.box\', + containment: \'.fiche\', + connectWith: \'.connectedSortable\', + stop: function(event, ui) { + updateBoxOrder(0); + } }); - jQuery(".boxclose").click(function() { - var self = this; // because JQuery can modify this + jQuery(".boxclose").click(function() { + var self = this; // because JQuery can modify this var boxid=self.id.substring(8); - var label=jQuery(\'#boxlabelentry\'+boxid).val(); + var label=jQuery(\'#boxlabelentry\'+boxid).val(); jQuery(\'#boxto_\'+boxid).remove(); if (boxid > 0) jQuery(\'#boxcombo\').append(new Option(label, boxid)); - updateBoxOrder(1); - }); + updateBoxOrder(1); + }); - });'."\n"; + });'."\n"; - print ''."\n"; + print ''."\n"; } $nbboxactivated=count($boxidactivatedforuser); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 434ffc7d7fb..9aca2c29c26 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -300,7 +300,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker $sqlmodified++; } - if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); + if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG); $result=$db->query($newsql,$usesavepoint); if ($result) diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 67b51748d3e..83d161a20a0 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -253,7 +253,7 @@ function barcode_encode_genbarcode($code,$encoding) $command=escapeshellarg($genbarcode_loc); //$paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\""; - $paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding)); + $paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding)); $fullcommandclear=$command." ".$paramclear." 2>&1"; //print $fullcommandclear."
\n";exit; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index cad4d4c3d52..1c26fbf5915 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1251,171 +1251,171 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity) $ret=array(); // Wrapping for some images - if ($modulepart == 'companylogo') - { - $accessallowed=1; - $original_file=$conf->mycompany->dir_output.'/logos/'.$original_file; - } - // Wrapping for users photos - elseif ($modulepart == 'userphoto') - { - $accessallowed=1; - $original_file=$conf->user->dir_output.'/'.$original_file; - } - // Wrapping for members photos - elseif ($modulepart == 'memberphoto') - { - $accessallowed=1; - $original_file=$conf->adherent->dir_output.'/'.$original_file; + if ($modulepart == 'companylogo') + { + $accessallowed=1; + $original_file=$conf->mycompany->dir_output.'/logos/'.$original_file; } - // Wrapping pour les apercu factures - elseif ($modulepart == 'apercufacture') - { - if ($user->rights->facture->lire) $accessallowed=1; - $original_file=$conf->facture->dir_output.'/'.$original_file; - } - // Wrapping pour les apercu propal - elseif ($modulepart == 'apercupropal') - { - if ($user->rights->propale->lire) $accessallowed=1; - $original_file=$conf->propal->dir_output.'/'.$original_file; - } - // Wrapping pour les apercu commande - elseif ($modulepart == 'apercucommande') - { - if ($user->rights->commande->lire) $accessallowed=1; - $original_file=$conf->commande->dir_output.'/'.$original_file; - } - // Wrapping pour les apercu intervention - elseif ($modulepart == 'apercufichinter') - { - if ($user->rights->ficheinter->lire) $accessallowed=1; - $original_file=$conf->ficheinter->dir_output.'/'.$original_file; - } - // Wrapping pour les images des stats propales - elseif ($modulepart == 'propalstats') - { - if ($user->rights->propale->lire) $accessallowed=1; - $original_file=$conf->propal->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats commandes - elseif ($modulepart == 'orderstats') - { - if ($user->rights->commande->lire) $accessallowed=1; - $original_file=$conf->commande->dir_temp.'/'.$original_file; - } - elseif ($modulepart == 'orderstatssupplier') - { - if ($user->rights->fournisseur->commande->lire) $accessallowed=1; - $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file; - } - // Wrapping pour les images des stats factures - elseif ($modulepart == 'billstats') - { - if ($user->rights->facture->lire) $accessallowed=1; - $original_file=$conf->facture->dir_temp.'/'.$original_file; - } - elseif ($modulepart == 'billstatssupplier') - { - if ($user->rights->fournisseur->facture->lire) $accessallowed=1; - $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file; - } - // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'expeditionstats') - { - if ($user->rights->expedition->lire) $accessallowed=1; - $original_file=$conf->expedition->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'tripsexpensesstats') - { - if ($user->rights->deplacement->lire) $accessallowed=1; - $original_file=$conf->deplacement->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats expeditions - elseif ($modulepart == 'memberstats') - { - if ($user->rights->adherent->lire) $accessallowed=1; - $original_file=$conf->adherent->dir_temp.'/'.$original_file; - } - // Wrapping pour les images des stats produits - elseif (preg_match('/^productstats_/i',$modulepart)) - { - if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1; - $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file; - } - // Wrapping for products or services - elseif ($modulepart == 'tax') - { - if ($user->rights->tax->charges->lire) $accessallowed=1; - $original_file=$conf->tax->dir_output.'/'.$original_file; - } - // Wrapping for products or services - elseif ($modulepart == 'actions') - { - if ($user->rights->agenda->myactions->read) $accessallowed=1; - $original_file=$conf->agenda->dir_output.'/'.$original_file; - } - // Wrapping for categories - elseif ($modulepart == 'category') - { - if ($user->rights->categorie->lire) $accessallowed=1; - $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file; - } - // Wrapping pour les prelevements - elseif ($modulepart == 'prelevement') + // Wrapping for users photos + elseif ($modulepart == 'userphoto') + { + $accessallowed=1; + $original_file=$conf->user->dir_output.'/'.$original_file; + } + // Wrapping for members photos + elseif ($modulepart == 'memberphoto') + { + $accessallowed=1; + $original_file=$conf->adherent->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu factures + elseif ($modulepart == 'apercufacture') + { + if ($user->rights->facture->lire) $accessallowed=1; + $original_file=$conf->facture->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu propal + elseif ($modulepart == 'apercupropal') + { + if ($user->rights->propale->lire) $accessallowed=1; + $original_file=$conf->propal->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu commande + elseif ($modulepart == 'apercucommande') + { + if ($user->rights->commande->lire) $accessallowed=1; + $original_file=$conf->commande->dir_output.'/'.$original_file; + } + // Wrapping pour les apercu intervention + elseif ($modulepart == 'apercufichinter') + { + if ($user->rights->ficheinter->lire) $accessallowed=1; + $original_file=$conf->ficheinter->dir_output.'/'.$original_file; + } + // Wrapping pour les images des stats propales + elseif ($modulepart == 'propalstats') + { + if ($user->rights->propale->lire) $accessallowed=1; + $original_file=$conf->propal->dir_temp.'/'.$original_file; + } + // Wrapping pour les images des stats commandes + elseif ($modulepart == 'orderstats') + { + if ($user->rights->commande->lire) $accessallowed=1; + $original_file=$conf->commande->dir_temp.'/'.$original_file; + } + elseif ($modulepart == 'orderstatssupplier') + { + if ($user->rights->fournisseur->commande->lire) $accessallowed=1; + $original_file=$conf->fournisseur->dir_output.'/commande/temp/'.$original_file; + } + // Wrapping pour les images des stats factures + elseif ($modulepart == 'billstats') + { + if ($user->rights->facture->lire) $accessallowed=1; + $original_file=$conf->facture->dir_temp.'/'.$original_file; + } + elseif ($modulepart == 'billstatssupplier') + { + if ($user->rights->fournisseur->facture->lire) $accessallowed=1; + $original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file; + } + // Wrapping pour les images des stats expeditions + elseif ($modulepart == 'expeditionstats') + { + if ($user->rights->expedition->lire) $accessallowed=1; + $original_file=$conf->expedition->dir_temp.'/'.$original_file; + } + // Wrapping pour les images des stats expeditions + elseif ($modulepart == 'tripsexpensesstats') + { + if ($user->rights->deplacement->lire) $accessallowed=1; + $original_file=$conf->deplacement->dir_temp.'/'.$original_file; + } + // Wrapping pour les images des stats expeditions + elseif ($modulepart == 'memberstats') + { + if ($user->rights->adherent->lire) $accessallowed=1; + $original_file=$conf->adherent->dir_temp.'/'.$original_file; + } + // Wrapping pour les images des stats produits + elseif (preg_match('/^productstats_/i',$modulepart)) + { + if ($user->rights->produit->lire || $user->rights->service->lire) $accessallowed=1; + $original_file=(!empty($conf->product->multidir_temp[$entity])?$conf->product->multidir_temp[$entity]:$conf->service->multidir_temp[$entity]).'/'.$original_file; + } + // Wrapping for products or services + elseif ($modulepart == 'tax') + { + if ($user->rights->tax->charges->lire) $accessallowed=1; + $original_file=$conf->tax->dir_output.'/'.$original_file; + } + // Wrapping for products or services + elseif ($modulepart == 'actions') + { + if ($user->rights->agenda->myactions->read) $accessallowed=1; + $original_file=$conf->agenda->dir_output.'/'.$original_file; + } + // Wrapping for categories + elseif ($modulepart == 'category') + { + if ($user->rights->categorie->lire) $accessallowed=1; + $original_file=$conf->categorie->multidir_output[$entity].'/'.$original_file; + } + // Wrapping pour les prelevements + elseif ($modulepart == 'prelevement') { if ($user->rights->prelevement->bons->lire || preg_match('/^specimen/i',$original_file)) { $accessallowed=1; } - $original_file=$conf->prelevement->dir_output.'/'.$original_file; - } - // Wrapping pour les graph energie - elseif ($modulepart == 'graph_stock') - { - $accessallowed=1; - $original_file=$conf->stock->dir_temp.'/'.$original_file; - } - // Wrapping pour les graph fournisseurs - elseif ($modulepart == 'graph_fourn') - { - $accessallowed=1; - $original_file=$conf->fournisseur->dir_temp.'/'.$original_file; - } - // Wrapping pour les graph des produits - elseif ($modulepart == 'graph_product') - { - $accessallowed=1; - $original_file=$conf->product->multidir_temp[$entity].'/'.$original_file; - } - // Wrapping pour les code barre - elseif ($modulepart == 'barcode') - { - $accessallowed=1; - // If viewimage is called for barcode, we try to output an image on the fly, - // with not build of file on disk. - //$original_file=$conf->barcode->dir_temp.'/'.$original_file; - $original_file=''; - } - // Wrapping pour les icones de background des mailings - elseif ($modulepart == 'iconmailing') - { - $accessallowed=1; - $original_file=$conf->mailing->dir_temp.'/'.$original_file; - } - // Wrapping pour les icones de background des mailings - elseif ($modulepart == 'scanner_user_temp') - { - $accessallowed=1; - $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; - } - // Wrapping pour les images fckeditor - elseif ($modulepart == 'fckeditor') - { - $accessallowed=1; - $original_file=$conf->fckeditor->dir_output.'/'.$original_file; - } + $original_file=$conf->prelevement->dir_output.'/'.$original_file; + } + // Wrapping pour les graph energie + elseif ($modulepart == 'graph_stock') + { + $accessallowed=1; + $original_file=$conf->stock->dir_temp.'/'.$original_file; + } + // Wrapping pour les graph fournisseurs + elseif ($modulepart == 'graph_fourn') + { + $accessallowed=1; + $original_file=$conf->fournisseur->dir_temp.'/'.$original_file; + } + // Wrapping pour les graph des produits + elseif ($modulepart == 'graph_product') + { + $accessallowed=1; + $original_file=$conf->product->multidir_temp[$entity].'/'.$original_file; + } + // Wrapping pour les code barre + elseif ($modulepart == 'barcode') + { + $accessallowed=1; + // If viewimage is called for barcode, we try to output an image on the fly, + // with not build of file on disk. + //$original_file=$conf->barcode->dir_temp.'/'.$original_file; + $original_file=''; + } + // Wrapping pour les icones de background des mailings + elseif ($modulepart == 'iconmailing') + { + $accessallowed=1; + $original_file=$conf->mailing->dir_temp.'/'.$original_file; + } + // Wrapping pour les icones de background des mailings + elseif ($modulepart == 'scanner_user_temp') + { + $accessallowed=1; + $original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file; + } + // Wrapping pour les images fckeditor + elseif ($modulepart == 'fckeditor') + { + $accessallowed=1; + $original_file=$conf->fckeditor->dir_output.'/'.$original_file; + } // Wrapping for third parties else if ($modulepart == 'company' || $modulepart == 'societe') @@ -1707,36 +1707,36 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity) else { // Define $accessallowed - if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg)) - { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file; - } - else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg)) - { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_temp.'/'.$original_file; - } - else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg)) - { - if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; - $original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file; - } - else - { - $perm=GETPOST('perm'); - $subperm=GETPOST('subperm'); - if ($perm || $subperm) - { - if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1; - $original_file=$conf->$modulepart->dir_output.'/'.$original_file; - } - else - { - if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1; - $original_file=$conf->$modulepart->dir_output.'/'.$original_file; - } - } + if (preg_match('/^([a-z]+)_user_temp$/i',$modulepart,$reg)) + { + if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; + $original_file=$conf->$reg[1]->dir_temp.'/'.$user->id.'/'.$original_file; + } + else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg)) + { + if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; + $original_file=$conf->$reg[1]->dir_temp.'/'.$original_file; + } + else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg)) + { + if ($user->rights->$reg[1]->lire || $user->rights->$reg[1]->read || ($user->rights->$reg[1]->download)) $accessallowed=1; + $original_file=$conf->$reg[1]->dir_output.'/'.$user->id.'/'.$original_file; + } + else + { + $perm=GETPOST('perm'); + $subperm=GETPOST('subperm'); + if ($perm || $subperm) + { + if (($perm && ! $subperm && $user->rights->$modulepart->$perm) || ($perm && $subperm && $user->rights->$modulepart->$perm->$subperm)) $accessallowed=1; + $original_file=$conf->$modulepart->dir_output.'/'.$original_file; + } + else + { + if ($user->rights->$modulepart->lire || $user->rights->$modulepart->read) $accessallowed=1; + $original_file=$conf->$modulepart->dir_output.'/'.$original_file; + } + } if (preg_match('/^specimen/i',$original_file)) $accessallowed=1; // If link to a specimen if ($user->admin) $accessallowed=1; // If user is admin diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4dd59768e9f..8123feede72 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -741,7 +741,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n") } } - if ($withcountry) $ret.=($object->country?$sep.$object->country:''); + if ($withcountry) $ret.=($object->country?$sep.$object->country:''); return $ret; } @@ -834,12 +834,12 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e else if ($format == 'dayxcard') $format='%Y%m%d'; else if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339 else if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 - else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S'; + else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S'; if ($reduceformat) { - $format=str_replace('%Y','%y',$format); - $format=str_replace('yyyy','yy',$format); + $format=str_replace('%Y','%y',$format); + $format=str_replace('yyyy','yy',$format); } // If date undefined or "", we return "" @@ -1230,8 +1230,8 @@ function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ=" { if (! empty($conf->browser->phone)) // If phone, we use link of phone { - $newphone =''; + $newphone =''; } else if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url { @@ -2331,10 +2331,10 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field { - $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); - $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); - $options=preg_replace('/&+/i','&',$options); - if (! preg_match('/^&/',$options)) $options='&'.$options; + $options=preg_replace('/sortfield=([a-zA-Z0-9,\s\.]+)/i','',$moreparam); + $options=preg_replace('/sortorder=([a-zA-Z0-9,\s\.]+)/i','',$options); + $options=preg_replace('/&+/i','&',$options); + if (! preg_match('/^&/',$options)) $options='&'.$options; if ($sortorder == 'DESC' ) $out.= ''; if ($sortorder == 'ASC' ) $out.= ''; @@ -2344,7 +2344,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field { - $out.=''; + $out.=''; } if (empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 66b64035c4d..145049c999c 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -748,18 +748,18 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m { $counterpadded=str_pad($counter,dol_strlen($maskcounter),"0",STR_PAD_LEFT); - // Define $maskLike - $maskLike = dol_string_nospecial($mask); - $maskLike = str_replace("%","_",$maskLike); - // Replace protected special codes with matching number of _ as wild card caracter - $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike); - $maskLike = preg_replace('/\{yy\}/i','__',$maskLike); - $maskLike = preg_replace('/\{y\}/i','_',$maskLike); - $maskLike = preg_replace('/\{mm\}/i','__',$maskLike); - $maskLike = preg_replace('/\{dd\}/i','__',$maskLike); - $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); - if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); - if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); + // Define $maskLike + $maskLike = dol_string_nospecial($mask); + $maskLike = str_replace("%","_",$maskLike); + // Replace protected special codes with matching number of _ as wild card caracter + $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike); + $maskLike = preg_replace('/\{yy\}/i','__',$maskLike); + $maskLike = preg_replace('/\{y\}/i','_',$maskLike); + $maskLike = preg_replace('/\{mm\}/i','__',$maskLike); + $maskLike = preg_replace('/\{dd\}/i','__',$maskLike); + $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); + if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); + if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); $ref=''; $sql = "SELECT ".$field." as ref"; @@ -767,8 +767,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'"; $sql.= " AND entity IN (".getEntity($table, 1).")"; - if ($where) $sql.=$where; - if ($sqlwhere) $sql.=' AND '.$sqlwhere; + if ($where) $sql.=$where; + if ($sqlwhere) $sql.=' AND '.$sqlwhere; dol_syslog("functions2::get_next_value sql=".$sql); $resql=$db->query($sql); diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 715ff2f877a..d4373fcd204 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -229,7 +229,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte $filename='mergedpdf'; if (! empty($option)) $filename.='_'.$option; - $file=$diroutputpdf.'/'.$filename.'.pdf'; + $file=$diroutputpdf.'/'.$filename.'.pdf'; if (! $error && $pagecount) { diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index dcb94bd084a..556007967f4 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -291,9 +291,9 @@ function dol_loginfunction($langs,$conf,$mysoc) // Set dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen, dol_nomousehover $dol_hide_topmenu=GETPOST('dol_hide_topmenu'); $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu'); - $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen'); - $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover'); - $dol_use_jmobile=GETPOST('dol_use_jmobile'); + $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen'); + $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover'); + $dol_use_jmobile=GETPOST('dol_use_jmobile'); // Include login page template include $template_dir.'login.tpl.php'; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 1c14f3de824..37179df0f75 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -76,8 +76,8 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) } $url=preg_replace('/__LOGIN__/',$user->login,$url); $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); - $url=preg_replace('/__USERID__/',$user->id,$url); - $shorturl=preg_replace('/__USERID__/',$user->id,$shorturl); + $url=preg_replace('/__USERID__/',$user->id,$url); + $shorturl=preg_replace('/__USERID__/',$user->id,$shorturl); // Define the class (top menu selected or not) if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; @@ -238,54 +238,54 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $menuArbo = new Menubase($db,'auguria'); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu); - // We update newmenu for special dynamic menus - if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account - { - $sql = "SELECT rowid, label, courant, rappro, courant"; - $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; - $sql.= " WHERE entity = ".$conf->entity; - $sql.= " AND clos = 0"; - $sql.= " ORDER BY label"; - - $resql = $db->query($sql); - if ($resql) - { - $numr = $db->num_rows($resql); - $i = 0; - - if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire); - - while ($i < $numr) - { - $objp = $db->fetch_object($resql); - $newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire); - if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate - { - $newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate); - } - $i++; - } - } - else dol_print_error($db); - $db->free($resql); + // We update newmenu for special dynamic menus + if ($conf->banque->enabled && $user->rights->banque->lire && $mainmenu == 'bank') // Entry for each bank account + { + $sql = "SELECT rowid, label, courant, rappro, courant"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; + $sql.= " WHERE entity = ".$conf->entity; + $sql.= " AND clos = 0"; + $sql.= " ORDER BY label"; + + $resql = $db->query($sql); + if ($resql) + { + $numr = $db->num_rows($resql); + $i = 0; + + if ($numr > 0) $newmenu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire); + + while ($i < $numr) + { + $objp = $db->fetch_object($resql); + $newmenu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire); + if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate + { + $newmenu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate); + } + $i++; + } + } + else dol_print_error($db); + $db->free($resql); } if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP { - $MAXFTP=20; - $i=1; - while ($i <= $MAXFTP) - { - $paramkey='FTP_NAME_'.$i; - //print $paramkey; - if (! empty($conf->global->$paramkey)) - { - $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; - - $newmenu->add($link, dol_trunc($conf->global->$paramkey,24)); - } - $i++; - } + $MAXFTP=20; + $i=1; + while ($i <= $MAXFTP) + { + $paramkey='FTP_NAME_'.$i; + //print $paramkey; + if (! empty($conf->global->$paramkey)) + { + $link="/ftp/index.php?idmenu=".$_SESSION["idmenu"]."&numero_ftp=".$i; + + $newmenu->add($link, dol_trunc($conf->global->$paramkey,24)); + } + $i++; + } } @@ -335,8 +335,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM // Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser. $url=dol_buildpath($menu_array[$i]['url'],1); - $url=preg_replace('/__LOGIN__/',$user->login,$url); - $url=preg_replace('/__USERID__/',$user->id,$url); + $url=preg_replace('/__LOGIN__/',$user->login,$url); + $url=preg_replace('/__USERID__/',$user->id,$url); if (! preg_match('/mainmenu=/i',$menu_array[$i]['url'])) { @@ -345,7 +345,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM $url.='mainmenu='.$mainmenu; } - print ''."\n"; + print ''."\n"; // Menu niveau 0 if ($menu_array[$i]['level'] == 0) diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index abf3abddc0f..ff6a303d5aa 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -101,7 +101,7 @@ class MenuManager // On va le chercher en session si non defini par le lien $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; } - if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu; + if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu; require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; $tabMenu=array(); @@ -191,8 +191,8 @@ class MenuManager if ($val['enabled'] == 1) { $relurl=dol_buildpath($val['url'],1); - $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); - $relurl=preg_replace('/__USERID__/',$user->id,$relurl); + $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); + $relurl=preg_replace('/__USERID__/',$user->id,$relurl); print ''.$val['titre'].''."\n"; // Search submenu fot this entry @@ -201,7 +201,7 @@ class MenuManager $submenu=new Menu(); $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); $nexturl=dol_buildpath($submenu->liste[0]['url'],1); - + $canonrelurl=preg_replace('/\?.*$/','',$relurl); $canonnexturl=preg_replace('/\?.*$/','',$nexturl); //var_dump($canonrelurl); @@ -210,12 +210,12 @@ class MenuManager if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools'))) || (strpos($canonrelurl,'/product/index.php') !== false || strpos($canonrelurl,'/compta/bank/index.php') !== false)) { - // We add sub entry - print str_pad('',1).'
  • '; // ui-btn to highlight on clic - print ''; - print str_pad('',12,' '); - print $langs->trans(ucfirst($val['mainmenu'])."Dashboard"); - print ''; + // We add sub entry + print str_pad('',1).'
  • '; // ui-btn to highlight on clic + print ''; + print str_pad('',12,' '); + print $langs->trans(ucfirst($val['mainmenu'])."Dashboard"); + print ''; print '
  • '."\n"; } foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' @@ -226,8 +226,8 @@ class MenuManager $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; - if ($val2['level']==0) print str_pad('',$val2['level']+1).''; // ui-btn to highlight on clic - else print str_pad('',$val2['level']+1).'
  • '; // ui-btn to highlight on clic + if ($val2['level']==0) print str_pad('',$val2['level']+1).''; // ui-btn to highlight on clic + else print str_pad('',$val2['level']+1).'
  • '; // ui-btn to highlight on clic if ($relurl2) print ''; print str_pad('',($val2['level']+1)*12,' '); print $val2['titre']; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 91c67a4ff55..59d841521ca 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -77,7 +77,7 @@ class MenuManager // On va le chercher en session si non defini par le lien $mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:''; } - if (! empty($forcemainmenu)) $mainmenu=$forcemainmenu; + if (! empty($forcemainmenu)) $mainmenu=$forcemainmenu; if (isset($_GET["leftmenu"])) { @@ -98,7 +98,7 @@ class MenuManager // On va le chercher en session si non defini par le lien $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; } - if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu; + if (! empty($forceleftmenu)) $leftmenu=$forceleftmenu; require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; $tabMenu=array(); @@ -145,8 +145,8 @@ class MenuManager if ($val['enabled'] == 1) { $relurl=dol_buildpath($val['url'],1); - $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); - $relurl=preg_replace('/__USERID__/',$user->id,$relurl); + $relurl=preg_replace('/__LOGIN__/',$user->login,$relurl); + $relurl=preg_replace('/__USERID__/',$user->id,$relurl); print ''.$val['titre'].''."\n"; // Search submenu fot this entry @@ -158,7 +158,7 @@ class MenuManager $canonrelurl=preg_replace('/\?.*$/','',$relurl); $canonnexturl=preg_replace('/\?.*$/','',$nexturl); - //var_dump($canonrelurl); + //var_dump($canonrelurl); //var_dump($canonnexturl); print '
      '."\n"; if (($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('tools'))) diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index e0e69c14c10..ce867816a3d 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -89,7 +89,7 @@ class MenuManager if (empty($noout)) print_start_menu_entry_empty($idsel, $classname, $showmode); if (empty($noout)) print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu=', $id, $idsel, $classname, $this->atarget); if (empty($noout)) print_end_menu_entry_empty($showmode); - $this->menu->add(dol_buildpath('/index.php',1), $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', ''); + $this->menu->add(dol_buildpath('/index.php',1), $langs->trans("Home"), 0, $showmode, $this->atarget, 'home', ''); if (empty($noout)) print_end_menu_array_empty(); @@ -191,7 +191,7 @@ class MenuManager { $this->leftmenu=dol_clone($this->menu); unset($this->menu->liste); - } + } } if ($mode == 'jmobile') @@ -221,32 +221,32 @@ class MenuManager //var_dump($canonnexturl); print '
        '; if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools'))) - { - // We add sub entry - print '
      • '.$langs->trans("MainArea").'-'.$val['titre'].'
      • '."\n"; - } - foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' - { - $relurl2=dol_buildpath($val2['url'],1); - $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); - $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2); - //var_dump($val2); - print ''.$val2['titre'].''."\n"; - } - //var_dump($submenu); - print '
      '; - } - if ($val['enabled'] == 2) - { - print ''.$val['titre'].''; - } - print ''; + { + // We add sub entry + print '
    • '.$langs->trans("MainArea").'-'.$val['titre'].'
    • '."\n"; + } + foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + { + $relurl2=dol_buildpath($val2['url'],1); + $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); + $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2); + //var_dump($val2); + print ''.$val2['titre'].''."\n"; + } + //var_dump($submenu); + print '
    '; + } + if ($val['enabled'] == 2) + { + print ''.$val['titre'].''; + } + print '
  • '; print ''."\n"; - break; // Only first menu entry (so home) - } - } - + break; // Only first menu entry (so home) + } + } + unset($this->menu); return $res; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index ca709ba4e32..73bf0c9e3d5 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -609,7 +609,7 @@ abstract class DolibarrModules $file = $this->boxes[$key]['file']; //$note = $this->boxes[$key][2]; - if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility + if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; $sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def"; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 90a0da8b7b3..dea0334dc13 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -655,9 +655,9 @@ function tablewithentity($table) global $db; $resql=$db->DDLDescTable($table,'entity'); - if ($resql) - { - $i=0; + if ($resql) + { + $i=0; $obj=$db->fetch_object($resql); if ($obj) return 1; else return 0; diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index adf1b8689b1..5b7b385ab27 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -150,17 +150,17 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $object->fetch_thirdparty(); - // Definition of $dir and $file - if ($object->specimen) - { - $dir = $conf->expedition->dir_output."/receipt"; - $file = $dir . "/SPECIMEN.pdf"; - } - else - { - $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->expedition->dir_output."/receipt/" . $objectref; - $file = $dir . "/" . $objectref . ".pdf"; + // Definition of $dir and $file + if ($object->specimen) + { + $dir = $conf->expedition->dir_output."/receipt"; + $file = $dir . "/SPECIMEN.pdf"; + } + else + { + $objectref = dol_sanitizeFileName($object->ref); + $dir = $conf->expedition->dir_output."/receipt/" . $objectref; + $file = $dir . "/" . $objectref . ".pdf"; } if (! file_exists($dir)) @@ -287,39 +287,39 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Description of product line $curX = $this->posxdesc-1; - $showpricebeforepagebreak=1; - - $pdf->startTransaction(); - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,3,$curX,$curY,$hideref,$hidedesc); - $pageposafter=$pdf->getPage(); - if ($pageposafter > $pageposbefore) // There is a pagebreak - { - $pdf->rollbackTransaction(true); - $pageposafter=$pageposbefore; - //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,4,$curX,$curY,$hideref,$hidedesc); - $posyafter=$pdf->GetY(); - if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text - { - if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page - { - $pdf->AddPage('','',true); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); - } - } - else - { - // We found a page break - $showpricebeforepagebreak=0; - } - } - else // No pagebreak - { - $pdf->commitTransaction(); - } + $showpricebeforepagebreak=1; + + $pdf->startTransaction(); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,3,$curX,$curY,$hideref,$hidedesc); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxcomm-$curX,4,$curX,$curY,$hideref,$hidedesc); + $posyafter=$pdf->GetY(); + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pagenb+1); + } + } + else + { + // We found a page break + $showpricebeforepagebreak=0; + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); @@ -526,31 +526,31 @@ class pdf_typhon extends ModelePDFDeliveryOrder return 0; } - /** - * Show miscellaneous information (payment mode, payment term, ...) - * - * @param PDF &$pdf Object PDF - * @param Object $object Object to show - * @param int $posy Y - * @param Translate $outputlangs Langs object - * @return void - */ - function _tableau_info(&$pdf, $object, $posy, $outputlangs) - { - global $conf; - $default_font_size = pdf_getPDFFontSize($outputlangs); + /** + * Show miscellaneous information (payment mode, payment term, ...) + * + * @param PDF &$pdf Object PDF + * @param Object $object Object to show + * @param int $posy Y + * @param Translate $outputlangs Langs object + * @return void + */ + function _tableau_info(&$pdf, $object, $posy, $outputlangs) + { + global $conf; + $default_font_size = pdf_getPDFFontSize($outputlangs); $pdf->SetFont('','', $default_font_size); - $pdf->SetXY($this->marge_gauche, $posy); - - $larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3; - $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25); - $pdf->SetXY($this->marge_gauche + 2, $posy + 2); - $pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L'); - - $pdf->Rect(2*$larg_sign+$this->marge_gauche, $posy + 1, $larg_sign, 25); - $pdf->SetXY(2*$larg_sign+$this->marge_gauche + 2, $posy + 2); - $pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L'); + $pdf->SetXY($this->marge_gauche, $posy); + + $larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3; + $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->SetXY($this->marge_gauche + 2, $posy + 2); + $pdf->MultiCell($larg_sign,2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":",'','L'); + + $pdf->Rect(2*$larg_sign+$this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->SetXY(2*$larg_sign+$this->marge_gauche + 2, $posy + 2); + $pdf->MultiCell($larg_sign,2, $outputlangs->trans("ForCustomer").':','','L'); } /** @@ -629,19 +629,19 @@ class pdf_typhon extends ModelePDFDeliveryOrder pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); - // Show Draft Watermark - if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) - { - pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); + // Show Draft Watermark + if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + { + pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); } - $pdf->SetTextColor(0,0,60); - $pdf->SetFont('','B', $default_font_size + 3); - - $posy=$this->marge_haute; - $posx=$this->page_largeur-$this->marge_droite-100; - - $pdf->SetXY($this->marge_gauche,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->SetFont('','B', $default_font_size + 3); + + $posy=$this->marge_haute; + $posx=$this->page_largeur-$this->marge_droite-100; + + $pdf->SetXY($this->marge_gauche,$posy); // Logo $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; @@ -695,8 +695,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder $posy+=2; - // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + // Show list of linked objects + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); if ($showaddress) { @@ -724,10 +724,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('','B',$default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - // Show sender information - $pdf->SetXY($posx+2,$posy+8); - $pdf->SetFont('','', $default_font_size - 1); - $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); + // Show sender information + $pdf->SetXY($posx+2,$posy+8); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); // Client destinataire $posy=42; diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 2d4b267a8e3..f016b5d6cf6 100755 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -114,14 +114,14 @@ class modOpenSurvey extends DolibarrModules $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; - // Add here list of permission defined by an id, a label, a boolean and two constant strings. - // Example: - $this->rights[$r][0] = 55002; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/modify surveys'; // Permission label - $this->rights[$r][2] = 'w'; // Permission by default for new user (0/1) - $this->rights[$r][3] = 0; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'survey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + // Add here list of permission defined by an id, a label, a boolean and two constant strings. + // Example: + $this->rights[$r][0] = 55002; // Permission id (must not be already used) + $this->rights[$r][1] = 'Create/modify surveys'; // Permission label + $this->rights[$r][2] = 'w'; // Permission by default for new user (0/1) + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'survey'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; @@ -195,7 +195,7 @@ class modOpenSurvey extends DolibarrModules */ function init($options='') { - // Permissions + // Permissions $this->remove($options); $sql = array(); diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 01f1a481f86..f05a324ae84 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -107,60 +107,60 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices { global $db,$conf; - if ($object->type == 2) $prefix=$this->prefixcreditnote; - else $prefix=$this->prefixinvoice; + if ($object->type == 2) $prefix=$this->prefixcreditnote; + else $prefix=$this->prefixinvoice; - // D'abord on recupere la valeur max - $posindice=8; - $sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; - $sql.= " WHERE ref LIKE '".$prefix."____-%'"; - $sql.= " AND entity = ".$conf->entity; - - $resql=$db->query($sql); - dol_syslog(get_class($this)."::getNextValue sql=".$sql); - if ($resql) - { - $obj = $db->fetch_object($resql); - if ($obj) $max = intval($obj->max); - else $max=0; - } - else - { - dol_syslog(get_class($this)."::getNextValue sql=".$sql, LOG_ERR); - return -1; - } - - if ($mode == 'last') - { - $num = sprintf("%04s",$max); - - $ref=''; - $sql = "SELECT ref as ref"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; - $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; - $sql.= " AND entity = ".$conf->entity; - - dol_syslog(get_class($this)."::getNextValue sql=".$sql); - $resql=$db->query($sql); - if ($resql) - { - $obj = $db->fetch_object($resql); - if ($obj) $ref = $obj->ref; - } - else dol_print_error($db); - - return $ref; - } - else if ($mode == 'next') - { - $date=$object->date; // This is invoice date (not creation date) - $yymm = strftime("%y%m",$date); - $num = sprintf("%04s",$max+1); - - dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); - return $prefix.$yymm."-".$num; - } + // D'abord on recupere la valeur max + $posindice=8; + $sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$prefix."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + dol_syslog(get_class($this)."::getNextValue sql=".$sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $max = intval($obj->max); + else $max=0; + } + else + { + dol_syslog(get_class($this)."::getNextValue sql=".$sql, LOG_ERR); + return -1; + } + + if ($mode == 'last') + { + $num = sprintf("%04s",$max); + + $ref=''; + $sql = "SELECT ref as ref"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; + $sql.= " AND entity = ".$conf->entity; + + dol_syslog(get_class($this)."::getNextValue sql=".$sql); + $resql=$db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $ref = $obj->ref; + } + else dol_print_error($db); + + return $ref; + } + else if ($mode == 'next') + { + $date=$object->date; // This is invoice date (not creation date) + $yymm = strftime("%y%m",$date); + $num = sprintf("%04s",$max+1); + + dol_syslog(get_class($this)."::getNextValue return ".$prefix.$yymm."-".$num); + return $prefix.$yymm."-".$num; + } else dol_print_error('','Bad parameter for getNextValue'); } diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 080d1e7556b..a05b4014899 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -49,8 +49,8 @@ $title=$langs->trans("Search"); // URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests $head=''."\n"; -$arrayofjs=array(); -$arrayofcss=array(); +$arrayofjs=array(); +$arrayofcss=array(); top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index be66c742cb9..d62b10ccea1 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -127,8 +127,8 @@ if ($forgetpasslink || $helpcenterlink) { $moreparam=''; if ($dol_hide_topmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$dol_hide_topmenu; - if ($dol_hide_leftmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$dol_hide_leftmenu; - if ($dol_no_mouse_hover) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$dol_no_mouse_hover; + if ($dol_hide_leftmenu) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$dol_hide_leftmenu; + if ($dol_no_mouse_hover) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$dol_no_mouse_hover; if ($dol_use_jmobile) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$dol_use_jmobile; echo '
    '; diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 29df45e6ebc..7d78d0947da 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -19,13 +19,13 @@ header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); -if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1; -if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; -if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; -if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; -if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; +if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1; +if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; +if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; +if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; +if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; -print top_htmlhead('',$langs->trans('Login').' '.$title); +print top_htmlhead('',$langs->trans('Login').' '.$title); ?> @@ -111,11 +111,11 @@ if (! empty($hookmanager->resArray['options'])) {
    dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; - if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; - if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; - if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; + $moreparam=''; + if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu; + if (! empty($conf->dol_hide_leftmenu)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu; + if (! empty($conf->dol_no_mouse_hover)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover; + if (! empty($conf->dol_use_jmobile)) $moreparam.=(strpos($moreparam,'?')===false?'?':'&').'dol_use_jmobile='.$conf->dol_use_jmobile; print '('.$langs->trans('BackToLoginPage').')'; ?> diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 42b41d0ed4f..f75fcb5754b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -119,16 +119,16 @@ print_fiche_titre($pagetitle,'','setup'); print $langs->trans('CronInfo'); -if ($action == 'delete') -{ - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); - if ($ret == 'html') print '
    '; -} - -if ($action == 'execute'){ - $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); - if ($ret == 'html') print '
    '; -} +if ($action == 'delete') +{ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + if ($ret == 'html') print '
    '; +} + +if ($action == 'execute'){ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + if ($ret == 'html') print '
    '; +} // liste des jobs creer @@ -181,7 +181,7 @@ if (count($object->lines)>0) { print ''; print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), GETPOST('status'), 1); print ''; - print ' '; + print ' '; print ''; print '  '; print ''; @@ -265,7 +265,7 @@ if (count($object->lines)>0) { print ''; print ''; - print yn($line->status); + print yn($line->status); print ''; print ''; diff --git a/htdocs/document.php b/htdocs/document.php index 6758a5f76c0..efa4cfef68c 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -100,7 +100,7 @@ if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); $check_access = dol_check_secure_access_document($modulepart,$original_file,$entity); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; -$original_file = $check_access['original_file']; +$original_file = $check_access['original_file']; // Basic protection (against external users only) if ($user->societe_id > 0) diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index d37f9ad336e..c68d793185d 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -52,7 +52,7 @@ print $langs->trans("FormatedExportDesc3").'
    '; print '
    '; -print '
    '; +print '
    '; // List export set @@ -108,7 +108,7 @@ if (count($export->array_export_code)) */ } print ''; -print '
    '; +print '
    '; print '
    '; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 3a75e9d4779..c76b822ceeb 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1467,7 +1467,7 @@ else if ($id > 0 || ! empty($ref)) $somethingshown=$object->showLinkedObjectBlock(); //print ''; - print '
    '; + print '
    '; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e3bc1fadb8b..19912e3f58f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -855,42 +855,42 @@ class FactureFournisseur extends CommonInvoice } } - if (! $error) - { - $this->oldref = ''; - - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) - { - // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref) - // afin de ne pas perdre les fichiers attaches - $facref = dol_sanitizeFileName($this->ref); + if (! $error) + { + $this->oldref = ''; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref) + // afin de ne pas perdre les fichiers attaches + $facref = dol_sanitizeFileName($this->ref); $snumfa = dol_sanitizeFileName($num); - $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref; + $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref; $dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa; - if (file_exists($dirsource)) - { - dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) - { - $this->oldref = $facref; - - dol_syslog("Rename ok"); - // Suppression ancien fichier PDF dans nouveau rep - dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*'); - } - } - } + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + $this->oldref = $facref; + + dol_syslog("Rename ok"); + // Suppression ancien fichier PDF dans nouveau rep + dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*'); + } + } + } } - // Set new ref and define current statut - if (! $error) - { - $this->ref = $num; - $this->statut=1; - //$this->date_validation=$now; this is stored into log table + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->statut=1; + //$this->date_validation=$now; this is stored into log table } // Triggers call diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index aa9658a9d84..c2dc17f798f 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -114,14 +114,14 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni $object->fetch($id); $object->fetch_thirdparty(); - $qualified_for_stock_change=0; - if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $qualified_for_stock_change=$object->hasProductsOrServices(2); - } - else - { - $qualified_for_stock_change=$object->hasProductsOrServices(1); + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); } // Check parameters diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 38ce1e648b3..1af03e83a01 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -219,7 +219,7 @@ if ($object->fetch($id)) print ''; - print '
    '; + print '
    '; //print ''; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 65ec397e242..f2681a936f7 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1314,11 +1314,11 @@ if ($step == 5 && $datatoimport) $sourcelinenb++; // Read line and stor it into $arrayrecord $arrayrecord=$obj->import_read_record(); - if ($arrayrecord === false) - { + if ($arrayrecord === false) + { $arrayofwarnings[$sourcelinenb][0]=array('lib'=>'File has '.$nboflines.' lines. However we reach end of file after record '.$sourcelinenb.'. This may occurs when some records are split onto several lines.','type'=>'EOF_RECORD_ON_SEVERAL_LINES'); - $endoffile++; - continue; + $endoffile++; + continue; } if ($excludefirstline && $sourcelinenb == 1) continue; diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index ac9e9d645fa..19642c63378 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -98,7 +98,7 @@ if (count($import->array_import_code)) //} } print ''; -print '
    '; +print '
    '; print '
    '; @@ -137,5 +137,5 @@ print '
    '; llxFooter(); -$db->close(); +$db->close(); ?> diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index e477ec3b6a5..280d9c5b746 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -335,11 +335,11 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $beforeversionarray=explode('.','3.4.9'); if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) { - // Reload modules (this must be always and only into last targeted version) - migrate_reload_modules($db,$langs,$conf); - - // Reload menus (this must be always and only into last targeted version) - migrate_reload_menu($db,$langs,$conf,$versionto); + // Reload modules (this must be always and only into last targeted version) + migrate_reload_modules($db,$langs,$conf); + + // Reload menus (this must be always and only into last targeted version) + migrate_reload_menu($db,$langs,$conf,$versionto); } print '
    '.$langs->trans("MigrationFinished").''; @@ -3526,9 +3526,9 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone.lib.php', DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_backoffice.php', DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_frontoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_backoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php', - DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_backoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php', DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_frontoffice.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/peche.modules.php', diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 5a015ba1c64..3cbf525ad7c 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -42,8 +42,8 @@ class MailmanSpip var $mladded_ok; var $mladded_ko; - var $mlremoved_ok; - var $mlremoved_ko; + var $mlremoved_ok; + var $mlremoved_ko; /** diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b4691761100..c9c4dd9ca4c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -345,17 +345,17 @@ if (! defined('NOLOGIN')) // It is not already authenticated and it requests the login / password include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $dol_dst_observed=GETPOST("dst_observed",3); - $dol_dst_first=GETPOST("dst_first",3); - $dol_dst_second=GETPOST("dst_second",3); - $dol_screenwidth=GETPOST("screenwidth",3); - $dol_screenheight=GETPOST("screenheight",3); - $dol_hide_topmenu=GETPOST('dol_hide_topmenu',3); - $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu',3); - $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen',3); - $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover',3); - $dol_use_jmobile=GETPOST('dol_use_jmobile',3); - //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); + $dol_dst_observed=GETPOST("dst_observed",3); + $dol_dst_first=GETPOST("dst_first",3); + $dol_dst_second=GETPOST("dst_second",3); + $dol_screenwidth=GETPOST("screenwidth",3); + $dol_screenheight=GETPOST("screenheight",3); + $dol_hide_topmenu=GETPOST('dol_hide_topmenu',3); + $dol_hide_leftmenu=GETPOST('dol_hide_leftmenu',3); + $dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen',3); + $dol_no_mouse_hover=GETPOST('dol_no_mouse_hover',3); + $dol_use_jmobile=GETPOST('dol_use_jmobile',3); + //dol_syslog("POST key=".join(array_keys($_POST),',').' value='.join($_POST,',')); // If in demo mode, we check we go to home page through the public/demo/index.php page if (! empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') // We ask index page @@ -589,7 +589,7 @@ if (! defined('NOLOGIN')) if (! empty($dol_hide_leftmenu)) $_SESSION['dol_hide_leftmenu']=$dol_hide_leftmenu; if (! empty($dol_optimize_smallscreen)) $_SESSION['dol_optimize_smallscreen']=$dol_optimize_smallscreen; if (! empty($dol_no_mouse_hover)) $_SESSION['dol_no_mouse_hover']=$dol_no_mouse_hover; - if (! empty($dol_use_jmobile)) $_SESSION['dol_use_jmobile']=$dol_use_jmobile; + if (! empty($dol_use_jmobile)) $_SESSION['dol_use_jmobile']=$dol_use_jmobile; dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"]." Session id=".session_id()); @@ -679,17 +679,17 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme','alpha',1); $conf->css = "/theme/".$conf->theme."/style.css.php"; } - -// Set javascript option -if (! GETPOST('nojs')) // If javascript was not disabled on URL -{ - if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT)) - { - $conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT; - } -} -else $conf->use_javascript_ajax=0; + +// Set javascript option +if (! GETPOST('nojs')) // If javascript was not disabled on URL +{ + if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT)) + { + $conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT; + } +} +else $conf->use_javascript_ajax=0; // Set terminal output option if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1; @@ -703,11 +703,11 @@ if (! empty($conf->browser->phone)) $conf->dol_no_mouse_hover=1; } -// Disabled bugged themes -if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) -{ - $conf->theme='eldy'; - $conf->css = "/theme/".$conf->theme."/style.css.php"; +// Disabled bugged themes +if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo'))) +{ + $conf->theme='eldy'; + $conf->css = "/theme/".$conf->theme."/style.css.php"; } if (! defined('NOREQUIRETRAN')) @@ -945,9 +945,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1); print ''."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; // Displays title $appli='Dolibarr'; @@ -988,9 +988,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { print ''."\n"; } - // jQuery jMobile - if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) - { + // jQuery jMobile + if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) + { print ''."\n"; } @@ -1153,28 +1153,28 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; print ''."\n"; } - // jQuery jMobile - if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) + // jQuery jMobile + if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) { // We must force not using ajax because cache of jquery does not load js of other pages. // This also increase seriously speed onto mobile device where complex js code is very slow and memory very low. if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 2) { - print ''; - } - print ''."\n"; - } + } + print ''."\n"; + } } - if (! $disablejs && ! empty($conf->use_javascript_ajax)) + if (! $disablejs && ! empty($conf->use_javascript_ajax)) { // CKEditor if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor')) @@ -1583,19 +1583,19 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print "\n"; } - //Dolibarr version - $doliurl='http://www.dolibarr.org'; - $appli='Dolibarr'; - if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; - } - $appli.=" ".DOL_VERSION; - print '
    '; - if ($doliurl) print ''; - print $appli; - if ($doliurl) print ''; - print '
    '; - + //Dolibarr version + $doliurl='http://www.dolibarr.org'; + $appli='Dolibarr'; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) { + $appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl=''; + } + $appli.=" ".DOL_VERSION; + print '
    '; + if ($doliurl) print ''; + print $appli; + if ($doliurl) print ''; + print '
    '; + // Link to Dolibarr wiki pages if ($helppagename && empty($conf->global->MAIN_HELP_DISABLELINK)) { diff --git a/htdocs/opensurvey/admin/index.php b/htdocs/opensurvey/admin/index.php index 6ab9c74dc24..d22c3f03cde 100755 --- a/htdocs/opensurvey/admin/index.php +++ b/htdocs/opensurvey/admin/index.php @@ -22,14 +22,14 @@ */ require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); - -// Security check +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); + +// Security check if (!$user->admin) accessforbidden(); -$langs->load("admin"); +$langs->load("admin"); $langs->load("other"); @@ -39,7 +39,7 @@ $langs->load("other"); $langs->load("opensurvey"); -llxHeader(); +llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("OpenSurveyArea"),$linkback,'setup'); @@ -47,16 +47,16 @@ print '
    '; echo $langs->trans("OpenSurveyNothingToSetup").'

    '."\n"; -// Link -print img_picto('','object_globe.png').' '.$langs->trans("PublicLinkToCreateSurvey").':
    '; - -// Define $urlwithroot -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); -$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - -$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/index.php',1); -$urllink=''.$url.''; +// Link +print img_picto('','object_globe.png').' '.$langs->trans("PublicLinkToCreateSurvey").':
    '; + +// Define $urlwithroot +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + +$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/index.php',1); +$urllink=''.$url.''; print $urllink; diff --git a/htdocs/opensurvey/adminstuds.php b/htdocs/opensurvey/adminstuds.php index d3547a4ac51..39d804ee578 100755 --- a/htdocs/opensurvey/adminstuds.php +++ b/htdocs/opensurvey/adminstuds.php @@ -15,17 +15,17 @@ * along with this program. If not, see . */ -/** - * \file htdocs/opensurvey/adminstuds.php - * \ingroup opensurvey - * \brief Page to edit survey +/** + * \file htdocs/opensurvey/adminstuds.php + * \ingroup opensurvey + * \brief Page to edit survey */ require_once('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); // Security check @@ -44,14 +44,14 @@ if (GETPOST('sondage')) } else { - $numsondageadmin=''; - $numsondage=GETPOST("sondage",'alpha'); + $numsondageadmin=''; + $numsondage=GETPOST("sondage",'alpha'); } } $object=new Opensurveysondage($db); -$expiredate=dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear')); +$expiredate=dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear')); @@ -94,7 +94,7 @@ if ($action == 'update') $object->mail_admin = GETPOST('nouvelleadresse'); $object->date_fin = $expiredate; $object->survey_link_visible = GETPOST('survey_link_visible')=='on'?1:0; - $object->canedit = GETPOST('canedit')=='on'?1:0; + $object->canedit = GETPOST('canedit')=='on'?1:0; $res=$object->update($user); if ($res < 0) @@ -153,13 +153,13 @@ if ($idcomment) $form=new Form($db); -$result=$object->fetch(0,$numsondage); -if ($result <= 0) -{ - print $langs->trans("ErrorRecordNotFound"); - llxFooter(); - exit; -} +$result=$object->fetch(0,$numsondage); +if ($result <= 0) +{ + print $langs->trans("ErrorRecordNotFound"); + llxFooter(); + exit; +} $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); @@ -248,24 +248,24 @@ if ($action == 'edit') else print dol_print_email($object->mail_admin); print ''; -// Can edit other votes +// Can edit other votes print ''.$langs->trans('CanEditVotes').''; if ($action == 'edit') { print 'canedit?' checked="true"':'').'">'; } else print yn($object->canedit); -print ''; +print ''; -// Expire date +// Expire date print ''.$langs->trans('ExpireDate').''; if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object->date_fin,'expire'); else print dol_print_date($object->date_fin,'day'); -print ''; +print ''; // Link -print ''.img_picto('','object_globe.png').' '.$langs->trans("UrlForSurvey",'').''; +print ''.img_picto('','object_globe.png').' '.$langs->trans("UrlForSurvey",'').''; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); diff --git a/htdocs/opensurvey/adminstuds_preview.php b/htdocs/opensurvey/adminstuds_preview.php index 27ca8814774..3e7ba2fd7e3 100755 --- a/htdocs/opensurvey/adminstuds_preview.php +++ b/htdocs/opensurvey/adminstuds_preview.php @@ -26,7 +26,7 @@ require_once('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); +require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); // Security check @@ -39,7 +39,7 @@ $numsondageadmin=GETPOST("sondage"); $numsondage=substr($numsondageadmin, 0, 16); $object=new Opensurveysondage($db); -$result=$object->fetch(0,$numsondage); +$result=$object->fetch(0,$numsondage); if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); $nblignes=count($object->fetch_lines()); @@ -49,7 +49,7 @@ $nblignes=count($object->fetch_lines()); * Actions */ -$nbcolonnes = substr_count($object->sujet, ',') + 1; +$nbcolonnes = substr_count($object->sujet, ',') + 1; // Add vote if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) @@ -74,7 +74,7 @@ if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) } } - $nom=substr(GETPOST("nom"),0,64); + $nom=substr(GETPOST("nom"),0,64); // Check if vote already exists $sql = 'SELECT id_users, nom'; @@ -147,23 +147,23 @@ if ($testmodifier) if (! $resql) dol_print_error($db); } -// Add column (not for date) -if (GETPOST("ajoutercolonne") && GETPOST('nouvellecolonne') && ($object->format == "A" || $object->format == "A+")) -{ - $nouveauxsujets=$object->sujet; - - //on rajoute la valeur a la fin de tous les sujets deja entrés - $nouveauxsujets.=','; - $nouveauxsujets.=str_replace(array(",","@"), " ", $_POST["nouvellecolonne"]).(empty($_POST["typecolonne"])?'':'@'.$_POST["typecolonne"]); - - //mise a jour avec les nouveaux sujets dans la base +// Add column (not for date) +if (GETPOST("ajoutercolonne") && GETPOST('nouvellecolonne') && ($object->format == "A" || $object->format == "A+")) +{ + $nouveauxsujets=$object->sujet; + + //on rajoute la valeur a la fin de tous les sujets deja entrés + $nouveauxsujets.=','; + $nouveauxsujets.=str_replace(array(",","@"), " ", $_POST["nouvellecolonne"]).(empty($_POST["typecolonne"])?'':'@'.$_POST["typecolonne"]); + + //mise a jour avec les nouveaux sujets dans la base $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " SET sujet = '".$db->escape($nouveauxsujets)."'"; - $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; + $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; dol_syslog("sql=".$sql); $resql = $db->query($sql); - if (! $resql) dol_print_error($db); -} + if (! $resql) dol_print_error($db); +} // Add column (with format date) if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->format == "D+")) @@ -236,12 +236,12 @@ if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->forma //mise a jour avec les nouveaux sujets dans la base if (isset($erreur_ajout_date) && !$erreur_ajout_date) { - $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage"; + $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " SET sujet = '".$db->escape($dateinsertion)."'"; - $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; + $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; dol_syslog("sql=".$sql); - $resql = $db->query($sql); - if (! $resql) dol_print_error($db); + $resql = $db->query($sql); + if (! $resql) dol_print_error($db); if ($nouvelledate > strtotime($object->date_fin)) { @@ -251,7 +251,7 @@ if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->forma $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; dol_syslog("sql=".$sql); $resql = $db->query($sql); - if (! $resql) dol_print_error($db); + if (! $resql) dol_print_error($db); } } @@ -270,17 +270,17 @@ for ($i = 0; $i < $nblignes; $i++) { $compteur=0; - // Loop on each answer - $compteur = 0; - $sql ="SELECT id_users, nom, id_sondage, reponses"; - $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; - $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; - dol_syslog('sql='.$sql); - $resql=$db->query($sql); - if (! $resql) dol_print_error($db); - $num=$db->num_rows($resql); - while ($compteur < $num) - { + // Loop on each answer + $compteur = 0; + $sql ="SELECT id_users, nom, id_sondage, reponses"; + $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; + $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; + dol_syslog('sql='.$sql); + $resql=$db->query($sql); + if (! $resql) dol_print_error($db); + $num=$db->num_rows($resql); + while ($compteur < $num) + { $obj=$db->fetch_object($resql); if ($compteur==$i) @@ -327,20 +327,20 @@ for ($i = 0; $i < $nbcolonnes; $i++) if (! $resql) dol_print_error($db); // Clean current answer to remove deleted columns - $compteur = 0; - $sql ="SELECT id_users, nom, id_sondage, reponses"; - $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; - $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; - dol_syslog('sql='.$sql); - $resql=$db->query($sql); - if (! $resql) - { - dol_print_error($db); - exit; - } - $num=$db->num_rows($resql); - while ($compteur < $num) - { + $compteur = 0; + $sql ="SELECT id_users, nom, id_sondage, reponses"; + $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; + $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; + dol_syslog('sql='.$sql); + $resql=$db->query($sql); + if (! $resql) + { + dol_print_error($db); + exit; + } + $num=$db->num_rows($resql); + while ($compteur < $num) + { $obj=$db->fetch_object($resql); $newcar = ''; @@ -379,13 +379,13 @@ for ($i = 0; $i < $nbcolonnes; $i++) $form=new Form($db); -$result=$object->fetch(0,$numsondage); -if ($result <= 0) -{ - print $langs->trans("ErrorRecordNotFound"); - llxFooter(); - exit; -} +$result=$object->fetch(0,$numsondage); +if ($result <= 0) +{ + print $langs->trans("ErrorRecordNotFound"); + llxFooter(); + exit; +} $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); @@ -768,7 +768,7 @@ while ($compteur < $num) for ($i = 0; $i < $nbcolonnes; $i++) { $car = substr($ensemblereponses, $i, 1); - //print 'xx'.$i."-".$car.'-'.$listofanswers[$i]['format'].'zz'; + //print 'xx'.$i."-".$car.'-'.$listofanswers[$i]['format'].'zz'; if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) { @@ -1065,7 +1065,7 @@ if ($nbofcheckbox >= 2) print ''."\n"; -print ''."\n"; +print ''."\n"; llxFooterSurvey(); diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 188e830be63..72cb620c462 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -91,7 +91,7 @@ class Opensurveysondage extends CommonObject if (isset($this->format)) $this->format=trim($this->format); if (isset($this->mailsonde)) $this->mailsonde=trim($this->mailsonde); if (isset($this->survey_link_visible)) $this->survey_link_visible=trim($this->survey_link_visible); - if (isset($this->canedit)) $this->canedit=trim($this->canedit); + if (isset($this->canedit)) $this->canedit=trim($this->canedit); @@ -111,7 +111,7 @@ class Opensurveysondage extends CommonObject $sql.= "format,"; $sql.= "mailsonde,"; $sql.= "survey_link_visible,"; - $sql.= "canedit"; + $sql.= "canedit"; $sql.= ") VALUES ("; $sql.= " ".(! isset($this->id_sondage)?'NULL':"'".$this->id_sondage."'").","; @@ -124,7 +124,7 @@ class Opensurveysondage extends CommonObject $sql.= " ".(! isset($this->format)?'NULL':"'".$this->db->escape($this->format)."'").","; $sql.= " ".(! isset($this->mailsonde)?'NULL':"'".$this->mailsonde."'").","; $sql.= " ".(! isset($this->survey_link_visible)?'NULL':"'".$this->survey_link_visible."'").","; - $sql.= " ".(! isset($this->canedit)?'NULL':"'".$this->canedit."'").""; + $sql.= " ".(! isset($this->canedit)?'NULL':"'".$this->canedit."'").""; $sql.= ")"; @@ -267,7 +267,7 @@ class Opensurveysondage extends CommonObject if (isset($this->format)) $this->format=trim($this->format); if (isset($this->mailsonde)) $this->mailsonde=trim($this->mailsonde); if (isset($this->survey_link_visible)) $this->survey_link_visible=trim($this->survey_link_visible); - if (isset($this->canedit)) $this->canedit=trim($this->canedit); + if (isset($this->canedit)) $this->canedit=trim($this->canedit); // Check parameters @@ -286,7 +286,7 @@ class Opensurveysondage extends CommonObject $sql.= " format=".(isset($this->format)?"'".$this->db->escape($this->format)."'":"null").","; $sql.= " mailsonde=".(isset($this->mailsonde)?$this->mailsonde:"null").","; $sql.= " survey_link_visible=".(isset($this->survey_link_visible)?$this->survey_link_visible:"null").","; - $sql.= " canedit=".(isset($this->canedit)?$this->canedit:"null").""; + $sql.= " canedit=".(isset($this->canedit)?$this->canedit:"null").""; //$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE id_sondage_admin='".$this->id_sondage_admin."'"; @@ -348,7 +348,7 @@ class Opensurveysondage extends CommonObject $numsondage=substr($numsondageadmin, 0, 16); $this->db->begin(); - + if (! $error) { if (! $notrigger) @@ -367,13 +367,13 @@ class Opensurveysondage extends CommonObject if (! $error) { - - $sql='DELETE FROM '.MAIN_DB_PREFIX."opensurvey_comments WHERE id_sondage = '".$numsondage."'"; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); - $resql=$this->db->query($sql); - $sql='DELETE FROM '.MAIN_DB_PREFIX."opensurvey_user_studs WHERE id_sondage = '".$numsondage."'"; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); - $resql=$this->db->query($sql); + + $sql='DELETE FROM '.MAIN_DB_PREFIX."opensurvey_comments WHERE id_sondage = '".$numsondage."'"; + dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + $sql='DELETE FROM '.MAIN_DB_PREFIX."opensurvey_user_studs WHERE id_sondage = '".$numsondage."'"; + dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); $sql = "DELETE FROM ".MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " WHERE id_sondage_admin = '".$numsondageadmin."'"; @@ -507,7 +507,7 @@ class Opensurveysondage extends CommonObject $this->format=''; $this->mailsonde=''; $this->survey_link_visible=''; - $this->canedit=0; + $this->canedit=0; } } diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index e2dbcd39af1..f83cb029207 100755 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -22,77 +22,77 @@ */ - -/** - * Show header for new member - * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param array $arrayofjs Array of complementary js files - * @param array $arrayofcss Array of complementary css files - * @return void - */ -function llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') -{ - global $user, $conf, $langs, $mysoc; - - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; - - showlogo(); - - print '
    '; -} - -/** - * Show footer for new member - * - * @return void - */ -function llxFooterSurvey() -{ - print '
    '; - - printCommonFooter('public'); - - dol_htmloutput_events(); - - print "\n"; - print "\n"; + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + print ''; + + showlogo(); + + print '
    '; } - -/** - * Show logo - * - * @return void - */ -function showlogo() -{ - global $user, $conf, $langs, $mysoc; - - // Print logo - $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; - - if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) - { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); - } - elseif (! empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) - { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode($mysoc->logo); - $width=128; - } - elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) - { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; - } - print '
    '; - print 'Logo
    '; - print ''.$langs->trans("OpenSurvey").''; - print '

    '; +/** + * Show footer for new member + * + * @return void + */ +function llxFooterSurvey() +{ + print '
    '; + + printCommonFooter('public'); + + dol_htmloutput_events(); + + print "\n"; + print "\n"; +} + + +/** + * Show logo + * + * @return void + */ +function showlogo() +{ + global $user, $conf, $langs, $mysoc; + + // Print logo + $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; + + if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small); + } + elseif (! empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file='.urlencode($mysoc->logo); + $width=128; + } + elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) + { + $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + } + print '
    '; + print 'Logo
    '; + print ''.$langs->trans("OpenSurvey").''; + print '

    '; } @@ -105,10 +105,10 @@ function get_server_name() { global $dolibarr_main_url_root; - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + $url=$urlwithouturlroot.dol_buildpath('/opensurvey/',1); if (!preg_match("|/$|", $url)) { @@ -171,94 +171,94 @@ function getUrlSondage($id, $admin = false) return $url; } - -/** - * Generate a random id + +/** + * Generate a random id * - * @param string $car Char to generate key - * @return void - */ -function dol_survey_random($car) -{ - $string = ""; - $chaine = "abcdefghijklmnopqrstuvwxyz123456789"; - srand((double) microtime()*1000000); - for($i=0; $i<$car; $i++) { - $string .= $chaine[rand()%strlen($chaine)]; - } - return $string; -} - -/** - * Add a poll - * - * @param string $origin Origin of poll creation - * @return void - */ -function ajouter_sondage($origin) -{ - global $conf, $db; - - $sondage=dol_survey_random(16); - $sondage_admin=$sondage.dol_survey_random(8); - - if ($_SESSION["formatsondage"]=="A"||$_SESSION["formatsondage"]=="A+") { - //extraction de la date de fin choisie - if ($_SESSION["champdatefin"]) { - if ($_SESSION["champdatefin"]>time()+250000) { - $date_fin=$_SESSION["champdatefin"]; - } - } else { - $date_fin=time()+15552000; - } - } - - if ($_SESSION["formatsondage"]=="D"||$_SESSION["formatsondage"]=="D+") { - //Calcul de la date de fin du sondage - $taille_tableau=count($_SESSION["totalchoixjour"])-1; - $date_fin=$_SESSION["totalchoixjour"][$taille_tableau]+200000; - } - - if (is_numeric($date_fin) === false) { - $date_fin = time()+15552000; + * @param string $car Char to generate key + * @return void + */ +function dol_survey_random($car) +{ + $string = ""; + $chaine = "abcdefghijklmnopqrstuvwxyz123456789"; + srand((double) microtime()*1000000); + for($i=0; $i<$car; $i++) { + $string .= $chaine[rand()%strlen($chaine)]; } - $canedit=empty($_SESSION['formatcanedit'])?'0':'1'; - - // Insert survey - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_sondage'; - $sql.= '(id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde, canedit, origin, sujet)'; - $sql.= " VALUES ('".$db->escape($sondage)."', '".$db->escape($_SESSION['commentaires'])."', '".$db->escape($_SESSION['adresse'])."', '".$db->escape($_SESSION['nom'])."',"; - $sql.= " '".$db->escape($_SESSION['titre'])."', '".$sondage_admin."', '".$db->idate($date_fin)."', '".$_SESSION['formatsondage']."', '".$db->escape($_SESSION['mailsonde'])."',"; - $sql.= " '".$canedit."', '".$db->escape($origin)."',"; - $sql.= " '".$db->escape($_SESSION['toutchoix'])."'"; - $sql.= ")"; - dol_syslog($sql); - $resql=$db->query($sql); - - if ($origin == 'dolibarr') $urlback=dol_buildpath('/opensurvey/adminstuds_preview.php',1).'?sondage='.$sondage_admin; - else - { - // Define $urlwithroot - $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); - $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - - $url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/studs.php',1).'?sondage='.$sondage; - - $urlback=$url; - - //var_dump($urlback);exit; - } - - unset($_SESSION["titre"]); - unset($_SESSION["nom"]); - unset($_SESSION["adresse"]); - unset($_SESSION["commentaires"]); - unset($_SESSION["canedit"]); - unset($_SESSION["mailsonde"]); - - header("Location: ".$urlback); - exit(); + return $string; +} + +/** + * Add a poll + * + * @param string $origin Origin of poll creation + * @return void + */ +function ajouter_sondage($origin) +{ + global $conf, $db; + + $sondage=dol_survey_random(16); + $sondage_admin=$sondage.dol_survey_random(8); + + if ($_SESSION["formatsondage"]=="A"||$_SESSION["formatsondage"]=="A+") { + //extraction de la date de fin choisie + if ($_SESSION["champdatefin"]) { + if ($_SESSION["champdatefin"]>time()+250000) { + $date_fin=$_SESSION["champdatefin"]; + } + } else { + $date_fin=time()+15552000; + } + } + + if ($_SESSION["formatsondage"]=="D"||$_SESSION["formatsondage"]=="D+") { + //Calcul de la date de fin du sondage + $taille_tableau=count($_SESSION["totalchoixjour"])-1; + $date_fin=$_SESSION["totalchoixjour"][$taille_tableau]+200000; + } + + if (is_numeric($date_fin) === false) { + $date_fin = time()+15552000; + } + $canedit=empty($_SESSION['formatcanedit'])?'0':'1'; + + // Insert survey + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_sondage'; + $sql.= '(id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde, canedit, origin, sujet)'; + $sql.= " VALUES ('".$db->escape($sondage)."', '".$db->escape($_SESSION['commentaires'])."', '".$db->escape($_SESSION['adresse'])."', '".$db->escape($_SESSION['nom'])."',"; + $sql.= " '".$db->escape($_SESSION['titre'])."', '".$sondage_admin."', '".$db->idate($date_fin)."', '".$_SESSION['formatsondage']."', '".$db->escape($_SESSION['mailsonde'])."',"; + $sql.= " '".$canedit."', '".$db->escape($origin)."',"; + $sql.= " '".$db->escape($_SESSION['toutchoix'])."'"; + $sql.= ")"; + dol_syslog($sql); + $resql=$db->query($sql); + + if ($origin == 'dolibarr') $urlback=dol_buildpath('/opensurvey/adminstuds_preview.php',1).'?sondage='.$sondage_admin; + else + { + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + $url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/studs.php',1).'?sondage='.$sondage; + + $urlback=$url; + + //var_dump($urlback);exit; + } + + unset($_SESSION["titre"]); + unset($_SESSION["nom"]); + unset($_SESSION["adresse"]); + unset($_SESSION["commentaires"]); + unset($_SESSION["canedit"]); + unset($_SESSION["mailsonde"]); + + header("Location: ".$urlback); + exit(); } diff --git a/htdocs/opensurvey/index.php b/htdocs/opensurvey/index.php index 37f975d1f40..a7f88631dd8 100755 --- a/htdocs/opensurvey/index.php +++ b/htdocs/opensurvey/index.php @@ -50,16 +50,16 @@ print_fiche_titre($langs->trans("OpenSurveyArea")); echo $langs->trans("NoSurveysInDatabase",$nbsondages).'

    '."\n"; -// Link -print img_picto('','object_globe.png').' '.$langs->trans("PublicLinkToCreateSurvey").':
    '; - -// Define $urlwithroot -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); -$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - -$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/index.php',1); -$urllink=''.$url.''; +// Link +print img_picto('','object_globe.png').' '.$langs->trans("PublicLinkToCreateSurvey").':
    '; + +// Define $urlwithroot +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + +$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/index.php',1); +$urllink=''.$url.''; print $urllink; diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index c87526ce5ca..908a01db8fd 100755 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -14,11 +14,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - -/** - * \file htdocs/opensurvey/list.php - * \ingroup opensurvey - * \brief Page to list surveys + +/** + * \file htdocs/opensurvey/list.php + * \ingroup opensurvey + * \brief Page to list surveys */ require_once('../main.inc.php'); @@ -27,14 +27,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); $action=GETPOST('action'); $id=GETPOST('id'); -$numsondage=substr($id, 0, 16); +$numsondage=substr($id, 0, 16); -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="p.titre"; -if ($page < 0) { - $page = 0; -} -$limit = $conf->liste_limit; +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="p.titre"; +if ($page < 0) { + $page = 0; +} +$limit = $conf->liste_limit; $offset = $limit * $page; @@ -46,10 +46,10 @@ if ($action == 'delete_confirm') { $db->begin(); - $object=new Opensurveysondage($db); + $object=new Opensurveysondage($db); + + $result=$object->delete($user,'',$numsondageadmin); - $result=$object->delete($user,'',$numsondageadmin); - $db->commit(); } @@ -81,14 +81,14 @@ print ''. $langs->trans("Survey").''. $lang $sql = "SELECT id_sondage, id_sondage_admin, mail_admin, format, origin, date_fin, titre, nom_admin"; $sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as p"; -// Count total nb of records -$nbtotalofrecords = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); +// Count total nb of records +$nbtotalofrecords = 0; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); } -$sql.= " ORDER BY $sortfield $sortorder "; +$sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); $resql=$db->query($sql); diff --git a/htdocs/opensurvey/public/choix_autre.php b/htdocs/opensurvey/public/choix_autre.php index 5975f9d4a0c..e120bd7ec20 100755 --- a/htdocs/opensurvey/public/choix_autre.php +++ b/htdocs/opensurvey/public/choix_autre.php @@ -28,87 +28,87 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); -$erreur = false; -$testdate = true; -$date_selected = ''; +$erreur = false; +$testdate = true; +$date_selected = ''; + +$origin=GETPOST('origin','alpha'); -$origin=GETPOST('origin','alpha'); - /* * Action */ -// Set session vars -$erreur_injection = false; -if (isset($_SESSION["nbrecases"])) { - for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) { - if (isset($_POST["choix"][$i])) { - $_SESSION["choix$i"]=$_POST["choix"][$i]; - } - if (isset($_POST["typecolonne"][$i])) { - $_SESSION["typecolonne$i"]=$_POST["typecolonne"][$i]; - } - } -} else { //nombre de cases par défaut - $_SESSION["nbrecases"]=5; -} - -if (isset($_POST["ajoutcases"]) || isset($_POST["ajoutcases_x"])) { - $_SESSION["nbrecases"]=$_SESSION["nbrecases"]+5; -} +// Set session vars +$erreur_injection = false; +if (isset($_SESSION["nbrecases"])) { + for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) { + if (isset($_POST["choix"][$i])) { + $_SESSION["choix$i"]=$_POST["choix"][$i]; + } + if (isset($_POST["typecolonne"][$i])) { + $_SESSION["typecolonne$i"]=$_POST["typecolonne"][$i]; + } + } +} else { //nombre de cases par défaut + $_SESSION["nbrecases"]=5; +} + +if (isset($_POST["ajoutcases"]) || isset($_POST["ajoutcases_x"])) { + $_SESSION["nbrecases"]=$_SESSION["nbrecases"]+5; +} + +// Create survey into database +if (isset($_POST["confirmecreation"]) || isset($_POST["confirmecreation_x"])) +{ + //recuperation des données de champs textes + $toutchoix = ''; + for ($i = 0; $i < $_SESSION["nbrecases"] + 1; $i++) + { + if (! empty($_POST["choix"][$i])) + { + $toutchoix.=','; + $toutchoix.=str_replace(array(",","@"), " ", $_POST["choix"][$i]).(empty($_POST["typecolonne"][$i])?'':'@'.$_POST["typecolonne"][$i]); + } + } + + $toutchoix=substr("$toutchoix",1); + $_SESSION["toutchoix"]=$toutchoix; -// Create survey into database -if (isset($_POST["confirmecreation"]) || isset($_POST["confirmecreation_x"])) -{ - //recuperation des données de champs textes - $toutchoix = ''; - for ($i = 0; $i < $_SESSION["nbrecases"] + 1; $i++) - { - if (! empty($_POST["choix"][$i])) - { - $toutchoix.=','; - $toutchoix.=str_replace(array(",","@"), " ", $_POST["choix"][$i]).(empty($_POST["typecolonne"][$i])?'':'@'.$_POST["typecolonne"][$i]); - } - } - - $toutchoix=substr("$toutchoix",1); - $_SESSION["toutchoix"]=$toutchoix; - if (GETPOST('champdatefin')) - { - $registredate=explode("/",$_POST["champdatefin"]); - if (is_array($registredate) === false || count($registredate) !== 3) { - $testdate = false; - $date_selected = $_POST["champdatefin"]; - } else { - $time = mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); - if ($time === false || date('d/m/Y', $time) !== $_POST["champdatefin"]) { - $testdate = false; - $date_selected = $_POST["champdatefin"]; - } else { - if (mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]) > time() + 250000) { - $_SESSION["champdatefin"]=mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); - } - } - } - } else { - $_SESSION["champdatefin"]=time()+15552000; - } - - if ($testdate === true) - { - //format du sondage AUTRE - $_SESSION["formatsondage"]="A"; - $_SESSION["caneditsondage"]=$_SESSION["canedit"]; + { + $registredate=explode("/",$_POST["champdatefin"]); + if (is_array($registredate) === false || count($registredate) !== 3) { + $testdate = false; + $date_selected = $_POST["champdatefin"]; + } else { + $time = mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); + if ($time === false || date('d/m/Y', $time) !== $_POST["champdatefin"]) { + $testdate = false; + $date_selected = $_POST["champdatefin"]; + } else { + if (mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]) > time() + 250000) { + $_SESSION["champdatefin"]=mktime(0,0,0,$registredate[1],$registredate[0],$registredate[2]); + } + } + } + } else { + $_SESSION["champdatefin"]=time()+15552000; + } - // Add into database - ajouter_sondage($origin); - } else { - $_POST["fin_sondage_autre"] = 'ok'; - } -} + if ($testdate === true) + { + //format du sondage AUTRE + $_SESSION["formatsondage"]="A"; + $_SESSION["caneditsondage"]=$_SESSION["canedit"]; + + // Add into database + ajouter_sondage($origin); + } else { + $_POST["fin_sondage_autre"] = 'ok'; + } +} @@ -119,16 +119,16 @@ if (isset($_POST["confirmecreation"]) || isset($_POST["confirmecreation_x"])) $form=new Form($db); -$arrayofjs=array(); -$arrayofcss=array('/opensurvey/css/style.css'); -llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); - -if (empty($_SESSION['titre']) || empty($_SESSION['nom']) || empty($_SESSION['adresse'])) -{ - dol_print_error('',"You haven't filled the first section of the poll creation"); - llxFooterSurvey(); - exit; -} +$arrayofjs=array(); +$arrayofcss=array('/opensurvey/css/style.css'); +llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); + +if (empty($_SESSION['titre']) || empty($_SESSION['nom']) || empty($_SESSION['adresse'])) +{ + dol_print_error('',"You haven't filled the first section of the poll creation"); + llxFooterSurvey(); + exit; +} //partie creation du sondage dans la base SQL @@ -150,8 +150,8 @@ for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) { $_SESSION["choix$i"] = ''; } print ''. $langs->trans("TitleChoice") .' '.$j.' : '; - $tmparray=array('checkbox'=>$langs->trans("CheckBox"),'yesno'=>$langs->trans("YesNoList"),'foragainst'=>$langs->trans("PourContreList")); - print '   '.$langs->trans("Type").' '.$form->selectarray("typecolonne[]", $tmparray, $_SESSION["typecolonne$i"]); + $tmparray=array('checkbox'=>$langs->trans("CheckBox"),'yesno'=>$langs->trans("YesNoList"),'foragainst'=>$langs->trans("PourContreList")); + print '   '.$langs->trans("Type").' '.$form->selectarray("typecolonne[]", $tmparray, $_SESSION["typecolonne$i"]); print ''."\n"; } diff --git a/htdocs/opensurvey/public/choix_date.php b/htdocs/opensurvey/public/choix_date.php index 46d5377c432..f651a91899d 100755 --- a/htdocs/opensurvey/public/choix_date.php +++ b/htdocs/opensurvey/public/choix_date.php @@ -28,56 +28,56 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); -$origin=GETPOST('origin','alpha'); +$origin=GETPOST('origin','alpha'); /* * Actions */ - -// Insert survey + +// Insert survey if (GETPOST('confirmation') || GETPOST('confirmation_x')) -{ +{ if (is_array($_SESSION['totalchoixjour'])) { - $nbofchoice=count($_SESSION["totalchoixjour"]); + $nbofchoice=count($_SESSION["totalchoixjour"]); for ($i = 0; $i < $nbofchoice; $i++) - { - if ($_SESSION["horaires$i"][0] == "" && $_SESSION["horaires$i"][1] == "" && $_SESSION["horaires$i"][2] == "" && $_SESSION["horaires$i"][3] == "" && $_SESSION["horaires$i"][4] == "") { - $choixdate.=","; - $choixdate .= $_SESSION["totalchoixjour"][$i]; - } else { - for ($j=0;$j<$_SESSION["nbrecaseshoraires"];$j++) { - if ($_SESSION["horaires$i"][$j]!="") { - $choixdate.=","; - $choixdate .= $_SESSION["totalchoixjour"][$i]; - $choixdate.="@"; - // On remplace la virgule et l'arobase pour ne pas avoir de problème par la suite - $choixdate .= str_replace(array(',', '@'), array(',', '@'), $_SESSION["horaires$i"][$j]); - } - } - } - } + { + if ($_SESSION["horaires$i"][0] == "" && $_SESSION["horaires$i"][1] == "" && $_SESSION["horaires$i"][2] == "" && $_SESSION["horaires$i"][3] == "" && $_SESSION["horaires$i"][4] == "") { + $choixdate.=","; + $choixdate .= $_SESSION["totalchoixjour"][$i]; + } else { + for ($j=0;$j<$_SESSION["nbrecaseshoraires"];$j++) { + if ($_SESSION["horaires$i"][$j]!="") { + $choixdate.=","; + $choixdate .= $_SESSION["totalchoixjour"][$i]; + $choixdate.="@"; + // On remplace la virgule et l'arobase pour ne pas avoir de problème par la suite + $choixdate .= str_replace(array(',', '@'), array(',', '@'), $_SESSION["horaires$i"][$j]); + } + } + } + } } - else dol_print_error('','array not defined'); - - $_SESSION["toutchoix"]=substr("$choixdate",1); - ajouter_sondage($origin); -} + else dol_print_error('','array not defined'); -// Reset days -if (GETPOST('reset')) { + $_SESSION["toutchoix"]=substr("$choixdate",1); + ajouter_sondage($origin); +} + +// Reset days +if (GETPOST('reset')) { $nbofchoice=count($_SESSION["totalchoixjour"]); - for ($i = 0; $i < $nbofchoice; $i++) { - for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { - unset($_SESSION["horaires$i"][$j]); - } - } - - unset($_SESSION["totalchoixjour"]); - unset($_SESSION["nbrecaseshoraires"]); -} - + for ($i = 0; $i < $nbofchoice; $i++) { + for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { + unset($_SESSION["horaires$i"][$j]); + } + } + + unset($_SESSION["totalchoixjour"]); + unset($_SESSION["nbrecaseshoraires"]); +} + /* @@ -90,9 +90,9 @@ if (! isset($_SESSION['nom']) && ! isset($_SESSION['adresse']) && ! isset($_SESS exit; } -$arrayofjs=array(); -$arrayofcss=array('/opensurvey/css/style.css'); -llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); +$arrayofjs=array(); +$arrayofcss=array('/opensurvey/css/style.css'); +llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); //nombre de cases par défaut if (! isset($_SESSION["nbrecaseshoraires"])) @@ -205,8 +205,8 @@ $nbrejourmois = date("t", mktime(0, 0, 0, $_SESSION["mois"], 1, $_SESSION["annee $premierjourmois = date("N", mktime(0, 0, 0, $_SESSION["mois"], 1, $_SESSION["annee"])) - 1; //le format du sondage est DATE -$_SESSION["formatsondage"] = "D"; -$_SESSION["formatcanedit"] = $_SESSION["canedit"]; +$_SESSION["formatsondage"] = "D"; +$_SESSION["formatcanedit"] = $_SESSION["canedit"]; //traduction de la valeur du mois if (is_integer($_SESSION["mois"]) && $_SESSION["mois"] > 0 && $_SESSION["mois"] < 13) @@ -223,7 +223,7 @@ else print '
    '."\n"; print ''; -print '
    '. $langs->trans("CreatePoll")." (2 / 2)" .'
    '."\n"; +print '
    '. $langs->trans("CreatePoll")." (2 / 2)" .'
    '."\n"; //affichage de l'aide pour les jours print '
    '."\n"; @@ -235,7 +235,7 @@ print '
    '."\n"; print ''."\n"; print ''; print ''; print ''."\n"; @@ -594,7 +594,7 @@ print ''."\n"; print '



    '."\n"; print ''."\n"; -llxFooterSurvey(); +llxFooterSurvey(); $db->close(); ?> \ No newline at end of file diff --git a/htdocs/opensurvey/public/create_survey.php b/htdocs/opensurvey/public/create_survey.php index d5e6a930357..40a41694732 100755 --- a/htdocs/opensurvey/public/create_survey.php +++ b/htdocs/opensurvey/public/create_survey.php @@ -21,24 +21,24 @@ * \brief Page to create a new survey */ -define("NOLOGIN",1); // This means this output page does not require to be logged. -define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +define("NOLOGIN",1); // This means this output page does not require to be logged. +define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); -$langs->load("opensurvey"); +$langs->load("opensurvey"); $origin=GETPOST('origin','alpha'); -// On teste toutes les variables pour supprimer l'ensemble des warnings PHP -// On transforme en entites html les données afin éviter les failles XSS -$post_var = array('titre', 'nom', 'adresse', 'commentaires', 'canedit', 'mailsonde', 'creation_sondage_date', 'creation_sondage_date_x', 'creation_sondage_autre', 'creation_sondage_autre_x'); +// On teste toutes les variables pour supprimer l'ensemble des warnings PHP +// On transforme en entites html les données afin éviter les failles XSS +$post_var = array('titre', 'nom', 'adresse', 'commentaires', 'canedit', 'mailsonde', 'creation_sondage_date', 'creation_sondage_date_x', 'creation_sondage_autre', 'creation_sondage_autre_x'); foreach ($post_var as $var) -{ - $$var = GETPOST($var); +{ + $$var = GETPOST($var); } // On initialise egalement la session car sinon bonjour les warning :-) @@ -101,9 +101,9 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre") || GET * View */ -$arrayofjs=array(); -$arrayofcss=array('/opensurvey/css/style.css'); -llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); +$arrayofjs=array(); +$arrayofcss=array('/opensurvey/css/style.css'); +llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); print '
    '. $langs->trans("CreatePoll").' (1 / 2)' .'
    '."\n"; diff --git a/htdocs/opensurvey/public/exportcsv.php b/htdocs/opensurvey/public/exportcsv.php index f933b37a317..5fded4f5d32 100755 --- a/htdocs/opensurvey/public/exportcsv.php +++ b/htdocs/opensurvey/public/exportcsv.php @@ -22,32 +22,32 @@ */ -define("NOLOGIN",1); // This means this output page does not require to be logged. -define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +define("NOLOGIN",1); // This means this output page does not require to be logged. +define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); -$action=GETPOST('action'); -$numsondage = $numsondageadmin = ''; -if (GETPOST('sondage')) -{ - if (strlen(GETPOST('sondage')) == 24) // recuperation du numero de sondage admin (24 car.) dans l'URL - { - $numsondageadmin=GETPOST("sondage",'alpha'); - $numsondage=substr($numsondageadmin, 0, 16); - } - else - { - $numsondageadmin=''; - $numsondage=GETPOST("sondage",'alpha'); - } +$action=GETPOST('action'); +$numsondage = $numsondageadmin = ''; +if (GETPOST('sondage')) +{ + if (strlen(GETPOST('sondage')) == 24) // recuperation du numero de sondage admin (24 car.) dans l'URL + { + $numsondageadmin=GETPOST("sondage",'alpha'); + $numsondage=substr($numsondageadmin, 0, 16); + } + else + { + $numsondageadmin=''; + $numsondage=GETPOST("sondage",'alpha'); + } } -$object=new Opensurveysondage($db); -$result=$object->fetch(0,$numsondage); -if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); +$object=new Opensurveysondage($db); +$result=$object->fetch(0,$numsondage); +if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); /* @@ -122,8 +122,8 @@ if ($resql) } else if ($car == "2") { - $input.='KO;'; - $somme[$k]++; + $input.='KO;'; + $somme[$k]++; } else { diff --git a/htdocs/opensurvey/public/index.php b/htdocs/opensurvey/public/index.php index fcbef77a4e0..6f0c2c06e25 100755 --- a/htdocs/opensurvey/public/index.php +++ b/htdocs/opensurvey/public/index.php @@ -16,18 +16,18 @@ */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -define("NOLOGIN",1); // This means this output page does not require to be logged. -define("NOCSRFCHECK",1); // We accept to go on this page from external web site. +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +define("NOLOGIN",1); // This means this output page does not require to be logged. +define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require_once('../../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); @@ -46,16 +46,16 @@ llxHeaderSurvey($langs->trans("OpenSurvey"), "", 0, 0, $arrayofjs, $arrayofcss); print '
    - -
    -

    '.$langs->trans("OpenSurveyDesc").' '.$langs->trans("OpenSurveyNoRegistration").'

    + +
    +

    '.$langs->trans("OpenSurveyDesc").' '.$langs->trans("OpenSurveyNoRegistration").'


    '; -print $langs->trans("OrganizeYourMeetingEasily").' -
    -
    +print $langs->trans("OrganizeYourMeetingEasily").' +
    +
    -
    -
    +
    +
    '; llxFooterSurvey(); diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index 9da1c4f79cb..62e78f172ee 100755 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -26,32 +26,32 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require_once('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); +require_once(DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php"); require_once(DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"); // Init vars $action=GETPOST('action'); -$numsondage = $numsondageadmin = ''; -if (GETPOST('sondage')) -{ - if (strlen(GETPOST('sondage')) == 24) // recuperation du numero de sondage admin (24 car.) dans l'URL - { - $numsondageadmin=GETPOST("sondage",'alpha'); - $numsondage=substr($numsondageadmin, 0, 16); - } - else - { - $numsondageadmin=''; - $numsondage=GETPOST("sondage",'alpha'); - } -} +$numsondage = $numsondageadmin = ''; +if (GETPOST('sondage')) +{ + if (strlen(GETPOST('sondage')) == 24) // recuperation du numero de sondage admin (24 car.) dans l'URL + { + $numsondageadmin=GETPOST("sondage",'alpha'); + $numsondage=substr($numsondageadmin, 0, 16); + } + else + { + $numsondageadmin=''; + $numsondage=GETPOST("sondage",'alpha'); + } +} $object=new Opensurveysondage($db); $result=$object->fetch(0,$numsondage); if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); -$nblignes=count($object->fetch_lines()); +$nblignes=count($object->fetch_lines()); /* @@ -60,7 +60,7 @@ $nblignes=count($object->fetch_lines()); $nbcolonnes = substr_count($object->sujet, ',') + 1; -$listofvoters=explode(',',$_SESSION["savevoter"]); +$listofvoters=explode(',',$_SESSION["savevoter"]); // Add comment if (GETPOST('ajoutcomment')) @@ -106,7 +106,7 @@ if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) } else if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') { - $nouveauchoix.="2"; + $nouveauchoix.="2"; } else { // sinon c'est 0 $nouveauchoix.="0"; @@ -134,7 +134,7 @@ if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) { // Add voter to session $_SESSION["savevoter"]=$nom.','.(empty($_SESSION["savevoter"])?'':$_SESSION["savevoter"]); // Save voter - $listofvoters=explode(',',$_SESSION["savevoter"]); + $listofvoters=explode(',',$_SESSION["savevoter"]); if (! empty($object->mailsonde)) { @@ -162,62 +162,62 @@ if (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"])) // Update vote -$testmodifier = false; -$testligneamodifier = false; -$ligneamodifier = -1; -for ($i=0; $i<$nblignes; $i++) -{ - if (isset($_POST['modifierligne'.$i])) - { - $ligneamodifier=$i; - $testligneamodifier=true; - } - - //test pour voir si une ligne est a modifier - if (isset($_POST['validermodifier'.$i])) - { - $modifier=$i; - $testmodifier=true; - } +$testmodifier = false; +$testligneamodifier = false; +$ligneamodifier = -1; +for ($i=0; $i<$nblignes; $i++) +{ + if (isset($_POST['modifierligne'.$i])) + { + $ligneamodifier=$i; + $testligneamodifier=true; + } + + //test pour voir si une ligne est a modifier + if (isset($_POST['validermodifier'.$i])) + { + $modifier=$i; + $testmodifier=true; + } } if ($testmodifier) { - //var_dump($_POST);exit; - $nouveauchoix = ''; - for ($i=0;$i<$nbcolonnes;$i++) + //var_dump($_POST);exit; + $nouveauchoix = ''; + for ($i=0;$i<$nbcolonnes;$i++) { - //var_dump($_POST["choix$i"]); - if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '1') - { - $nouveauchoix.="1"; - } - else if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') - { - $nouveauchoix.="2"; - } - else { // sinon c'est 0 - $nouveauchoix.="0"; - } - } + //var_dump($_POST["choix$i"]); + if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '1') + { + $nouveauchoix.="1"; + } + else if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2') + { + $nouveauchoix.="2"; + } + else { // sinon c'est 0 + $nouveauchoix.="0"; + } + } - $idtomodify=$_POST["idtomodify".$modifier]; - $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs"; - $sql.= " SET reponses = '".$db->escape($nouveauchoix)."'"; - $sql.= " WHERE id_users = '".$db->escape($idtomodify)."'"; - - dol_syslog("sql=".$sql); - $resql = $db->query($sql); - if (! $resql) dol_print_error($db); + $idtomodify=$_POST["idtomodify".$modifier]; + $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs"; + $sql.= " SET reponses = '".$db->escape($nouveauchoix)."'"; + $sql.= " WHERE id_users = '".$db->escape($idtomodify)."'"; + + dol_syslog("sql=".$sql); + $resql = $db->query($sql); + if (! $resql) dol_print_error($db); } -// Delete comment -$idcomment=GETPOST('deletecomment','int'); -if ($idcomment) -{ - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.$idcomment; - $resql = $db->query($sql); -} +// Delete comment +$idcomment=GETPOST('deletecomment','int'); +if ($idcomment) +{ + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.$idcomment; + $resql = $db->query($sql); +} @@ -228,21 +228,21 @@ if ($idcomment) $form=new Form($db); $object=new OpenSurveySondage($db); -$result=$object->fetch(0,$numsondage); -if ($result <= 0) -{ - print $langs->trans("ErrorRecordNotFound"); - llxFooterSurvey(); - exit; +$result=$object->fetch(0,$numsondage); +if ($result <= 0) +{ + print $langs->trans("ErrorRecordNotFound"); + llxFooterSurvey(); + exit; } -$arrayofjs=array(); -$arrayofcss=array('/opensurvey/css/style.css'); -llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); - +$arrayofjs=array(); +$arrayofcss=array('/opensurvey/css/style.css'); +llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); -// Define format of choices -$toutsujet=explode(",",$object->sujet); + +// Define format of choices +$toutsujet=explode(",",$object->sujet); $listofanswers=array(); foreach ($toutsujet as $value) { @@ -253,7 +253,7 @@ $toutsujet=str_replace("°","'",$toutsujet); print '
    '.$langs->trans("YouAreInivitedToVote").'
    '; -print $langs->trans("OpenSurveyHowTo").'

    '; +print $langs->trans("OpenSurveyHowTo").'

    '; print '
    '."\n"; @@ -657,12 +657,12 @@ for ($i = 0; $i < $nbcolonnes; $i++) { if ($object->format=="D"||$object->format=="D+") { $meilleursujetexport = $toutsujet[$i]; - if (strpos($toutsujet[$i], '@') !== false) { - $toutsujetdate = explode("@", $toutsujet[$i]); - $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . _("for") . ' ' . $toutsujetdate[1]; - } else { - $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ' ('.dol_print_date($toutsujet[$i],'%A').')'; - } + if (strpos($toutsujet[$i], '@') !== false) { + $toutsujetdate = explode("@", $toutsujet[$i]); + $meilleursujet .= dol_print_date($toutsujetdate[0],'daytext'). ' ('.dol_print_date($toutsujetdate[0],'%A').')' . _("for") . ' ' . $toutsujetdate[1]; + } else { + $meilleursujet .= dol_print_date($toutsujet[$i],'daytext'). ' ('.dol_print_date($toutsujet[$i],'%A').')'; + } } else { @@ -696,52 +696,52 @@ if ($nbofcheckbox >= 2) print '
    '; -// Comment list -$sql = 'SELECT id_comment, usercomment, comment'; -$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_comments'; -$sql.= " WHERE id_sondage='".$db->escape($numsondage)."'"; -$sql.= " ORDER BY id_comment"; -$resql = $db->query($sql); -$num_rows=$db->num_rows($resql); -if ($num_rows > 0) -{ - $i = 0; +// Comment list +$sql = 'SELECT id_comment, usercomment, comment'; +$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_comments'; +$sql.= " WHERE id_sondage='".$db->escape($numsondage)."'"; +$sql.= " ORDER BY id_comment"; +$resql = $db->query($sql); +$num_rows=$db->num_rows($resql); +if ($num_rows > 0) +{ + $i = 0; print "
    " . $langs->trans("CommentsOfVoters") . " :
    \n"; - while ( $i < $num_rows) - { + while ( $i < $num_rows) + { $obj=$db->fetch_object($resql); - print '
    '; + print '
    '; if (in_array($obj->usercomment, $listofvoters)) print ' '.img_picto('', 'delete.png').' '; - print $obj->usercomment.' : '.dol_nl2br($obj->comment)."
    "; - $i++; - } -} + print $obj->usercomment.' :
    '.dol_nl2br($obj->comment)."
    "; + $i++; + } +} // Form to add comment print '
    ' .$langs->trans("AddACommentForPoll") . "
    \n"; print '
    '."\n"; -print $langs->trans("Name") .' : '; -print '   '."\n"; +print $langs->trans("Name") .' : '; +print '   '."\n"; print '
    '."\n"; print ''."\n"; print '
    '."\n"; // div add comment -print '

    '; +print '

    '; /* -// Define $urlwithroot -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); -$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - -$message=''; -$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/studs.php',1).'?sondage='.$numsondage; -$urlvcal=''.$url.''; -$message.=img_picto('','object_globe.png').' '.$langs->trans("UrlForSurvey").': '.$urlvcal; - -print '
    '.$message.'
    '; +// Define $urlwithroot +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + +$message=''; +$url=$urlwithouturlroot.dol_buildpath('/opensurvey/public/studs.php',1).'?sondage='.$numsondage; +$urlvcal=''.$url.''; +$message.=img_picto('','object_globe.png').' '.$langs->trans("UrlForSurvey").': '.$urlvcal; + +print '
    '.$message.'
    '; */ diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index 6e7e0513576..aafe01bbb01 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -89,22 +89,22 @@ if ($action == 'convert') foreach ($listofmulti as $level => $multiprices) { $price_base_type = $objectstatic->multiprices_base_type[$level]; // Get price_base_type of product/service to keep the same for update - if (empty($price_base_type)) continue; // Discard not defined price levels + if (empty($price_base_type)) continue; // Discard not defined price levels - if ($price_base_type == 'TTC') - { - $newprice=price2num($objectstatic->multiprices_ttc[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->multiprices_min_ttc[$level]; - } - else - { - $newprice=price2num($objectstatic->multiprices[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->multiprices_min[$level]; - } - if ($newminprice > $newprice) $newminprice=$newprice; - $newvat=str_replace('*','',$newvatrate); - $newnpr=$objectstatic->multiprices_recuperableonly[$level]; - $newlevel=$level; + if ($price_base_type == 'TTC') + { + $newprice=price2num($objectstatic->multiprices_ttc[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->multiprices_min_ttc[$level]; + } + else + { + $newprice=price2num($objectstatic->multiprices[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->multiprices_min[$level]; + } + if ($newminprice > $newprice) $newminprice=$newprice; + $newvat=str_replace('*','',$newvatrate); + $newnpr=$objectstatic->multiprices_recuperableonly[$level]; + $newlevel=$level; //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
    \n"; $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); @@ -117,30 +117,30 @@ if ($action == 'convert') if ($newlevel == 1) $updatelevel1=true; } - // Update single price - $price_base_type = $objectstatic->price_base_type; // Get price_base_type of product/service to keep the same for update - if ($price_base_type == 'TTC') - { - $newprice=price2num($objectstatic->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->price_min_ttc; - } - else - { - $newprice=price2num($objectstatic->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) - $newminprice=$objectstatic->price_min; - } - if ($newminprice > $newprice) $newminprice=$newprice; - $newvat=str_replace('*','',$newvatrate); - $newnpr=$objectstatic->recuperableonly; - $newlevel=0; - if (! empty($price_base_type) && ! $updatelevel1) - { - //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
    \n"; - $ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); - } - - if ($ret < 0 || $retm < 0) $error++; - else $nbrecordsmodified++; + // Update single price + $price_base_type = $objectstatic->price_base_type; // Get price_base_type of product/service to keep the same for update + if ($price_base_type == 'TTC') + { + $newprice=price2num($objectstatic->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->price_min_ttc; + } + else + { + $newprice=price2num($objectstatic->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) + $newminprice=$objectstatic->price_min; + } + if ($newminprice > $newprice) $newminprice=$newprice; + $newvat=str_replace('*','',$newvatrate); + $newnpr=$objectstatic->recuperableonly; + $newlevel=0; + if (! empty($price_base_type) && ! $updatelevel1) + { + //print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr
    \n"; + $ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); + } + + if ($ret < 0 || $retm < 0) $error++; + else $nbrecordsmodified++; } $i++; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2645c53923a..0a45a94e7c8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1070,9 +1070,9 @@ class Product extends CommonObject // Price by quantity $this->price_by_qty = $newpsq; - $this->_log_price($user,$level); // Save price for level into table product_price - - $this->level = $level; // Store level of price edited for trigger + $this->_log_price($user,$level); // Save price for level into table product_price + + $this->level = $level; // Store level of price edited for trigger // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); @@ -1223,8 +1223,8 @@ class Product extends CommonObject $this->multiprices_min[$i]=$result["price_min"]; $this->multiprices_min_ttc[$i]=$result["price_min_ttc"]; $this->multiprices_base_type[$i]=$result["price_base_type"]; - $this->multiprices_tva_tx[$i]=$result["tva_tx"]; - $this->multiprices_recuperableonly[$i]=$result["recuperableonly"]; + $this->multiprices_tva_tx[$i]=$result["tva_tx"]; + $this->multiprices_recuperableonly[$i]=$result["recuperableonly"]; // Price by quantity $this->prices_by_qty[$i]=$result["price_by_qty"]; @@ -1867,7 +1867,7 @@ class Product extends CommonObject function del_sousproduit($fk_parent, $fk_child) { if (! is_numeric($fk_parent)) $fk_parent=0; - if (! is_numeric($fk_child)) $fk_child=0; + if (! is_numeric($fk_child)) $fk_child=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; $sql.= " WHERE fk_product_pere = ".$fk_parent; @@ -2156,7 +2156,7 @@ class Product extends CommonObject $id=(! empty($desc_pere[0]) ? $desc_pere[0] :''); $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); - $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); + $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); if ($multiply < 1) $multiply=1; //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; @@ -2402,9 +2402,9 @@ class Product extends CommonObject $lien = ''; $lienfin=''; } - else if ($option == 'category') - { - $lien = ''; + else if ($option == 'category') + { + $lien = ''; } else { diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index a8ca8521a65..5c312886313 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -36,7 +36,7 @@ if (! empty($conf->categorie->enabled)) $langs->load("products"); $langs->load("stocks"); -$langs->load("suppliers"); +$langs->load("suppliers"); $action = GETPOST('action'); $sref=GETPOST("sref"); diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index f7b5fa76650..f011c39f63c 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -66,7 +66,7 @@ else } -print '
    '; +print '
    '; print_projecttasks_array($db,$socid,$projectsListId,$mine); diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index a99366d9a36..d48b0effe6b 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -33,11 +33,11 @@ $langs->load("main"); $langs->load("install"); $langs->load("other"); -$conf->dol_hide_topmenu=GETPOST('dol_hide_topmenu'); -$conf->dol_hide_leftmenu=GETPOST('dol_hide_leftmenu'); -$conf->dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen'); -$conf->dol_no_mouse_hover=GETPOST('dol_no_mouse_hover'); -$conf->dol_use_jmobile=GETPOST('dol_use_jmobile'); +$conf->dol_hide_topmenu=GETPOST('dol_hide_topmenu'); +$conf->dol_hide_leftmenu=GETPOST('dol_hide_leftmenu'); +$conf->dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen'); +$conf->dol_no_mouse_hover=GETPOST('dol_no_mouse_hover'); +$conf->dol_use_jmobile=GETPOST('dol_use_jmobile'); // Security check global $dolibarr_main_demo; @@ -47,8 +47,8 @@ if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo mu $res=$hookmanager->initHooks(array('demo')); $demoprofiles=array(); -$alwayscheckedmodules=array(); -$alwaysuncheckedmodules=array(); +$alwayscheckedmodules=array(); +$alwaysuncheckedmodules=array(); $alwayshiddencheckedmodules=array(); $alwayshiddenuncheckedmodules=array(); @@ -228,12 +228,12 @@ if (GETPOST("action") == 'gotodemo') // Do redirect to login page if ($disablestring) { - $url=''; - $url.=($url?'&':'').($conf->dol_hide_topmenu?'dol_hide_topmenu='.$conf->dol_hide_topmenu:''); - $url.=($url?'&':'').($conf->dol_hide_leftmenu?'dol_hide_leftmenu='.$conf->dol_hide_leftmenu:''); - $url.=($url?'&':'').($conf->dol_optimize_smallscreen?'dol_optimize_smallscreen='.$conf->dol_optimize_smallscreen:''); - $url.=($url?'&':'').($conf->dol_no_mouse_hover?'dol_no_mouse_hover='.$conf->dol_no_mouse_hover:''); - $url.=($url?'&':'').($conf->dol_use_jmobile?'dol_use_jmobile='.$conf->dol_use_jmobile:''); + $url=''; + $url.=($url?'&':'').($conf->dol_hide_topmenu?'dol_hide_topmenu='.$conf->dol_hide_topmenu:''); + $url.=($url?'&':'').($conf->dol_hide_leftmenu?'dol_hide_leftmenu='.$conf->dol_hide_leftmenu:''); + $url.=($url?'&':'').($conf->dol_optimize_smallscreen?'dol_optimize_smallscreen='.$conf->dol_optimize_smallscreen:''); + $url.=($url?'&':'').($conf->dol_no_mouse_hover?'dol_no_mouse_hover='.$conf->dol_no_mouse_hover:''); + $url.=($url?'&':'').($conf->dol_use_jmobile?'dol_use_jmobile='.$conf->dol_use_jmobile:''); if (GETPOST('urlfrom')) $url.=($url?'&':'').'urlfrom='.urlencode(GETPOST('urlfrom','alpha')); $url=DOL_URL_ROOT.'/index.php?'.($url?$url.'&':'').'disablemodules='.$disablestring; header("Location: ".$url); @@ -247,60 +247,60 @@ if (GETPOST("action") == 'gotodemo') */ $head=''; -$head.=''."\n"; -$head.=''."\n"; -$head.=' -'; llxHeaderVierge($langs->trans("DolibarrDemo"), $head); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index e44342278f0..81d218cec78 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -26,10 +26,10 @@ */ if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu /** * Header empty @@ -55,13 +55,13 @@ $securitykey=GETPOST('securitykey'); * Actions */ -dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); - +dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); + if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) { print 'Bad security key value.'; exit; -} +} if (! empty($tag)) { diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 8585b19cd4a..3f86685fad3 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -25,16 +25,16 @@ * \brief Script use to update unsubcribe contact to prospect mailing list */ -if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOLOGIN')) define("NOLOGIN",1); // This means this output page does not require to be logged. +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu -/** - * Header empty - * - * @return void - */ -function llxHeader() { } +/** + * Header empty + * + * @return void + */ +function llxHeader() { } /** * Footer empty * @@ -53,15 +53,15 @@ $langs->load("mails"); $tag=GETPOST('tag'); $unsuscrib=GETPOST('unsuscrib'); -$securitykey=GETPOST('securitykey'); +$securitykey=GETPOST('securitykey'); /* * Actions */ -dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); - +dol_syslog("public/emailing/mailing-read.php : tag=".$tag." securitykey=".$securitykey, LOG_DEBUG); + if ($securitykey != $conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) { print 'Bad security key value.'; diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index 24be3c5af6f..c4457ff4d93 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -63,29 +63,29 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox'); -// Send an email -if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) -{ - $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; - $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', - $sendto, + 'New subscription payed', + $sendto, $from, 'New subscription payed '.$fulltag - ); + ); - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } -} + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} llxHeaderPayBox($langs->trans("PaymentForm")); diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 33107883d8f..b8940fa1a32 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -41,15 +41,15 @@ $langs->load("companies"); $langs->load("paybox"); $langs->load("paypal"); -/*$source=GETPOST('source'); -$ref=GETPOST('ref'); -$PAYBOXTOKEN=GETPOST('TOKEN'); -if (empty($PAYBOXTOKEN)) $PAYBOXTOKEN=GETPOST('token'); -$PAYBOXPAYERID=GETPOST('PAYERID'); -if (empty($PAYBOXPAYERID)) $PAYBOXPAYERID=GETPOST('PayerID'); +/*$source=GETPOST('source'); +$ref=GETPOST('ref'); +$PAYBOXTOKEN=GETPOST('TOKEN'); +if (empty($PAYBOXTOKEN)) $PAYBOXTOKEN=GETPOST('token'); +$PAYBOXPAYERID=GETPOST('PAYERID'); +if (empty($PAYBOXPAYERID)) $PAYBOXPAYERID=GETPOST('PayerID'); */ -$PAYBOXFULLTAG=GETPOST('FULLTAG'); -if (empty($PAYBOXFULLTAG)) $PAYBOXFULLTAG=GETPOST('fulltag'); +$PAYBOXFULLTAG=GETPOST('FULLTAG'); +if (empty($PAYBOXFULLTAG)) $PAYBOXFULLTAG=GETPOST('fulltag'); /* @@ -77,44 +77,44 @@ llxHeaderPayBox($langs->trans("PaymentForm")); print ''."\n"; print '
    '."\n"; -// Get on url call +// Get on url call /* $token = $PAYBOXTOKEN; -*/ -$fulltag = $PAYBOXFULLTAG; -/*$payerID = $PAYBOXPAYERID; -// Set by newpayment.php -$paymentType = $_SESSION['PaymentType']; -$currencyCodeType = $_SESSION['currencyCodeType']; -$FinalPaymentAmt = $_SESSION["Payment_Amount"]; -// From env -$ipaddress = $_SESSION['ipaddress']; - -dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag); -*/ - -// Send an email -if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) -{ - $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; - $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; +*/ +$fulltag = $PAYBOXFULLTAG; +/*$payerID = $PAYBOXPAYERID; +// Set by newpayment.php +$paymentType = $_SESSION['PaymentType']; +$currencyCodeType = $_SESSION['currencyCodeType']; +$FinalPaymentAmt = $_SESSION["Payment_Amount"]; +// From env +$ipaddress = $_SESSION['ipaddress']; + +dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag); +*/ + +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', - $sendto, - $from, + 'New subscription payed', + $sendto, + $from, 'New subscription payed '.$fulltag - ); - - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } } diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index ee72206ae52..21d93f3eaa1 100755 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -71,29 +71,29 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n"; dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal'); -// Send an email -if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) -{ - $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; - $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; +// Send an email +if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag)) +{ + $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; + $from=$conf->global->MAILING_EMAIL_FROM; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', - $sendto, - $from, + 'New subscription payed', + $sendto, + $from, 'New subscription payed '.$fulltag - ); - - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } -} + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); + } +} llxHeaderPaypal($langs->trans("PaymentForm")); diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 012269b8be3..e4ea8a92095 100755 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -81,14 +81,14 @@ if (empty($PAYPAL_API_SIGNATURE)) return -1; } -$source=GETPOST('source'); -$ref=GETPOST('ref'); -$PAYPALTOKEN=GETPOST('TOKEN'); -if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); -$PAYPALPAYERID=GETPOST('PAYERID'); -if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); -$PAYPALFULLTAG=GETPOST('FULLTAG'); -if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag'); +$source=GETPOST('source'); +$ref=GETPOST('ref'); +$PAYPALTOKEN=GETPOST('TOKEN'); +if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); +$PAYPALPAYERID=GETPOST('PAYERID'); +if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID'); +$PAYPALFULLTAG=GETPOST('FULLTAG'); +if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag'); /* @@ -135,23 +135,23 @@ if ($PAYPALTOKEN) { $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL; $from=$conf->global->MAILING_EMAIL_FROM; - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile( - 'New subscription payed', + 'New subscription payed', $sendto, - $from, + $from, 'New subscription payed '.$fulltag - ); - - $result=$mailfile->sendfile(); - if ($result) - { - dol_syslog("EMail sent to ".$sendto); - } - else - { + ); + + $result=$mailfile->sendfile(); + if ($result) + { + dol_syslog("EMail sent to ".$sendto); + } + else + { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR); - } + } } diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 61c01b00f2a..0fb2da5a053 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -66,8 +66,8 @@ else //ini_set('default_socket_timeout', $params['response_timeout']); //$soapclient = new SoapClient($WS_DOL_URL_WSDL,$params); $soapclient = new nusoap_client($WS_DOL_URL_WSDL,true,$params['proxy_host'],$params['proxy_port'],$params['proxy_login'],$params['proxy_password'],$params['connection_timeout'],$params['response_timeout']); - $soapclient->soap_defencoding = 'utf-8'; - $soapclient->xml_encoding = 'utf-8'; + $soapclient->soap_defencoding = 'utf-8'; + $soapclient->xml_encoding = 'utf-8'; $soapclient->decode_utf8 = false; // Check for an error diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f998f563729..b6bee432087 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1452,14 +1452,14 @@ class Societe extends CommonObject { $lien = 'url='http://www.specimen.com'; $this->phone='0909090901'; - $this->fax='0909090909'; + $this->fax='0909090909'; $this->code_client='CC-'.dol_print_date($now,'dayhourlog'); $this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 7618feb0349..49554379404 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -445,10 +445,10 @@ if (empty($reshook)) } // Set parent company - if ($action == 'set_thirdparty' && $user->rights->societe->creer) + if ($action == 'set_thirdparty' && $user->rights->societe->creer) { - $result = $object->set_parent(GETPOST('editparentcompany','int')); - } + $result = $object->set_parent(GETPOST('editparentcompany','int')); + } /* * Generate document @@ -1727,24 +1727,24 @@ else // Parent company if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) { - // Payment term - print '
    '; - print ''; + // Payment term + print ''; + print ''; } // Sales representative diff --git a/htdocs/support/index.php b/htdocs/support/index.php index 6b555672631..5d2d7fb5104 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -175,7 +175,7 @@ print ''; print '
    '.$motmois.' '.$_SESSION["annee"].'
    '; -print ''; +print ''; print '
    '; print '
    '; - print ''; - if ($action != 'editparentcompany') print ''; - print '
    '; - print $langs->trans('ParentCompany'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'
    '; - print '
    '; - if ($action == 'editparentcompany') - { - $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'editparentcompany','s.rowid <> '.$object->id,1); - } - else - { - $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'none','s.rowid <> '.$object->id,1); - } - print '
    '; + print ''; + if ($action != 'editparentcompany') print ''; + print '
    '; + print $langs->trans('ParentCompany'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'
    '; + print '
    '; + if ($action == 'editparentcompany') + { + $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'editparentcompany','s.rowid <> '.$object->id,1); + } + else + { + $form->form_thirdparty($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->parent,'none','s.rowid <> '.$object->id,1); + } + print '
    '."\n"; -print '
    '; // Other support diff --git a/htdocs/theme/amarok/graph-color.php b/htdocs/theme/amarok/graph-color.php index 1a0d2253a2a..be8421b6d4b 100755 --- a/htdocs/theme/amarok/graph-color.php +++ b/htdocs/theme/amarok/graph-color.php @@ -22,10 +22,10 @@ * \ingroup core */ -global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; -$theme_bordercolor = array(235,235,224); -$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); -$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); -$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); +global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; +$theme_bordercolor = array(235,235,224); +$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); +$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); +$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); ?> diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 8e6df230465..b81ae3a090e 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -41,8 +41,8 @@ session_cache_limiter(FALSE); require_once '../../main.inc.php'; -// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) -if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login']); +// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) +if (empty($user->id) && ! empty($_SESSION['dol_login'])) $user->fetch('',$_SESSION['dol_login']); // Define css type header('Content-type: text/css'); @@ -72,109 +72,109 @@ $fontlist='helvetica,arial,tahoma,verdana'; //$fontlist='Verdana,Helvetica,Ar $img_liste_titre=dol_buildpath($path.'/theme/'.$theme.'/img/menus/trtitle.png',1); $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; - -// Define reference colors -// Example: Light grey: $colred=235;$colgreen=235;$colblue=235; -// Example: Pink: $colred=230;$colgreen=210;$colblue=230; -// Example: Green: $colred=210;$colgreen=230;$colblue=210; -// Example: Ocean: $colred=220;$colgreen=220;$colblue=240; -//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; -//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; -//var_dump($user->conf->THEME_ELDY_RGB); -$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,0,2))); -$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,2,2))); -$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,4,2))); - -// Colors -$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255 -$isgreen=max(0,(2*$colgreen-$colred-$colblue)/2); // 0 - 255 -$isblue=max(0,(2*$colblue-$colred-$colgreen)/2); // 0 - 255 -$colorback1=($colred-3).','.($colgreen-3).','.($colblue-3); // topmenu -$colorback2=($colred+5).','.($colgreen+5).','.($colblue+5); -$colorbacktab1=($colred+15).','.($colgreen+16).','.($colblue+17); // vmenu -$colorbacktab1b=($colred+5).','.($colgreen+6).','.($colblue+7); // vmenu (not menu) -$colorbacktab2=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacktitle1=($colred-5).','.($colgreen-5).','.($colblue-5); // title of array -$colorbacktitle2=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacktabcard1=($colred+15).','.($colgreen+16).','.($colblue+17); // card -$colorbacktabcard2=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacktabactive=($colred-15).','.($colgreen-15).','.($colblue-15); -$colorbacklineimpair1=(244+round($isred/3)).','.(244+round($isgreen/3)).','.(244+round($isblue/3)); // line impair -$colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+round($isblue/3)); // line impair -$colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line impair -$colorbacklinepair1='255,255,255'; // line pair -$colorbacklinepair2='255,255,255'; // line pair -$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); -$colorbackbody='#f5f5f5'; -$colortext='40,40,40'; -$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; -$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; -$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); -$colorback2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$user->conf->THEME_ELDY_TOPMENU_BACK2); -$colorbacktab1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$user->conf->THEME_ELDY_VERMENU_BACK1); -$colorbacktab1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); -$colorbacktab2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$user->conf->THEME_ELDY_VERMENU_BACK2); -$colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); -$colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); -$colorbacktabcard1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD1) ?$colorbacktabcard1:$conf->global->THEME_ELDY_BACKTABCARD1) :(empty($user->conf->THEME_ELDY_BACKTABCARD1)?$colorbacktabcard1:$user->conf->THEME_ELDY_BACKTABCARD1); -$colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD2) ?$colorbacktabcard2:$conf->global->THEME_ELDY_BACKTABCARD2) :(empty($user->conf->THEME_ELDY_BACKTABCARD2)?$colorbacktabcard2:$user->conf->THEME_ELDY_BACKTABCARD2); -$colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); -$colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); -$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); -$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); -$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); -$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); -$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); -$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); -$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); -$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); -$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); -// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER -if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) - || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) -{ - $colorbacklineimpairhover=''; - $colorbacklinepairhover=''; -} - -// Set text color to black or white -$tmppart=explode(',',$colorback1); -$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : ''); -$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); -$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); -//print $tmpval; -if ($tmpval < 340) $colortextmain='FFFFFF'; -else $colortextmain='101010'; - -$usecss3=true; -if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; -elseif ($conf->browser->name == 'iceweasel') $usecss3=false; -elseif ($conf->browser->name == 'epiphany') $usecss3=false; - -print '/*'."\n"; -print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; -print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; -print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; -print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; -print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; -print 'colorbacklinepair1='.$colorbacklinepair1."\n"; -print 'colorbacklinepair2='.$colorbacklinepair2."\n"; -print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; -print 'usecss3='.$usecss3."\n"; -print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; -print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; -print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; -print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; -print 'dol_use_jmobile='.$dol_use_jmobile."\n"; -print '*/'."\n"; - +// Define reference colors +// Example: Light grey: $colred=235;$colgreen=235;$colblue=235; +// Example: Pink: $colred=230;$colgreen=210;$colblue=230; +// Example: Green: $colred=210;$colgreen=230;$colblue=210; +// Example: Ocean: $colred=220;$colgreen=220;$colblue=240; +//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0; +//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0; +//var_dump($user->conf->THEME_ELDY_RGB); +$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,0,2))); +$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,2,2))); +$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($user->conf->THEME_ELDY_RGB,4,2))); + +// Colors +$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255 +$isgreen=max(0,(2*$colgreen-$colred-$colblue)/2); // 0 - 255 +$isblue=max(0,(2*$colblue-$colred-$colgreen)/2); // 0 - 255 +$colorback1=($colred-3).','.($colgreen-3).','.($colblue-3); // topmenu +$colorback2=($colred+5).','.($colgreen+5).','.($colblue+5); +$colorbacktab1=($colred+15).','.($colgreen+16).','.($colblue+17); // vmenu +$colorbacktab1b=($colred+5).','.($colgreen+6).','.($colblue+7); // vmenu (not menu) +$colorbacktab2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktitle1=($colred-5).','.($colgreen-5).','.($colblue-5); // title of array +$colorbacktitle2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktabcard1=($colred+15).','.($colgreen+16).','.($colblue+17); // card +$colorbacktabcard2=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacktabactive=($colred-15).','.($colgreen-15).','.($colblue-15); +$colorbacklineimpair1=(244+round($isred/3)).','.(244+round($isgreen/3)).','.(244+round($isblue/3)); // line impair +$colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+round($isblue/3)); // line impair +$colorbacklineimpairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line impair +$colorbacklinepair1='255,255,255'; // line pair +$colorbacklinepair2='255,255,255'; // line pair +$colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); +$colorbackbody='#f5f5f5'; +$colortext='40,40,40'; +$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14'; +$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14'; + +$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1); +$colorback2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorback2:$user->conf->THEME_ELDY_TOPMENU_BACK2); +$colorbacktab1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbacktab1:$user->conf->THEME_ELDY_VERMENU_BACK1); +$colorbacktab1b =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1:$conf->global->THEME_ELDY_VERMENU_BACK1b) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1b)?$colorbacktab1b:$user->conf->THEME_ELDY_VERMENU_BACK1b); +$colorbacktab2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbacktab2:$user->conf->THEME_ELDY_VERMENU_BACK2); +$colorbacktitle1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE1) ?$colorbacktitle1:$conf->global->THEME_ELDY_BACKTITLE1) :(empty($user->conf->THEME_ELDY_BACKTITLE1)?$colorbacktitle1:$user->conf->THEME_ELDY_BACKTITLE1); +$colorbacktitle2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTITLE2) ?$colorbacktitle2:$conf->global->THEME_ELDY_BACKTITLE2) :(empty($user->conf->THEME_ELDY_BACKTITLE2)?$colorbacktitle2:$user->conf->THEME_ELDY_BACKTITLE2); +$colorbacktabcard1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD1) ?$colorbacktabcard1:$conf->global->THEME_ELDY_BACKTABCARD1) :(empty($user->conf->THEME_ELDY_BACKTABCARD1)?$colorbacktabcard1:$user->conf->THEME_ELDY_BACKTABCARD1); +$colorbacktabcard2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABCARD2) ?$colorbacktabcard2:$conf->global->THEME_ELDY_BACKTABCARD2) :(empty($user->conf->THEME_ELDY_BACKTABCARD2)?$colorbacktabcard2:$user->conf->THEME_ELDY_BACKTABCARD2); +$colorbacktabactive =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$conf->global->THEME_ELDY_BACKTABACTIVE):(empty($user->conf->THEME_ELDY_BACKTABACTIVE)?$colorbacktabactive:$user->conf->THEME_ELDY_BACKTABACTIVE); +$colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR1) ?$colorbacklineimpair1:$conf->global->THEME_ELDY_LINEIMPAIR1):(empty($user->conf->THEME_ELDY_LINEIMPAIR1)?$colorbacklineimpair1:$user->conf->THEME_ELDY_LINEIMPAIR1); +$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2); +$colorbacklineimpairhover=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIRHOVER) ?$colorbacklineimpairhover:$conf->global->THEME_ELDY_LINEIMPAIRHOVER):(empty($user->conf->THEME_ELDY_LINEIMPAIRHOVER)?$colorbacklineimpairhover:$user->conf->THEME_ELDY_LINEIMPAIRHOVER); +$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1); +$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2); +$colorbacklinepairhover =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIRHOVER) ?$colorbacklinepairhover:$conf->global->THEME_ELDY_LINEPAIRHOVER) :(empty($user->conf->THEME_ELDY_LINEPAIRHOVER)?$colorbacklinepairhover:$user->conf->THEME_ELDY_LINEPAIRHOVER); +$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY); +$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); +$fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); +$fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); +// No hover by default, we keep only if we set var THEME_ELDY_USE_HOVER +if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($user->conf->THEME_ELDY_USE_HOVER)) + || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && empty($conf->global->THEME_ELDY_USE_HOVER))) +{ + $colorbacklineimpairhover=''; + $colorbacklinepairhover=''; +} + +// Set text color to black or white +$tmppart=explode(',',$colorback1); +$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : ''); +$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : ''); +$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : ''); +//print $tmpval; +if ($tmpval < 340) $colortextmain='FFFFFF'; +else $colortextmain='101010'; + +$usecss3=true; +if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; +elseif ($conf->browser->name == 'iceweasel') $usecss3=false; +elseif ($conf->browser->name == 'epiphany') $usecss3=false; + +print '/*'."\n"; +print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n"; +print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n"; +print 'colorbacklineimpair1='.$colorbacklineimpair1."\n"; +print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; +print 'colorbacklineimpairhover='.$colorbacklineimpairhover."\n"; +print 'colorbacklinepair1='.$colorbacklinepair1."\n"; +print 'colorbacklinepair2='.$colorbacklinepair2."\n"; +print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'usecss3='.$usecss3."\n"; +print 'dol_hide_topmenu='.$dol_hide_topmenu."\n"; +print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n"; +print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n"; +print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n"; +print 'dol_use_jmobile='.$dol_use_jmobile."\n"; +print '*/'."\n"; + if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11; ?> diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 4727fa30a2c..f61c8e9d3d0 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -63,10 +63,10 @@ if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global- // Define image path files $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; $dol_use_jmobile=$conf->dol_use_jmobile; $img_liste_titre=dol_buildpath($path.'/theme/'.$theme.'/img/menus/trtitle.png',1); diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 49943e38a20..989d4988ec5 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -58,18 +58,18 @@ $fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; -$path=''; // This value may be used in future for external module to overwrite theme -$theme='bureau2crea'; // Value of theme -if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } +$path=''; // This value may be used in future for external module to overwrite theme +$theme='bureau2crea'; // Value of theme +if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } // Define image path files $fontlist='arial, sans-serif, verdana, helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; $dol_use_jmobile=$conf->dol_use_jmobile; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index ea3b0b9df5c..769d20dfee9 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -60,10 +60,10 @@ $fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; -$dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_hide_topmenu=$conf->dol_hide_topmenu; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; $dol_use_jmobile=$conf->dol_use_jmobile; $path=''; // This value may be used in future for external module to overwrite theme diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 2b55a6fb080..8f6c184bb56 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -58,8 +58,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on $langs->load("main",0,1); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); -$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; -$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; +$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12'; +$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11'; $path=''; // This value may be used in future for external module to overwrite theme $theme='eldy'; // Value of theme @@ -70,10 +70,10 @@ $fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Ar $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1); $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); $dol_hide_topmenu=$conf->dol_hide_topmenu; -$dol_hide_leftmenu=$conf->dol_hide_leftmenu; -$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; -$dol_no_mouse_hover=$conf->dol_no_mouse_hover; -$dol_use_jmobile=$conf->dol_use_jmobile; +$dol_hide_leftmenu=$conf->dol_hide_leftmenu; +$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen; +$dol_no_mouse_hover=$conf->dol_no_mouse_hover; +$dol_use_jmobile=$conf->dol_use_jmobile; // Define reference colors diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4639405bfd4..76d034e762c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1113,9 +1113,9 @@ class User extends CommonObject $this->note = trim($this->note); $this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning $this->admin = $this->admin?$this->admin:0; - $this->address = empty($this->address)?'':$this->address; - $this->zip = empty($this->zip)?'':$this->zip; - $this->town = empty($this->town)?'':$this->town; + $this->address = empty($this->address)?'':$this->address; + $this->zip = empty($this->zip)?'':$this->zip; + $this->town = empty($this->town)?'':$this->town; // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) @@ -1586,7 +1586,7 @@ class User extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; $sql .= " WHERE fk_user = ".$this->id; - dol_syslog(get_class($this).'::update_clicktodial sql='.$sql); + dol_syslog(get_class($this).'::update_clicktodial sql='.$sql); $result = $this->db->query($sql); $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_clicktodial"; diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 48f02ca5603..b95374d800b 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -54,7 +54,7 @@ if ($action == 'update' && ! $_POST['cancel']) $edituser->clicktodial_url = GETPOST("url"); $edituser->clicktodial_login = GETPOST("login"); $edituser->clicktodial_password = GETPOST("password"); - $edituser->clicktodial_poste = GETPOST("poste"); + $edituser->clicktodial_poste = GETPOST("poste"); $result=$edituser->update_clicktodial(); if ($result < 0) setEventMessage($edituser->error,'errors'); @@ -155,10 +155,10 @@ if ($id > 0) print ''; - print '
    '; - print '     '; - print ''; - print '
    '; + print '
    '; + print '     '; + print ''; + print '
    '; print ''; } diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index dd9350977ed..9f3f033e915 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -63,9 +63,9 @@ if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOU if (GETPOST('dol_hide_topmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1'; if (GETPOST('dol_hide_leftmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1'; -if (GETPOST('dol_optimize_smallscreen')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_optimize_smallscreen=1'; -if (GETPOST('dol_no_mouse_hover')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_hover=1'; -if (GETPOST('dol_use_jmobile')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_use_jmobile=1'; +if (GETPOST('dol_optimize_smallscreen')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_optimize_smallscreen=1'; +if (GETPOST('dol_no_mouse_hover')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_hover=1'; +if (GETPOST('dol_use_jmobile')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_use_jmobile=1'; // Destroy session $prefix=dol_getprefix(); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 568cebad27e..54a9093bd34 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -122,10 +122,10 @@ $title = $langs->trans("User"); if ($action == 'edit') { - print '
    '; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; } diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 112f38caded..d1512fea9ab 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -55,11 +55,11 @@ $conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1); $hookmanager->initHooks(array('passwordforgottenpage')); -if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1; -if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1; -if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1; -if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1; -if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1; +if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1; +if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu'])) $conf->dol_hide_topmenu=1; +if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1; +if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover'])) $conf->dol_no_mouse_hover=1; +if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile'])) $conf->dol_use_jmobile=1; /** diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 616b0609f7a..0c2b17dcb1a 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -272,8 +272,8 @@ print ''."\n"; print '
    '; if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"), 0, 1).'
    '; -// Show warning about external users -if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'

    '."\n"; +// Show warning about external users +if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'

    '."\n"; // For multicompany transversal mode if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 864bd9cb5af..3f4a8f2a662 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -47,7 +47,7 @@ function llxHeader() { } * * @return void */ -function llxFooter() { } +function llxFooter() { } require 'main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -98,12 +98,12 @@ else $type=dol_mimetype($original_file); // Suppression de la chaine de caractere ../ dans $original_file $original_file = str_replace("../","/", $original_file); -// Security check +// Security check if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); -$check_access = dol_check_secure_access_document($modulepart,$original_file,$entity); -$accessallowed = $check_access['accessallowed']; -$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; -$original_file = $check_access['original_file']; +$check_access = dol_check_secure_access_document($modulepart,$original_file,$entity); +$accessallowed = $check_access['accessallowed']; +$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; +$original_file = $check_access['original_file']; // Security: // Limit access if permissions are wrong diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 0655b0cd729..57021f5f2b2 100755 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -381,7 +381,7 @@ function getSupplierInvoicesForThirdParty($authentication,$idthirdparty) $result=$invoice->fetch($obj->facid); if ($result < 0) { - $error++; + $error++; $errorcode=$result; $errorlabel=$invoice->error; break; } From 307ae65924ae509c00ac335f23d8748886629fc4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Jun 2013 17:43:27 +0200 Subject: [PATCH 5/8] Fix: crlf to lf for avoid errors with git clone --- htdocs/includes/ckeditor/CHANGES.html | 3096 ++-- htdocs/includes/ckeditor/INSTALL.html | 184 +- htdocs/includes/ckeditor/LICENSE.html | 2654 ++-- htdocs/includes/ckeditor/adapters/jquery.js | 12 +- htdocs/includes/ckeditor/ckeditor.js | 304 +- htdocs/includes/ckeditor/ckeditor_basic.js | 16 +- .../ckeditor/ckeditor_basic_source.js | 40 +- htdocs/includes/ckeditor/ckeditor_source.js | 70 +- htdocs/includes/ckeditor/config.js | 22 +- htdocs/includes/ckeditor/lang/_languages.js | 12 +- htdocs/includes/ckeditor/lang/af.js | 12 +- htdocs/includes/ckeditor/lang/ar.js | 12 +- htdocs/includes/ckeditor/lang/bg.js | 12 +- htdocs/includes/ckeditor/lang/bn.js | 12 +- htdocs/includes/ckeditor/lang/bs.js | 12 +- htdocs/includes/ckeditor/lang/ca.js | 12 +- htdocs/includes/ckeditor/lang/cs.js | 12 +- htdocs/includes/ckeditor/lang/cy.js | 12 +- htdocs/includes/ckeditor/lang/da.js | 12 +- htdocs/includes/ckeditor/lang/de.js | 12 +- htdocs/includes/ckeditor/lang/el.js | 12 +- htdocs/includes/ckeditor/lang/en-au.js | 12 +- htdocs/includes/ckeditor/lang/en-ca.js | 12 +- htdocs/includes/ckeditor/lang/en-gb.js | 12 +- htdocs/includes/ckeditor/lang/en.js | 12 +- htdocs/includes/ckeditor/lang/eo.js | 12 +- htdocs/includes/ckeditor/lang/es.js | 12 +- htdocs/includes/ckeditor/lang/et.js | 12 +- htdocs/includes/ckeditor/lang/eu.js | 12 +- htdocs/includes/ckeditor/lang/fa.js | 12 +- htdocs/includes/ckeditor/lang/fi.js | 12 +- htdocs/includes/ckeditor/lang/fo.js | 12 +- htdocs/includes/ckeditor/lang/fr-ca.js | 12 +- htdocs/includes/ckeditor/lang/fr.js | 12 +- htdocs/includes/ckeditor/lang/gl.js | 12 +- htdocs/includes/ckeditor/lang/gu.js | 12 +- htdocs/includes/ckeditor/lang/he.js | 12 +- htdocs/includes/ckeditor/lang/hi.js | 12 +- htdocs/includes/ckeditor/lang/hr.js | 12 +- htdocs/includes/ckeditor/lang/hu.js | 12 +- htdocs/includes/ckeditor/lang/id.js | 12 +- htdocs/includes/ckeditor/lang/is.js | 12 +- htdocs/includes/ckeditor/lang/it.js | 12 +- htdocs/includes/ckeditor/lang/ja.js | 12 +- htdocs/includes/ckeditor/lang/ka.js | 12 +- htdocs/includes/ckeditor/lang/km.js | 12 +- htdocs/includes/ckeditor/lang/ko.js | 12 +- htdocs/includes/ckeditor/lang/lt.js | 12 +- htdocs/includes/ckeditor/lang/lv.js | 12 +- htdocs/includes/ckeditor/lang/mk.js | 12 +- htdocs/includes/ckeditor/lang/mn.js | 12 +- htdocs/includes/ckeditor/lang/ms.js | 12 +- htdocs/includes/ckeditor/lang/nb.js | 12 +- htdocs/includes/ckeditor/lang/nl.js | 12 +- htdocs/includes/ckeditor/lang/no.js | 12 +- htdocs/includes/ckeditor/lang/pl.js | 12 +- htdocs/includes/ckeditor/lang/pt-br.js | 12 +- htdocs/includes/ckeditor/lang/pt.js | 12 +- htdocs/includes/ckeditor/lang/ro.js | 12 +- htdocs/includes/ckeditor/lang/ru.js | 12 +- htdocs/includes/ckeditor/lang/sk.js | 12 +- htdocs/includes/ckeditor/lang/sl.js | 12 +- htdocs/includes/ckeditor/lang/sr-latn.js | 12 +- htdocs/includes/ckeditor/lang/sr.js | 12 +- htdocs/includes/ckeditor/lang/sv.js | 12 +- htdocs/includes/ckeditor/lang/th.js | 12 +- htdocs/includes/ckeditor/lang/tr.js | 12 +- htdocs/includes/ckeditor/lang/ug.js | 12 +- htdocs/includes/ckeditor/lang/uk.js | 12 +- htdocs/includes/ckeditor/lang/vi.js | 12 +- htdocs/includes/ckeditor/lang/zh-cn.js | 12 +- htdocs/includes/ckeditor/lang/zh.js | 12 +- .../plugins/a11yhelp/dialogs/a11yhelp.js | 14 +- .../ckeditor/plugins/a11yhelp/lang/cs.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/cy.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/da.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/de.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/el.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/en.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/eo.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/fa.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/fi.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/fr.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/gu.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/he.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/it.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/mk.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/nb.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/nl.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/no.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/pt-br.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/ro.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/tr.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/ug.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/vi.js | 12 +- .../ckeditor/plugins/a11yhelp/lang/zh-cn.js | 12 +- .../ckeditor/plugins/about/dialogs/about.js | 12 +- .../ckeditor/plugins/adobeair/plugin.js | 12 +- .../includes/ckeditor/plugins/ajax/plugin.js | 12 +- .../ckeditor/plugins/autogrow/plugin.js | 12 +- .../ckeditor/plugins/bbcode/plugin.js | 18 +- .../plugins/clipboard/dialogs/paste.js | 14 +- .../colordialog/dialogs/colordialog.js | 14 +- .../ckeditor/plugins/devtools/lang/bg.js | 12 +- .../ckeditor/plugins/devtools/lang/cs.js | 12 +- .../ckeditor/plugins/devtools/lang/cy.js | 12 +- .../ckeditor/plugins/devtools/lang/da.js | 12 +- .../ckeditor/plugins/devtools/lang/de.js | 12 +- .../ckeditor/plugins/devtools/lang/el.js | 12 +- .../ckeditor/plugins/devtools/lang/en.js | 12 +- .../ckeditor/plugins/devtools/lang/eo.js | 12 +- .../ckeditor/plugins/devtools/lang/et.js | 12 +- .../ckeditor/plugins/devtools/lang/fa.js | 12 +- .../ckeditor/plugins/devtools/lang/fi.js | 12 +- .../ckeditor/plugins/devtools/lang/fr.js | 12 +- .../ckeditor/plugins/devtools/lang/gu.js | 12 +- .../ckeditor/plugins/devtools/lang/he.js | 12 +- .../ckeditor/plugins/devtools/lang/hr.js | 12 +- .../ckeditor/plugins/devtools/lang/it.js | 12 +- .../ckeditor/plugins/devtools/lang/nb.js | 12 +- .../ckeditor/plugins/devtools/lang/nl.js | 12 +- .../ckeditor/plugins/devtools/lang/no.js | 12 +- .../ckeditor/plugins/devtools/lang/pl.js | 12 +- .../ckeditor/plugins/devtools/lang/pt-br.js | 12 +- .../ckeditor/plugins/devtools/lang/tr.js | 12 +- .../ckeditor/plugins/devtools/lang/ug.js | 12 +- .../ckeditor/plugins/devtools/lang/uk.js | 12 +- .../ckeditor/plugins/devtools/lang/vi.js | 12 +- .../ckeditor/plugins/devtools/lang/zh-cn.js | 12 +- .../ckeditor/plugins/devtools/plugin.js | 12 +- .../plugins/dialog/dialogDefinition.js | 8 +- .../ckeditor/plugins/div/dialogs/div.js | 16 +- .../plugins/docprops/dialogs/docprops.js | 20 +- .../ckeditor/plugins/docprops/plugin.js | 12 +- .../ckeditor/plugins/find/dialogs/find.js | 20 +- .../ckeditor/plugins/flash/dialogs/flash.js | 18 +- .../ckeditor/plugins/forms/dialogs/button.js | 12 +- .../plugins/forms/dialogs/checkbox.js | 12 +- .../ckeditor/plugins/forms/dialogs/form.js | 12 +- .../plugins/forms/dialogs/hiddenfield.js | 12 +- .../ckeditor/plugins/forms/dialogs/radio.js | 12 +- .../ckeditor/plugins/forms/dialogs/select.js | 18 +- .../plugins/forms/dialogs/textarea.js | 12 +- .../plugins/forms/dialogs/textfield.js | 12 +- .../ckeditor/plugins/iframe/dialogs/iframe.js | 14 +- .../ckeditor/plugins/iframedialog/plugin.js | 12 +- .../ckeditor/plugins/image/dialogs/image.js | 26 +- .../ckeditor/plugins/link/dialogs/anchor.js | 12 +- .../ckeditor/plugins/link/dialogs/link.js | 24 +- .../plugins/liststyle/dialogs/liststyle.js | 14 +- .../plugins/pastefromword/filter/default.js | 22 +- .../plugins/pastetext/dialogs/pastetext.js | 12 +- .../placeholder/dialogs/placeholder.js | 12 +- .../ckeditor/plugins/placeholder/lang/bg.js | 12 +- .../ckeditor/plugins/placeholder/lang/cs.js | 12 +- .../ckeditor/plugins/placeholder/lang/cy.js | 12 +- .../ckeditor/plugins/placeholder/lang/da.js | 12 +- .../ckeditor/plugins/placeholder/lang/de.js | 12 +- .../ckeditor/plugins/placeholder/lang/el.js | 12 +- .../ckeditor/plugins/placeholder/lang/en.js | 12 +- .../ckeditor/plugins/placeholder/lang/eo.js | 12 +- .../ckeditor/plugins/placeholder/lang/et.js | 12 +- .../ckeditor/plugins/placeholder/lang/fa.js | 12 +- .../ckeditor/plugins/placeholder/lang/fi.js | 12 +- .../ckeditor/plugins/placeholder/lang/fr.js | 12 +- .../ckeditor/plugins/placeholder/lang/he.js | 12 +- .../ckeditor/plugins/placeholder/lang/hr.js | 12 +- .../ckeditor/plugins/placeholder/lang/it.js | 12 +- .../ckeditor/plugins/placeholder/lang/nb.js | 12 +- .../ckeditor/plugins/placeholder/lang/nl.js | 12 +- .../ckeditor/plugins/placeholder/lang/no.js | 12 +- .../ckeditor/plugins/placeholder/lang/pl.js | 12 +- .../plugins/placeholder/lang/pt-br.js | 12 +- .../ckeditor/plugins/placeholder/lang/tr.js | 12 +- .../ckeditor/plugins/placeholder/lang/ug.js | 12 +- .../ckeditor/plugins/placeholder/lang/uk.js | 12 +- .../ckeditor/plugins/placeholder/lang/vi.js | 12 +- .../plugins/placeholder/lang/zh-cn.js | 12 +- .../ckeditor/plugins/placeholder/plugin.js | 12 +- .../ckeditor/plugins/preview/preview.html | 20 +- .../ckeditor/plugins/scayt/dialogs/options.js | 16 +- .../ckeditor/plugins/smiley/dialogs/smiley.js | 14 +- .../specialchar/dialogs/specialchar.js | 14 +- .../ckeditor/plugins/specialchar/lang/cs.js | 12 +- .../ckeditor/plugins/specialchar/lang/cy.js | 12 +- .../ckeditor/plugins/specialchar/lang/de.js | 12 +- .../ckeditor/plugins/specialchar/lang/el.js | 12 +- .../ckeditor/plugins/specialchar/lang/en.js | 12 +- .../ckeditor/plugins/specialchar/lang/eo.js | 12 +- .../ckeditor/plugins/specialchar/lang/et.js | 12 +- .../ckeditor/plugins/specialchar/lang/fa.js | 12 +- .../ckeditor/plugins/specialchar/lang/fi.js | 12 +- .../ckeditor/plugins/specialchar/lang/fr.js | 12 +- .../ckeditor/plugins/specialchar/lang/he.js | 12 +- .../ckeditor/plugins/specialchar/lang/hr.js | 12 +- .../ckeditor/plugins/specialchar/lang/it.js | 12 +- .../ckeditor/plugins/specialchar/lang/nb.js | 12 +- .../ckeditor/plugins/specialchar/lang/nl.js | 12 +- .../ckeditor/plugins/specialchar/lang/no.js | 12 +- .../plugins/specialchar/lang/pt-br.js | 12 +- .../ckeditor/plugins/specialchar/lang/tr.js | 12 +- .../ckeditor/plugins/specialchar/lang/ug.js | 12 +- .../plugins/specialchar/lang/zh-cn.js | 12 +- .../ckeditor/plugins/styles/styles/default.js | 12 +- .../plugins/stylesheetparser/plugin.js | 12 +- .../ckeditor/plugins/table/dialogs/table.js | 18 +- .../ckeditor/plugins/tableresize/plugin.js | 14 +- .../plugins/tabletools/dialogs/tableCell.js | 16 +- .../plugins/templates/dialogs/templates.js | 14 +- .../plugins/templates/templates/default.js | 12 +- .../plugins/uicolor/dialogs/uicolor.js | 14 +- .../ckeditor/plugins/uicolor/lang/bg.js | 12 +- .../ckeditor/plugins/uicolor/lang/cs.js | 12 +- .../ckeditor/plugins/uicolor/lang/cy.js | 12 +- .../ckeditor/plugins/uicolor/lang/da.js | 12 +- .../ckeditor/plugins/uicolor/lang/de.js | 12 +- .../ckeditor/plugins/uicolor/lang/el.js | 12 +- .../ckeditor/plugins/uicolor/lang/en.js | 12 +- .../ckeditor/plugins/uicolor/lang/eo.js | 12 +- .../ckeditor/plugins/uicolor/lang/et.js | 12 +- .../ckeditor/plugins/uicolor/lang/fa.js | 12 +- .../ckeditor/plugins/uicolor/lang/fi.js | 12 +- .../ckeditor/plugins/uicolor/lang/fr.js | 12 +- .../ckeditor/plugins/uicolor/lang/he.js | 12 +- .../ckeditor/plugins/uicolor/lang/hr.js | 12 +- .../ckeditor/plugins/uicolor/lang/it.js | 12 +- .../ckeditor/plugins/uicolor/lang/mk.js | 12 +- .../ckeditor/plugins/uicolor/lang/nb.js | 12 +- .../ckeditor/plugins/uicolor/lang/nl.js | 12 +- .../ckeditor/plugins/uicolor/lang/no.js | 12 +- .../ckeditor/plugins/uicolor/lang/pl.js | 12 +- .../ckeditor/plugins/uicolor/lang/pt-br.js | 12 +- .../ckeditor/plugins/uicolor/lang/tr.js | 12 +- .../ckeditor/plugins/uicolor/lang/ug.js | 12 +- .../ckeditor/plugins/uicolor/lang/uk.js | 12 +- .../ckeditor/plugins/uicolor/lang/vi.js | 12 +- .../ckeditor/plugins/uicolor/lang/zh-cn.js | 12 +- .../ckeditor/plugins/uicolor/plugin.js | 12 +- .../ckeditor/plugins/uicolor/yui/yui.js | 152 +- .../ckeditor/plugins/wsc/dialogs/ciframe.html | 98 +- .../plugins/wsc/dialogs/tmpFrameset.html | 104 +- .../ckeditor/plugins/wsc/dialogs/wsc.js | 14 +- .../includes/ckeditor/plugins/xml/plugin.js | 12 +- htdocs/includes/ckeditor/skins/kama/skin.js | 14 +- .../ckeditor/skins/office2003/skin.js | 12 +- htdocs/includes/ckeditor/skins/v2/skin.js | 12 +- .../includes/ckeditor/themes/default/theme.js | 16 +- .../includes/jquery/js/jquery-latest.min.js | 2 +- .../jquery/plugins/jpicker/Example.html | 1074 +- .../jquerytreeview/jquery.treeview.async.js | 216 +- .../jquery.treeview.sortable.js | 756 +- .../plugins/layout/jquery.layout-latest.js | 11836 ++++++++-------- 252 files changed, 11788 insertions(+), 11788 deletions(-) diff --git a/htdocs/includes/ckeditor/CHANGES.html b/htdocs/includes/ckeditor/CHANGES.html index 62da0a31865..6fa02bbfd44 100644 --- a/htdocs/includes/ckeditor/CHANGES.html +++ b/htdocs/includes/ckeditor/CHANGES.html @@ -1,1548 +1,1548 @@ - - - - - Changelog — CKEditor - - - - -

    - CKEditor Changelog -

    -

    - CKEditor 3.6.4

    -

    - Fixed issues:

    -
      -
    • #8887 : Ugly hover effect for buttons in dialog windows due to slightly wrong background position.
    • -
    • #8783 : getAttribute( 'contenteditable' ) returns 'inherited' on IE7 and IE6 for elements created from code.
    • -
    • #8463 : WebKit: Cut/Copy buttons didn't go on "enabled" state after selecting text in the editor.
    • -
    • #9043 : Command newpage didn't return its name when afterCommandExec event was fired.
    • -
    • #9015 : Applied ARIA label on dialog file input element.
    • -
    • #9016 : Applied the "presentation" role on the iframe element in dialog file field markup.
    • -
    • #8949 : Image Properties does not show in context menu when the image is wrapped in a div with the width set.
    • -
    • #9008 : Fixed list items order reversed when merging two lists.
    • -
    • #9042 : [Safari] Fixed pasting left garbage html at the end of document.
    • -
    • #7745 : The list of frames on JAWS will not any more show the "ALT+0 for help" text for the editor entry.
    • -
    • #8979 : Overriding matches will not any more interfere on the Font size combo.
    • -
    • #5447 : Anchor names created by the Link dialog are now trimmed to protect against unwanted spaces.
    • -
    • #8997 : Styles are lost on sub-lists when converting list type.
    • -
    • #8971 : [IE7] Dialog size are stretched when long text field value is received.
    • -
    • #8945 : Fake elements now show alternative text on High Contrast mode.
    • -
    • #8985 : Better handling of Enter key events on dialogs.
    • -
    • #8925 : [Firefox] Unexpected page scroll on large floating block when editor is re-focused.
    • -
    • #8978 : [IE] Saved editor text selection is lost after close menu.
    • -
    • #9022 : [IE7] Fixed wrong selection introduced in empty editor document when click to the bottom-right of the document.
    • -
    • #9034 : [IE7] Fixed JavaScript error caused by drag-to-select at the bottom of the document.
    • -
    • #9057 : Unexpected block established when decreasing indent of a styled list item.
    • -
    • #9063 : Styles on sub-list are lost when decreasing indent of the parent list.
    • -
    • #9047 : [Firefox] Anchors in the preview window will now work properly.
    • -
    • #8941 : [Webkit] Content region disappeared when resizing the browser.
    • -
    • #8968 : [Firefox] The forcePasteAsPlainText configuration is not working when using Ctrl/Cmd-V.
    • -
    • #6217 : Handled Del/Backspace key at the boundary of table to unify the cursor position.
    • -
    • #8950 : Changed the cursor position after calling editor::insertElement on block element.
    • -
    • #9080 : Fixed Backspace key in front of the list item to join with previous line.
    • -
    • #3592 : Removed the "title" field from flash dialog advanced tab.
    • -
    • #9084 : [IE] Dragging absolute positioned elements is now enabled by default.
    • -
    • #8879 : Corrected styling of labels used in dialog windows.
    • -
    • #8921 : [Chrome] Paste on a newly created CKEditor instance does not work on Chrome.
    • -
    • #9036 : Find feature cannot locate certain words while Match Whole Word is enabled.
    • -
    • #9069 : [Chrome] Issue with popups not opening properly on Chrome 20 makes it impossible to view the file browser window.
    • -
    • #5811 : Code for Image dialog is missing dialog dependency.
    • -
    • #5810 : Code for Div Container is missing dialog dependency.
    • -
    • #5809 : Dialog a11yhelp is missing dialog dependency.
    • -
    • #4045 : "Field Name" Column in sample_posteddata.php is to narrow.
    • -
    • Updated the following language files as submitted to the CKEditor UI Translation Center: Bulgarian, Chinese, Czech, Danish, Esperanto, Estonian, Greek, Italian, Norwegian, Portuguese, Romanian, Vietnamese.
    • -
    -

    - CKEditor 3.6.3

    -

    - New features:

    -
      -
    • #7430 : Justify commands now perform alignment on the element when an image is selected.
    • -
    • #8706 : Better ARIA accessibility for the color picker dialog window.
    • -
    • #7366 : Editor paste function is now available on browser toolbar and context menu.
    • -
    -

    - Fixed issues:

    -
      -
    • #8634 : [IE] Command execution always returns true in IE browsers.
    • -
    • #8333 : Dialog windows can now be closed with the Esc key even if there is no Cancel button available.
    • -
    • #8644 : Missing variable declaration in the dialog plugin.
    • -
    • #8699 : Focus is now moved to the clicked button and back to color picker dialog window opener (button) in all browsers after the dialog window is closed.
    • -
    • #8132 : [IE9] Link line gets broken when it contains a br tag.
    • -
    • #8629 : Optimize float panel layout when there is not enough space in the viewport.
    • -
    • #7955 : [FF] Page Up and Page Down in the WYSIWYG mode cause the selection to become lost.
    • -
    • #8698 : Esc key does not close the color picker dialog window.
    • -
    • #8413 : HTML comment nodes break content styling in tables.
    • -
    • #7932, #8643 : [IE] Clicking below the content region scrolls the page to the top.
    • -
    • #5538, #8729 : [IE] Focus jump results in incorrect context menu display.
    • -
    • #6359 : [IE] Selectable area in blank WYSIWYG editor is too small.
    • -
    • #7326, #8074 : [FF] Scrolling does not work correctly in editor with large amount of text.
    • -
    • #8630 : HTML events are now disabled when loading data.
    • -
    • #8433 : [IE9] Use W3C event model.
    • -
    • #8691 : [IE] Pasting invalid HTML crashes the browser.
    • -
    • #8345 : [IE] Selection is not properly restored after closing the Link dialog window.
    • -
    • #6308 : Vertical-only resize imposes fixed width on editor chrome.
    • -
    • #7360 : [WebKit] WYSIWYG area sometimes does not resize with the chrome.
    • -
    • #5527 : Do not encode the # character sent from the file browser.
    • -
    • #8014 : Autogrow now stretches to fit the content when switching editor modes.
    • -
    • #8249 : Inconsistent behavior with the Backspace key used at the start of a list item.
    • -
    • #8617 : [WebKit] Selection becomes broken after an inline style is opened.
    • -
    • #8527 : Insertion with cursor before an empty anchor is error-prone.
    • -
    • #8632 : Cursor panic when the Backspace key is used in a list item.
    • -
    • #8455 : Mousedown focus is too agressive.
    • -
    • #8475 : Issue with deleting elements with inline styling in tables.
    • -
    • #8324 : [IE8] Undo generates an error when a control type element is selected.
    • -
    • #7946 : Find and Replace dialog window result does not scroll into view when the editor is off the viewport.
    • -
    • #8157 : Flash/IFrame dialog window cannot be closed when displayed over Flash/IFrame with dialog_startupFocusTab set to true.
    • -
    • #8305 : Text direction lost when converting a paragraph to a list.
    • -
    • #8379 : The cursor moves to the start of the document when inserting a row or column is undone.
    • -
    • #6666 : Removed references to element.all.
    • -
    • #8732 : Issue when CKEDITOR.range::enlarge passes through comment nodes.
    • -
    • #7492 : The Style system can now use overrides with the same element (change classes instead of nesting).
    • -
    • #6111 : Splitting table cells results in incorrect column spans.
    • -
    • #8247 : [IE] Error when aligning a document with page breaks inside of contents.
    • -
    • #8540 : Orphan texts inside a list or table are now properly fixed.
    • -
    • #8774 : The Entities plugin can now be configured to only output XML entities.
    • -
    • #8602 : Image source is now properly hidden when running data through the data processor.
    • -
    • #8812 : [IE] Issues with the native range translation with comments in the DOM.
    • -
    • #7907 : Decreasing indentation of a RTL block in a list item loses text direction.
    • -
    • #8835 : Right margin on IE<8 removed to avoid mouse click confusion.
    • -
    • #8400 : [IE] Script error when closing the Cell Properties dialog window if the table cell text is selected.
    • -
    • #8248 : [IE8] Issues with Backspace and Del keys when used at the start or end of list items.
    • -
    • #8855 : [Chrome] Issue with the popup window size in Chrome 18 makes it impossible to view the file browser window.
    • -
    • #8407 : Unneeded aria-posinset and aria-setsize for a list block are now removed.
    • -
    • #8701 : Highlight field in the color picker does not show the correct color when keyboard navigation is used.
    • -
    • #8509 : Table height gets copied from the width value when the Advanced tab is hidden.
    • -
    • #8432 : [IE8] openDialog('image') error.
    • -
    • #8493 : [IE] It is impossible to add a link to the selected text.
    • -
    • #8528 : Redundant imagePreviewBoxId in the Image Properties dialog window is now removed.
    • -
    • #8864 : [IE] Fix ARIA presentation of toolbar rich combo in JAWS.
    • -
    • #8459 : Fix wrong undo step on enter key.
    • -
    • #8895 : Editing anchors using the Link dialog window could not work in release version.
    • -
    • #8876 : <link> element in the floating panels have been moved to <head>.
    • -
    • Updated the following language files as submitted to the CKEditor UI Translation Center: Arabic, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, Esperanto, Estonian, Faroese, French, German, Greek, Gujarati, Hindi, Italian, Macedonian, Norwegian (Bokmål and Nynorsk), Polish, Portuguese, Turkish, Uighur, Ukrainian, Vietnamese, Welsh.
    • -
    -

    - CKEditor 3.6.2

    -

    - New features:

    -
      -
    • #6089 : The editor is now enabled on iOS 5 (iPad and iPhone).
    • -
    • #7354 : It is now possible to exit from blockquotes by using the Enter key on empty paragraphs.
    • -
    • #7931 : The mode event now carries the previous editor mode.
    • -
    • #6161 : New autoGrow_onStartup configuration option.
    • -
    • #8052 : autogrow is now available as an editor command.
    • -
    • #3457 : It is now possible to edit the contents of <textarea> elements through the dialog window.
    • -
    • #8242 : The "»" character is now added to the Special Character dialog window.
    • -
    -

    - Fixed issues:

    -
      -
    • #8171, #8172 : Updated links to WebSpellChecker.net.
    • -
    • #8155 : Tooltips in the Special Character dialog window corrected.
    • -
    • #8163 : The name of the filebrowserWindowFeatures configuration setting corrected to match the documented name.
    • -
    • #8124 : The Style fields in Advanced dialog window tabs are now validated according to CSS style attribute syntax.
    • -
    • #8025 : The checkboxes in the Find and Replace dialog window are now part of a fieldset.
    • -
    • #7943 : CSS conflict no longer appears when the page styles set the float property of label elements.
    • -
    • #8016 : [WebKit] Flash content is not visible when previewing content.
    • -
    • #6908 : Text color should always be applied to the linked text.
    • -
    • #7619 : [IE] IFrame shim now consolidates the editor dialog window to avoid having it masked by embedded objects.
    • -
    • #7900 : [FF] Copy/Paste operations for table cells no longer break the Table Properties dialog window.
    • -
    • #7243 : Inline JavaScript events may become corrupted.
    • -
    • #7448 : List creation in RTL blocks is wrongly merged with the above LTR block.
    • -
    • #6957 : Highlighting of searched terms does not reach read-only blocks.
    • -
    • #7948 : Tooltips with information about correct length units are now displayed for the Width/Height fields of the Table Properties dialog window.
    • -
    • #6212 : [WebKit] Editor resize may scroll the host page.
    • -
    • #6540 : [Safari] Editor loses focus on resizing.
    • -
    • #7908 : [IE] Unlink command is sometimes missing from the context menu of a link.
    • -
    • #8159 : Editor fails to load if the browser has no default language set.
    • -
    • #7490 : [IE] Block format leaks to the next unselected line when enterMode is set to BR.
    • -
    • #8087 : Indenting list items may add redundant text direction attributes.
    • -
    • #6200 : Add styling for certain dialog window element types that miss focus outline (like checkbox).
    • -
    • #7894 : Fault tolerance when parsing a malformed link.
    • -
    • #8049 : Bullets/Numbers are invisible for list items with LTR text direction.
    • -
    • #8222 : [IE] Incorrect selection locking after opening a dialog window in some cases.
    • -
    • #7002 : [IE] Undo operation when a table is selected results in an error.
    • -
    • #8232 : [IE] Unable to apply inline style that starts at the end of a link text.
    • -
    • #7153 : Fail to load the source version of the editor after the window is loaded.
    • -
    • #8246 : Bad editing performance on certain document contents.
    • -
    • #7912 : Cursor trapped in an invisible element after pressing the Enter key.
    • -
    • #7645 : Full list or table deletion with the Backspace/Delete key.
    • -
    • #8050 : AutoGrow feature better fits the content styles.
    • -
    • #8349 : [IE9] Larger toolbar top offset on HTML5 pages.
    • -
    • #8352 : [IE9] Toolbar wrapping is incorrect.
    • -
    • #8080 : JavaScript error when inserting a new table row.
    • -
    • Updated the following language files:
        -
      • #8263 : Dutch;
      • -
      • #8238 : Estonian;
      • -
      • #8193 : Finnish;
      • -
      • German;
      • -
      • Hebrew;
      • -
      • #8179 : Hungarian;
      • -
      • #8128 : Italian;
      • -
      • #8371 : Lithuanian;
      • -
      • #8126, #8256 : Norwegian (Bokmal and Nynorsk);
      • -
      • #8356 : Persian;
      • -
      • Polish;
      • -
      • Portuguese (Brazil);
      • -
      • #8151, #8298 : Russian;
      • -
      • Spanish;
      • -
    • -
    -

    - CKEditor 3.6.1

    -

    - New features:

    -
      -
    • #4556 : Initial support for HTML5 elements.
    • -
    • #6492 : The Find/Replace dialog window will now be populated with text selected in the editor.
    • -
    • #7323 : New align property in dialog window UI elements for field alignment.
    • -
    • #6462 : A wider range of CSS length units (like pt and percentage) are now supported in related dialog window fields.
    • -
    • #7911 : New Remove Anchor option is now available in the context menu.
    • -
    • #7387 : Allow styleDefinition to be applied to a set of elements.
    • -
    • #4345 : A new langLoaded event added to CKEDITOR.editor in order to make it possible to perform "by code" language updates.
    • -
    • #7959 : The cursor will now blink in the first cell after a table is inserted.
    • -
    • #7885 : New editor::removeMenuItem API for removing plugin context menu items introduced.
    • -
    • #7991 : Introduce the controlStyle and inputStyle definitions to allow fine-grained controlling of dialog window element styles.
    • -
    -

    - Fixed issues:

    -
      -
    • #7914 : ATTENTION! The signature for the setReadOnly() function has been changed, reversing the meaning of the parameter to be passed to it. Please make sure to update your code when upgrading.
    • -
    • #7657 : Wrong margin mirroring when creating a list from RTL paragraphs.
    • -
    • #7620 : A glitch in list pasting from Microsoft Word caused by broken child references when filtering.
    • -
    • #7811 : [IE] Deleting table row throws a JavaScript error.
    • -
    • #6962 : Changed the CKEDITOR.CTRL, CKEDITOR.SHIFT and CKEDITOR.ALT constant values to avoid collision with any possible Unicode character.
    • -
    • #6263 : Some table cell context menu options may be incorrectly disabled.
    • -
    • #6247 : Focus is not restored properly after a drop-down menu is closed.
    • -
    • #7334 : [IE7] Indentation style does not apply to RTL lists.
    • -
    • #6845 : Spaces inside the URL field in the Link dialog window will now be removed.
    • -
    • #7840 : [IE] Opening the Table Properties dialog window via the context menu causes a JavaScript error.
    • -
    • #7733 : Flash movies inserted with the Flash Properties dialog window are not displaying properly when injected into the page.
    • -
    • #7837 : [IE<8] Inserting a page break results in an error.
    • -
    • #7804 : The HTML5 wbr tag is now recognized by the editor.
    • -
    • #7867 : The file browser for the background image in the Document Properties plugin dialog window does not work.
    • -
    • #7130 : The column resizer gripping area is invading adjacent table cells.
    • -
    • #7844 : [FF] Calling setData() on a hidden editor caused editor not to display.
    • -
    • #7860 : The BBCode plugin was stripping BBCode tags that were not implemented in the plugin, but from now on they will be handled as simple text.
    • -
    • #7321 : [IE6] Contents inside the RTL fields in dialog windows are overflowing.
    • -
    • #7323 : [IE Quirks] Some fields are not centered in the dialog window.
    • -
    • #5955 : Editor accessibility issue with JAWS when a drop-down menu is placed as the first item in the toolbar.
    • -
    • #6671 : [FF] Selection of an item from the Styles drop-down list is not refreshed after the style is removed.
    • -
    • #7879 : The Style and Height/Width fields of the Table Properties dialog window are not synchronized.
    • -
    • #7581 : [IE] The Enter key pressed at the end of a list item containing the start attribute crashes the browser.
    • -
    • #7266 : Dialog window fields that did not pass validation are now ARIA-compatible with aria-invalid.
    • -
    • #7742 : [WebKit] Indentation, alignment, and language direction are not applied on an empty document without the editor being in focus.
    • -
    • #7801 : [Opera] Pasted paragraphs now split partially selected blocks.
    • -
    • #6663 : Table caption that contains rich text is corrupted after an edit done with the Table Properties dialog window.
    • -
    • #7893 : [WebKit, Opera, IE<8] It is impossible to link to anchors in the document.
    • -
    • #7637 : Cursor position might in some cases cause problems after inserting a page break.
    • -
    • #5314 : The aria-selected attribute is not removed when toolbar drop-down menu items are deselected.
    • -
    • #7749 : Small check introduced to avoid issues with custom data processors and the insertHtml function.
    • -
    • #7269 : [WebKit] Paste from Word is including the full file:// URL path for anchor links.
    • -
    • #7584 : Start number of the List dialog window now works with numbered list items.
    • -
    • #6975 : [IE6, IE7] A definition list crashes Internet Explorer on HTML output.
    • -
    • #7841 : Deleting a column with a cell deleted in one of the rows does not work.
    • -
    • #7944 : The Enter key should not split or create new paragraphs inside caption elements.
    • -
    • #7639 : [IE9] Browser might crash when an object is selected in the document.
    • -
    • #7847 : [IE8] Inserting an image with non-secure source in a HTTPS page breaks the dialog window.
    • -
    • #7953 : [IE] Text selection lost after the browser context menu is opened.
    • -
    • #5239 : Inconsistent focus behavior after closing a toolbar drop-down menu.
    • -
    • #6470 : The Start attribute of a Numbered List is rendered incorrectly if the field is left empty.
    • -
    • #7324 : [IE6 Quirks] Context menus are not displayed correctly.
    • -
    • #7566 : BiDi: Increasing indentation of a list item changes the language direction.
    • -
    • #7839 : [IE] Pasting multi-level numbered lists from Microsoft Word does not work properly.
    • -
    • #188 : [IE] Object selection was making the toolbar inactive in some situations.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.6

    -

    - New features:

    -
      -
    • #7044 : New BBCode sample plugin that makes the editor output (one dialect of) BBCode format.
    • -
    • #5647 : Accessibility enhancements to the structure of the toolbar.
    • -
    • #5647 : The Kama skin now presents separators for the toolbar items, making it easier to group buttons and have a cleaner layout.
    • -
    • #5647 : Usability enhancements to keyboard navigation on the toolbar. The Tab key is now used to jump between toolbar groups, while the Arrow keys can be used to cycle within the group. The new toolbarGroupCycling setting can be used to change the Arrow keys behavior.
    • -
    • #1376 : It is now possible to put the editor in the "read-only" state, so that the users would not be able to introduce changes to the contents. Check out the new CKEDITOR.editor::setReadOnly method, the CKEDITOR.editor::readOnly property, the CKEDITOR.editor::readOnly event, and the readOnly setting.
    • -
    • #3582 : New presentation of anchor elements in the WYSIWYG mode.
    • -
    • #6737 : The Format drop-down list will now display the preview of its contents exactly as defined in their style configurations.
    • -
    • #6654 : A new autoParagraph configuration setting is added to disable the auto paragraphing feature.
    • -
    • #901 : New Stylesheet Parser (stylesheetparser) plugin that fills the Styles drop-down list based on the CSS classes available for the content. Check the new sample to learn how to use it.
    • -
    • #2988 : New Document Properties (docprops) plugin that sets the metadata of the page in the Full Page mode.
    • -
    • #7240 : New Developer Tools (devtools) plugin that shows information about dialog window UI elements to allow for easier customization.
    • -
    • #6841 : Pressing the Enter key at the end of a pre-formatted block will now exit from it.
    • -
    • #6850 : The About CKEditor dialog window now contains a link to CKEditor User's Guide.
    • -
    • #5745 : Extra configuration options for the iframeDialog can now be passed.
    • -
    • #6589 : The onDialogEvent function will now be used automatically in the iframeDialog contents if no callback is used on creation.
    • -
    • #7757 : Georgian localization added.
    • -
    -

    - Fixed issues:

    -
      -
    • #6774 : Internal styles are not included in the contents.css sample.
    • -
    • #6521 : Added sample for the TableResize plugin.
    • -
    • #6664 : Page break is sometimes merged into block-level elements.
    • -
    • #7594 : Toolbar keyboard navigation is not possible after recreating the editor.
    • -
    • #6657 : Allow to style the entire dialog window field when the input element is disabled.
    • -
    • Updated the following language files:
        -
      • Hebrew;
      • -
      • Polish;
      • -
    • -
    -

    - CKEditor 3.5.4

    -

    - Fixed issues:

    -
      -
    • Added protection against XSS attacks in PHP samples when displaying element names.
    • -
    • #7347 : The Enter key will no longer be caught by the dialog window covering the editor.
    • -
    • #6718 : Paste from Word command overrides the Force Paste as Plain Text configuration.
    • -
    • #6629 : Padding body is no longer needed when the last block is pre-formatted.
    • -
    • #4844 : [IE] Dialog windows fail to load if there are too many editor instances on the page.
    • -
    • #5788 : HTML parser trims empty spaces following <br> elements.
    • -
    • #7513 : Invalid markup could cause the editor to hang.
    • -
    • #6109 : Paste and Paste as Plain Text dialog windows now use the standard commitContent and setupContent methods.
    • -
    • #7588 : The editor code now has a protection system to avoid issues when including ckeditor.js more than once in the page.
    • -
    • #7322 : Text font plugin now recognizes font family names that contain quotes.
    • -
    • #7540 : Paste from Word introduces wrong spaces.
    • -
    • #7697 : Successive calls of the replace() method did not work after SCAYT context menu initialization.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.5.3

    -

    - New features:

    -
      -
    • #4890 : Added the possibility to edit the rel attribute for links.
    • -
    • #7004 : Allow loading plugin translations even if they are not present in the plugin definition.
    • -
    • #7315 : Firing the resize event on dialog window instances is now possible.
    • -
    • #7259 : Dialog window definition allows to specify initial width and height values.
    • -
    • #7131 : List item numbering is now supported on pasting from Microsoft Word.
    • -
    -

    - Fixed issues:

    -
      -
    • #1272 : [WebKit] It is now possible to apply styles to collapsed selections in Safari and Chrome.
    • -
    • #7054 : The tooltips for special characters are now lowercased, making them more readable.
    • -
    • #7102 : "Replace DIV" sample did not work when double-clicking inside the formatted text.
    • -
    • #7088 : Loading of plugins failed on new instances of the editor after the Insert Special Character dialog window was used.
    • -
    • #6215 : Removal of inline styles now also removes overrides.
    • -
    • #6144 : Rich text drop-down lists have wrong height when toolbar is wrapped.
    • -
    • #6387 : AutoGrow may cause an error when editor instance is destroyed too quickly after a height change.
    • -
    • #6901 : Mixed direction content was not properly respected in a shared toolbar setting.
    • -
    • #4809 : Table-related tags are output in wrong order.
    • -
    • #7092 : Corrupted toolbar button state for inline style after switching to Source.
    • -
    • #6921 : Pasted text marked by SCAYT in one language is not re-checked if another spellchecking language is selected in the editor.
    • -
    • #6614 : Enhancement of the resize handle in RTL.
    • -
    • #5924 : Flash plugin now recognizes Flash content without an embed tag.
    • -
    • #4475 : Protected source in attributes and inline CSS text is not handled correctly.
    • -
    • #6984 : [FF] Trailing line breaks are lost in ENTER_BR.
    • -
    • #6987 : [IE] Text selection lost when calling editor::insertHtml from a dialog window in some situations.
    • -
    • #6865 : BiDi mirroring does not work when a text direction change is done through a dialog window.
    • -
    • #6966 : [IE] Unintended paragraph is created in an empty document in enterMode set for BR and DIV.
    • -
    • #7084 : SCAYT dialog window is now working properly with more than one editor instance in a page.
    • -
    • #6662 : [FF] List structure pasting error caused by a regression from FF3.5.x is now fixed.
    • -
    • #7300 : Link dialog window now loads numeric values correctly.
    • -
    • #7330 : New list items no longer inherit the value attribute from their sibling.
    • -
    • #7293 : The "Automatic" color button is now presented correctly without focus inside the editor.
    • -
    • #7018 : [IE] Toolbar drop-down lists did not have a border around them.
    • -
    • #7073 : Image dialog window no longer allows zero height and width value to be entered.
    • -
    • #7316 : [FF] Clicking on "Paste" button incorrectly breaks the line at the cursor position.
    • -
    • #6751 : Inline whitespaces are incorrectly stripped when pasting from Word.
    • -
    • #6236 : [IE] Fixing malformed nested list structure which was introduced by the Backspace key.
    • -
    • #6649 : [IE] Selection of the full table sometimes does not work.
    • -
    • #6946 : HTML parser is now able to fix orphan list items.
    • -
    • #6861 : Indenting a list item should retain the text direction.
    • -
    • #6938 : Outdenting a list item should retain the text direction.
    • -
    • #6849 : Correct Enter key behavior on list item.
    • -
    • #7113 : [WebKit] Undesired document scroll on click after scrolling.
    • -
    • #6491 : Undesired Image dialog window dimension lock reset on URL change.
    • -
    • #7284 : [FF Quirks] Maximize now works correctly.
    • -
    • #6609 : [IE9] Browser in high contrast mode is not properly detected.
    • -
    • #7222 : [WebKit] Impossible to apply a single style to a collapsed selection without giving the editor focus.
    • -
    • #7180 : [IE9] When using Kama skin and RTL layout dialog window buttons were not being displayed correctly.
    • -
    • #7182 : [IE9] When using Office2003/v2 skin and RTL layout dialog window shadows were corrupted.
    • -
    • #6913 : Invalid escape sequence (\b) was used in the PHP integration.
    • -
    • #5757 : [IE6] Text was not wrapping in the accessibility instructions dialog window.
    • -
    • [6604] : Xml.js and Ajax.js are now available as plugins ('xml' and 'ajax').
    • -
    • #7304 : Microsoft Word cleanup function is not always invoked when clicking on the "Paste From Word" button.
    • -
    • #6658 : [IE] Pasting text from Microsoft Word with one or more tabs between list items was failing.
    • -
    • #7433 : [IE9] ENTER_BR at the end of a block breaks due to an IE9 regression.
    • -
    • #7432 : [WebKit] Unable to create a new list in an empty document.
    • -
    • #4880 : CKEditor changes tag style inside HTML comment with cke_protected.
    • -
    • #7023 : [IE] JavaScript error when a Selection Field is inserted into a page.
    • -
    • #7034 : Inserting special characters into styled text.
    • -
    • #7132 : Paste toolbar buttons are becoming disabled.
    • -
    • #7138 : The api.html sample in Opera does not work as expected.
    • -
    • #7160 : Cannot paste the form element on top of the page.
    • -
    • #7171 : Double-clicking an image in non-editable content opens the editing dialog window.
    • -
    • #7455 : Extra line break is added automatically to the preformatted element.
    • -
    • #7467 : [Firefox] Extra br element is added in a nested list.
    • -
    • Updated the following language files:
        -
      • #7124 : Czech;
      • -
      • #7126 : French;
      • -
      • #7140 : Catalan;
      • -
      • #7215 : Faroese;
      • -
      • #7177 : Finnish;
      • -
      • #7163 : Norwegian (no and nb);
      • -
      • #7219 : Swedish;
      • -
      • #7183 : Afrikaans;
      • -
      • Hebrew;
      • -
      • Spanish;
      • -
      • Polish;
      • -
      • German;
      • -
    • -
    -

    - CKEditor 3.5.2

    -

    - Fixed issues:

    -
      -
    • #7168 : [IE9] Destroying an editor instance throws an error.
    • -
    • #7169 : [IE9] Menu item has incorrect height.
    • -
    • #7178 : [IE9] Read-only attributes do not work in IE9.
    • -
    • #7181 : [IE9] Toolbar items are not aligned in v2 and Office2003 skins.
    • -
    • #7174 : [IE9] Elements path does not load correctly when the editor is switched back from Source to WYSIWYG.
    • -
    -

    - CKEditor 3.5.1

    -

    - New features:

    -
      -
    • #6107 : It is now possible to remove block styles using Styles and Paragraph Format drop-down lists.
    • -
    • #5590 : Remove Format command works in collapsed selections.
    • -
    • #5755 : The dialog_buttonsOrder option now works in Internet Explorer.
    • -
    • #6869 : The data-cke-nostyle attribute (which was introduced for escaping the element from been influenced by the style system since 3.5) is deprecated in favor of the new data-nostyle attribute.
    • -
    • Revised sample pages with code examples and clarifications.
    • -
    -

    - Fixed issues:

    -
      -
    • #5855 : Updating a link multiple times generates wrong href attribute.
    • -
    • #6166 : Error on Maximize command, when the toolbar button is not shown.
    • -
    • #6607 : Table cell "merge down" and "merge right" commands work only once.
    • -
    • #6228 : Merge down does not work, throwing a JavasSript error.
    • -
    • #6625 : BIDI: Mixed LTR/RTL direction causes incorrect behavior.
    • -
    • #6881 : IFrame capitalization is now consistent throughout labels.
    • -
    • #6686 : BIDI: [FF] When we apply explicit language direction to a numbered/bulleted list, the corresponding language direction toolbar icon is not highlighted.
    • -
    • #6566 : It is now possible to exit a blockquote using ENTER_BR.
    • -
    • #6868 : Partial (invalid) list structure crashes the editor on load.
    • -
    • #6804 : Buggy behavior when editing the legend element inside a fieldset.
    • -
    • #6724 : [IE7] Nested list display bug on empty list item.
    • -
    • #6715 : List items do not create paragraphs after the list placed in a table cell is removed.
    • -
    • #6695 : [Webkit] Display bug after the editor is restored from the full screen mode.
    • -
    • #6661 : [IE] Pre-formatted style does not preserve applied text direction.
    • -
    • #6655 : Using the editor resize grip causes small visual offsets.
    • -
    • #6604 : The div element should be used as a formatting block in ENTER_BR.
    • -
    • #6249 : BIDI: List item bullets are off viewport with RTL text direction.
    • -
    • #6610 : BIDI: ENTER_BR change direction in one line out of multiple.
    • -
    • #6872 : [IE] Link target field is not populated properly when no target is set.
    • -
    • #6880 : Samples: Added a user-friendly message for users on servers without PHP support.
    • -
    • #6628 : Setting config.enterMode from PHP fails.
    • -
    • #6278 : Comments were moved above the br tags.
    • -
    • #6687 : Empty tag should be removed in inline-style format.
    • -
    • #6645 : Allow to configure whether " (double quotes) characters should be encoded in the contents.
    • -
    • #6336 : IE: (double)clicking an input type="submit" button submitted the form.
    • -
    • #6646 : Context menu was not working for text inputs present in the initial content.
    • -
    • #6641 : Copying and pasting links inside the editor was not working.
    • -
    • #4208 : The disableObjectResizing setting now works in IE.
    • -
    • #6242 : [IE] Editing existing links with href of a relative path mangles containing text.
    • -
    • #5930 : [IE] Style definitions are no longer lowercased.
    • -
    • #5361 : Preview window's title should reflect the title tag in full page mode.
    • -
    • #5522 : [IE] In versions < 8 or compatibility mode, type="text" was missing in text fields.
    • -
    • #6126 : [IE] Avoid problems if there are two buttons named "submit".
    • -
    • #6791 : [IE7] Editor did not show up when the name of a replaced textarea matched the name of a meta tag in the page.
    • -
    • #5684 : [FF] When forcePasteAsPlainText is used, the cursor disappears after paste.
    • -
    • #6390 : Prevent toolbar dialog window buttons from being clicked twice.
    • -
    • #6684 : [Webkit] Toolbar buttons are not wrapping correctly when the editor is displayed inside a table.
    • -
    • #6703 : [IE] editor focus event not fired in an instance, when a dialog window closes.
    • -
    • #6873 : Difficult to drag the resize grip of the spell checker dialog window.
    • -
    • #6896 : [Webkit] Unable to paste into source area when the editor is maximized.
    • -
    • #6020 : The state of the Cut, Copy, and Paste toolbar now matches the state of the context menu buttons.
    • -
    • #5256 : JavaScript error thrown when percent (%) sign is used in image URL.
    • -
    • #6577 : [FF] Selection error when an element containing the editor instance is hidden.
    • -
    • #5500 : [IE] value attribute of text input dialog window field was missing.
    • -
    • #6665 : [IE] name field of Link dialog window was missing.
    • -
    • #6639 : Line-breaks inside pasted list item from Microsoft Word break the list structure.
    • -
    • #6909 : [IE] GIF icons of toolbar button from custom plugins are not diplayed in zoom level 100%.
    • -
    • #6860 : [FF] Double-clicking the placeholder element in order to open a Placeholder dialog window throws a JavaScript error.
    • -
    • #6630 : Empty pre elements are output differently in various browsers.
    • -
    • #6568 : Insert table row/column does not work with spanning.
    • -
    • #6735 : Inaccurate read-only selection detection.
    • -
    • #6728 : BIDI: Change direction does not work with list nested inside a blockquote.
    • -
    • #6432 : Inserting a table in place of a fully selected list results in a JavaScript error.
    • -
    • #6438 : [IE] Performance enhancement when typing inside an element with many child nodes.
    • -
    • #6970 : [IE] Dialog window shadows were presented inaccurately.
    • -
    • #6672 : [IE] Unnecessary br element is no longer inserted after a form.
    • -
    • #7087 : [FF] Sometimes it was not possible to move cursor out of link at the end of block.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.5

    -

    - New features:

    -
      -
    • #4090 : Full Adobe AIR support.
    • -
    • #5084 : Dialog windows are now resizable with a grip located in the footer.
    • -
    • #5755 : Introduced the dialog_buttonsOrder setting, making it possible to control the buttons order.
    • -
    • #4648 : Added the new iFrame plugin.
    • -
    • #6010 : The Automatic option of the font/background color panel now represents the real color.
    • -
    • #5654 : New "placeholder" plugin.
    • -
    • #6334 : CKEditor now uses HTML5's data-* attributes for its internal attributes.
    • -
    • #6103 : It's now possible to control the styling of inline read-only elements with the disableReadonlyStyling setting. It's also possible to avoid inline-styling any element by setting its "data-cke-nostyle" attribute to "1".
    • -
    • #5404 : fillEmptyBlocks configuration option of v2 is now available.
    • -
    • #5367 : New CKEDITOR.editor#insertText method (check api.html sample page for usages) is now provided to insert plain text into editor.
    • -
    • #5915 : New removeDialogTabs configuration option to hide certain dialog tabs.
    • -
    -

    - Fixed issues:

    -
      -
    • #4821 : Icons in the toolbar were distorted with IE and zoom != 100%.
    • -
    • #5587 : Visual improvements in dialogs, reinforce field label on separate line.
    • -
    • #4652 : Now it's able to disable editor context menu by simply removing the "contextmenu" plugin.
    • -
    • #5599 : Labels of "specialchar" dialog are now translated.
    • -
    • #6419 : [IE] List creation by merging problem.
    • -
    • #6502 : Removed IE6 image preloading, which was used to defect the duplicate request of background images.
    • -
    • #6822 : Added labels to fake objects.
    • -
    • #6898 : [IE6] Toolbar icons becomes invisible in RTL.
    • -
    • Updated the following language files:
        -
      • Hebrew
      • -
    • -
    -

    - CKEditor 3.4.3

    -

    - Fixed issues:

    -
      -
    • #6554 : [Webkit] cannot type after inserting Page Break.
    • -
    • #6569 : Indentation now complies with text direction of the only item.
    • -
    • #6579 : The jQuery adapter was not working properly and was turned on in incompatible environments.
    • -
    • #6644 : Restrict onmousedown handler to the toolbar area.
    • -
    • #6656 : Panelbutton's buttons became active when clicking on Source.
    • -
    • #6248 : Whitespaces (nbsp elements) were incorrectly added into empty table cells and list items.
    • -
    • #6575 : Tabs disappearing in Link dialog window after a specific sequence of actions.
    • -
    • #6510 : Margin mirroring does not respect style configuration.
    • -
    • #6471 : BIDI: Pressing Decrease Indent in an RTL bulleted list causes incorrect behaviour.
    • -
    • #6479 : BIDI: Language direction is not being preserved when pressing Enter after a Paragraph Format was applied.
    • -
    • #6670 : BIDI: Indent & List icons are not reversed when we apply RTL direction to a paragraph with any of Paragraph Formatting options.
    • -
    • #6640 : Floating panels are now being closed when switching modes.
    • -
    • #4790 : Remove list with multiple items in enterBr doesnot preserve line breaks.
    • -
    • #6297 : Floated inline elements are not taking part in behavior of blocks anymore.
    • -
    • #6171 : [Firefox] Opening rich content drop-down list scrolls host page to the top when editor has a vertical scrollbar.
    • -
    • #6330 : List markers from MS Word with Roman numbering are not preserved.
    • -
    • #6720 : Attribute protection might detect wrong elements.
    • -
    • #6580 : [IE9] Flash dialog window does not get filled up.
    • -
    • #6447 : Decreasing indentation of a list with indentClasses config does not work.
    • -
    • #5894 : Adding custom buttons at the bottom of a dialog window does not cause it to expand to include its contents.
    • -
    • #6513 : Wrong ARIA attributes created on list options of Styles drop-down list.
    • -
    • #6150 : [Safari] Color dialog window was broken.
    • -
    • #6747 : Full screen layout issue caused by page element focus outside editor.
    • -
    • #6779 : Clicking the body element on elements path turns the selection on and off immediately.
    • -
    • #6781 : [IE7] Dialog windows are broken with RTL, Office 2003 and v2 skins.
    • -
    • #6798 : [IE7] Dialog window buttons disappearing in RTL after dragging.
    • -
    • #6806 : [IE7] Dialog window buttons invisible on focus.
    • -
    • #6588 : Copy and paste adds <span> if SCAYT is enabled.
    • -
    • #6673 : IE Target combo for Image Link shown as blank even when we select <not set> as an option.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.4.2

    -

    - New features:

    -
      -
    • #5024 : Added a sample that shows how to output HTML that is valid for Flash.
    • -
    -

    - Fixed issues:

    -
      -
    • #5237 : English text in dialogs' title was flipped when using RTL language (office2003 and v2 skins).
    • -
    • #6289 : Deleting nested table removed the parent cell.
    • -
    • #6341 : The editor contents now have the text cursor.
    • -
    • #6153 : Chrome: tab focus is wrong.
    • -
    • #6261 : Focus and infinite loop between multiple editors.
    • -
    • #6170 : Dedicated class names are removed from floating panels when opening another panel.
    • -
    • #6339 : Autogrow plugin now doesn't work on maximized editors.
    • -
    • #6237 : BIDI: Applying same language direction to all paragraphs not working.
    • -
    • #6353 : [IE] Resize was broken with office2003 and v2 skins.
    • -
    • #6375 : Avoiding errors when hiding the editor after the blur event.
    • -
    • #6133 : Styled paragraphs result on buggy list creation.
    • -
    • #5074 : Link target is not removed when changing to popup.
    • -
    • #6408 : [IE] Autogrow now works correctly on Quirks.
    • -
    • #6420 : [IE] The table properties dialog now correctly retrieves the caption text.
    • -
    • #6141 : It was impossible to outdent a list when indentOffset was set to 0.
    • -
    • #6377 : FF width and height are not shown for smiley in Image properties dialog.
    • -
    • #5399 : Lists pasted from Word do not maintain their nesting.
    • -
    • #6225 : [FF] Cannot transform several lines to list with enterMode BR.
    • -
    • #6467 : [FF] It is now possible to disable the plugin command on "mode" event.
    • -
    • #6461 : Attributes are now being kept when changing block formatting.
    • -
    • #6226 : BIDI: Language direction applied to a Paragraph is removed when we apply one of Paragraph formatting options.
    • -
    • #5395 : [Opera] Native context menu incorrectly opened after Opera 10.2.
    • -
    • #6444 : [Opera] Close panels and dialogs don't return focus to wysiwyg frame.
    • -
    • #6332 : IE: V2 skin bottom dialog's border broken.
    • -
    • #5646 : Parser incorrectly removes inline element when there's only one comment node enclosed.
    • -
    • #6189 : Minor code size reduction.
    • -
    • #5045 : uiColor behaved wrong if multiple editors were used with period in their names.
    • -
    • #5766 : Config entry "ignoreEmptyParagraph" should only remove one single empty paragraph in document.
    • -
    • #5931 : Unable to apply inline style because of nested elements with same style name.
    • -
    • #6083 : Dialog close sometimes cause collapsed editor selection before the insertion.
    • -
    • #6253 : BIDI: creating a Numbered/Bulleted list causing improper behavior on bidi.
    • -
    • #4023 : [Opera] Maximize plugin.
    • -
    • #6403 : [Opera] Font name options are not correctly marked in dropdown list.
    • -
    • #4534 : [Opera] Arrow key to navigate through combo list has side effects of window scrolling.
    • -
    • #6534 : [Opera] Menu key brings up both CKEditor and browser context menu.
    • -
    • #6534 : [Opera] Menu key brings up both CKEditor and browser context menu.
    • -
    • #6416 : [IE9] Unable to make text selection with mouse in source area.
    • -
    • #6417 : [IE9] Context menu opens at the upper-left corner always.
    • -
    • #6501 : [IE9] Context menu item layout is broken.
    • -
    • #6099 : BIDI: when we apply explicit language direction to Numbered/Bulleted List the corresponding BIDI Tool bar icon is not highlighted in the Toolbar.
    • -
    • #6100 : BIDI: when we change Table language direction indentation of text in Table cells is not applied correctly.
    • -
    • #6376 : BIDI: buttons should not toggle the base language direction.
    • -
    • #6235 : BIDI: Applying direction to multi-paragraph selection within a div.
    • -
    • #6187 : [IE6] Multi-instance loading produces 404s on background images.
    • -
    • #5446 : Setting config.filebrowserImageBrowseUrl results in displaying also Browser Server on links.
    • -
    • #5626 : CKeditor 3.2.1 : html content attached makes ckeditor crash the browser FF/IE.
    • -
    • #6508 : BiDi: Margin mirroring logic doesn't honor CSS direction.
    • -
    • #6043 : BIDI: When we apply RTL direction to a right aligned Paragraph, Paragraph is not moved to the left & Alignment of Paragraph is not changed.
    • -
    • #6485 : BIDI: When direction is applied on partial selected list, the style is been incorrectly applied to the entire list.
    • -
    • #6087 : Cursor of input fields in dialog isn't visible in RTL.
    • -
    • #5595 : Extra leading spaces added in preformatted block.
    • -
    • #6094 : Match full word option doesn't stop on block boundaries.
    • -
    • #5730 : [Safari] Continual pastes (holding paste key) breaks document contents.
    • -
    • #5850 : [IE] Inline style misbehaviors at the beginning of numbered/bulleted list.
    • -
    • Updated the following language files:
        -
      • #6427 : Ukrainian;
      • -
      • #6464 : Finnish;
      • -
      • Hebrew;
      • -
    • -
    -

    - CKEditor 3.4.1

    -

    - New features:

    - -

    - Fixed issues:

    -
      -
    • #6027 : Modifying Table Properties by selecting more than one cell caused issues.
    • -
    • #6146 : IE: Floating panels were being opened in the wrong place in RTL pages with horizontal scrollbars.
    • -
    • #6055 : The timestamp is now added only once to each loaded file.
    • -
    • #6097 : The bookmarks now use the right name.
    • -
    • #5717 : Removed the scayt_contextMenuOntop setting and the SCAYT context menu options are always on top.
    • -
    • #5956 : [FF] It was impossible to create an editor inside an hidden container.
    • -
    • #5753 : It was impossible to have a default value for the name field in the select dialog.
    • -
    • #6041 : BIDI: Direction of Increase Indent & Decrease Indent icons are not reversed after changing Lang direction to RTL.
    • -
    • #6138 : List indentation is not working.
    • -
    • #5649 : Image dialog too wide when many styles are set.
    • -
    • #5715 : Cell color picker dialog returns focus to document.
    • -
    • #6108 : Fixed div style.
    • -
    • #5336 : Remove object style.
    • -
    • #6155 : [[FF]] Modifying Table Header Properties by selecting first Row, causing several issues.
    • -
    • #6163 : Focus not going to Tabs in Image dialog when we went to Edit the Image.
    • -
    • #6177 : IE we can't start Numbered/Bulleted list on a Empty page.
    • -
    • #6034 : Horizontal Alignment applied to Table cell is not updated correctly in the Toolbar.
    • -
    • #6112 : BIDI: Alignment set to text in Table cell is not shown in the Tool bar when we press Enter to start a new Paragraph.
    • -
    • #6117 : BIDI: Language direction is changing when we come out of Numbered/Bulleted list.
    • -
    • #6182 : Language Direction field on the Advanced tab of Table Properties dialog has a fixed pixel width.
    • -
    • #5487 : Fullpage writer problem with line-break.
    • -
    • #6197 : The CKEDITOR.loader base path auto-detection was not working with the _source folder.
    • -
    • #6240 : Font Names & Font Sizes should be shown Left Align even for RTL Languages.
    • -
    • #5975 : Page-break should have proper Alt Text instead of Unknown object. so that JAWS reads it properly.
    • -
    • #6255 : Inserting a page break as the first node triggered an error.
    • -
    • #6188 : [IE7] Automatic color button had the wrong cursor.
    • -
    • #6129 : The show blocks' labels are now shown in the right for RTL languages.
    • -
    • #5421 : &shy; entity not converted when config.entities=false.
    • -
    • #5769 : xhtml code generation problem &nbsp; instead of &#160; (htmlentities, entities,entities_additional,..., configuration).
    • -
    • #4472 : [FF3] Browser window scrolls to loaded CKEditor.
    • -
    • #6230 : Fixed invalid parameter count for setTimeout function call.
    • -
    • #5335 : Several lines' formatted data will be merged to one line when we apply Numbers/Bullets.
    • -
    • #5353 : wrong width of editor after resize() called in Firefox 3.6.
    • -
    • #5778 : [IE] Unwanted scroll on first mouse right-click.
    • -
    • #5218 : [FF] Copy/paste of an image from same domain changed URL to relative URL.
    • -
    • #6265 : Popup window properties were visible in the link dialog's target tab when nothing was selected.
    • -
    • #6075 : [FF] Newly created links didn't fill in information on edit.
    • -
    • #6183 : The toolbar panels options sometimes had the contents' link color.
    • -
    • #6192 : [WebKit] Inserting smileys was not working because of editor focus issues.
    • -
    • #6178 : [WebKit] Inserting elements by code was failing if the editor didn't receive the focus first.
    • -
    • #6179 : [WebKit] The Image dialog was not working if the editor didn't receive the focus first.
    • -
    • #4657 : [Opera] Styles where not working with collapsed selections.
    • -
    • #5839 : "Insert row after" was removing the ids of the elements from the clicked row.
    • -
    • #6315 : DIV plugin TT #2885 regression.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.4

    -

    - Fixed issues:

    -
      -
    • #6118 : Initial focus is now set to the tabs in the table properties dialog.
    • -
    • #6135 : The dialogadvtab plugin now uses the correct label.
    • -
    • #6125 : Focus was lost after applying commands in Opera.
    • -
    • #6137 : The table dialog was missing the default width value on second opening.
    • -
    -

    - CKEditor 3.4 Beta

    -

    - New features:

    -
      -
    • #5909 : New BiDi feature, making it possible to switch the base language direction of block elements.
    • -
    • #5268 : Introducing the "tableresize" plugin, which makes it possible to resize tables columns by mouse drag. It's not enabled by default, so it must be enabled in the configurations file.
    • -
    • #979 : New enableTabKeyTools configuration to allow using the TAB key to navigate through table cells.
    • -
    • #4606 : Introduce the "autogrow" plugin, which makes the editor resize automatically, based on the contents size.
    • -
    • #5737 : Added support for the HTML5 contenteditable attribute, making it possible to define read only regions into the editor contents.
    • -
    • #5418 : New "Advanced" tab introduced on the Table Properties dialog. It's based on the new dialogadvtab plugin.
    • -
    • #6082 : Introduced the useComputedState setting, making it possible to control whether toolbar features, like alignment and direction, should reflect the "computed" selection states, even when the effective feature value is not applied.
    • -
    -

    - Fixed issues:

    -
      -
    • #5911 : BiDi: List items should support and retain correct base language direction
    • -
    • #5689 : Make it possible to run CKEditor inside of Firefox chrome.
    • -
    • #6042 : It wasn't possible to align a paragraph with the dir attribute to the opposite direction.
    • -
    • #6058 : Fixed a small style glitch with file upload fields in IE+Quirks.
    • -
    -

    - CKEditor 3.3.2

    -

    - New features:

    -
      -
    • #5882 : Introduce the dialog#selectPage event, replicating the OnDialogTabChange feature available in FCKeditor 2.
    • -
    • #5927 : The native controls in ui.dialog.elements can be styled with the controlStyle definition.
    • -
    -

    - Fixed issues:

    -
      -
    • #1644 : Removed references to cursor:hand in the stylesheets.
    • -
    • #5411 : Anchor, hidden fields and Page-Break objects can no longer be resized.
    • -
    • #5456 : Initial focus incorect in api_dialog sample page.
    • -
    • #5628 : Incorrect <pre> siblings merging.
    • -
    • #5829 : Adding validation for start number field in list style dialog.
    • -
    • #5845 : Context menu on empty list item loses selection.
    • -
    • #5860 : [IE] > in attribute values are incorrectly escaped.
    • -
    • #5905 : SCAYT is not any more enabled by default.
    • -
    • #5736 : Improved the text generated for mailto: links if no text was selected.
    • -
    • #4779 : Adjust resize_minWidth and resize_minHeight if smaller than actual dimensions.
    • -
    • #5687 : Navigation through colors is now compatible with RTL.
    • -
    • #4615 : [IE] Text fields are no longer disrupted in dialog with RTL.
    • -
    • #5887 : The number of columns in the smileys table is now configurable via the smiley_columns setting.
    • -
    • #5100 : It was possible to drag&drop some elements like context menu items or dropdown entries.
    • -
    • #5933 : Text color and background color panels don't have scrollbars anymore under office2003 and v2 skins.
    • -
    • #5943 : An error is no longer generated when using percent or pixel values in the image dialog.
    • -
    • #5951 : Avoid problems with security systems due to the usage of UniversalXPConnect.
    • -
    • #5441 : Avoid errors if the editor instance is removed from the DOM before calling its destroy() method.
    • -
    • #4997 : Provide better access to the native input in the ui.dialog.file element.
    • -
    • #5914 : Modified the Smileys dialog to make active only the images and not their borders.
    • -
    • #5565 : The scrollbar does not behaves erratically when opening a rich combo in RTL page.
    • -
    • #5843 : In CKEditor 3.3: When we set the focus in the 'instanceReady' event, FF3.6 is giving js error.
    • -
    • #5902 : paste and pastetext dialogs cannot be skinned easily.
    • -
    • #5959 : Dialog auto focus does not check for hidden tabs.
    • -
    • #5415 : Undo not working when we change the Table Properties for the table on a saved page.
    • -
    • #5435 : IE: we can't start Numbered/Bulleted list in Tables by Clicking on Insert/Remove Numbers/Bullets Icon.
    • -
    • #5832 : The JQuery adapter sample is not working properly with SSL.
    • -
    • #5728 : Text field & Upload Button in Upload Tab of Image Properties dialog are not shown Properly in Arabic.
    • -
    • #5436 : IE: Cursor goes to next Table Cell after we insert a Smiley in the Table Cell.
    • -
    • #5580 : Maximize does not work properly in the Office 2003 and V2 skins.
    • -
    • #5495 : The link dialog was breaking the undo system on some situations.
    • -
    • #5775 : Required field's label to contain a CSS class to allow it to be styled differently.
    • -
    • #5999 : Table dialog rows and columns fields are now marked as required.
    • -
    • #5693 : baseHref detection in the flash dialog now works correctly.
    • -
    • #5690 : Table cell's width attribute is now respected properly.
    • -
    • #5819 : Introducing the new removeFormatCleanup event and making sure remove format doesn't break the showborder plugin.
    • -
    • #5558 : After pasting on WebKit based browsers the editor now scrolls to the end of the pasted content.
    • -
    • #5799 : Correct plugin dependencies for the liststyle plugin with contextMenu and dialog.
    • -
    • #5436 : IE: The cursor was moving to the wrong position when inserting inline elements at the end of cells on tables.
    • -
    • #5984 : Firefox: CTRL+HOME was creating an unwanted empty paragraph at the start of the document.
    • -
    • #5634 : IE: It was needed to click twice in the editor to make it editable on some situations.
    • -
    • #5338 : Pasting from Open Office could lead on error.
    • -
    • #5224 : Some invalid markup could break the editor.
    • -
    • #5455 : It was not possible to remove formatting from pasted content on specific cases.
    • -
    • #5735 : IE: The editor was having focus issues when the previous selection got hidden by scroll operations.
    • -
    • #5563 : Firefox: The disableObjectResizing and disableNativeTableHandles settings stopped working.
    • -
    • #5781 : Firefox: Editing was not possible in an empty document.
    • -
    • #5293 : Firefox: Unwanted BR tags were being left in the editor output when it should be empty.
    • -
    • #5280 : IE: Scrollbars where reacting improperly when clicking in the bar space.
    • -
    • #5840 : Some dialog access keys are conflicting with "Ctrl + A", select all text behavior on text input.
    • -
    • #6059 : Changing list type didn't preserve the list's attributes.
    • -
    • #5193 : In Firefox, the element path options had the text cursor instead of the arrow.
    • -
    • #6073 : The list context menu was showing the wrong option when in a mixed list hierarchy.
    • -
    • #6074 : The Insert Table Column command was duplicating the selected column cells ids.
    • -
    • #6066 : The toolbar combos had the text cursor instead of the arrow.
    • -
    • #6062 : The toolbar buttons had the text cursor instead of the arrow.
    • -
    • #6068 : [IE7] A few labels were hidden in a RTL language.
    • -
    • #6000 : Safari and Chrome where scrolling the contents to the top when moving the focus to the editor.
    • -
    • #6090 : IE: Textarea with selection inside causes Link dialog issues.
    • -
    • #5079 : Page break in lists move to above the list when you switch from WYSIWYG to HTML mode and back.
    • -
    • Updated the following language files:
        -
      • Chinese Simplified;
      • -
      • Hebrew;
      • -
      • #5962 : German;
      • -
      • #5645 : Portuguese;
      • -
      • #5797 : Turkish;
      • -
    • -
    -

    - CKEditor 3.3.1

    -

    - Fixed issues:

    -
      -
    • #5780 : Text selection lost when opening some of the dialogs.
    • -
    • #5787 : Liststyle plugin wasn't packaged into the core (CKEDITOR.resourceManager.load exception).
    • -
    • #5637 : Fix wrong nesting that generated "<head> must be a child of <html>" warning in Webkit.
    • -
    • #5790 : Internal only attributes output on fullpage <html> tag.
    • -
    • #5761 : [IE] Color dialog matrix buttons are barely clickable in quirks mode.
    • -
    • #5759 : [IE] Clicking on the scrollbar and then on the host page causes error.
    • -
    • #5772 : List style dialog is missing tab page ids.
    • -
    • #5782 : [FF] Wysiwyg mode is broken by 'display' style changes on editor's parent DOM tree.
    • -
    • #5801 : [IE] contentEditable="false" doesn't apply in effect on inline-elements.
    • -
    • #5794 : Empty find matching twice results in JavaScript error.
    • -
    • #5732 : If it isn't possible to connect to the SCAYT servers the dialogs might hang in Firefox. Fix for Firefox>=3.6.
    • -
    • #5807 : [FF2] New page command results in uneditable document.
    • -
    • #5807 : [FF2] SCAYT plugin is disabled in Firefox2 due to selection interference.
    • -
    • #5772 : [IE] Some numbered list style types are not supported by IE6/7 and causes JavaScript error.
    • -
    -

    - CKEditor 3.3

    -

    - New features:

    -
      -
    • #635 : The properties dialog will now open when double clicking on objects.
    • -
    • #3893 : It's now possible to indent/outdent lists when selecting the first list item.
    • -
    • #4968 : The contentsLangDirection setting now has a default value 'ui' which inherit language direction from the editor UI language.
    • -
    • #4649 : The color picker dialog is now accessible.
    • -
    • #3593 : The editing area is now enabled by contentEditable="true" instead of designMode="on" to allow creating uneditable content elements in all browsers.
    • -
    • #4056 : Hidden fields will now be displayed as fake element just like in FCKeditor 2.
    • -
    -

    - CKEditor 3.2.2

    -

    - New features:

    -
      -
    • The SCAYT spell checker is now enabled by default through the autoStartup setting.
    • -
    • #5631 : The SCAYT context menu options can now be reorganized through the scayt_contextMenuItemsOrder setting.
    • -
    • #4231 : Introducing the resize_dir setting, to be able to restrict manual resizing of the editor to only one direction (horizontal/vertical).
    • -
    • #5479 : Introducing the classic ASP integration files and samples.
    • -
    • #5024 : Added samples (HTML and XHTML) to show how to output HTML using fonts and other attributes instead of styles.
    • -
    • #4358 : Introduced the List Properties dialog.
    • -
    • #5485 : Adding the contentsLanguage configuration option to be able to set the language for the editor contents.
    • -
    -

    - Fixed issues:

    -
      -
    • #5330 : Corrected detection of CTRL and META keys in Macs for the context menu.
    • -
    • #5434 : Fixed access denied issues with IE when accessing web sites through IPv6 IP addresses.
    • -
    • #4476 : [IE] Inaccessible empty list item contains sub list.
    • -
    • #4881 : [IE] Selection range broken because of cutting a single control type element from it.
    • -
    • #5505 : Image dialog throw JavaScript error when click close dialog before preview area is loading.
    • -
    • #5144 : [Chrome] Paste in Webkit sometimes leaves extra 'div' element.
    • -
    • #5021 : [Firefox] Typing in empty document start from second line when enterMode = CKEDITOR.ENTER_BR.
    • -
    • #5416 : [IE] Delete table throws a error when enterMode = CKEDITOR.ENTER_BR.
    • -
    • #4459 : [IE] Select element is penetrating the maximized editor in IE6.
    • -
    • #5559 : [IE] The first call to setData is affected by iframe cache when loading the wysiwyg mode.
    • -
    • #5567 : [IE] Remove inline styles in some case doesn't join identical siblings.
    • -
    • #5450 : [FireFox] Press ENTER on 'replace' button result wrong.
    • -
    • #5121 : Recognizes the <br /> tag as a separator when apply block styles and enterMode = CKEDITOR.ENTER_BR.
    • -
    • #5575 : CKEDITOR.replaceAll should consider all kind of white spaces between class names.
    • -
    • #5582 : Prevent the default behavior when click the 'x' button to close dialog box.
    • -
    • #5584 : ENTER key with forceEnterMode turns on doesn't inherit current block attributes.
    • -
    • #4797 : [Opera] Press ENTER key in dialog fields to close throws JavaScript error.
    • -
    • #5578 : Add flash fake element align property when switch mode (source to wysiwyg).
    • -
    • #5577 : Update delete column behavior when choose multiple cells in the same column.
    • -
    • #5512 : Open context menu with SHIFT+F10 doesn't get correct editor selection.
    • -
    • #5433 : English protocol text directions in Link dialog are not incorrect in 'rtl' UI languages.
    • -
    • #5553 : Paste dialog clipboard area text direction is incorrect for 'rtl' content languages.
    • -
    • #4734 : Font size resets when font name is changed in an empty numbered list.
    • -
    • #5237 : English text in dialogs' title is flipped when using RTL language.
    • -
    • #3257 : Create list doesn't keep blocks as headings.
    • -
    • #5111 : [Firefox] JAWS doesn't respect PC cursor mode (application role) on toolbar.
    • -
    • #5530 : Page break for printing can't be removed with undo.
    • -
    • #5381 : Unable to place cursor between two paragraphs in body.
    • -
    • #5568 : [IE6/7] Selecting a entire table cell changes the original range.
    • -
    • #5623 : [Firefox] Apply style that edges another inline style result incorrect.
    • -
    • #5586 : [Firefox] Maximize the second editor ruins full screen mode.
    • -
    • #5617 : HTML filter system does not allow two 'text' filter rules.
    • -
    • #5663 : General memory clean up after destroying last instance.
    • -
    • #5461 : [IE] Fix Paste from Word dialog doesn't accept imput problem.
    • -
    • #5676 : Make color buttons use RRGGBB instead of RGB for better compatibility with IE.
    • -
    • #4948 : [Safari] Select the first/last cell of table to open context menu may lead to undetected table.
    • -
    • #5591 : [Firefox] Select a list item makes selected element broken.
    • -
    • #5667 : Pasting in a RTL page content causes shows up the horizontal scrollbar.
    • -
    • #5688 : Duplicate ids are used in dialog definition.
    • -
    • #5719 : [IE] 'change' dialog event should not be triggered when dialog is already closed.
    • -
    • #5747 : [IE] Error thrown when IE input field editing mode is turned on.
    • -
    • #5516 : IE8: Toolbar buttons have higher bottom padding.
    • -
    • #5402 : SHIFT-ENTER could now be used to exit from preformat block.
    • -
    • SCAYT plugin related:
        -
      • #4836 : Using SCAYT result in fragile elements when applying inline styles.
      • -
      • #5425 : [Opera] Disable SCAYT plugin for Opera browser.
      • -
      • #5632 : SCAYT word marker is not visible on text with background-color set.
      • -
      • #4125 : Remove Format command incorrectly removes SCAYT word markers.
      • -
      • #5671 : SCAYT bootstrap script could be added multiple times unnecessarily.
      • -
      • #5573 : SCAYT move cursor position after insert element into marked word text.
      • -
      • #5546 : SCAYT interferes with undo/redo commands.
      • -
      • #5570 : [IE] First enabling SCAYT blind cursor in editor.
      • -
      • #5741 : Enable SCAYT cause error in multiple editor instances.
      • -
      • #5744 : Remove editor with SCAYT enabled in source mode throws error.
      • -
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.2.1

    -

    - New features:

    -
      -
    • #4478 : Enable the SelectAll command in source mode.
    • -
    • #5150 : Allow names in the CKEDITOR.config.colorButton_colors setting.
    • -
    • #4810 : Adding configuration option for image dialog preview area filling text.
    • -
    • #536 : Object style now could be applied on any parent element of current selection.
    • -
    • #5290 : Unified stylesSet loading removing dependencies from the styles combo. - Now the configuration entry is named 'config.stylesSet' instead of config.stylesCombo_stylesSet and the default location - is under the 'styles' plugin instead of 'stylescombo'.
    • -
    • #5352 : Allow to define the stylesSet array in the config object for the editor.
    • -
    • #5302 : Adding config option "forceEnterMode".
    • -
    • #5216 : Extend CKEDITOR.appendTo to allow a data parameter for the initial value.
    • -
    • #5024 : Added sample to show how to output XHTML and avoid deprecated tags.
    • -
    -

    - Fixed issues:

    -
      -
    • #5152 : Indentation using class attribute doesn't work properly.
    • -
    • #4682 : It wasn't possible to edit block elements in IE that had styles like width, height or float.
    • -
    • #4750 : Correcting default order of buttons layout in dialogs on Mac.
    • -
    • #4932 : Fixed collapse button not clickable on simple toolbar.
    • -
    • #5228 : Link dialog is automatically changes protocol when URLs that starts with '?'.
    • -
    • #4877 : Fixed CKEditor displays source code in one long line (IE quirks mode + office2003 skin).
    • -
    • #5132 : Apply inline style leaks into sibling words which are seperated spaces.
    • -
    • #3599 : Background color style on sized text displayed as narrow band behind.
    • -
    • #4661 : Translation missing in link dialog.
    • -
    • #5240 : Flash alignment property is not presented visually on fake element.
    • -
    • #4910 : Pasting in IE scrolls document to the end.
    • -
    • #5041 : Table summary attribute can't be removed with dialog.
    • -
    • #5124 : All inline styles cannot be applied on empty spaces.
    • -
    • #3570 : SCAYT marker shouldn't appear inside elements path bar.
    • -
    • #4553 : Dirty check result incorrect when editor document is empty.
    • -
    • #4555 : Unreleased memory when editor is created and destroyed.
    • -
    • #5118 : Arrow keys navigation in RTL languages is incorrect.
    • -
    • #4721 : Remove attribute 'value' of checkbox in IE.
    • -
    • #5278 : IE: Add validation to check for bad window names of popup window.
    • -
    • #5171 : Dialogs contains lists don't have proper voice labels.
    • -
    • #4791 : Can't place cursor inside a form that end with a checkbox/radio.
    • -
    • #4479 : StylesCombo doesn't reflect the selection state until it's first opened.
    • -
    • #4717 : 'Unlink' and 'Outdent' command buttons should be disabled on editor startup.
    • -
    • #5119 : Disabled command buttons are not being properly styled when focused.
    • -
    • #5307 : Hide dialog page cause problem when there's two tab pages remain.
    • -
    • #5343 : Active list item ARIA role is wrongly placed.
    • -
    • #3599 : Background color style applying to text with font size style has been narrowly rendered.
    • -
    • #4711 : Line break character inside preformatted text makes it unable to type text at the end of previous line.
    • -
    • #4829 : [IE] Apply style from combo has wrong result on manually created selection.
    • -
    • #4830 : Retrieving selected element isn't always right, especially selecting using keyboard (SHIFT+ARROW).
    • -
    • #5128 : Element attribute inside preformatted text is corrupted when converting to other blocks.
    • -
    • #5190 : Template list entry shouldn't gain initial focus open templates list dialog opens.
    • -
    • #5238 : Menu button doesn't display arrow icon in high-contrast mode.
    • -
    • #3576 : Non-attributed element of the same name with the applied style is incorrectly removed.
    • -
    • #5221 : Insert table into empty document cause JavaScript error thrown.
    • -
    • #5242 : Apply 'automatic' color option of text color incorrectly removes background-color style.
    • -
    • #4719 : IE does not escape attribute values properly.
    • -
    • #5170 : Firefox does not insert text into styled element properly.
    • -
    • #4026 : Office2003 skin has no toolbar button borders in High Contrast in IE7.
    • -
    • #4348 : There should have exception thrown when 'CKEDITOR_BASEPATH' couldn't be figured out automatically.
    • -
    • #5364 : Focus may not be put into dialog correctly when dialog skin file is loading slow.
    • -
    • #4016 : Justify the layout of forms select dialog in Chrome and IE7.
    • -
    • #5373 : Variable 'pathBlockElements' defines wrong items in CKEDITOR.dom.elementPath.
    • -
    • #5082 : Ctrl key should be described as Cmd key on Mac.
    • -
    • #5182 : Context menu is not been announced correctly by ATs.
    • -
    • #4898 : Can't navigate outside table under the last paragraph of document.
    • -
    • #4950 : List commands could compromise list item attribute and styles.
    • -
    • #5018 : Find result highlighting remove normal font color styles unintentionally.
    • -
    • #5376 : Unable to exit list from within a empty block under list item.
    • -
    • #5145 : Various SCAYT fixes.
    • -
    • #5319 : Match whole word doesn't work anymore after replacement has happened.
    • -
    • #5363 : 'title' attribute now presents on all editor iframes.
    • -
    • #5374 : Unable to toggle inline style when the selection starts at the linefeed of the previous paragraph.
    • -
    • #4513 : Selected link element is not always correctly detected when using keyboard arrows to perform such selection.
    • -
    • #5372 : Newly created sub list should inherit nothing from the original (parent) list, except the list type.
    • -
    • #5274 : [IE6] Templates preview image is displayed in wrong size.
    • -
    • #5292 : Preview in font size and family doesn't work with custom styles.
    • -
    • #5396 : Selection is lost when use cell properties dialog to change cell type to header.
    • -
    • #4082 : [IE+Quirks] Preview text in the image dialog is not wrapping.
    • -
    • #4197 : Fixing format combo don't hide when editor blur on Safari.
    • -
    • #5401 : The context menu break layout with Office2003 and V2 skin on IE quirks mode.
    • -
    • #4825 : Fixing browser context menu is opened when clicking right mouse button twice.
    • -
    • #5356 : The SCAYT dialog had issues with Prototype enabled pages.
    • -
    • #5266 : SCAYT was disturbing the rendering of TH elements.
    • -
    • #4688 : SCAYT was interfering on checkDirty.
    • -
    • #5429 : High Contrast mode was being mistakenly detected when loading the editor through Dojo's xhrGet.
    • -
    • #5221 : Range is mangled when making collapsed selection in an empty paragraph.
    • -
    • #5261 : Config option 'scayt_autoStartup' slow down editor loading.
    • -
    • #3846 : Google Chrome - No Img properties after inserting.
    • -
    • #5465 : ShiftEnter=DIV doesn't respect list item when pressing ENTER at end of list item.
    • -
    • #5454 : After replaced success, the popup window couldn't be closed and a js error occured.
    • -
    • #4784 : Incorrect cursor position after delete table cells.
    • -
    • #5149 : [FF] Cursor disappears after maximize when the editor has focus.
    • -
    • #5220 : DTD now shows tolerance to <style> appear inside content.
    • -
    • #5440 : Mobile browsers (iPhone, Android...) are marked as incompatible as they don't support editing features.
    • -
    • #5504 : [IE6/7] 'Paste' dialog will always get opened even when user allows the clipboard access dialog when using 'Paste' button.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.2

    -

    - New features:

    -
      -
    • Several accessibility enhancements:
        -
      • #4502 : The editor accessibility is now totally based on WAI-ARIA.
      • -
      • #5015 : Adding accessibility help dialog plugin.
      • -
      • #5014 : Keyboard navigation compliance with screen reader suggested keys.
      • -
      • #4595 : Better accessibility in the Templates dialog.
      • -
      • #3389 : Esc/Arrow Key now works for closing sub menu.
      • -
    • -
    • #4973 : The Style field in the Div Container dialog is now loading the styles defined in the default styleset used by the Styles toolbar combo.
    • -
    -

    - Fixed issues:

    -
      -
    • #5049 : Form Field list command in JAWS incorrectly lists extra fields.
    • -
    • #5008 : Lock/Unlock ratio buttons in the Image dialog was poorly designed in High Contrast mode.
    • -
    • #3980 : All labels in dialogs now use <label> instead of <div>.
    • -
    • #5213 : Reorganization of some entries in the language files to make it more consistent.
    • -
    • #5199 : In IE, single row toolbars didn't have the bottom padding.
    • -
    -

    - CKEditor 3.1.1

    -

    - New features:

    -
      -
    • #4399 : Improved support for external file browsers by allowing executing a callback function.
    • -
    • #4612 : The text of links is now updated if it matches the URL to which it points to.
    • -
    • #4936 : New localization support for the Welsh language.
    • -
    -

    - Fixed issues:

    -
      -
    • #4272 : Kama skin toolbar was broken in IE+Quirks+RTL.
    • -
    • #4987 : Changed the url which is called by the Browser Server button in the Link tab of Image Properties dialog.
    • -
    • #5030 : The CKEDITOR.timestamp wasn't been appended to the skin.js file.
    • -
    • #4993 : Removed the float style from images when the user selects 'not set' for alignment.
    • -
    • #4944 : Fixed a bug where nested list structures with inconsequent levels were not being pasted correctly from MS Word.
    • -
    • #4637 : Table cells' 'nowrap' attribute was not being loaded by the cell property dialog. Thanks to pomu0325.
    • -
    • #4724 : Using the mouse to insert a link in IE might create incorrect results.
    • -
    • #4640 : Small optimizations for the fileBrowser plugin.
    • -
    • #4583 : The "Target Frame Name" field is now visible when target is set to 'frame' only.
    • -
    • #4863 : Fixing iframedialog's height doesn't stretch to 100% (except IE Quirks).
    • -
    • #4964 : The BACKSPACE key positioning was not correct in some cases with Firefox.
    • -
    • #4980 : Setting border, vspace and hspace of images to zero was not working.
    • -
    • #4773 : The fileBrowser plugin was overwriting onClick functions eventually defined on fileButton elements.
    • -
    • #4731 : The clipboard plugin was missing a reference to the dialog plugin.
    • -
    • #5051 : The about plugin was missing a reference to the dialog plugin.
    • -
    • #5146 : The wsc plugin was missing a reference to the dialog plugin.
    • -
    • #4632 : The print command will now properly break on the insertion point of page break for printing.
    • -
    • #4862 : The English (United Kingdom) language file has been renamed to en-gb.js.
    • -
    • #4618 : Selecting an emoticon or the lock and reset buttons in the image dialog fired the onBeforeUnload event in IE.
    • -
    • #4678 : It was not possible to set tables' width to empty value.
    • -
    • #5012 : Fixed dependency issues with the menu plugin.
    • -
    • #5040 : The editor will not properly ignore font related settings that have extra item separators (semi-colons).
    • -
    • #4046 : Justify should respect config.enterMode = CKEDITOR.ENTER_BR.
    • -
    • #4622 : Inserting tables multiple times was corrupting the undo system.
    • -
    • #4647 : [IE] Selection on an element within positioned container is lost after open context-menu then click one menu item.
    • -
    • #4683 : Double-quote character in attribute values was not escaped in the editor output.
    • -
    • #4762 : [IE] Unexpected vertical-scrolling behavior happens whenever focus is moving out of editor in source mode.
    • -
    • #4772 : Text color was not being applied properly on links.
    • -
    • #4795 : [IE] Press 'Del' key on horizontal line or table result in error.
    • -
    • #4824 : [IE] <br/> at the very first table cell breaks the editor selection.
    • -
    • #4851 : [IE] Delete table rows with context-menu may cause error.
    • -
    • #4951 : Replacing text with empty string was throwing errors.
    • -
    • #4963 : Link dialog was not opening properly for e-mail type links.
    • -
    • #5043 : Removed the possibility of having an unwanted script tag being outputted with the editor contents.
    • -
    • #3678 : There were issues when editing links inside floating divs with IE.
    • -
    • #4763 : Pressing ENTER key with text selected was not deleting the text in some situations.
    • -
    • #5096 : Simple ampersand attribute value doesn't work for more than one occurrence.
    • -
    • #3494 : Context menu is too narrow in some translations.
    • -
    • #5005 : Fixed HTML errors in PHP samples.
    • -
    • #5123 : Fixed broken XHTML in User Interface Languages sample.
    • -
    • #4893 : Editor now understands table cell inline styles.
    • -
    • #4611 : Selection around <select> in editor doesn't cause error anymore.
    • -
    • #4886 : Extra BR tags were being created in the output HTML.
    • -
    • #4933 : Empty tags with BR were being left in the DOM.
    • -
    • #5127 : There were errors when removing dialog definition pages through code.
    • -
    • #4767 : CKEditor was not working when ckeditor_source.js is loaded in the <body> .
    • -
    • #5062 : Avoided security warning message when loading the wysiwyg area in IE6 under HTTPS.
    • -
    • #5135 : The TAB key will now behave properly when in Source mode.
    • -
    • #4988 : It wasn't possible to use forcePasteAsPlainText with Safari on Mac.
    • -
    • #5095 : Safari on Mac deleted the current selection in the editor when Edit menu was clicked.
    • -
    • #5140 : In High Contrast mode, arrows were now been displayed for menus with submenus.
    • -
    • #5163 : The undo system was not working on some specific cases.
    • -
    • #5162 : The ajax sample was throwing errors when loading data.
    • -
    • #4999 : The Template dialog was not generating an undo snapshot.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.1

    -

    - New features:

    -
      -
    • #4067 : Introduced the full page editing support (from <html> to </html>).
    • -
    • #4228 : Introduced the Shared Spaces feature.
    • -
    • #4379 : Introduced the new powerful pasting system and word cleanup procedure, including enhancements to the paste as plain text feature.
    • -
    • #2872 : Introduced the new native PHP API, the first standardized server side support.
    • -
    • #4210 : Added CKEditor plugin for jQuery.
    • -
    • #2885 : Added 'div' dialog and corresponding context menu options.
    • -
    • #4574 : Added the table merging tools and corresponding context menu options.
    • -
    • #4340 : Added the email protection option for link dialog.
    • -
    • #4463 : Added inline CSS support in all places where custom stylesheet could apply.
    • -
    • #3881 : Added color dialog for 'more color' option in color buttons.
    • -
    • #4341 : Added the 'showborder' plugin.
    • -
    • #4549 : Make the anti-cache query string configurable.
    • -
    • #4708 : Added the 'htmlEncodeOutput' config option.
    • -
    • #4342 : Introduced the bodyId and bodyClass settings to specify the id and class. to be used in the editing area at runtime.
    • -
    • #3401 : Introduced the baseHref setting so it's possible to set the URL to be used to resolve absolute and relative URLs in the contents.
    • -
    • #4729 : Added support to fake elements for comments.
    • -
    -

    - Fixed issues:

    -
      -
    • #4707 : Fixed invalid link is requested in image preview.
    • -
    • #4461 : Fixed toolbar separator line along side combo enlarging the toolbar height.
    • -
    • #4596 : Fixed image re-size lock buttons aren't accessible in high-contrast mode.
    • -
    • #4676 : Fixed editing tables using table properties dialog overwrites original style values.
    • -
    • #4714 : Fixed IE6 JavaScript error when editing flash by commit 'Flash' dialog.
    • -
    • #3905 : Fixed 'wysiwyg' mode causes unauthenticated content warnings over SSL in FF 3.5.
    • -
    • #4768 : Fixed open context menu in IE throws js error when focus is not inside document.
    • -
    • #4822 : Fixed applying 'Headers' to existing table does not work in IE.
    • -
    • #4855 : Fixed toolbar doesn't wrap well for 'v2' skin in all browsers.
    • -
    • #4882 : Fixed auto detect paste from MS-Word is not working for Safari.
    • -
    • #4882 : Fixed unexpected margin style left behind on content cleaning up from MS-Word.
    • -
    • #4896 : Fixed paste nested list from MS-Word with measurement units set to cm is broken.
    • -
    • #4899 : Fixed unable to undo pre-formatted style.
    • -
    • #4900 : Fixed ratio-lock inconsistent between browsers.
    • -
    • #4901 : Fixed unable to edit any link with popup window's features in Firefox.
    • -
    • #4904 : Fixed when paste happen from dialog, it always throw JavaScript error.
    • -
    • #4905 : Fixed paste plain text result incorrect when content from dialog.
    • -
    • #4889 : Fixed unable to undo 'New Page' command after typing inside editor.
    • -
    • #4892 : Fixed table alignment style is not properly represented by the wrapping div.
    • -
    • #4918 : Fixed switching mode when maximized is showing background page contents.
    • -
    -

    - CKEditor 3.0.2

    -

    - New features:

    -
      -
    • #4343 : Added the configuration option 'browserContextMenuOnCtrl' so it's possible to enable the default browser context menu by holding the CTRL key.
    • -
    -

    - Fixed issues:

    -
      -
    • #4552 : Fixed float panel doesn't show up since editor instanced been destroyed once.
    • -
    • #3918 : Fixed fake object is editable with Image dialog.
    • -
    • #4053 : Fixed 'Form Properties' missing from context menu when selection collapsed inside form.
    • -
    • #4401 : Fixed customized by removing 'upload' tab page from 'Link dialog' cause JavaScript error.
    • -
    • #4477 : Adding missing tag names in object style elements.
    • -
    • #4567 : Fixed IE throw error when pressing BACKSPACE in source mode.
    • -
    • #4573 : Fixed 'IgnoreEmptyPargraph' config doesn't work with the config 'entities' is set to 'false'.
    • -
    • #4614 : Fixed attribute protection fails because of line-break.
    • -
    • #4546 : Fixed UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.
    • -
    • #4609 : Fixed flash object is lost when loading data from outside editor.
    • -
    • #4625 : Fixed editor stays visible in a div with style 'visibility:hidden'.
    • -
    • #4621 : Fixed clicking below table caused an empty table been generated.
    • -
    • #3373 : Fixed empty context menu when there's no menu item at all.
    • -
    • #4473 : Fixed setting rules on the same element tag name throws error.
    • -
    • #4514 : Fixed press 'Back' button breaks wysiwyg editing mode is Firefox.
    • -
    • #4542 : Fixed unable to access buttons using tab key in Safari and Opera.
    • -
    • #4577 : Fixed relative link url is broken after opening 'Link' dialog.
    • -
    • #4597 : Fixed custom style with same attribute name but different attribute value doesn't work.
    • -
    • #4651 : Fixed 'Deleted' and 'Inserted' text style is not rendering in wysiwyg mode and is wrong is source mode.
    • -
    • #4654 : Fixed 'CKEDITOR.config.font_defaultLabel(fontSize_defaultLabel)' is not working.
    • -
    • #3950 : Fixed table column insertion incorrect when selecting empty cell area.
    • -
    • #3912 : Fixed UIColor not working in IE when page has more than 30+ editors.
    • -
    • #4031 : Fixed mouse cursor on toolbar combo has more than 3 shapes.
    • -
    • #4041 : Fixed open context menu on multiple cells to remove them result in only one removed.
    • -
    • #4185 : Fixed resize handler effect doesn't affect flash object on output.
    • -
    • #4196 : Fixed 'Remove Numbered/Bulleted List' on nested list doesn't work well on nested list.
    • -
    • #4200 : Fixed unable to insert 'password' type filed with attributes.
    • -
    • #4530 : Fixed context menu couldn't open in Opera.
    • -
    • #4536 : Fixed keyboard navigation doesn't work at all in IE quirks mode.
    • -
    • #4584 : Fixed updated link Target field is not updating when updating to certain values.
    • -
    • #4603 : Fixed unable to disable submenu items in contextmenu.
    • -
    • #4672 : Fixed unable to redo the insertion of horizontal line.
    • -
    • #4677 : Fixed 'Tab' key is trapped by hidden dialog elements.
    • -
    • #4073 : Fixed insert template with replace option could result in empty document.
    • -
    • #4455 : Fixed unable to start editing when image inside document not loaded.
    • -
    • #4517 : Fixed 'dialog_backgroundCoverColor' doesn't work on IE6.
    • -
    • #3165 : Fixed enter key in empty list item before nested one result in collapsed line.
    • -
    • #4527 : Fixed checkbox generate invalid 'checked' attribute.
    • -
    • #1659 : Fixed unable to click below content to start editing in IE with 'config.docType' setting to standard compliant.
    • -
    • #3933 : Fixed extra <br> left at the end of document when the last element is a table.
    • -
    • #4736 : Fixed PAGE UP and PAGE DOWN keys in standards mode are not working.
    • -
    • #4725 : Fixed hitting 'enter' before html comment node produces a JavaScript error.
    • -
    • #4522 : Fixed unable to redo when typing after insert an image with relative url.
    • -
    • #4594 : Fixed context menu goes off-screen when mouse is at right had side of screen.
    • -
    • #4673 : Fixed undo not available straight away if shift key is used to enter first character.
    • -
    • #4690 : Fixed the parsing of nested inline elements.
    • -
    • #4450 : Fixed selecting multiple table cells before apply justify commands generates spurious paragraph in Firefox.
    • -
    • #4733 : Fixed dialog opening sometimes hang up Firefox and Safari.
    • -
    • #4498 : Fixed toolbar collapse button missing tooltip.
    • -
    • #4738 : Fixed inserting table inside bold/italic/underline generates error on ENTER_BR mode.
    • -
    • #4246 : Fixed avoid XHTML deprecated attributes for image styling.
    • -
    • #4543 : Fixed unable to move cursor between table and hr.
    • -
    • #4764 : Fixed wrong exception message when CKEDITOR.editor.append() to non-existing elements.
    • -
    • #4521 : Fixed dialog layout in IE6/7 may have scroll-bar and other weird effects.
    • -
    • #4709 : Fixed inconsistent scroll-bar behavior on IE.
    • -
    • #4776 : Fixed preview page failed to open when relative URl contains in document.
    • -
    • #4812 : Fixed 'Esc' key not working on dialogs in Opera.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.0.1

    -

    - New features:

    -
      -
    • #4219 : Added fallback mechanism for config.language.
    • -
    • #4194 : Added support for using multiple css style sheets within the editor.
    • -
    -

    - Fixed issues:

    -
      -
    • #3898 : Added validation for URL value in Image dialog.
    • -
    • #3528 : Fixed Context Menu issue when triggered using Shift+F10.
    • -
    • #4028 : Maximize control's tool tip was wrong once it is maximized.
    • -
    • #4237 : Toolbar is chopped off in Safari browser 3.x.
    • -
    • #4241 : Float panels are left on screen while editor is destroyed.
    • -
    • #4274 : Double click event is incorrect handled in 'divreplace' sample.
    • -
    • #4354 : Fixed TAB key on toolbar to not focus disabled buttons.
    • -
    • #3856 : Fixed focus and blur events in source view mode.
    • -
    • #3438 : Floating panels are off by (-1px, 0px) in RTL mode.
    • -
    • #3370 : Refactored use of CKEDITOR.env.isCustomDomain().
    • -
    • #4230 : HC detection caused js error.
    • -
    • #3978 : Fixed setStyle float on IE7 strict.
    • -
    • #4262 : Tab and Shift+Tab was not working to cycle through CTRL+SHIFT+F10 context menu in IE.
    • -
    • #3633 : Default context menu isn't disabled in toolbar, status bar, panels...
    • -
    • #3897 : Now there is no image previews when the URL is empty in image dialog.
    • -
    • #4048 : Context submenu was lacking uiColor.
    • -
    • #3568 : Dialogs now select all text when tabbing to text inputs.
    • -
    • #3727 : Cell Properties dialog was missing color selection option.
    • -
    • #3517 : Fixed "Match cyclic" field in Find & Replace dialog.
    • -
    • #4368 : borderColor table cell attribute haven't worked for none-IE
    • -
    • #4203 : In IE quirks mode + toolbar collapsed + source mode editing block height was incorrect.
    • -
    • #4387 : Fixed: right clicking in Kama skin can lead to a javascript error.
    • -
    • #4397 : Wysiwyg mode caused the host page scroll.
    • -
    • #4385 : Fixed editor's auto adjusting on DOM structure were confusing the dirty checking mechanism.
    • -
    • #4397 : Fixed regression of [3816] where turn on design mode was causing Firefox3 to scroll the host page.
    • -
    • #4254 : Added basic API sample.
    • -
    • #4107 : Normalize css font-family style text for correct comparision.
    • -
    • #3664 : Insert block element in empty editor document should not create new paragraph.
    • -
    • #4037 : 'id' attribute is missing with Flash dialog advanced page.
    • -
    • #4047 : Delete selected control type element when 'Backspace' is pressed on it.
    • -
    • #4191 : Fixed: dialog changes confirmation on image dialog appeared even when no changes have been made.
    • -
    • #4351 : Dash and dot could appear in attribute names.
    • -
    • #4355 : 'maximize' and 'showblock' commands shouldn't take editor focus.
    • -
    • #4504 : Fixed 'Enter'/'Esc' key is not working on dialog button.
    • -
    • #4245 : 'Strange Template' now come with a style attribute for width.
    • -
    • #4512 : Fixed styles plugin incorrectly adding semicolons to style text.
    • -
    • #3855 : Fixed loading unminified _source files when ckeditor_source.js is used.
    • -
    • #3717 : Dialog settings defaults can now be overridden in-page through the CKEDITOR.config object.
    • -
    • #4481 : The 'stylesCombo_stylesSet' configuration entry didn't work for full URLs.
    • -
    • #4480 : Fixed scope attribute in th.
    • -
    • #4467 : Fixed bug to use custom icon in context menus. Thanks to george.
    • -
    • #4190 : Fixed select field dialog layout in Safari.
    • -
    • #4518 : Fixed unable to open dialog without editor focus in IE.
    • -
    • #4519 : Fixed maximize without editor focus throw error in IE.
    • -
    • Updated the following language files:
    • -
    -

    - CKEditor 3.0

    -

    - New features:

    -
      -
    • #3188 : Introduce - <pre> formatting feature when converting from other blocks.
    • -
    • #4445 : editor::setData now support an optional callback parameter.
    • -
    -

    - Fixed issues:

    -
      -
    • #2856 : Fixed problem with inches in Paste From Word plugin.
    • -
    • #3929 : Using Paste dialog, - the text is pasted into current selection
    • -
    • #3920 : Mouse cursor over characters in - Special Character dialog now is correct
    • -
    • #3882 : Fixed an issue - with PasteFromWord dialog in which default values was ignored
    • -
    • #3859 : Fixed Flash dialog layout in Webkit
    • -
    • #3852 : Disabled textarea resizing in dialogs
    • -
    • #3831 : The attempt to remove the contextmenu plugin - will not anymore break the editor
    • -
    • #3781 : Colorbutton is now disabled in 'source' mode
    • -
    • #3848 : Fixed an issue with Webkit in witch - elements in the Image and Link dialogs had wrong dimensions.
    • -
    • #3808 : Fixed UI Color Picker dialog size in example page.
    • -
    • #3658 : Editor had horizontal scrollbar in IE6.
    • -
    • #3819 : The cursor was not visible - when applying style to collapsed selections in Firefox 2.
    • -
    • #3809 : Fixed beam cursor - when mouse cursor is over text-only buttons in IE.
    • -
    • #3815 : Fixed an issue - with the form dialog in which the "enctype" attribute is outputted as "encoding".
    • -
    • #3785 : Fixed an issue - in CKEDITOR.tools.htmlEncode() which incorrectly outputs &nbsp; in IE8.
    • -
    • #3820 : Fixed an issue in - bullet list command in which a list created at the bottom of another gets merged to the top. -
    • -
    • #3830 : Table cell properties dialog - doesn't apply to all selected cells.
    • -
    • #3835 : Element path is not refreshed - after click on 'newpage'; and safari is not putting focus on document also. -
    • -
    • #3821 : Fixed an issue with JAWS in which - toolbar items are read inconsistently between virtual cursor modes.
    • -
    • #3789 : The "src" attribute - was getting duplicated in some situations.
    • -
    • #3591 : Protecting flash related elements - including '<object>', '<embed>' and '<param>'. -
    • -
    • #3759 : Fixed CKEDITOR.dom.element::scrollIntoView - logic bug which scroll even element is inside viewport. -
    • -
    • #3773 : Fixed remove list will merge lines. -
    • -
    • #3829 : Fixed remove empty link on output data.
    • -
    • #3730 : Indent is performing on the whole - block instead of selected lines in enterMode = BR.
    • -
    • #3844 : Fixed UndoManager register keydown on obsoleted document
    • -
    • #3805 : Enabled SCAYT plugin for IE.
    • -
    • #3834 : Context menu on table caption was incorrect.
    • -
    • #3812 : Fixed an issue in which the editor - may show up empty or uneditable in IE7, 8 and Firefox 3.
    • -
    • #3825 : Fixed JS error when opening spellingcheck.
    • -
    • #3862 : Fixed html parser infinite loop on certain malformed - source code.
    • -
    • #3639 : Button size was inconsistent.
    • -
    • #3874 : Paste as plain text in Safari loosing lines.
    • -
    • #3849 : Fixed IE8 crashes when applying lists and indenting.
    • -
    • #3876 : Changed dialog checkbox and radio labels to explicit labels.
    • -
    • #3843 : Fixed context submenu position in IE 6 & 7 RTL.
    • -
    • #3864 : [FF]Document is not editable after inserting element on a fresh page.
    • -
    • #3883 : Fixed removing inline style logic incorrect on Firefox2.
    • -
    • #3884 : Empty "href" attribute was duplicated on output data.
    • -
    • #3858 : Fixed the issue where toolbars - break up in IE6 and IE7 after the browser is resized.
    • -
    • #3868 : [chrome] SCAYT toolbar options was in reversed order.
    • -
    • #3875 : Fixed an issue in Safari where - table row/column/cell menus are not useable when table cells are selected.
    • -
    • #3896 : The editing area was - flashing when switching forth and back to source view.
    • -
    • #3894 : Fixed an issue where editor failed to initialize when using the on-demand loading way.
    • -
    • #3903 : Color button plugin doesn't read config entry from editor instance correctly.
    • -
    • #3801 : Comments at the start of the document was lost in IE.
    • -
    • #3871 : Unable to redo when undos to the front of snapshots stack.
    • -
    • #3909 : Move focus from editor into a text input control is broken.
    • -
    • #3870 : The empty paragraph - desappears when hitting ENTER after "New Page".
    • -
    • #3887 : Fixed an issue in which the create - list command may leak outside of a selected table cell and into the rest of document.
    • -
    • #3916 : Fixed maximize does not enlarge editor width when width is set.
    • -
    • #3879 : [webkit] Color button panel had incorrect size on first open.
    • -
    • #3839 : Update Scayt plugin to reflect the latest change from SpellChecker.net.
    • -
    • #3742 : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .
    • -
    • #3671 : Fixed body fixing should be applied to the real type under fake elements.
    • -
    • #3836 : Fixed remove list in enterMode=BR will merge sibling text to one line.
    • -
    • #3949 : Fixed enterKey within pre-formatted text introduce wrong line-break.
    • -
    • #3878 : Whenever possible, - dialogs will not present scrollbars if the content is too big for its standard - size.
    • -
    • #3782 : Remove empty list in table cell result in collapsed cell.
    • -
    • Updated the following language files:
    • -
    • #3984 : [IE]The pre-formatted style is generating error.
    • -
    • #3946 : Fixed unable to hide contextmenu.
    • -
    • #3956 : Fixed About dialog in Source Mode for IE.
    • -
    • #3953 : Fixed keystroke for close Paste dialog.
    • -
    • #3951 : Reset size and lock ratio options were not accessible in Image dialog.
    • -
    • #3921 : Fixed Container scroll issue on IE7.
    • -
    • #3940 : Fixed list operation doesn't stop at table.
    • -
    • #3891 : [IE] Fixed 'automatic' font color doesn't work.
    • -
    • #3972 : Fixed unable to remove a single empty list in document in Firefox with enterMode=BR.
    • -
    • #3973 : Fixed list creation error at the end of document.
    • -
    • #3959 : Pasting styled text from word result in content lost.
    • -
    • #3793 : Combined images into sprites.
    • -
    • #3783 : Fixed indenting command in table cells create collapsed paragraph.
    • -
    • #3968 : About dialog layout was broken with IE+Standards+RTL.
    • -
    • #3991 : In IE quirks, text was not visible in v2 and office2003 skins.
    • -
    • #3983 : In IE, we'll now - silently ignore wrong toolbar definition settings which have extra commas being - left around.
    • -
    • Fixed the following test cases:
        -
      • #3992 : core/ckeditor2.html
      • -
      • #4138 : core/plugins.html
      • -
      • #3801 : plugins/htmldataprocessor/htmldataprocessor.html
      • -
    • -
    • #3989 : Host page horizontal scrolling a lot when on having righ-to-left direction.
    • -
    • #4001 : Create link around existing image result incorrect.
    • -
    • #3988 : Destroy editor on form submit event cause error.
    • -
    • #3994 : Insert horizontal line at end of document cause error.
    • -
    • #4074 : Indent error with 'indentClasses' config specified.
    • -
    • #4057 : Fixed anchor is lost after switch between editing modes.
    • -
    • #3644 : Image dialog was missin radio lock.
    • -
    • #4014 : Firefox2 had no dialog button backgrounds.
    • -
    • #4018 : Firefox2 had no richcombo text visible.
    • -
    • #4035 : [IE6] Paste dialog size was too small.
    • -
    • #4049 : Kama skin was too wide with config.width.
    • -
    • The following released files now doesn't require the _source folder
        -
      • #4086 : _samples/ui_languages.html
      • -
      • #4093 : _tests/core/dom/document.html
      • -
      • #4094 : Smiley plugin file
      • -
      • #4097 : No undo/redo support for fontColor and backgroundColor buttons.
      • -
    • -
    • #4085 : Paste and Paste from Word dialogs were not well styled in IE+RTL.
    • -
    • #3982 : Fixed enterKey on empty list item result in weird dom structure.
    • -
    • #4101 : Now it is possible to close dialog before gets focus.
    • -
    • #4075 : [IE6/7]Fixed apply custom inline style with "class" attribute failed.
    • -
    • #4087 : [Firefox]Fixed extra blocks created on create list when full document selected.
    • -
    • #4097 : No undo/redo support for fontColor and backgroundColor buttons.
    • -
    • #4111 : Fixed apply block style after inline style applied on full document error.
    • -
    • #3622 : Fixed shift enter with selection not deleting highlighted text.
    • -
    • #4092 : [IE6] Close button was missing for dialog without multiple tabs.
    • -
    • #4003 : Markup on the image dialog was disrupted when removing the border input.
    • -
    • #4096 : Editor content area was pushed down in IE RTL quirks.
    • -
    • #4112 : [FF] Paste dialog had scrollbars in quirks.
    • -
    • #4118 : Dialog dragging was - occasionally behaving strangely .
    • -
    • #4077 : The toolbar combos - were rendering incorrectly in some languages, like Chinese.
    • -
    • #3622 : The toolbar in the v2 - skin was wrapping improperly in some languages.
    • -
    • #4119 : Unable to edit image link with image dialog.
    • -
    • #4117 : Fixed dialog error when transforming image into button.
    • -
    • #4058 : [FF] wysiwyg mode is sometimes not been activated.
    • -
    • #4114 : [IE] RTE + IE6/IE7 Quirks = dialog mispositoned.
    • -
    • #4123 : Some dialog buttons were broken in IE7 quirks.
    • -
    • #4122 : [IE] The image dialog - was being rendered improperly when loading an image with long URL.
    • -
    • #4144 : Fixed the white-spaces at the end of <pre> is incorrectly removed.
    • -
    • #4143 : Fixed element id is lost when extracting contents from the range.
    • -
    • #4007 : [IE] Source area overflow from editor chrome.
    • -
    • #4145 : Fixed the on demand - ("basic") loading model of the editor.
    • -
    • #4139 : Fixed list plugin regression of [3903].
    • -
    • #4147 : Unify style text normalization logic when comparing styles.
    • -
    • #4150 : Fixed enlarge list result incorrect at the inner boundary of block.
    • -
    • #4164 : Now it is possible to paste text - in Source mode even if forcePasteAsPlainText = true.
    • -
    • #4129 : [FF]Unable to remove list with Ctrl-A.
    • -
    • #4172 : [Safari] The trailing - <br> was not been always added to blank lines ending with &nbsp;.
    • -
    • #4178 : It's now possible to - copy and paste Flash content among different editor instances.
    • -
    • #4193 : Automatic font color produced empty span on Firefox 3.5.
    • -
    • #4186 : [FF] Fixed First open float panel cause host page scrollbar blinking.
    • -
    • #4227 : Fixed destroy editor instance created on textarea which is not within form cause error.
    • -
    • #4240 : Fixed editor name containing hyphen break editor completely.
    • -
    • #3828 : Malformed nested list is now corrected by the parser.
    • -
    -

    - CKEditor 3.0 RC

    -

    - Changelog starts at this release.

    - - - + + + + + Changelog — CKEditor + + + + +

    + CKEditor Changelog +

    +

    + CKEditor 3.6.4

    +

    + Fixed issues:

    +
      +
    • #8887 : Ugly hover effect for buttons in dialog windows due to slightly wrong background position.
    • +
    • #8783 : getAttribute( 'contenteditable' ) returns 'inherited' on IE7 and IE6 for elements created from code.
    • +
    • #8463 : WebKit: Cut/Copy buttons didn't go on "enabled" state after selecting text in the editor.
    • +
    • #9043 : Command newpage didn't return its name when afterCommandExec event was fired.
    • +
    • #9015 : Applied ARIA label on dialog file input element.
    • +
    • #9016 : Applied the "presentation" role on the iframe element in dialog file field markup.
    • +
    • #8949 : Image Properties does not show in context menu when the image is wrapped in a div with the width set.
    • +
    • #9008 : Fixed list items order reversed when merging two lists.
    • +
    • #9042 : [Safari] Fixed pasting left garbage html at the end of document.
    • +
    • #7745 : The list of frames on JAWS will not any more show the "ALT+0 for help" text for the editor entry.
    • +
    • #8979 : Overriding matches will not any more interfere on the Font size combo.
    • +
    • #5447 : Anchor names created by the Link dialog are now trimmed to protect against unwanted spaces.
    • +
    • #8997 : Styles are lost on sub-lists when converting list type.
    • +
    • #8971 : [IE7] Dialog size are stretched when long text field value is received.
    • +
    • #8945 : Fake elements now show alternative text on High Contrast mode.
    • +
    • #8985 : Better handling of Enter key events on dialogs.
    • +
    • #8925 : [Firefox] Unexpected page scroll on large floating block when editor is re-focused.
    • +
    • #8978 : [IE] Saved editor text selection is lost after close menu.
    • +
    • #9022 : [IE7] Fixed wrong selection introduced in empty editor document when click to the bottom-right of the document.
    • +
    • #9034 : [IE7] Fixed JavaScript error caused by drag-to-select at the bottom of the document.
    • +
    • #9057 : Unexpected block established when decreasing indent of a styled list item.
    • +
    • #9063 : Styles on sub-list are lost when decreasing indent of the parent list.
    • +
    • #9047 : [Firefox] Anchors in the preview window will now work properly.
    • +
    • #8941 : [Webkit] Content region disappeared when resizing the browser.
    • +
    • #8968 : [Firefox] The forcePasteAsPlainText configuration is not working when using Ctrl/Cmd-V.
    • +
    • #6217 : Handled Del/Backspace key at the boundary of table to unify the cursor position.
    • +
    • #8950 : Changed the cursor position after calling editor::insertElement on block element.
    • +
    • #9080 : Fixed Backspace key in front of the list item to join with previous line.
    • +
    • #3592 : Removed the "title" field from flash dialog advanced tab.
    • +
    • #9084 : [IE] Dragging absolute positioned elements is now enabled by default.
    • +
    • #8879 : Corrected styling of labels used in dialog windows.
    • +
    • #8921 : [Chrome] Paste on a newly created CKEditor instance does not work on Chrome.
    • +
    • #9036 : Find feature cannot locate certain words while Match Whole Word is enabled.
    • +
    • #9069 : [Chrome] Issue with popups not opening properly on Chrome 20 makes it impossible to view the file browser window.
    • +
    • #5811 : Code for Image dialog is missing dialog dependency.
    • +
    • #5810 : Code for Div Container is missing dialog dependency.
    • +
    • #5809 : Dialog a11yhelp is missing dialog dependency.
    • +
    • #4045 : "Field Name" Column in sample_posteddata.php is to narrow.
    • +
    • Updated the following language files as submitted to the CKEditor UI Translation Center: Bulgarian, Chinese, Czech, Danish, Esperanto, Estonian, Greek, Italian, Norwegian, Portuguese, Romanian, Vietnamese.
    • +
    +

    + CKEditor 3.6.3

    +

    + New features:

    +
      +
    • #7430 : Justify commands now perform alignment on the element when an image is selected.
    • +
    • #8706 : Better ARIA accessibility for the color picker dialog window.
    • +
    • #7366 : Editor paste function is now available on browser toolbar and context menu.
    • +
    +

    + Fixed issues:

    +
      +
    • #8634 : [IE] Command execution always returns true in IE browsers.
    • +
    • #8333 : Dialog windows can now be closed with the Esc key even if there is no Cancel button available.
    • +
    • #8644 : Missing variable declaration in the dialog plugin.
    • +
    • #8699 : Focus is now moved to the clicked button and back to color picker dialog window opener (button) in all browsers after the dialog window is closed.
    • +
    • #8132 : [IE9] Link line gets broken when it contains a br tag.
    • +
    • #8629 : Optimize float panel layout when there is not enough space in the viewport.
    • +
    • #7955 : [FF] Page Up and Page Down in the WYSIWYG mode cause the selection to become lost.
    • +
    • #8698 : Esc key does not close the color picker dialog window.
    • +
    • #8413 : HTML comment nodes break content styling in tables.
    • +
    • #7932, #8643 : [IE] Clicking below the content region scrolls the page to the top.
    • +
    • #5538, #8729 : [IE] Focus jump results in incorrect context menu display.
    • +
    • #6359 : [IE] Selectable area in blank WYSIWYG editor is too small.
    • +
    • #7326, #8074 : [FF] Scrolling does not work correctly in editor with large amount of text.
    • +
    • #8630 : HTML events are now disabled when loading data.
    • +
    • #8433 : [IE9] Use W3C event model.
    • +
    • #8691 : [IE] Pasting invalid HTML crashes the browser.
    • +
    • #8345 : [IE] Selection is not properly restored after closing the Link dialog window.
    • +
    • #6308 : Vertical-only resize imposes fixed width on editor chrome.
    • +
    • #7360 : [WebKit] WYSIWYG area sometimes does not resize with the chrome.
    • +
    • #5527 : Do not encode the # character sent from the file browser.
    • +
    • #8014 : Autogrow now stretches to fit the content when switching editor modes.
    • +
    • #8249 : Inconsistent behavior with the Backspace key used at the start of a list item.
    • +
    • #8617 : [WebKit] Selection becomes broken after an inline style is opened.
    • +
    • #8527 : Insertion with cursor before an empty anchor is error-prone.
    • +
    • #8632 : Cursor panic when the Backspace key is used in a list item.
    • +
    • #8455 : Mousedown focus is too agressive.
    • +
    • #8475 : Issue with deleting elements with inline styling in tables.
    • +
    • #8324 : [IE8] Undo generates an error when a control type element is selected.
    • +
    • #7946 : Find and Replace dialog window result does not scroll into view when the editor is off the viewport.
    • +
    • #8157 : Flash/IFrame dialog window cannot be closed when displayed over Flash/IFrame with dialog_startupFocusTab set to true.
    • +
    • #8305 : Text direction lost when converting a paragraph to a list.
    • +
    • #8379 : The cursor moves to the start of the document when inserting a row or column is undone.
    • +
    • #6666 : Removed references to element.all.
    • +
    • #8732 : Issue when CKEDITOR.range::enlarge passes through comment nodes.
    • +
    • #7492 : The Style system can now use overrides with the same element (change classes instead of nesting).
    • +
    • #6111 : Splitting table cells results in incorrect column spans.
    • +
    • #8247 : [IE] Error when aligning a document with page breaks inside of contents.
    • +
    • #8540 : Orphan texts inside a list or table are now properly fixed.
    • +
    • #8774 : The Entities plugin can now be configured to only output XML entities.
    • +
    • #8602 : Image source is now properly hidden when running data through the data processor.
    • +
    • #8812 : [IE] Issues with the native range translation with comments in the DOM.
    • +
    • #7907 : Decreasing indentation of a RTL block in a list item loses text direction.
    • +
    • #8835 : Right margin on IE<8 removed to avoid mouse click confusion.
    • +
    • #8400 : [IE] Script error when closing the Cell Properties dialog window if the table cell text is selected.
    • +
    • #8248 : [IE8] Issues with Backspace and Del keys when used at the start or end of list items.
    • +
    • #8855 : [Chrome] Issue with the popup window size in Chrome 18 makes it impossible to view the file browser window.
    • +
    • #8407 : Unneeded aria-posinset and aria-setsize for a list block are now removed.
    • +
    • #8701 : Highlight field in the color picker does not show the correct color when keyboard navigation is used.
    • +
    • #8509 : Table height gets copied from the width value when the Advanced tab is hidden.
    • +
    • #8432 : [IE8] openDialog('image') error.
    • +
    • #8493 : [IE] It is impossible to add a link to the selected text.
    • +
    • #8528 : Redundant imagePreviewBoxId in the Image Properties dialog window is now removed.
    • +
    • #8864 : [IE] Fix ARIA presentation of toolbar rich combo in JAWS.
    • +
    • #8459 : Fix wrong undo step on enter key.
    • +
    • #8895 : Editing anchors using the Link dialog window could not work in release version.
    • +
    • #8876 : <link> element in the floating panels have been moved to <head>.
    • +
    • Updated the following language files as submitted to the CKEditor UI Translation Center: Arabic, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, Esperanto, Estonian, Faroese, French, German, Greek, Gujarati, Hindi, Italian, Macedonian, Norwegian (Bokmål and Nynorsk), Polish, Portuguese, Turkish, Uighur, Ukrainian, Vietnamese, Welsh.
    • +
    +

    + CKEditor 3.6.2

    +

    + New features:

    +
      +
    • #6089 : The editor is now enabled on iOS 5 (iPad and iPhone).
    • +
    • #7354 : It is now possible to exit from blockquotes by using the Enter key on empty paragraphs.
    • +
    • #7931 : The mode event now carries the previous editor mode.
    • +
    • #6161 : New autoGrow_onStartup configuration option.
    • +
    • #8052 : autogrow is now available as an editor command.
    • +
    • #3457 : It is now possible to edit the contents of <textarea> elements through the dialog window.
    • +
    • #8242 : The "»" character is now added to the Special Character dialog window.
    • +
    +

    + Fixed issues:

    +
      +
    • #8171, #8172 : Updated links to WebSpellChecker.net.
    • +
    • #8155 : Tooltips in the Special Character dialog window corrected.
    • +
    • #8163 : The name of the filebrowserWindowFeatures configuration setting corrected to match the documented name.
    • +
    • #8124 : The Style fields in Advanced dialog window tabs are now validated according to CSS style attribute syntax.
    • +
    • #8025 : The checkboxes in the Find and Replace dialog window are now part of a fieldset.
    • +
    • #7943 : CSS conflict no longer appears when the page styles set the float property of label elements.
    • +
    • #8016 : [WebKit] Flash content is not visible when previewing content.
    • +
    • #6908 : Text color should always be applied to the linked text.
    • +
    • #7619 : [IE] IFrame shim now consolidates the editor dialog window to avoid having it masked by embedded objects.
    • +
    • #7900 : [FF] Copy/Paste operations for table cells no longer break the Table Properties dialog window.
    • +
    • #7243 : Inline JavaScript events may become corrupted.
    • +
    • #7448 : List creation in RTL blocks is wrongly merged with the above LTR block.
    • +
    • #6957 : Highlighting of searched terms does not reach read-only blocks.
    • +
    • #7948 : Tooltips with information about correct length units are now displayed for the Width/Height fields of the Table Properties dialog window.
    • +
    • #6212 : [WebKit] Editor resize may scroll the host page.
    • +
    • #6540 : [Safari] Editor loses focus on resizing.
    • +
    • #7908 : [IE] Unlink command is sometimes missing from the context menu of a link.
    • +
    • #8159 : Editor fails to load if the browser has no default language set.
    • +
    • #7490 : [IE] Block format leaks to the next unselected line when enterMode is set to BR.
    • +
    • #8087 : Indenting list items may add redundant text direction attributes.
    • +
    • #6200 : Add styling for certain dialog window element types that miss focus outline (like checkbox).
    • +
    • #7894 : Fault tolerance when parsing a malformed link.
    • +
    • #8049 : Bullets/Numbers are invisible for list items with LTR text direction.
    • +
    • #8222 : [IE] Incorrect selection locking after opening a dialog window in some cases.
    • +
    • #7002 : [IE] Undo operation when a table is selected results in an error.
    • +
    • #8232 : [IE] Unable to apply inline style that starts at the end of a link text.
    • +
    • #7153 : Fail to load the source version of the editor after the window is loaded.
    • +
    • #8246 : Bad editing performance on certain document contents.
    • +
    • #7912 : Cursor trapped in an invisible element after pressing the Enter key.
    • +
    • #7645 : Full list or table deletion with the Backspace/Delete key.
    • +
    • #8050 : AutoGrow feature better fits the content styles.
    • +
    • #8349 : [IE9] Larger toolbar top offset on HTML5 pages.
    • +
    • #8352 : [IE9] Toolbar wrapping is incorrect.
    • +
    • #8080 : JavaScript error when inserting a new table row.
    • +
    • Updated the following language files:
        +
      • #8263 : Dutch;
      • +
      • #8238 : Estonian;
      • +
      • #8193 : Finnish;
      • +
      • German;
      • +
      • Hebrew;
      • +
      • #8179 : Hungarian;
      • +
      • #8128 : Italian;
      • +
      • #8371 : Lithuanian;
      • +
      • #8126, #8256 : Norwegian (Bokmal and Nynorsk);
      • +
      • #8356 : Persian;
      • +
      • Polish;
      • +
      • Portuguese (Brazil);
      • +
      • #8151, #8298 : Russian;
      • +
      • Spanish;
      • +
    • +
    +

    + CKEditor 3.6.1

    +

    + New features:

    +
      +
    • #4556 : Initial support for HTML5 elements.
    • +
    • #6492 : The Find/Replace dialog window will now be populated with text selected in the editor.
    • +
    • #7323 : New align property in dialog window UI elements for field alignment.
    • +
    • #6462 : A wider range of CSS length units (like pt and percentage) are now supported in related dialog window fields.
    • +
    • #7911 : New Remove Anchor option is now available in the context menu.
    • +
    • #7387 : Allow styleDefinition to be applied to a set of elements.
    • +
    • #4345 : A new langLoaded event added to CKEDITOR.editor in order to make it possible to perform "by code" language updates.
    • +
    • #7959 : The cursor will now blink in the first cell after a table is inserted.
    • +
    • #7885 : New editor::removeMenuItem API for removing plugin context menu items introduced.
    • +
    • #7991 : Introduce the controlStyle and inputStyle definitions to allow fine-grained controlling of dialog window element styles.
    • +
    +

    + Fixed issues:

    +
      +
    • #7914 : ATTENTION! The signature for the setReadOnly() function has been changed, reversing the meaning of the parameter to be passed to it. Please make sure to update your code when upgrading.
    • +
    • #7657 : Wrong margin mirroring when creating a list from RTL paragraphs.
    • +
    • #7620 : A glitch in list pasting from Microsoft Word caused by broken child references when filtering.
    • +
    • #7811 : [IE] Deleting table row throws a JavaScript error.
    • +
    • #6962 : Changed the CKEDITOR.CTRL, CKEDITOR.SHIFT and CKEDITOR.ALT constant values to avoid collision with any possible Unicode character.
    • +
    • #6263 : Some table cell context menu options may be incorrectly disabled.
    • +
    • #6247 : Focus is not restored properly after a drop-down menu is closed.
    • +
    • #7334 : [IE7] Indentation style does not apply to RTL lists.
    • +
    • #6845 : Spaces inside the URL field in the Link dialog window will now be removed.
    • +
    • #7840 : [IE] Opening the Table Properties dialog window via the context menu causes a JavaScript error.
    • +
    • #7733 : Flash movies inserted with the Flash Properties dialog window are not displaying properly when injected into the page.
    • +
    • #7837 : [IE<8] Inserting a page break results in an error.
    • +
    • #7804 : The HTML5 wbr tag is now recognized by the editor.
    • +
    • #7867 : The file browser for the background image in the Document Properties plugin dialog window does not work.
    • +
    • #7130 : The column resizer gripping area is invading adjacent table cells.
    • +
    • #7844 : [FF] Calling setData() on a hidden editor caused editor not to display.
    • +
    • #7860 : The BBCode plugin was stripping BBCode tags that were not implemented in the plugin, but from now on they will be handled as simple text.
    • +
    • #7321 : [IE6] Contents inside the RTL fields in dialog windows are overflowing.
    • +
    • #7323 : [IE Quirks] Some fields are not centered in the dialog window.
    • +
    • #5955 : Editor accessibility issue with JAWS when a drop-down menu is placed as the first item in the toolbar.
    • +
    • #6671 : [FF] Selection of an item from the Styles drop-down list is not refreshed after the style is removed.
    • +
    • #7879 : The Style and Height/Width fields of the Table Properties dialog window are not synchronized.
    • +
    • #7581 : [IE] The Enter key pressed at the end of a list item containing the start attribute crashes the browser.
    • +
    • #7266 : Dialog window fields that did not pass validation are now ARIA-compatible with aria-invalid.
    • +
    • #7742 : [WebKit] Indentation, alignment, and language direction are not applied on an empty document without the editor being in focus.
    • +
    • #7801 : [Opera] Pasted paragraphs now split partially selected blocks.
    • +
    • #6663 : Table caption that contains rich text is corrupted after an edit done with the Table Properties dialog window.
    • +
    • #7893 : [WebKit, Opera, IE<8] It is impossible to link to anchors in the document.
    • +
    • #7637 : Cursor position might in some cases cause problems after inserting a page break.
    • +
    • #5314 : The aria-selected attribute is not removed when toolbar drop-down menu items are deselected.
    • +
    • #7749 : Small check introduced to avoid issues with custom data processors and the insertHtml function.
    • +
    • #7269 : [WebKit] Paste from Word is including the full file:// URL path for anchor links.
    • +
    • #7584 : Start number of the List dialog window now works with numbered list items.
    • +
    • #6975 : [IE6, IE7] A definition list crashes Internet Explorer on HTML output.
    • +
    • #7841 : Deleting a column with a cell deleted in one of the rows does not work.
    • +
    • #7944 : The Enter key should not split or create new paragraphs inside caption elements.
    • +
    • #7639 : [IE9] Browser might crash when an object is selected in the document.
    • +
    • #7847 : [IE8] Inserting an image with non-secure source in a HTTPS page breaks the dialog window.
    • +
    • #7953 : [IE] Text selection lost after the browser context menu is opened.
    • +
    • #5239 : Inconsistent focus behavior after closing a toolbar drop-down menu.
    • +
    • #6470 : The Start attribute of a Numbered List is rendered incorrectly if the field is left empty.
    • +
    • #7324 : [IE6 Quirks] Context menus are not displayed correctly.
    • +
    • #7566 : BiDi: Increasing indentation of a list item changes the language direction.
    • +
    • #7839 : [IE] Pasting multi-level numbered lists from Microsoft Word does not work properly.
    • +
    • #188 : [IE] Object selection was making the toolbar inactive in some situations.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.6

    +

    + New features:

    +
      +
    • #7044 : New BBCode sample plugin that makes the editor output (one dialect of) BBCode format.
    • +
    • #5647 : Accessibility enhancements to the structure of the toolbar.
    • +
    • #5647 : The Kama skin now presents separators for the toolbar items, making it easier to group buttons and have a cleaner layout.
    • +
    • #5647 : Usability enhancements to keyboard navigation on the toolbar. The Tab key is now used to jump between toolbar groups, while the Arrow keys can be used to cycle within the group. The new toolbarGroupCycling setting can be used to change the Arrow keys behavior.
    • +
    • #1376 : It is now possible to put the editor in the "read-only" state, so that the users would not be able to introduce changes to the contents. Check out the new CKEDITOR.editor::setReadOnly method, the CKEDITOR.editor::readOnly property, the CKEDITOR.editor::readOnly event, and the readOnly setting.
    • +
    • #3582 : New presentation of anchor elements in the WYSIWYG mode.
    • +
    • #6737 : The Format drop-down list will now display the preview of its contents exactly as defined in their style configurations.
    • +
    • #6654 : A new autoParagraph configuration setting is added to disable the auto paragraphing feature.
    • +
    • #901 : New Stylesheet Parser (stylesheetparser) plugin that fills the Styles drop-down list based on the CSS classes available for the content. Check the new sample to learn how to use it.
    • +
    • #2988 : New Document Properties (docprops) plugin that sets the metadata of the page in the Full Page mode.
    • +
    • #7240 : New Developer Tools (devtools) plugin that shows information about dialog window UI elements to allow for easier customization.
    • +
    • #6841 : Pressing the Enter key at the end of a pre-formatted block will now exit from it.
    • +
    • #6850 : The About CKEditor dialog window now contains a link to CKEditor User's Guide.
    • +
    • #5745 : Extra configuration options for the iframeDialog can now be passed.
    • +
    • #6589 : The onDialogEvent function will now be used automatically in the iframeDialog contents if no callback is used on creation.
    • +
    • #7757 : Georgian localization added.
    • +
    +

    + Fixed issues:

    +
      +
    • #6774 : Internal styles are not included in the contents.css sample.
    • +
    • #6521 : Added sample for the TableResize plugin.
    • +
    • #6664 : Page break is sometimes merged into block-level elements.
    • +
    • #7594 : Toolbar keyboard navigation is not possible after recreating the editor.
    • +
    • #6657 : Allow to style the entire dialog window field when the input element is disabled.
    • +
    • Updated the following language files:
        +
      • Hebrew;
      • +
      • Polish;
      • +
    • +
    +

    + CKEditor 3.5.4

    +

    + Fixed issues:

    +
      +
    • Added protection against XSS attacks in PHP samples when displaying element names.
    • +
    • #7347 : The Enter key will no longer be caught by the dialog window covering the editor.
    • +
    • #6718 : Paste from Word command overrides the Force Paste as Plain Text configuration.
    • +
    • #6629 : Padding body is no longer needed when the last block is pre-formatted.
    • +
    • #4844 : [IE] Dialog windows fail to load if there are too many editor instances on the page.
    • +
    • #5788 : HTML parser trims empty spaces following <br> elements.
    • +
    • #7513 : Invalid markup could cause the editor to hang.
    • +
    • #6109 : Paste and Paste as Plain Text dialog windows now use the standard commitContent and setupContent methods.
    • +
    • #7588 : The editor code now has a protection system to avoid issues when including ckeditor.js more than once in the page.
    • +
    • #7322 : Text font plugin now recognizes font family names that contain quotes.
    • +
    • #7540 : Paste from Word introduces wrong spaces.
    • +
    • #7697 : Successive calls of the replace() method did not work after SCAYT context menu initialization.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.5.3

    +

    + New features:

    +
      +
    • #4890 : Added the possibility to edit the rel attribute for links.
    • +
    • #7004 : Allow loading plugin translations even if they are not present in the plugin definition.
    • +
    • #7315 : Firing the resize event on dialog window instances is now possible.
    • +
    • #7259 : Dialog window definition allows to specify initial width and height values.
    • +
    • #7131 : List item numbering is now supported on pasting from Microsoft Word.
    • +
    +

    + Fixed issues:

    +
      +
    • #1272 : [WebKit] It is now possible to apply styles to collapsed selections in Safari and Chrome.
    • +
    • #7054 : The tooltips for special characters are now lowercased, making them more readable.
    • +
    • #7102 : "Replace DIV" sample did not work when double-clicking inside the formatted text.
    • +
    • #7088 : Loading of plugins failed on new instances of the editor after the Insert Special Character dialog window was used.
    • +
    • #6215 : Removal of inline styles now also removes overrides.
    • +
    • #6144 : Rich text drop-down lists have wrong height when toolbar is wrapped.
    • +
    • #6387 : AutoGrow may cause an error when editor instance is destroyed too quickly after a height change.
    • +
    • #6901 : Mixed direction content was not properly respected in a shared toolbar setting.
    • +
    • #4809 : Table-related tags are output in wrong order.
    • +
    • #7092 : Corrupted toolbar button state for inline style after switching to Source.
    • +
    • #6921 : Pasted text marked by SCAYT in one language is not re-checked if another spellchecking language is selected in the editor.
    • +
    • #6614 : Enhancement of the resize handle in RTL.
    • +
    • #5924 : Flash plugin now recognizes Flash content without an embed tag.
    • +
    • #4475 : Protected source in attributes and inline CSS text is not handled correctly.
    • +
    • #6984 : [FF] Trailing line breaks are lost in ENTER_BR.
    • +
    • #6987 : [IE] Text selection lost when calling editor::insertHtml from a dialog window in some situations.
    • +
    • #6865 : BiDi mirroring does not work when a text direction change is done through a dialog window.
    • +
    • #6966 : [IE] Unintended paragraph is created in an empty document in enterMode set for BR and DIV.
    • +
    • #7084 : SCAYT dialog window is now working properly with more than one editor instance in a page.
    • +
    • #6662 : [FF] List structure pasting error caused by a regression from FF3.5.x is now fixed.
    • +
    • #7300 : Link dialog window now loads numeric values correctly.
    • +
    • #7330 : New list items no longer inherit the value attribute from their sibling.
    • +
    • #7293 : The "Automatic" color button is now presented correctly without focus inside the editor.
    • +
    • #7018 : [IE] Toolbar drop-down lists did not have a border around them.
    • +
    • #7073 : Image dialog window no longer allows zero height and width value to be entered.
    • +
    • #7316 : [FF] Clicking on "Paste" button incorrectly breaks the line at the cursor position.
    • +
    • #6751 : Inline whitespaces are incorrectly stripped when pasting from Word.
    • +
    • #6236 : [IE] Fixing malformed nested list structure which was introduced by the Backspace key.
    • +
    • #6649 : [IE] Selection of the full table sometimes does not work.
    • +
    • #6946 : HTML parser is now able to fix orphan list items.
    • +
    • #6861 : Indenting a list item should retain the text direction.
    • +
    • #6938 : Outdenting a list item should retain the text direction.
    • +
    • #6849 : Correct Enter key behavior on list item.
    • +
    • #7113 : [WebKit] Undesired document scroll on click after scrolling.
    • +
    • #6491 : Undesired Image dialog window dimension lock reset on URL change.
    • +
    • #7284 : [FF Quirks] Maximize now works correctly.
    • +
    • #6609 : [IE9] Browser in high contrast mode is not properly detected.
    • +
    • #7222 : [WebKit] Impossible to apply a single style to a collapsed selection without giving the editor focus.
    • +
    • #7180 : [IE9] When using Kama skin and RTL layout dialog window buttons were not being displayed correctly.
    • +
    • #7182 : [IE9] When using Office2003/v2 skin and RTL layout dialog window shadows were corrupted.
    • +
    • #6913 : Invalid escape sequence (\b) was used in the PHP integration.
    • +
    • #5757 : [IE6] Text was not wrapping in the accessibility instructions dialog window.
    • +
    • [6604] : Xml.js and Ajax.js are now available as plugins ('xml' and 'ajax').
    • +
    • #7304 : Microsoft Word cleanup function is not always invoked when clicking on the "Paste From Word" button.
    • +
    • #6658 : [IE] Pasting text from Microsoft Word with one or more tabs between list items was failing.
    • +
    • #7433 : [IE9] ENTER_BR at the end of a block breaks due to an IE9 regression.
    • +
    • #7432 : [WebKit] Unable to create a new list in an empty document.
    • +
    • #4880 : CKEditor changes tag style inside HTML comment with cke_protected.
    • +
    • #7023 : [IE] JavaScript error when a Selection Field is inserted into a page.
    • +
    • #7034 : Inserting special characters into styled text.
    • +
    • #7132 : Paste toolbar buttons are becoming disabled.
    • +
    • #7138 : The api.html sample in Opera does not work as expected.
    • +
    • #7160 : Cannot paste the form element on top of the page.
    • +
    • #7171 : Double-clicking an image in non-editable content opens the editing dialog window.
    • +
    • #7455 : Extra line break is added automatically to the preformatted element.
    • +
    • #7467 : [Firefox] Extra br element is added in a nested list.
    • +
    • Updated the following language files:
        +
      • #7124 : Czech;
      • +
      • #7126 : French;
      • +
      • #7140 : Catalan;
      • +
      • #7215 : Faroese;
      • +
      • #7177 : Finnish;
      • +
      • #7163 : Norwegian (no and nb);
      • +
      • #7219 : Swedish;
      • +
      • #7183 : Afrikaans;
      • +
      • Hebrew;
      • +
      • Spanish;
      • +
      • Polish;
      • +
      • German;
      • +
    • +
    +

    + CKEditor 3.5.2

    +

    + Fixed issues:

    +
      +
    • #7168 : [IE9] Destroying an editor instance throws an error.
    • +
    • #7169 : [IE9] Menu item has incorrect height.
    • +
    • #7178 : [IE9] Read-only attributes do not work in IE9.
    • +
    • #7181 : [IE9] Toolbar items are not aligned in v2 and Office2003 skins.
    • +
    • #7174 : [IE9] Elements path does not load correctly when the editor is switched back from Source to WYSIWYG.
    • +
    +

    + CKEditor 3.5.1

    +

    + New features:

    +
      +
    • #6107 : It is now possible to remove block styles using Styles and Paragraph Format drop-down lists.
    • +
    • #5590 : Remove Format command works in collapsed selections.
    • +
    • #5755 : The dialog_buttonsOrder option now works in Internet Explorer.
    • +
    • #6869 : The data-cke-nostyle attribute (which was introduced for escaping the element from been influenced by the style system since 3.5) is deprecated in favor of the new data-nostyle attribute.
    • +
    • Revised sample pages with code examples and clarifications.
    • +
    +

    + Fixed issues:

    +
      +
    • #5855 : Updating a link multiple times generates wrong href attribute.
    • +
    • #6166 : Error on Maximize command, when the toolbar button is not shown.
    • +
    • #6607 : Table cell "merge down" and "merge right" commands work only once.
    • +
    • #6228 : Merge down does not work, throwing a JavasSript error.
    • +
    • #6625 : BIDI: Mixed LTR/RTL direction causes incorrect behavior.
    • +
    • #6881 : IFrame capitalization is now consistent throughout labels.
    • +
    • #6686 : BIDI: [FF] When we apply explicit language direction to a numbered/bulleted list, the corresponding language direction toolbar icon is not highlighted.
    • +
    • #6566 : It is now possible to exit a blockquote using ENTER_BR.
    • +
    • #6868 : Partial (invalid) list structure crashes the editor on load.
    • +
    • #6804 : Buggy behavior when editing the legend element inside a fieldset.
    • +
    • #6724 : [IE7] Nested list display bug on empty list item.
    • +
    • #6715 : List items do not create paragraphs after the list placed in a table cell is removed.
    • +
    • #6695 : [Webkit] Display bug after the editor is restored from the full screen mode.
    • +
    • #6661 : [IE] Pre-formatted style does not preserve applied text direction.
    • +
    • #6655 : Using the editor resize grip causes small visual offsets.
    • +
    • #6604 : The div element should be used as a formatting block in ENTER_BR.
    • +
    • #6249 : BIDI: List item bullets are off viewport with RTL text direction.
    • +
    • #6610 : BIDI: ENTER_BR change direction in one line out of multiple.
    • +
    • #6872 : [IE] Link target field is not populated properly when no target is set.
    • +
    • #6880 : Samples: Added a user-friendly message for users on servers without PHP support.
    • +
    • #6628 : Setting config.enterMode from PHP fails.
    • +
    • #6278 : Comments were moved above the br tags.
    • +
    • #6687 : Empty tag should be removed in inline-style format.
    • +
    • #6645 : Allow to configure whether " (double quotes) characters should be encoded in the contents.
    • +
    • #6336 : IE: (double)clicking an input type="submit" button submitted the form.
    • +
    • #6646 : Context menu was not working for text inputs present in the initial content.
    • +
    • #6641 : Copying and pasting links inside the editor was not working.
    • +
    • #4208 : The disableObjectResizing setting now works in IE.
    • +
    • #6242 : [IE] Editing existing links with href of a relative path mangles containing text.
    • +
    • #5930 : [IE] Style definitions are no longer lowercased.
    • +
    • #5361 : Preview window's title should reflect the title tag in full page mode.
    • +
    • #5522 : [IE] In versions < 8 or compatibility mode, type="text" was missing in text fields.
    • +
    • #6126 : [IE] Avoid problems if there are two buttons named "submit".
    • +
    • #6791 : [IE7] Editor did not show up when the name of a replaced textarea matched the name of a meta tag in the page.
    • +
    • #5684 : [FF] When forcePasteAsPlainText is used, the cursor disappears after paste.
    • +
    • #6390 : Prevent toolbar dialog window buttons from being clicked twice.
    • +
    • #6684 : [Webkit] Toolbar buttons are not wrapping correctly when the editor is displayed inside a table.
    • +
    • #6703 : [IE] editor focus event not fired in an instance, when a dialog window closes.
    • +
    • #6873 : Difficult to drag the resize grip of the spell checker dialog window.
    • +
    • #6896 : [Webkit] Unable to paste into source area when the editor is maximized.
    • +
    • #6020 : The state of the Cut, Copy, and Paste toolbar now matches the state of the context menu buttons.
    • +
    • #5256 : JavaScript error thrown when percent (%) sign is used in image URL.
    • +
    • #6577 : [FF] Selection error when an element containing the editor instance is hidden.
    • +
    • #5500 : [IE] value attribute of text input dialog window field was missing.
    • +
    • #6665 : [IE] name field of Link dialog window was missing.
    • +
    • #6639 : Line-breaks inside pasted list item from Microsoft Word break the list structure.
    • +
    • #6909 : [IE] GIF icons of toolbar button from custom plugins are not diplayed in zoom level 100%.
    • +
    • #6860 : [FF] Double-clicking the placeholder element in order to open a Placeholder dialog window throws a JavaScript error.
    • +
    • #6630 : Empty pre elements are output differently in various browsers.
    • +
    • #6568 : Insert table row/column does not work with spanning.
    • +
    • #6735 : Inaccurate read-only selection detection.
    • +
    • #6728 : BIDI: Change direction does not work with list nested inside a blockquote.
    • +
    • #6432 : Inserting a table in place of a fully selected list results in a JavaScript error.
    • +
    • #6438 : [IE] Performance enhancement when typing inside an element with many child nodes.
    • +
    • #6970 : [IE] Dialog window shadows were presented inaccurately.
    • +
    • #6672 : [IE] Unnecessary br element is no longer inserted after a form.
    • +
    • #7087 : [FF] Sometimes it was not possible to move cursor out of link at the end of block.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.5

    +

    + New features:

    +
      +
    • #4090 : Full Adobe AIR support.
    • +
    • #5084 : Dialog windows are now resizable with a grip located in the footer.
    • +
    • #5755 : Introduced the dialog_buttonsOrder setting, making it possible to control the buttons order.
    • +
    • #4648 : Added the new iFrame plugin.
    • +
    • #6010 : The Automatic option of the font/background color panel now represents the real color.
    • +
    • #5654 : New "placeholder" plugin.
    • +
    • #6334 : CKEditor now uses HTML5's data-* attributes for its internal attributes.
    • +
    • #6103 : It's now possible to control the styling of inline read-only elements with the disableReadonlyStyling setting. It's also possible to avoid inline-styling any element by setting its "data-cke-nostyle" attribute to "1".
    • +
    • #5404 : fillEmptyBlocks configuration option of v2 is now available.
    • +
    • #5367 : New CKEDITOR.editor#insertText method (check api.html sample page for usages) is now provided to insert plain text into editor.
    • +
    • #5915 : New removeDialogTabs configuration option to hide certain dialog tabs.
    • +
    +

    + Fixed issues:

    +
      +
    • #4821 : Icons in the toolbar were distorted with IE and zoom != 100%.
    • +
    • #5587 : Visual improvements in dialogs, reinforce field label on separate line.
    • +
    • #4652 : Now it's able to disable editor context menu by simply removing the "contextmenu" plugin.
    • +
    • #5599 : Labels of "specialchar" dialog are now translated.
    • +
    • #6419 : [IE] List creation by merging problem.
    • +
    • #6502 : Removed IE6 image preloading, which was used to defect the duplicate request of background images.
    • +
    • #6822 : Added labels to fake objects.
    • +
    • #6898 : [IE6] Toolbar icons becomes invisible in RTL.
    • +
    • Updated the following language files:
        +
      • Hebrew
      • +
    • +
    +

    + CKEditor 3.4.3

    +

    + Fixed issues:

    +
      +
    • #6554 : [Webkit] cannot type after inserting Page Break.
    • +
    • #6569 : Indentation now complies with text direction of the only item.
    • +
    • #6579 : The jQuery adapter was not working properly and was turned on in incompatible environments.
    • +
    • #6644 : Restrict onmousedown handler to the toolbar area.
    • +
    • #6656 : Panelbutton's buttons became active when clicking on Source.
    • +
    • #6248 : Whitespaces (nbsp elements) were incorrectly added into empty table cells and list items.
    • +
    • #6575 : Tabs disappearing in Link dialog window after a specific sequence of actions.
    • +
    • #6510 : Margin mirroring does not respect style configuration.
    • +
    • #6471 : BIDI: Pressing Decrease Indent in an RTL bulleted list causes incorrect behaviour.
    • +
    • #6479 : BIDI: Language direction is not being preserved when pressing Enter after a Paragraph Format was applied.
    • +
    • #6670 : BIDI: Indent & List icons are not reversed when we apply RTL direction to a paragraph with any of Paragraph Formatting options.
    • +
    • #6640 : Floating panels are now being closed when switching modes.
    • +
    • #4790 : Remove list with multiple items in enterBr doesnot preserve line breaks.
    • +
    • #6297 : Floated inline elements are not taking part in behavior of blocks anymore.
    • +
    • #6171 : [Firefox] Opening rich content drop-down list scrolls host page to the top when editor has a vertical scrollbar.
    • +
    • #6330 : List markers from MS Word with Roman numbering are not preserved.
    • +
    • #6720 : Attribute protection might detect wrong elements.
    • +
    • #6580 : [IE9] Flash dialog window does not get filled up.
    • +
    • #6447 : Decreasing indentation of a list with indentClasses config does not work.
    • +
    • #5894 : Adding custom buttons at the bottom of a dialog window does not cause it to expand to include its contents.
    • +
    • #6513 : Wrong ARIA attributes created on list options of Styles drop-down list.
    • +
    • #6150 : [Safari] Color dialog window was broken.
    • +
    • #6747 : Full screen layout issue caused by page element focus outside editor.
    • +
    • #6779 : Clicking the body element on elements path turns the selection on and off immediately.
    • +
    • #6781 : [IE7] Dialog windows are broken with RTL, Office 2003 and v2 skins.
    • +
    • #6798 : [IE7] Dialog window buttons disappearing in RTL after dragging.
    • +
    • #6806 : [IE7] Dialog window buttons invisible on focus.
    • +
    • #6588 : Copy and paste adds <span> if SCAYT is enabled.
    • +
    • #6673 : IE Target combo for Image Link shown as blank even when we select <not set> as an option.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.4.2

    +

    + New features:

    +
      +
    • #5024 : Added a sample that shows how to output HTML that is valid for Flash.
    • +
    +

    + Fixed issues:

    +
      +
    • #5237 : English text in dialogs' title was flipped when using RTL language (office2003 and v2 skins).
    • +
    • #6289 : Deleting nested table removed the parent cell.
    • +
    • #6341 : The editor contents now have the text cursor.
    • +
    • #6153 : Chrome: tab focus is wrong.
    • +
    • #6261 : Focus and infinite loop between multiple editors.
    • +
    • #6170 : Dedicated class names are removed from floating panels when opening another panel.
    • +
    • #6339 : Autogrow plugin now doesn't work on maximized editors.
    • +
    • #6237 : BIDI: Applying same language direction to all paragraphs not working.
    • +
    • #6353 : [IE] Resize was broken with office2003 and v2 skins.
    • +
    • #6375 : Avoiding errors when hiding the editor after the blur event.
    • +
    • #6133 : Styled paragraphs result on buggy list creation.
    • +
    • #5074 : Link target is not removed when changing to popup.
    • +
    • #6408 : [IE] Autogrow now works correctly on Quirks.
    • +
    • #6420 : [IE] The table properties dialog now correctly retrieves the caption text.
    • +
    • #6141 : It was impossible to outdent a list when indentOffset was set to 0.
    • +
    • #6377 : FF width and height are not shown for smiley in Image properties dialog.
    • +
    • #5399 : Lists pasted from Word do not maintain their nesting.
    • +
    • #6225 : [FF] Cannot transform several lines to list with enterMode BR.
    • +
    • #6467 : [FF] It is now possible to disable the plugin command on "mode" event.
    • +
    • #6461 : Attributes are now being kept when changing block formatting.
    • +
    • #6226 : BIDI: Language direction applied to a Paragraph is removed when we apply one of Paragraph formatting options.
    • +
    • #5395 : [Opera] Native context menu incorrectly opened after Opera 10.2.
    • +
    • #6444 : [Opera] Close panels and dialogs don't return focus to wysiwyg frame.
    • +
    • #6332 : IE: V2 skin bottom dialog's border broken.
    • +
    • #5646 : Parser incorrectly removes inline element when there's only one comment node enclosed.
    • +
    • #6189 : Minor code size reduction.
    • +
    • #5045 : uiColor behaved wrong if multiple editors were used with period in their names.
    • +
    • #5766 : Config entry "ignoreEmptyParagraph" should only remove one single empty paragraph in document.
    • +
    • #5931 : Unable to apply inline style because of nested elements with same style name.
    • +
    • #6083 : Dialog close sometimes cause collapsed editor selection before the insertion.
    • +
    • #6253 : BIDI: creating a Numbered/Bulleted list causing improper behavior on bidi.
    • +
    • #4023 : [Opera] Maximize plugin.
    • +
    • #6403 : [Opera] Font name options are not correctly marked in dropdown list.
    • +
    • #4534 : [Opera] Arrow key to navigate through combo list has side effects of window scrolling.
    • +
    • #6534 : [Opera] Menu key brings up both CKEditor and browser context menu.
    • +
    • #6534 : [Opera] Menu key brings up both CKEditor and browser context menu.
    • +
    • #6416 : [IE9] Unable to make text selection with mouse in source area.
    • +
    • #6417 : [IE9] Context menu opens at the upper-left corner always.
    • +
    • #6501 : [IE9] Context menu item layout is broken.
    • +
    • #6099 : BIDI: when we apply explicit language direction to Numbered/Bulleted List the corresponding BIDI Tool bar icon is not highlighted in the Toolbar.
    • +
    • #6100 : BIDI: when we change Table language direction indentation of text in Table cells is not applied correctly.
    • +
    • #6376 : BIDI: buttons should not toggle the base language direction.
    • +
    • #6235 : BIDI: Applying direction to multi-paragraph selection within a div.
    • +
    • #6187 : [IE6] Multi-instance loading produces 404s on background images.
    • +
    • #5446 : Setting config.filebrowserImageBrowseUrl results in displaying also Browser Server on links.
    • +
    • #5626 : CKeditor 3.2.1 : html content attached makes ckeditor crash the browser FF/IE.
    • +
    • #6508 : BiDi: Margin mirroring logic doesn't honor CSS direction.
    • +
    • #6043 : BIDI: When we apply RTL direction to a right aligned Paragraph, Paragraph is not moved to the left & Alignment of Paragraph is not changed.
    • +
    • #6485 : BIDI: When direction is applied on partial selected list, the style is been incorrectly applied to the entire list.
    • +
    • #6087 : Cursor of input fields in dialog isn't visible in RTL.
    • +
    • #5595 : Extra leading spaces added in preformatted block.
    • +
    • #6094 : Match full word option doesn't stop on block boundaries.
    • +
    • #5730 : [Safari] Continual pastes (holding paste key) breaks document contents.
    • +
    • #5850 : [IE] Inline style misbehaviors at the beginning of numbered/bulleted list.
    • +
    • Updated the following language files:
        +
      • #6427 : Ukrainian;
      • +
      • #6464 : Finnish;
      • +
      • Hebrew;
      • +
    • +
    +

    + CKEditor 3.4.1

    +

    + New features:

    + +

    + Fixed issues:

    +
      +
    • #6027 : Modifying Table Properties by selecting more than one cell caused issues.
    • +
    • #6146 : IE: Floating panels were being opened in the wrong place in RTL pages with horizontal scrollbars.
    • +
    • #6055 : The timestamp is now added only once to each loaded file.
    • +
    • #6097 : The bookmarks now use the right name.
    • +
    • #5717 : Removed the scayt_contextMenuOntop setting and the SCAYT context menu options are always on top.
    • +
    • #5956 : [FF] It was impossible to create an editor inside an hidden container.
    • +
    • #5753 : It was impossible to have a default value for the name field in the select dialog.
    • +
    • #6041 : BIDI: Direction of Increase Indent & Decrease Indent icons are not reversed after changing Lang direction to RTL.
    • +
    • #6138 : List indentation is not working.
    • +
    • #5649 : Image dialog too wide when many styles are set.
    • +
    • #5715 : Cell color picker dialog returns focus to document.
    • +
    • #6108 : Fixed div style.
    • +
    • #5336 : Remove object style.
    • +
    • #6155 : [[FF]] Modifying Table Header Properties by selecting first Row, causing several issues.
    • +
    • #6163 : Focus not going to Tabs in Image dialog when we went to Edit the Image.
    • +
    • #6177 : IE we can't start Numbered/Bulleted list on a Empty page.
    • +
    • #6034 : Horizontal Alignment applied to Table cell is not updated correctly in the Toolbar.
    • +
    • #6112 : BIDI: Alignment set to text in Table cell is not shown in the Tool bar when we press Enter to start a new Paragraph.
    • +
    • #6117 : BIDI: Language direction is changing when we come out of Numbered/Bulleted list.
    • +
    • #6182 : Language Direction field on the Advanced tab of Table Properties dialog has a fixed pixel width.
    • +
    • #5487 : Fullpage writer problem with line-break.
    • +
    • #6197 : The CKEDITOR.loader base path auto-detection was not working with the _source folder.
    • +
    • #6240 : Font Names & Font Sizes should be shown Left Align even for RTL Languages.
    • +
    • #5975 : Page-break should have proper Alt Text instead of Unknown object. so that JAWS reads it properly.
    • +
    • #6255 : Inserting a page break as the first node triggered an error.
    • +
    • #6188 : [IE7] Automatic color button had the wrong cursor.
    • +
    • #6129 : The show blocks' labels are now shown in the right for RTL languages.
    • +
    • #5421 : &shy; entity not converted when config.entities=false.
    • +
    • #5769 : xhtml code generation problem &nbsp; instead of &#160; (htmlentities, entities,entities_additional,..., configuration).
    • +
    • #4472 : [FF3] Browser window scrolls to loaded CKEditor.
    • +
    • #6230 : Fixed invalid parameter count for setTimeout function call.
    • +
    • #5335 : Several lines' formatted data will be merged to one line when we apply Numbers/Bullets.
    • +
    • #5353 : wrong width of editor after resize() called in Firefox 3.6.
    • +
    • #5778 : [IE] Unwanted scroll on first mouse right-click.
    • +
    • #5218 : [FF] Copy/paste of an image from same domain changed URL to relative URL.
    • +
    • #6265 : Popup window properties were visible in the link dialog's target tab when nothing was selected.
    • +
    • #6075 : [FF] Newly created links didn't fill in information on edit.
    • +
    • #6183 : The toolbar panels options sometimes had the contents' link color.
    • +
    • #6192 : [WebKit] Inserting smileys was not working because of editor focus issues.
    • +
    • #6178 : [WebKit] Inserting elements by code was failing if the editor didn't receive the focus first.
    • +
    • #6179 : [WebKit] The Image dialog was not working if the editor didn't receive the focus first.
    • +
    • #4657 : [Opera] Styles where not working with collapsed selections.
    • +
    • #5839 : "Insert row after" was removing the ids of the elements from the clicked row.
    • +
    • #6315 : DIV plugin TT #2885 regression.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.4

    +

    + Fixed issues:

    +
      +
    • #6118 : Initial focus is now set to the tabs in the table properties dialog.
    • +
    • #6135 : The dialogadvtab plugin now uses the correct label.
    • +
    • #6125 : Focus was lost after applying commands in Opera.
    • +
    • #6137 : The table dialog was missing the default width value on second opening.
    • +
    +

    + CKEditor 3.4 Beta

    +

    + New features:

    +
      +
    • #5909 : New BiDi feature, making it possible to switch the base language direction of block elements.
    • +
    • #5268 : Introducing the "tableresize" plugin, which makes it possible to resize tables columns by mouse drag. It's not enabled by default, so it must be enabled in the configurations file.
    • +
    • #979 : New enableTabKeyTools configuration to allow using the TAB key to navigate through table cells.
    • +
    • #4606 : Introduce the "autogrow" plugin, which makes the editor resize automatically, based on the contents size.
    • +
    • #5737 : Added support for the HTML5 contenteditable attribute, making it possible to define read only regions into the editor contents.
    • +
    • #5418 : New "Advanced" tab introduced on the Table Properties dialog. It's based on the new dialogadvtab plugin.
    • +
    • #6082 : Introduced the useComputedState setting, making it possible to control whether toolbar features, like alignment and direction, should reflect the "computed" selection states, even when the effective feature value is not applied.
    • +
    +

    + Fixed issues:

    +
      +
    • #5911 : BiDi: List items should support and retain correct base language direction
    • +
    • #5689 : Make it possible to run CKEditor inside of Firefox chrome.
    • +
    • #6042 : It wasn't possible to align a paragraph with the dir attribute to the opposite direction.
    • +
    • #6058 : Fixed a small style glitch with file upload fields in IE+Quirks.
    • +
    +

    + CKEditor 3.3.2

    +

    + New features:

    +
      +
    • #5882 : Introduce the dialog#selectPage event, replicating the OnDialogTabChange feature available in FCKeditor 2.
    • +
    • #5927 : The native controls in ui.dialog.elements can be styled with the controlStyle definition.
    • +
    +

    + Fixed issues:

    +
      +
    • #1644 : Removed references to cursor:hand in the stylesheets.
    • +
    • #5411 : Anchor, hidden fields and Page-Break objects can no longer be resized.
    • +
    • #5456 : Initial focus incorect in api_dialog sample page.
    • +
    • #5628 : Incorrect <pre> siblings merging.
    • +
    • #5829 : Adding validation for start number field in list style dialog.
    • +
    • #5845 : Context menu on empty list item loses selection.
    • +
    • #5860 : [IE] > in attribute values are incorrectly escaped.
    • +
    • #5905 : SCAYT is not any more enabled by default.
    • +
    • #5736 : Improved the text generated for mailto: links if no text was selected.
    • +
    • #4779 : Adjust resize_minWidth and resize_minHeight if smaller than actual dimensions.
    • +
    • #5687 : Navigation through colors is now compatible with RTL.
    • +
    • #4615 : [IE] Text fields are no longer disrupted in dialog with RTL.
    • +
    • #5887 : The number of columns in the smileys table is now configurable via the smiley_columns setting.
    • +
    • #5100 : It was possible to drag&drop some elements like context menu items or dropdown entries.
    • +
    • #5933 : Text color and background color panels don't have scrollbars anymore under office2003 and v2 skins.
    • +
    • #5943 : An error is no longer generated when using percent or pixel values in the image dialog.
    • +
    • #5951 : Avoid problems with security systems due to the usage of UniversalXPConnect.
    • +
    • #5441 : Avoid errors if the editor instance is removed from the DOM before calling its destroy() method.
    • +
    • #4997 : Provide better access to the native input in the ui.dialog.file element.
    • +
    • #5914 : Modified the Smileys dialog to make active only the images and not their borders.
    • +
    • #5565 : The scrollbar does not behaves erratically when opening a rich combo in RTL page.
    • +
    • #5843 : In CKEditor 3.3: When we set the focus in the 'instanceReady' event, FF3.6 is giving js error.
    • +
    • #5902 : paste and pastetext dialogs cannot be skinned easily.
    • +
    • #5959 : Dialog auto focus does not check for hidden tabs.
    • +
    • #5415 : Undo not working when we change the Table Properties for the table on a saved page.
    • +
    • #5435 : IE: we can't start Numbered/Bulleted list in Tables by Clicking on Insert/Remove Numbers/Bullets Icon.
    • +
    • #5832 : The JQuery adapter sample is not working properly with SSL.
    • +
    • #5728 : Text field & Upload Button in Upload Tab of Image Properties dialog are not shown Properly in Arabic.
    • +
    • #5436 : IE: Cursor goes to next Table Cell after we insert a Smiley in the Table Cell.
    • +
    • #5580 : Maximize does not work properly in the Office 2003 and V2 skins.
    • +
    • #5495 : The link dialog was breaking the undo system on some situations.
    • +
    • #5775 : Required field's label to contain a CSS class to allow it to be styled differently.
    • +
    • #5999 : Table dialog rows and columns fields are now marked as required.
    • +
    • #5693 : baseHref detection in the flash dialog now works correctly.
    • +
    • #5690 : Table cell's width attribute is now respected properly.
    • +
    • #5819 : Introducing the new removeFormatCleanup event and making sure remove format doesn't break the showborder plugin.
    • +
    • #5558 : After pasting on WebKit based browsers the editor now scrolls to the end of the pasted content.
    • +
    • #5799 : Correct plugin dependencies for the liststyle plugin with contextMenu and dialog.
    • +
    • #5436 : IE: The cursor was moving to the wrong position when inserting inline elements at the end of cells on tables.
    • +
    • #5984 : Firefox: CTRL+HOME was creating an unwanted empty paragraph at the start of the document.
    • +
    • #5634 : IE: It was needed to click twice in the editor to make it editable on some situations.
    • +
    • #5338 : Pasting from Open Office could lead on error.
    • +
    • #5224 : Some invalid markup could break the editor.
    • +
    • #5455 : It was not possible to remove formatting from pasted content on specific cases.
    • +
    • #5735 : IE: The editor was having focus issues when the previous selection got hidden by scroll operations.
    • +
    • #5563 : Firefox: The disableObjectResizing and disableNativeTableHandles settings stopped working.
    • +
    • #5781 : Firefox: Editing was not possible in an empty document.
    • +
    • #5293 : Firefox: Unwanted BR tags were being left in the editor output when it should be empty.
    • +
    • #5280 : IE: Scrollbars where reacting improperly when clicking in the bar space.
    • +
    • #5840 : Some dialog access keys are conflicting with "Ctrl + A", select all text behavior on text input.
    • +
    • #6059 : Changing list type didn't preserve the list's attributes.
    • +
    • #5193 : In Firefox, the element path options had the text cursor instead of the arrow.
    • +
    • #6073 : The list context menu was showing the wrong option when in a mixed list hierarchy.
    • +
    • #6074 : The Insert Table Column command was duplicating the selected column cells ids.
    • +
    • #6066 : The toolbar combos had the text cursor instead of the arrow.
    • +
    • #6062 : The toolbar buttons had the text cursor instead of the arrow.
    • +
    • #6068 : [IE7] A few labels were hidden in a RTL language.
    • +
    • #6000 : Safari and Chrome where scrolling the contents to the top when moving the focus to the editor.
    • +
    • #6090 : IE: Textarea with selection inside causes Link dialog issues.
    • +
    • #5079 : Page break in lists move to above the list when you switch from WYSIWYG to HTML mode and back.
    • +
    • Updated the following language files:
        +
      • Chinese Simplified;
      • +
      • Hebrew;
      • +
      • #5962 : German;
      • +
      • #5645 : Portuguese;
      • +
      • #5797 : Turkish;
      • +
    • +
    +

    + CKEditor 3.3.1

    +

    + Fixed issues:

    +
      +
    • #5780 : Text selection lost when opening some of the dialogs.
    • +
    • #5787 : Liststyle plugin wasn't packaged into the core (CKEDITOR.resourceManager.load exception).
    • +
    • #5637 : Fix wrong nesting that generated "<head> must be a child of <html>" warning in Webkit.
    • +
    • #5790 : Internal only attributes output on fullpage <html> tag.
    • +
    • #5761 : [IE] Color dialog matrix buttons are barely clickable in quirks mode.
    • +
    • #5759 : [IE] Clicking on the scrollbar and then on the host page causes error.
    • +
    • #5772 : List style dialog is missing tab page ids.
    • +
    • #5782 : [FF] Wysiwyg mode is broken by 'display' style changes on editor's parent DOM tree.
    • +
    • #5801 : [IE] contentEditable="false" doesn't apply in effect on inline-elements.
    • +
    • #5794 : Empty find matching twice results in JavaScript error.
    • +
    • #5732 : If it isn't possible to connect to the SCAYT servers the dialogs might hang in Firefox. Fix for Firefox>=3.6.
    • +
    • #5807 : [FF2] New page command results in uneditable document.
    • +
    • #5807 : [FF2] SCAYT plugin is disabled in Firefox2 due to selection interference.
    • +
    • #5772 : [IE] Some numbered list style types are not supported by IE6/7 and causes JavaScript error.
    • +
    +

    + CKEditor 3.3

    +

    + New features:

    +
      +
    • #635 : The properties dialog will now open when double clicking on objects.
    • +
    • #3893 : It's now possible to indent/outdent lists when selecting the first list item.
    • +
    • #4968 : The contentsLangDirection setting now has a default value 'ui' which inherit language direction from the editor UI language.
    • +
    • #4649 : The color picker dialog is now accessible.
    • +
    • #3593 : The editing area is now enabled by contentEditable="true" instead of designMode="on" to allow creating uneditable content elements in all browsers.
    • +
    • #4056 : Hidden fields will now be displayed as fake element just like in FCKeditor 2.
    • +
    +

    + CKEditor 3.2.2

    +

    + New features:

    +
      +
    • The SCAYT spell checker is now enabled by default through the autoStartup setting.
    • +
    • #5631 : The SCAYT context menu options can now be reorganized through the scayt_contextMenuItemsOrder setting.
    • +
    • #4231 : Introducing the resize_dir setting, to be able to restrict manual resizing of the editor to only one direction (horizontal/vertical).
    • +
    • #5479 : Introducing the classic ASP integration files and samples.
    • +
    • #5024 : Added samples (HTML and XHTML) to show how to output HTML using fonts and other attributes instead of styles.
    • +
    • #4358 : Introduced the List Properties dialog.
    • +
    • #5485 : Adding the contentsLanguage configuration option to be able to set the language for the editor contents.
    • +
    +

    + Fixed issues:

    +
      +
    • #5330 : Corrected detection of CTRL and META keys in Macs for the context menu.
    • +
    • #5434 : Fixed access denied issues with IE when accessing web sites through IPv6 IP addresses.
    • +
    • #4476 : [IE] Inaccessible empty list item contains sub list.
    • +
    • #4881 : [IE] Selection range broken because of cutting a single control type element from it.
    • +
    • #5505 : Image dialog throw JavaScript error when click close dialog before preview area is loading.
    • +
    • #5144 : [Chrome] Paste in Webkit sometimes leaves extra 'div' element.
    • +
    • #5021 : [Firefox] Typing in empty document start from second line when enterMode = CKEDITOR.ENTER_BR.
    • +
    • #5416 : [IE] Delete table throws a error when enterMode = CKEDITOR.ENTER_BR.
    • +
    • #4459 : [IE] Select element is penetrating the maximized editor in IE6.
    • +
    • #5559 : [IE] The first call to setData is affected by iframe cache when loading the wysiwyg mode.
    • +
    • #5567 : [IE] Remove inline styles in some case doesn't join identical siblings.
    • +
    • #5450 : [FireFox] Press ENTER on 'replace' button result wrong.
    • +
    • #5121 : Recognizes the <br /> tag as a separator when apply block styles and enterMode = CKEDITOR.ENTER_BR.
    • +
    • #5575 : CKEDITOR.replaceAll should consider all kind of white spaces between class names.
    • +
    • #5582 : Prevent the default behavior when click the 'x' button to close dialog box.
    • +
    • #5584 : ENTER key with forceEnterMode turns on doesn't inherit current block attributes.
    • +
    • #4797 : [Opera] Press ENTER key in dialog fields to close throws JavaScript error.
    • +
    • #5578 : Add flash fake element align property when switch mode (source to wysiwyg).
    • +
    • #5577 : Update delete column behavior when choose multiple cells in the same column.
    • +
    • #5512 : Open context menu with SHIFT+F10 doesn't get correct editor selection.
    • +
    • #5433 : English protocol text directions in Link dialog are not incorrect in 'rtl' UI languages.
    • +
    • #5553 : Paste dialog clipboard area text direction is incorrect for 'rtl' content languages.
    • +
    • #4734 : Font size resets when font name is changed in an empty numbered list.
    • +
    • #5237 : English text in dialogs' title is flipped when using RTL language.
    • +
    • #3257 : Create list doesn't keep blocks as headings.
    • +
    • #5111 : [Firefox] JAWS doesn't respect PC cursor mode (application role) on toolbar.
    • +
    • #5530 : Page break for printing can't be removed with undo.
    • +
    • #5381 : Unable to place cursor between two paragraphs in body.
    • +
    • #5568 : [IE6/7] Selecting a entire table cell changes the original range.
    • +
    • #5623 : [Firefox] Apply style that edges another inline style result incorrect.
    • +
    • #5586 : [Firefox] Maximize the second editor ruins full screen mode.
    • +
    • #5617 : HTML filter system does not allow two 'text' filter rules.
    • +
    • #5663 : General memory clean up after destroying last instance.
    • +
    • #5461 : [IE] Fix Paste from Word dialog doesn't accept imput problem.
    • +
    • #5676 : Make color buttons use RRGGBB instead of RGB for better compatibility with IE.
    • +
    • #4948 : [Safari] Select the first/last cell of table to open context menu may lead to undetected table.
    • +
    • #5591 : [Firefox] Select a list item makes selected element broken.
    • +
    • #5667 : Pasting in a RTL page content causes shows up the horizontal scrollbar.
    • +
    • #5688 : Duplicate ids are used in dialog definition.
    • +
    • #5719 : [IE] 'change' dialog event should not be triggered when dialog is already closed.
    • +
    • #5747 : [IE] Error thrown when IE input field editing mode is turned on.
    • +
    • #5516 : IE8: Toolbar buttons have higher bottom padding.
    • +
    • #5402 : SHIFT-ENTER could now be used to exit from preformat block.
    • +
    • SCAYT plugin related:
        +
      • #4836 : Using SCAYT result in fragile elements when applying inline styles.
      • +
      • #5425 : [Opera] Disable SCAYT plugin for Opera browser.
      • +
      • #5632 : SCAYT word marker is not visible on text with background-color set.
      • +
      • #4125 : Remove Format command incorrectly removes SCAYT word markers.
      • +
      • #5671 : SCAYT bootstrap script could be added multiple times unnecessarily.
      • +
      • #5573 : SCAYT move cursor position after insert element into marked word text.
      • +
      • #5546 : SCAYT interferes with undo/redo commands.
      • +
      • #5570 : [IE] First enabling SCAYT blind cursor in editor.
      • +
      • #5741 : Enable SCAYT cause error in multiple editor instances.
      • +
      • #5744 : Remove editor with SCAYT enabled in source mode throws error.
      • +
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.2.1

    +

    + New features:

    +
      +
    • #4478 : Enable the SelectAll command in source mode.
    • +
    • #5150 : Allow names in the CKEDITOR.config.colorButton_colors setting.
    • +
    • #4810 : Adding configuration option for image dialog preview area filling text.
    • +
    • #536 : Object style now could be applied on any parent element of current selection.
    • +
    • #5290 : Unified stylesSet loading removing dependencies from the styles combo. + Now the configuration entry is named 'config.stylesSet' instead of config.stylesCombo_stylesSet and the default location + is under the 'styles' plugin instead of 'stylescombo'.
    • +
    • #5352 : Allow to define the stylesSet array in the config object for the editor.
    • +
    • #5302 : Adding config option "forceEnterMode".
    • +
    • #5216 : Extend CKEDITOR.appendTo to allow a data parameter for the initial value.
    • +
    • #5024 : Added sample to show how to output XHTML and avoid deprecated tags.
    • +
    +

    + Fixed issues:

    +
      +
    • #5152 : Indentation using class attribute doesn't work properly.
    • +
    • #4682 : It wasn't possible to edit block elements in IE that had styles like width, height or float.
    • +
    • #4750 : Correcting default order of buttons layout in dialogs on Mac.
    • +
    • #4932 : Fixed collapse button not clickable on simple toolbar.
    • +
    • #5228 : Link dialog is automatically changes protocol when URLs that starts with '?'.
    • +
    • #4877 : Fixed CKEditor displays source code in one long line (IE quirks mode + office2003 skin).
    • +
    • #5132 : Apply inline style leaks into sibling words which are seperated spaces.
    • +
    • #3599 : Background color style on sized text displayed as narrow band behind.
    • +
    • #4661 : Translation missing in link dialog.
    • +
    • #5240 : Flash alignment property is not presented visually on fake element.
    • +
    • #4910 : Pasting in IE scrolls document to the end.
    • +
    • #5041 : Table summary attribute can't be removed with dialog.
    • +
    • #5124 : All inline styles cannot be applied on empty spaces.
    • +
    • #3570 : SCAYT marker shouldn't appear inside elements path bar.
    • +
    • #4553 : Dirty check result incorrect when editor document is empty.
    • +
    • #4555 : Unreleased memory when editor is created and destroyed.
    • +
    • #5118 : Arrow keys navigation in RTL languages is incorrect.
    • +
    • #4721 : Remove attribute 'value' of checkbox in IE.
    • +
    • #5278 : IE: Add validation to check for bad window names of popup window.
    • +
    • #5171 : Dialogs contains lists don't have proper voice labels.
    • +
    • #4791 : Can't place cursor inside a form that end with a checkbox/radio.
    • +
    • #4479 : StylesCombo doesn't reflect the selection state until it's first opened.
    • +
    • #4717 : 'Unlink' and 'Outdent' command buttons should be disabled on editor startup.
    • +
    • #5119 : Disabled command buttons are not being properly styled when focused.
    • +
    • #5307 : Hide dialog page cause problem when there's two tab pages remain.
    • +
    • #5343 : Active list item ARIA role is wrongly placed.
    • +
    • #3599 : Background color style applying to text with font size style has been narrowly rendered.
    • +
    • #4711 : Line break character inside preformatted text makes it unable to type text at the end of previous line.
    • +
    • #4829 : [IE] Apply style from combo has wrong result on manually created selection.
    • +
    • #4830 : Retrieving selected element isn't always right, especially selecting using keyboard (SHIFT+ARROW).
    • +
    • #5128 : Element attribute inside preformatted text is corrupted when converting to other blocks.
    • +
    • #5190 : Template list entry shouldn't gain initial focus open templates list dialog opens.
    • +
    • #5238 : Menu button doesn't display arrow icon in high-contrast mode.
    • +
    • #3576 : Non-attributed element of the same name with the applied style is incorrectly removed.
    • +
    • #5221 : Insert table into empty document cause JavaScript error thrown.
    • +
    • #5242 : Apply 'automatic' color option of text color incorrectly removes background-color style.
    • +
    • #4719 : IE does not escape attribute values properly.
    • +
    • #5170 : Firefox does not insert text into styled element properly.
    • +
    • #4026 : Office2003 skin has no toolbar button borders in High Contrast in IE7.
    • +
    • #4348 : There should have exception thrown when 'CKEDITOR_BASEPATH' couldn't be figured out automatically.
    • +
    • #5364 : Focus may not be put into dialog correctly when dialog skin file is loading slow.
    • +
    • #4016 : Justify the layout of forms select dialog in Chrome and IE7.
    • +
    • #5373 : Variable 'pathBlockElements' defines wrong items in CKEDITOR.dom.elementPath.
    • +
    • #5082 : Ctrl key should be described as Cmd key on Mac.
    • +
    • #5182 : Context menu is not been announced correctly by ATs.
    • +
    • #4898 : Can't navigate outside table under the last paragraph of document.
    • +
    • #4950 : List commands could compromise list item attribute and styles.
    • +
    • #5018 : Find result highlighting remove normal font color styles unintentionally.
    • +
    • #5376 : Unable to exit list from within a empty block under list item.
    • +
    • #5145 : Various SCAYT fixes.
    • +
    • #5319 : Match whole word doesn't work anymore after replacement has happened.
    • +
    • #5363 : 'title' attribute now presents on all editor iframes.
    • +
    • #5374 : Unable to toggle inline style when the selection starts at the linefeed of the previous paragraph.
    • +
    • #4513 : Selected link element is not always correctly detected when using keyboard arrows to perform such selection.
    • +
    • #5372 : Newly created sub list should inherit nothing from the original (parent) list, except the list type.
    • +
    • #5274 : [IE6] Templates preview image is displayed in wrong size.
    • +
    • #5292 : Preview in font size and family doesn't work with custom styles.
    • +
    • #5396 : Selection is lost when use cell properties dialog to change cell type to header.
    • +
    • #4082 : [IE+Quirks] Preview text in the image dialog is not wrapping.
    • +
    • #4197 : Fixing format combo don't hide when editor blur on Safari.
    • +
    • #5401 : The context menu break layout with Office2003 and V2 skin on IE quirks mode.
    • +
    • #4825 : Fixing browser context menu is opened when clicking right mouse button twice.
    • +
    • #5356 : The SCAYT dialog had issues with Prototype enabled pages.
    • +
    • #5266 : SCAYT was disturbing the rendering of TH elements.
    • +
    • #4688 : SCAYT was interfering on checkDirty.
    • +
    • #5429 : High Contrast mode was being mistakenly detected when loading the editor through Dojo's xhrGet.
    • +
    • #5221 : Range is mangled when making collapsed selection in an empty paragraph.
    • +
    • #5261 : Config option 'scayt_autoStartup' slow down editor loading.
    • +
    • #3846 : Google Chrome - No Img properties after inserting.
    • +
    • #5465 : ShiftEnter=DIV doesn't respect list item when pressing ENTER at end of list item.
    • +
    • #5454 : After replaced success, the popup window couldn't be closed and a js error occured.
    • +
    • #4784 : Incorrect cursor position after delete table cells.
    • +
    • #5149 : [FF] Cursor disappears after maximize when the editor has focus.
    • +
    • #5220 : DTD now shows tolerance to <style> appear inside content.
    • +
    • #5440 : Mobile browsers (iPhone, Android...) are marked as incompatible as they don't support editing features.
    • +
    • #5504 : [IE6/7] 'Paste' dialog will always get opened even when user allows the clipboard access dialog when using 'Paste' button.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.2

    +

    + New features:

    +
      +
    • Several accessibility enhancements:
        +
      • #4502 : The editor accessibility is now totally based on WAI-ARIA.
      • +
      • #5015 : Adding accessibility help dialog plugin.
      • +
      • #5014 : Keyboard navigation compliance with screen reader suggested keys.
      • +
      • #4595 : Better accessibility in the Templates dialog.
      • +
      • #3389 : Esc/Arrow Key now works for closing sub menu.
      • +
    • +
    • #4973 : The Style field in the Div Container dialog is now loading the styles defined in the default styleset used by the Styles toolbar combo.
    • +
    +

    + Fixed issues:

    +
      +
    • #5049 : Form Field list command in JAWS incorrectly lists extra fields.
    • +
    • #5008 : Lock/Unlock ratio buttons in the Image dialog was poorly designed in High Contrast mode.
    • +
    • #3980 : All labels in dialogs now use <label> instead of <div>.
    • +
    • #5213 : Reorganization of some entries in the language files to make it more consistent.
    • +
    • #5199 : In IE, single row toolbars didn't have the bottom padding.
    • +
    +

    + CKEditor 3.1.1

    +

    + New features:

    +
      +
    • #4399 : Improved support for external file browsers by allowing executing a callback function.
    • +
    • #4612 : The text of links is now updated if it matches the URL to which it points to.
    • +
    • #4936 : New localization support for the Welsh language.
    • +
    +

    + Fixed issues:

    +
      +
    • #4272 : Kama skin toolbar was broken in IE+Quirks+RTL.
    • +
    • #4987 : Changed the url which is called by the Browser Server button in the Link tab of Image Properties dialog.
    • +
    • #5030 : The CKEDITOR.timestamp wasn't been appended to the skin.js file.
    • +
    • #4993 : Removed the float style from images when the user selects 'not set' for alignment.
    • +
    • #4944 : Fixed a bug where nested list structures with inconsequent levels were not being pasted correctly from MS Word.
    • +
    • #4637 : Table cells' 'nowrap' attribute was not being loaded by the cell property dialog. Thanks to pomu0325.
    • +
    • #4724 : Using the mouse to insert a link in IE might create incorrect results.
    • +
    • #4640 : Small optimizations for the fileBrowser plugin.
    • +
    • #4583 : The "Target Frame Name" field is now visible when target is set to 'frame' only.
    • +
    • #4863 : Fixing iframedialog's height doesn't stretch to 100% (except IE Quirks).
    • +
    • #4964 : The BACKSPACE key positioning was not correct in some cases with Firefox.
    • +
    • #4980 : Setting border, vspace and hspace of images to zero was not working.
    • +
    • #4773 : The fileBrowser plugin was overwriting onClick functions eventually defined on fileButton elements.
    • +
    • #4731 : The clipboard plugin was missing a reference to the dialog plugin.
    • +
    • #5051 : The about plugin was missing a reference to the dialog plugin.
    • +
    • #5146 : The wsc plugin was missing a reference to the dialog plugin.
    • +
    • #4632 : The print command will now properly break on the insertion point of page break for printing.
    • +
    • #4862 : The English (United Kingdom) language file has been renamed to en-gb.js.
    • +
    • #4618 : Selecting an emoticon or the lock and reset buttons in the image dialog fired the onBeforeUnload event in IE.
    • +
    • #4678 : It was not possible to set tables' width to empty value.
    • +
    • #5012 : Fixed dependency issues with the menu plugin.
    • +
    • #5040 : The editor will not properly ignore font related settings that have extra item separators (semi-colons).
    • +
    • #4046 : Justify should respect config.enterMode = CKEDITOR.ENTER_BR.
    • +
    • #4622 : Inserting tables multiple times was corrupting the undo system.
    • +
    • #4647 : [IE] Selection on an element within positioned container is lost after open context-menu then click one menu item.
    • +
    • #4683 : Double-quote character in attribute values was not escaped in the editor output.
    • +
    • #4762 : [IE] Unexpected vertical-scrolling behavior happens whenever focus is moving out of editor in source mode.
    • +
    • #4772 : Text color was not being applied properly on links.
    • +
    • #4795 : [IE] Press 'Del' key on horizontal line or table result in error.
    • +
    • #4824 : [IE] <br/> at the very first table cell breaks the editor selection.
    • +
    • #4851 : [IE] Delete table rows with context-menu may cause error.
    • +
    • #4951 : Replacing text with empty string was throwing errors.
    • +
    • #4963 : Link dialog was not opening properly for e-mail type links.
    • +
    • #5043 : Removed the possibility of having an unwanted script tag being outputted with the editor contents.
    • +
    • #3678 : There were issues when editing links inside floating divs with IE.
    • +
    • #4763 : Pressing ENTER key with text selected was not deleting the text in some situations.
    • +
    • #5096 : Simple ampersand attribute value doesn't work for more than one occurrence.
    • +
    • #3494 : Context menu is too narrow in some translations.
    • +
    • #5005 : Fixed HTML errors in PHP samples.
    • +
    • #5123 : Fixed broken XHTML in User Interface Languages sample.
    • +
    • #4893 : Editor now understands table cell inline styles.
    • +
    • #4611 : Selection around <select> in editor doesn't cause error anymore.
    • +
    • #4886 : Extra BR tags were being created in the output HTML.
    • +
    • #4933 : Empty tags with BR were being left in the DOM.
    • +
    • #5127 : There were errors when removing dialog definition pages through code.
    • +
    • #4767 : CKEditor was not working when ckeditor_source.js is loaded in the <body> .
    • +
    • #5062 : Avoided security warning message when loading the wysiwyg area in IE6 under HTTPS.
    • +
    • #5135 : The TAB key will now behave properly when in Source mode.
    • +
    • #4988 : It wasn't possible to use forcePasteAsPlainText with Safari on Mac.
    • +
    • #5095 : Safari on Mac deleted the current selection in the editor when Edit menu was clicked.
    • +
    • #5140 : In High Contrast mode, arrows were now been displayed for menus with submenus.
    • +
    • #5163 : The undo system was not working on some specific cases.
    • +
    • #5162 : The ajax sample was throwing errors when loading data.
    • +
    • #4999 : The Template dialog was not generating an undo snapshot.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.1

    +

    + New features:

    +
      +
    • #4067 : Introduced the full page editing support (from <html> to </html>).
    • +
    • #4228 : Introduced the Shared Spaces feature.
    • +
    • #4379 : Introduced the new powerful pasting system and word cleanup procedure, including enhancements to the paste as plain text feature.
    • +
    • #2872 : Introduced the new native PHP API, the first standardized server side support.
    • +
    • #4210 : Added CKEditor plugin for jQuery.
    • +
    • #2885 : Added 'div' dialog and corresponding context menu options.
    • +
    • #4574 : Added the table merging tools and corresponding context menu options.
    • +
    • #4340 : Added the email protection option for link dialog.
    • +
    • #4463 : Added inline CSS support in all places where custom stylesheet could apply.
    • +
    • #3881 : Added color dialog for 'more color' option in color buttons.
    • +
    • #4341 : Added the 'showborder' plugin.
    • +
    • #4549 : Make the anti-cache query string configurable.
    • +
    • #4708 : Added the 'htmlEncodeOutput' config option.
    • +
    • #4342 : Introduced the bodyId and bodyClass settings to specify the id and class. to be used in the editing area at runtime.
    • +
    • #3401 : Introduced the baseHref setting so it's possible to set the URL to be used to resolve absolute and relative URLs in the contents.
    • +
    • #4729 : Added support to fake elements for comments.
    • +
    +

    + Fixed issues:

    +
      +
    • #4707 : Fixed invalid link is requested in image preview.
    • +
    • #4461 : Fixed toolbar separator line along side combo enlarging the toolbar height.
    • +
    • #4596 : Fixed image re-size lock buttons aren't accessible in high-contrast mode.
    • +
    • #4676 : Fixed editing tables using table properties dialog overwrites original style values.
    • +
    • #4714 : Fixed IE6 JavaScript error when editing flash by commit 'Flash' dialog.
    • +
    • #3905 : Fixed 'wysiwyg' mode causes unauthenticated content warnings over SSL in FF 3.5.
    • +
    • #4768 : Fixed open context menu in IE throws js error when focus is not inside document.
    • +
    • #4822 : Fixed applying 'Headers' to existing table does not work in IE.
    • +
    • #4855 : Fixed toolbar doesn't wrap well for 'v2' skin in all browsers.
    • +
    • #4882 : Fixed auto detect paste from MS-Word is not working for Safari.
    • +
    • #4882 : Fixed unexpected margin style left behind on content cleaning up from MS-Word.
    • +
    • #4896 : Fixed paste nested list from MS-Word with measurement units set to cm is broken.
    • +
    • #4899 : Fixed unable to undo pre-formatted style.
    • +
    • #4900 : Fixed ratio-lock inconsistent between browsers.
    • +
    • #4901 : Fixed unable to edit any link with popup window's features in Firefox.
    • +
    • #4904 : Fixed when paste happen from dialog, it always throw JavaScript error.
    • +
    • #4905 : Fixed paste plain text result incorrect when content from dialog.
    • +
    • #4889 : Fixed unable to undo 'New Page' command after typing inside editor.
    • +
    • #4892 : Fixed table alignment style is not properly represented by the wrapping div.
    • +
    • #4918 : Fixed switching mode when maximized is showing background page contents.
    • +
    +

    + CKEditor 3.0.2

    +

    + New features:

    +
      +
    • #4343 : Added the configuration option 'browserContextMenuOnCtrl' so it's possible to enable the default browser context menu by holding the CTRL key.
    • +
    +

    + Fixed issues:

    +
      +
    • #4552 : Fixed float panel doesn't show up since editor instanced been destroyed once.
    • +
    • #3918 : Fixed fake object is editable with Image dialog.
    • +
    • #4053 : Fixed 'Form Properties' missing from context menu when selection collapsed inside form.
    • +
    • #4401 : Fixed customized by removing 'upload' tab page from 'Link dialog' cause JavaScript error.
    • +
    • #4477 : Adding missing tag names in object style elements.
    • +
    • #4567 : Fixed IE throw error when pressing BACKSPACE in source mode.
    • +
    • #4573 : Fixed 'IgnoreEmptyPargraph' config doesn't work with the config 'entities' is set to 'false'.
    • +
    • #4614 : Fixed attribute protection fails because of line-break.
    • +
    • #4546 : Fixed UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.
    • +
    • #4609 : Fixed flash object is lost when loading data from outside editor.
    • +
    • #4625 : Fixed editor stays visible in a div with style 'visibility:hidden'.
    • +
    • #4621 : Fixed clicking below table caused an empty table been generated.
    • +
    • #3373 : Fixed empty context menu when there's no menu item at all.
    • +
    • #4473 : Fixed setting rules on the same element tag name throws error.
    • +
    • #4514 : Fixed press 'Back' button breaks wysiwyg editing mode is Firefox.
    • +
    • #4542 : Fixed unable to access buttons using tab key in Safari and Opera.
    • +
    • #4577 : Fixed relative link url is broken after opening 'Link' dialog.
    • +
    • #4597 : Fixed custom style with same attribute name but different attribute value doesn't work.
    • +
    • #4651 : Fixed 'Deleted' and 'Inserted' text style is not rendering in wysiwyg mode and is wrong is source mode.
    • +
    • #4654 : Fixed 'CKEDITOR.config.font_defaultLabel(fontSize_defaultLabel)' is not working.
    • +
    • #3950 : Fixed table column insertion incorrect when selecting empty cell area.
    • +
    • #3912 : Fixed UIColor not working in IE when page has more than 30+ editors.
    • +
    • #4031 : Fixed mouse cursor on toolbar combo has more than 3 shapes.
    • +
    • #4041 : Fixed open context menu on multiple cells to remove them result in only one removed.
    • +
    • #4185 : Fixed resize handler effect doesn't affect flash object on output.
    • +
    • #4196 : Fixed 'Remove Numbered/Bulleted List' on nested list doesn't work well on nested list.
    • +
    • #4200 : Fixed unable to insert 'password' type filed with attributes.
    • +
    • #4530 : Fixed context menu couldn't open in Opera.
    • +
    • #4536 : Fixed keyboard navigation doesn't work at all in IE quirks mode.
    • +
    • #4584 : Fixed updated link Target field is not updating when updating to certain values.
    • +
    • #4603 : Fixed unable to disable submenu items in contextmenu.
    • +
    • #4672 : Fixed unable to redo the insertion of horizontal line.
    • +
    • #4677 : Fixed 'Tab' key is trapped by hidden dialog elements.
    • +
    • #4073 : Fixed insert template with replace option could result in empty document.
    • +
    • #4455 : Fixed unable to start editing when image inside document not loaded.
    • +
    • #4517 : Fixed 'dialog_backgroundCoverColor' doesn't work on IE6.
    • +
    • #3165 : Fixed enter key in empty list item before nested one result in collapsed line.
    • +
    • #4527 : Fixed checkbox generate invalid 'checked' attribute.
    • +
    • #1659 : Fixed unable to click below content to start editing in IE with 'config.docType' setting to standard compliant.
    • +
    • #3933 : Fixed extra <br> left at the end of document when the last element is a table.
    • +
    • #4736 : Fixed PAGE UP and PAGE DOWN keys in standards mode are not working.
    • +
    • #4725 : Fixed hitting 'enter' before html comment node produces a JavaScript error.
    • +
    • #4522 : Fixed unable to redo when typing after insert an image with relative url.
    • +
    • #4594 : Fixed context menu goes off-screen when mouse is at right had side of screen.
    • +
    • #4673 : Fixed undo not available straight away if shift key is used to enter first character.
    • +
    • #4690 : Fixed the parsing of nested inline elements.
    • +
    • #4450 : Fixed selecting multiple table cells before apply justify commands generates spurious paragraph in Firefox.
    • +
    • #4733 : Fixed dialog opening sometimes hang up Firefox and Safari.
    • +
    • #4498 : Fixed toolbar collapse button missing tooltip.
    • +
    • #4738 : Fixed inserting table inside bold/italic/underline generates error on ENTER_BR mode.
    • +
    • #4246 : Fixed avoid XHTML deprecated attributes for image styling.
    • +
    • #4543 : Fixed unable to move cursor between table and hr.
    • +
    • #4764 : Fixed wrong exception message when CKEDITOR.editor.append() to non-existing elements.
    • +
    • #4521 : Fixed dialog layout in IE6/7 may have scroll-bar and other weird effects.
    • +
    • #4709 : Fixed inconsistent scroll-bar behavior on IE.
    • +
    • #4776 : Fixed preview page failed to open when relative URl contains in document.
    • +
    • #4812 : Fixed 'Esc' key not working on dialogs in Opera.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.0.1

    +

    + New features:

    +
      +
    • #4219 : Added fallback mechanism for config.language.
    • +
    • #4194 : Added support for using multiple css style sheets within the editor.
    • +
    +

    + Fixed issues:

    +
      +
    • #3898 : Added validation for URL value in Image dialog.
    • +
    • #3528 : Fixed Context Menu issue when triggered using Shift+F10.
    • +
    • #4028 : Maximize control's tool tip was wrong once it is maximized.
    • +
    • #4237 : Toolbar is chopped off in Safari browser 3.x.
    • +
    • #4241 : Float panels are left on screen while editor is destroyed.
    • +
    • #4274 : Double click event is incorrect handled in 'divreplace' sample.
    • +
    • #4354 : Fixed TAB key on toolbar to not focus disabled buttons.
    • +
    • #3856 : Fixed focus and blur events in source view mode.
    • +
    • #3438 : Floating panels are off by (-1px, 0px) in RTL mode.
    • +
    • #3370 : Refactored use of CKEDITOR.env.isCustomDomain().
    • +
    • #4230 : HC detection caused js error.
    • +
    • #3978 : Fixed setStyle float on IE7 strict.
    • +
    • #4262 : Tab and Shift+Tab was not working to cycle through CTRL+SHIFT+F10 context menu in IE.
    • +
    • #3633 : Default context menu isn't disabled in toolbar, status bar, panels...
    • +
    • #3897 : Now there is no image previews when the URL is empty in image dialog.
    • +
    • #4048 : Context submenu was lacking uiColor.
    • +
    • #3568 : Dialogs now select all text when tabbing to text inputs.
    • +
    • #3727 : Cell Properties dialog was missing color selection option.
    • +
    • #3517 : Fixed "Match cyclic" field in Find & Replace dialog.
    • +
    • #4368 : borderColor table cell attribute haven't worked for none-IE
    • +
    • #4203 : In IE quirks mode + toolbar collapsed + source mode editing block height was incorrect.
    • +
    • #4387 : Fixed: right clicking in Kama skin can lead to a javascript error.
    • +
    • #4397 : Wysiwyg mode caused the host page scroll.
    • +
    • #4385 : Fixed editor's auto adjusting on DOM structure were confusing the dirty checking mechanism.
    • +
    • #4397 : Fixed regression of [3816] where turn on design mode was causing Firefox3 to scroll the host page.
    • +
    • #4254 : Added basic API sample.
    • +
    • #4107 : Normalize css font-family style text for correct comparision.
    • +
    • #3664 : Insert block element in empty editor document should not create new paragraph.
    • +
    • #4037 : 'id' attribute is missing with Flash dialog advanced page.
    • +
    • #4047 : Delete selected control type element when 'Backspace' is pressed on it.
    • +
    • #4191 : Fixed: dialog changes confirmation on image dialog appeared even when no changes have been made.
    • +
    • #4351 : Dash and dot could appear in attribute names.
    • +
    • #4355 : 'maximize' and 'showblock' commands shouldn't take editor focus.
    • +
    • #4504 : Fixed 'Enter'/'Esc' key is not working on dialog button.
    • +
    • #4245 : 'Strange Template' now come with a style attribute for width.
    • +
    • #4512 : Fixed styles plugin incorrectly adding semicolons to style text.
    • +
    • #3855 : Fixed loading unminified _source files when ckeditor_source.js is used.
    • +
    • #3717 : Dialog settings defaults can now be overridden in-page through the CKEDITOR.config object.
    • +
    • #4481 : The 'stylesCombo_stylesSet' configuration entry didn't work for full URLs.
    • +
    • #4480 : Fixed scope attribute in th.
    • +
    • #4467 : Fixed bug to use custom icon in context menus. Thanks to george.
    • +
    • #4190 : Fixed select field dialog layout in Safari.
    • +
    • #4518 : Fixed unable to open dialog without editor focus in IE.
    • +
    • #4519 : Fixed maximize without editor focus throw error in IE.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.0

    +

    + New features:

    +
      +
    • #3188 : Introduce + <pre> formatting feature when converting from other blocks.
    • +
    • #4445 : editor::setData now support an optional callback parameter.
    • +
    +

    + Fixed issues:

    +
      +
    • #2856 : Fixed problem with inches in Paste From Word plugin.
    • +
    • #3929 : Using Paste dialog, + the text is pasted into current selection
    • +
    • #3920 : Mouse cursor over characters in + Special Character dialog now is correct
    • +
    • #3882 : Fixed an issue + with PasteFromWord dialog in which default values was ignored
    • +
    • #3859 : Fixed Flash dialog layout in Webkit
    • +
    • #3852 : Disabled textarea resizing in dialogs
    • +
    • #3831 : The attempt to remove the contextmenu plugin + will not anymore break the editor
    • +
    • #3781 : Colorbutton is now disabled in 'source' mode
    • +
    • #3848 : Fixed an issue with Webkit in witch + elements in the Image and Link dialogs had wrong dimensions.
    • +
    • #3808 : Fixed UI Color Picker dialog size in example page.
    • +
    • #3658 : Editor had horizontal scrollbar in IE6.
    • +
    • #3819 : The cursor was not visible + when applying style to collapsed selections in Firefox 2.
    • +
    • #3809 : Fixed beam cursor + when mouse cursor is over text-only buttons in IE.
    • +
    • #3815 : Fixed an issue + with the form dialog in which the "enctype" attribute is outputted as "encoding".
    • +
    • #3785 : Fixed an issue + in CKEDITOR.tools.htmlEncode() which incorrectly outputs &nbsp; in IE8.
    • +
    • #3820 : Fixed an issue in + bullet list command in which a list created at the bottom of another gets merged to the top. +
    • +
    • #3830 : Table cell properties dialog + doesn't apply to all selected cells.
    • +
    • #3835 : Element path is not refreshed + after click on 'newpage'; and safari is not putting focus on document also. +
    • +
    • #3821 : Fixed an issue with JAWS in which + toolbar items are read inconsistently between virtual cursor modes.
    • +
    • #3789 : The "src" attribute + was getting duplicated in some situations.
    • +
    • #3591 : Protecting flash related elements + including '<object>', '<embed>' and '<param>'. +
    • +
    • #3759 : Fixed CKEDITOR.dom.element::scrollIntoView + logic bug which scroll even element is inside viewport. +
    • +
    • #3773 : Fixed remove list will merge lines. +
    • +
    • #3829 : Fixed remove empty link on output data.
    • +
    • #3730 : Indent is performing on the whole + block instead of selected lines in enterMode = BR.
    • +
    • #3844 : Fixed UndoManager register keydown on obsoleted document
    • +
    • #3805 : Enabled SCAYT plugin for IE.
    • +
    • #3834 : Context menu on table caption was incorrect.
    • +
    • #3812 : Fixed an issue in which the editor + may show up empty or uneditable in IE7, 8 and Firefox 3.
    • +
    • #3825 : Fixed JS error when opening spellingcheck.
    • +
    • #3862 : Fixed html parser infinite loop on certain malformed + source code.
    • +
    • #3639 : Button size was inconsistent.
    • +
    • #3874 : Paste as plain text in Safari loosing lines.
    • +
    • #3849 : Fixed IE8 crashes when applying lists and indenting.
    • +
    • #3876 : Changed dialog checkbox and radio labels to explicit labels.
    • +
    • #3843 : Fixed context submenu position in IE 6 & 7 RTL.
    • +
    • #3864 : [FF]Document is not editable after inserting element on a fresh page.
    • +
    • #3883 : Fixed removing inline style logic incorrect on Firefox2.
    • +
    • #3884 : Empty "href" attribute was duplicated on output data.
    • +
    • #3858 : Fixed the issue where toolbars + break up in IE6 and IE7 after the browser is resized.
    • +
    • #3868 : [chrome] SCAYT toolbar options was in reversed order.
    • +
    • #3875 : Fixed an issue in Safari where + table row/column/cell menus are not useable when table cells are selected.
    • +
    • #3896 : The editing area was + flashing when switching forth and back to source view.
    • +
    • #3894 : Fixed an issue where editor failed to initialize when using the on-demand loading way.
    • +
    • #3903 : Color button plugin doesn't read config entry from editor instance correctly.
    • +
    • #3801 : Comments at the start of the document was lost in IE.
    • +
    • #3871 : Unable to redo when undos to the front of snapshots stack.
    • +
    • #3909 : Move focus from editor into a text input control is broken.
    • +
    • #3870 : The empty paragraph + desappears when hitting ENTER after "New Page".
    • +
    • #3887 : Fixed an issue in which the create + list command may leak outside of a selected table cell and into the rest of document.
    • +
    • #3916 : Fixed maximize does not enlarge editor width when width is set.
    • +
    • #3879 : [webkit] Color button panel had incorrect size on first open.
    • +
    • #3839 : Update Scayt plugin to reflect the latest change from SpellChecker.net.
    • +
    • #3742 : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .
    • +
    • #3671 : Fixed body fixing should be applied to the real type under fake elements.
    • +
    • #3836 : Fixed remove list in enterMode=BR will merge sibling text to one line.
    • +
    • #3949 : Fixed enterKey within pre-formatted text introduce wrong line-break.
    • +
    • #3878 : Whenever possible, + dialogs will not present scrollbars if the content is too big for its standard + size.
    • +
    • #3782 : Remove empty list in table cell result in collapsed cell.
    • +
    • Updated the following language files:
    • +
    • #3984 : [IE]The pre-formatted style is generating error.
    • +
    • #3946 : Fixed unable to hide contextmenu.
    • +
    • #3956 : Fixed About dialog in Source Mode for IE.
    • +
    • #3953 : Fixed keystroke for close Paste dialog.
    • +
    • #3951 : Reset size and lock ratio options were not accessible in Image dialog.
    • +
    • #3921 : Fixed Container scroll issue on IE7.
    • +
    • #3940 : Fixed list operation doesn't stop at table.
    • +
    • #3891 : [IE] Fixed 'automatic' font color doesn't work.
    • +
    • #3972 : Fixed unable to remove a single empty list in document in Firefox with enterMode=BR.
    • +
    • #3973 : Fixed list creation error at the end of document.
    • +
    • #3959 : Pasting styled text from word result in content lost.
    • +
    • #3793 : Combined images into sprites.
    • +
    • #3783 : Fixed indenting command in table cells create collapsed paragraph.
    • +
    • #3968 : About dialog layout was broken with IE+Standards+RTL.
    • +
    • #3991 : In IE quirks, text was not visible in v2 and office2003 skins.
    • +
    • #3983 : In IE, we'll now + silently ignore wrong toolbar definition settings which have extra commas being + left around.
    • +
    • Fixed the following test cases:
        +
      • #3992 : core/ckeditor2.html
      • +
      • #4138 : core/plugins.html
      • +
      • #3801 : plugins/htmldataprocessor/htmldataprocessor.html
      • +
    • +
    • #3989 : Host page horizontal scrolling a lot when on having righ-to-left direction.
    • +
    • #4001 : Create link around existing image result incorrect.
    • +
    • #3988 : Destroy editor on form submit event cause error.
    • +
    • #3994 : Insert horizontal line at end of document cause error.
    • +
    • #4074 : Indent error with 'indentClasses' config specified.
    • +
    • #4057 : Fixed anchor is lost after switch between editing modes.
    • +
    • #3644 : Image dialog was missin radio lock.
    • +
    • #4014 : Firefox2 had no dialog button backgrounds.
    • +
    • #4018 : Firefox2 had no richcombo text visible.
    • +
    • #4035 : [IE6] Paste dialog size was too small.
    • +
    • #4049 : Kama skin was too wide with config.width.
    • +
    • The following released files now doesn't require the _source folder
        +
      • #4086 : _samples/ui_languages.html
      • +
      • #4093 : _tests/core/dom/document.html
      • +
      • #4094 : Smiley plugin file
      • +
      • #4097 : No undo/redo support for fontColor and backgroundColor buttons.
      • +
    • +
    • #4085 : Paste and Paste from Word dialogs were not well styled in IE+RTL.
    • +
    • #3982 : Fixed enterKey on empty list item result in weird dom structure.
    • +
    • #4101 : Now it is possible to close dialog before gets focus.
    • +
    • #4075 : [IE6/7]Fixed apply custom inline style with "class" attribute failed.
    • +
    • #4087 : [Firefox]Fixed extra blocks created on create list when full document selected.
    • +
    • #4097 : No undo/redo support for fontColor and backgroundColor buttons.
    • +
    • #4111 : Fixed apply block style after inline style applied on full document error.
    • +
    • #3622 : Fixed shift enter with selection not deleting highlighted text.
    • +
    • #4092 : [IE6] Close button was missing for dialog without multiple tabs.
    • +
    • #4003 : Markup on the image dialog was disrupted when removing the border input.
    • +
    • #4096 : Editor content area was pushed down in IE RTL quirks.
    • +
    • #4112 : [FF] Paste dialog had scrollbars in quirks.
    • +
    • #4118 : Dialog dragging was + occasionally behaving strangely .
    • +
    • #4077 : The toolbar combos + were rendering incorrectly in some languages, like Chinese.
    • +
    • #3622 : The toolbar in the v2 + skin was wrapping improperly in some languages.
    • +
    • #4119 : Unable to edit image link with image dialog.
    • +
    • #4117 : Fixed dialog error when transforming image into button.
    • +
    • #4058 : [FF] wysiwyg mode is sometimes not been activated.
    • +
    • #4114 : [IE] RTE + IE6/IE7 Quirks = dialog mispositoned.
    • +
    • #4123 : Some dialog buttons were broken in IE7 quirks.
    • +
    • #4122 : [IE] The image dialog + was being rendered improperly when loading an image with long URL.
    • +
    • #4144 : Fixed the white-spaces at the end of <pre> is incorrectly removed.
    • +
    • #4143 : Fixed element id is lost when extracting contents from the range.
    • +
    • #4007 : [IE] Source area overflow from editor chrome.
    • +
    • #4145 : Fixed the on demand + ("basic") loading model of the editor.
    • +
    • #4139 : Fixed list plugin regression of [3903].
    • +
    • #4147 : Unify style text normalization logic when comparing styles.
    • +
    • #4150 : Fixed enlarge list result incorrect at the inner boundary of block.
    • +
    • #4164 : Now it is possible to paste text + in Source mode even if forcePasteAsPlainText = true.
    • +
    • #4129 : [FF]Unable to remove list with Ctrl-A.
    • +
    • #4172 : [Safari] The trailing + <br> was not been always added to blank lines ending with &nbsp;.
    • +
    • #4178 : It's now possible to + copy and paste Flash content among different editor instances.
    • +
    • #4193 : Automatic font color produced empty span on Firefox 3.5.
    • +
    • #4186 : [FF] Fixed First open float panel cause host page scrollbar blinking.
    • +
    • #4227 : Fixed destroy editor instance created on textarea which is not within form cause error.
    • +
    • #4240 : Fixed editor name containing hyphen break editor completely.
    • +
    • #3828 : Malformed nested list is now corrected by the parser.
    • +
    +

    + CKEditor 3.0 RC

    +

    + Changelog starts at this release.

    + + + diff --git a/htdocs/includes/ckeditor/INSTALL.html b/htdocs/includes/ckeditor/INSTALL.html index aed6a4750b0..95bed84e8a2 100644 --- a/htdocs/includes/ckeditor/INSTALL.html +++ b/htdocs/includes/ckeditor/INSTALL.html @@ -1,92 +1,92 @@ - - - - - Installation Guide - CKEditor - - - - -

    - CKEditor Installation Guide

    -

    - What's CKEditor?

    -

    - CKEditor is a text editor to be used inside web pages. It's not a replacement - for desktop text editors like Word or OpenOffice, but a component to be used as - part of web applications and web sites.

    -

    - Installation

    -

    - Installing CKEditor is an easy task. Just follow these simple steps:

    -
      -
    1. Download the latest version of the editor from our web site: http://ckeditor.com. You should have already completed - this step, but be sure you have the very latest version.
    2. -
    3. Extract (decompress) the downloaded file into the root of your - web site.
    4. -
    -

    - Note: CKEditor is by default installed in the "ckeditor" - folder. You can place the files in whichever you want though.

    -

    - Checking Your Installation -

    -

    - The editor comes with a few sample pages that can be used to verify that installation - proceeded properly. Take a look at the _samples directory.

    -

    - To test your installation, just call the following page at your web site:

    -
    -http://<your site>/<CKEditor installation path>/_samples/index.html
    -
    -For example:
    -http://www.example.com/ckeditor/_samples/index.html
    -

    - Documentation

    -

    - The full editor documentation is available online at the following address:
    - http://docs.cksource.com/ckeditor

    - - - + + + + + Installation Guide - CKEditor + + + + +

    + CKEditor Installation Guide

    +

    + What's CKEditor?

    +

    + CKEditor is a text editor to be used inside web pages. It's not a replacement + for desktop text editors like Word or OpenOffice, but a component to be used as + part of web applications and web sites.

    +

    + Installation

    +

    + Installing CKEditor is an easy task. Just follow these simple steps:

    +
      +
    1. Download the latest version of the editor from our web site: http://ckeditor.com. You should have already completed + this step, but be sure you have the very latest version.
    2. +
    3. Extract (decompress) the downloaded file into the root of your + web site.
    4. +
    +

    + Note: CKEditor is by default installed in the "ckeditor" + folder. You can place the files in whichever you want though.

    +

    + Checking Your Installation +

    +

    + The editor comes with a few sample pages that can be used to verify that installation + proceeded properly. Take a look at the _samples directory.

    +

    + To test your installation, just call the following page at your web site:

    +
    +http://<your site>/<CKEditor installation path>/_samples/index.html
    +
    +For example:
    +http://www.example.com/ckeditor/_samples/index.html
    +

    + Documentation

    +

    + The full editor documentation is available online at the following address:
    + http://docs.cksource.com/ckeditor

    + + + diff --git a/htdocs/includes/ckeditor/LICENSE.html b/htdocs/includes/ckeditor/LICENSE.html index 67572d5bbb6..910020f91bf 100644 --- a/htdocs/includes/ckeditor/LICENSE.html +++ b/htdocs/includes/ckeditor/LICENSE.html @@ -1,1327 +1,1327 @@ - - - - - License - CKEditor - - -

    - Software License Agreement -

    -

    - CKEditor™ - The text editor for Internet™ - - http://ckeditor.com
    - Copyright © 2003-2012, CKSource - Frederico Knabben. All rights reserved. -

    -

    - Licensed under the terms of any of the following licenses at your choice: -

    - -

    - You are not required to, but if you want to explicitly declare the license you have - chosen to be bound to when using, reproducing, modifying and distributing this software, - just include a text file titled "LEGAL" in your version of this software, indicating - your license choice. In any case, your choice will not restrict any recipient of - your version of this software to use, reproduce, modify and distribute this software - under any of the above licenses. -

    -

    - Sources of Intellectual Property Included in CKEditor -

    -

    - Where not otherwise indicated, all CKEditor content is authored by CKSource engineers - and consists of CKSource-owned intellectual property. In some specific instances, - CKEditor will incorporate work done by developers outside of CKSource with their - express permission. -

    -

    - YUI Test: At _source/tests/yuitest.js - can be found part of the source code of YUI, which is licensed under the terms of - the BSD License. YUI is - Copyright © 2008, Yahoo! Inc. -

    -

    - Trademarks -

    -

    - CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product - names are trademarks, registered trademarks or service marks of their respective - holders. -

    - - + + + + + License - CKEditor + + +

    + Software License Agreement +

    +

    + CKEditor™ - The text editor for Internet™ - + http://ckeditor.com
    + Copyright © 2003-2012, CKSource - Frederico Knabben. All rights reserved. +

    +

    + Licensed under the terms of any of the following licenses at your choice: +

    + +

    + You are not required to, but if you want to explicitly declare the license you have + chosen to be bound to when using, reproducing, modifying and distributing this software, + just include a text file titled "LEGAL" in your version of this software, indicating + your license choice. In any case, your choice will not restrict any recipient of + your version of this software to use, reproduce, modify and distribute this software + under any of the above licenses. +

    +

    + Sources of Intellectual Property Included in CKEditor +

    +

    + Where not otherwise indicated, all CKEditor content is authored by CKSource engineers + and consists of CKSource-owned intellectual property. In some specific instances, + CKEditor will incorporate work done by developers outside of CKSource with their + express permission. +

    +

    + YUI Test: At _source/tests/yuitest.js + can be found part of the source code of YUI, which is licensed under the terms of + the BSD License. YUI is + Copyright © 2008, Yahoo! Inc. +

    +

    + Trademarks +

    +

    + CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product + names are trademarks, registered trademarks or service marks of their respective + holders. +

    + + diff --git a/htdocs/includes/ckeditor/adapters/jquery.js b/htdocs/includes/ckeditor/adapters/jquery.js index f3deeb1a510..1bc36c8674d 100644 --- a/htdocs/includes/ckeditor/adapters/jquery.js +++ b/htdocs/includes/ckeditor/adapters/jquery.js @@ -1,6 +1,6 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -(function(){CKEDITOR.config.jqueryOverrideVal=typeof CKEDITOR.config.jqueryOverrideVal=='undefined'?true:CKEDITOR.config.jqueryOverrideVal;var a=window.jQuery;if(typeof a=='undefined')return;a.extend(a.fn,{ckeditorGet:function(){var b=this.eq(0).data('ckeditorInstance');if(!b)throw 'CKEditor not yet initialized, use ckeditor() with callback.';return b;},ckeditor:function(b,c){if(!CKEDITOR.env.isCompatible)return this;if(!a.isFunction(b)){var d=c;c=b;b=d;}c=c||{};this.filter('textarea, div, p').each(function(){var e=a(this),f=e.data('ckeditorInstance'),g=e.data('_ckeditorInstanceLock'),h=this;if(f&&!g){if(b)b.apply(f,[this]);}else if(!g){if(c.autoUpdateElement||typeof c.autoUpdateElement=='undefined'&&CKEDITOR.config.autoUpdateElement)c.autoUpdateElementJquery=true;c.autoUpdateElement=false;e.data('_ckeditorInstanceLock',true);f=CKEDITOR.replace(h,c);e.data('ckeditorInstance',f);f.on('instanceReady',function(i){var j=i.editor;setTimeout(function(){if(!j.element){setTimeout(arguments.callee,100);return;}i.removeListener('instanceReady',this.callee);j.on('dataReady',function(){e.trigger('setData.ckeditor',[j]);});j.on('getData',function(l){e.trigger('getData.ckeditor',[j,l.data]);},999);j.on('destroy',function(){e.trigger('destroy.ckeditor',[j]);});if(j.config.autoUpdateElementJquery&&e.is('textarea')&&e.parents('form').length){var k=function(){e.ckeditor(function(){j.updateElement();});};e.parents('form').submit(k);e.parents('form').bind('form-pre-serialize',k);e.bind('destroy.ckeditor',function(){e.parents('form').unbind('submit',k);e.parents('form').unbind('form-pre-serialize',k);});}j.on('destroy',function(){e.data('ckeditorInstance',null);});e.data('_ckeditorInstanceLock',null);e.trigger('instanceReady.ckeditor',[j]);if(b)b.apply(j,[h]);},0);},null,null,9999);}else CKEDITOR.on('instanceReady',function(i){var j=i.editor;setTimeout(function(){if(!j.element){setTimeout(arguments.callee,100);return;}if(j.element.$==h)if(b)b.apply(j,[h]);},0);},null,null,9999);});return this;}});if(CKEDITOR.config.jqueryOverrideVal)a.fn.val=CKEDITOR.tools.override(a.fn.val,function(b){return function(c,d){var e=typeof c!='undefined',f;this.each(function(){var g=a(this),h=g.data('ckeditorInstance');if(!d&&g.is('textarea')&&h){if(e)h.setData(c);else{f=h.getData();return null;}}else if(e)b.call(g,c);else{f=b.call(g);return null;}return true;});return e?this:f;};});})(); +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function(){CKEDITOR.config.jqueryOverrideVal=typeof CKEDITOR.config.jqueryOverrideVal=='undefined'?true:CKEDITOR.config.jqueryOverrideVal;var a=window.jQuery;if(typeof a=='undefined')return;a.extend(a.fn,{ckeditorGet:function(){var b=this.eq(0).data('ckeditorInstance');if(!b)throw 'CKEditor not yet initialized, use ckeditor() with callback.';return b;},ckeditor:function(b,c){if(!CKEDITOR.env.isCompatible)return this;if(!a.isFunction(b)){var d=c;c=b;b=d;}c=c||{};this.filter('textarea, div, p').each(function(){var e=a(this),f=e.data('ckeditorInstance'),g=e.data('_ckeditorInstanceLock'),h=this;if(f&&!g){if(b)b.apply(f,[this]);}else if(!g){if(c.autoUpdateElement||typeof c.autoUpdateElement=='undefined'&&CKEDITOR.config.autoUpdateElement)c.autoUpdateElementJquery=true;c.autoUpdateElement=false;e.data('_ckeditorInstanceLock',true);f=CKEDITOR.replace(h,c);e.data('ckeditorInstance',f);f.on('instanceReady',function(i){var j=i.editor;setTimeout(function(){if(!j.element){setTimeout(arguments.callee,100);return;}i.removeListener('instanceReady',this.callee);j.on('dataReady',function(){e.trigger('setData.ckeditor',[j]);});j.on('getData',function(l){e.trigger('getData.ckeditor',[j,l.data]);},999);j.on('destroy',function(){e.trigger('destroy.ckeditor',[j]);});if(j.config.autoUpdateElementJquery&&e.is('textarea')&&e.parents('form').length){var k=function(){e.ckeditor(function(){j.updateElement();});};e.parents('form').submit(k);e.parents('form').bind('form-pre-serialize',k);e.bind('destroy.ckeditor',function(){e.parents('form').unbind('submit',k);e.parents('form').unbind('form-pre-serialize',k);});}j.on('destroy',function(){e.data('ckeditorInstance',null);});e.data('_ckeditorInstanceLock',null);e.trigger('instanceReady.ckeditor',[j]);if(b)b.apply(j,[h]);},0);},null,null,9999);}else CKEDITOR.on('instanceReady',function(i){var j=i.editor;setTimeout(function(){if(!j.element){setTimeout(arguments.callee,100);return;}if(j.element.$==h)if(b)b.apply(j,[h]);},0);},null,null,9999);});return this;}});if(CKEDITOR.config.jqueryOverrideVal)a.fn.val=CKEDITOR.tools.override(a.fn.val,function(b){return function(c,d){var e=typeof c!='undefined',f;this.each(function(){var g=a(this),h=g.data('ckeditorInstance');if(!d&&g.is('textarea')&&h){if(e)h.setData(c);else{f=h.getData();return null;}}else if(e)b.call(g,c);else{f=b.call(g);return null;}return true;});return e?this:f;};});})(); diff --git a/htdocs/includes/ckeditor/ckeditor.js b/htdocs/includes/ckeditor/ckeditor.js index 44b4b2fcb93..ff0442ae112 100644 --- a/htdocs/includes/ckeditor/ckeditor.js +++ b/htdocs/includes/ckeditor/ckeditor.js @@ -1,152 +1,152 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'C6HH5UF',version:'3.6.4',revision:'7575',rnd:Math.floor(Math.random()*900)+100,_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b){var c=a.event.prototype;for(var d in c){if(b[d]==undefined)b[d]=c[d];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d];return e&&e.listeners.length>0;}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(d&&d.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1})d=null;if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,iOS:/(ipad|iphone|ipod)/.test(b),isCustomDomain:function(){if(!this.ie)return false;var g=document.domain,h=window.location.hostname;return g!=h&&g!='['+h+']';},secure:location.protocol=='https:'};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie9Compat=document.documentMode==9;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=d.iOS&&e>=534||!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.webkit?'webkit':'unknown'); -if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?document.documentMode:'7');if(d.quirks)d.cssClass+=' cke_browser_iequirks';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';if(d.air)d.cssClass+=' cke_browser_air';return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=1;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=1;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f'+g+'');else h.push('');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='
    '?function(k){return g(k).replace(/
    /gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'>');}:h,j=g(' ')=='  '?function(k){return i(k).replace(/ /g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'"').replace(//g,'>');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),getNextId:function(){return 'cke_'+this.getNextNumber();},override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h
    ',a.document);a.document.getBody().append(f);}if(!/%$/.test(g)){f.setStyle('width',g);return f.$.clientWidth;}return g;};})(),repeat:function(f,g){return new Array(g+1).join(f);},tryThese:function(){var f;for(var g=0,h=arguments.length;g8))&&i)h=i+':'+h;return new d.nodeList(this.$.getElementsByTagName(h));},getHead:function(){var h=this.$.getElementsByTagName('head')[0];if(!h)h=this.getDocumentElement().append(new d.element('head'),true);else h=new d.element(h);return(this.getHead=function(){return h;})();},getBody:function(){var h=new d.element(this.$.body);return(this.getBody=function(){return h;})();},getDocumentElement:function(){var h=new d.element(this.$.documentElement);return(this.getDocumentElement=function(){return h;})();},getWindow:function(){var h=new d.window(this.$.parentWindow||this.$.defaultView);return(this.getWindow=function(){return h;})();},write:function(h){var i=this;i.$.open('text/html','replace');b.isCustomDomain()&&(i.$.domain=document.domain);i.$.write(h);i.$.close();}});d.node=function(h){if(h){var i=h.nodeType==9?'document':h.nodeType==1?'element':h.nodeType==3?'text':h.nodeType==8?'comment':'domObject';return new d[i](h);}return this;};d.node.prototype=new d.domObject();a.NODE_ELEMENT=1;a.NODE_DOCUMENT=9;a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1; -a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h),k=function(l){if(l.nodeType!=1)return;if(!i)l.removeAttribute('id',false);l.removeAttribute('data-cke-expando',false);if(h){var m=l.childNodes;for(var n=0;n]*>/g,''):i;},getOuterHtml:function(){var j=this;if(j.$.outerHTML)return j.$.outerHTML.replace(/<\?[^>]*>/,'');var i=j.$.ownerDocument.createElement('div');i.appendChild(j.$.cloneNode(true));return i.innerHTML;},setHtml:function(i){return this.$.innerHTML=i;},setText:function(i){h.prototype.setText=this.$.innerText!=undefined?function(j){return this.$.innerText=j;}:function(j){return this.$.textContent=j;};return this.setText(i);},getAttribute:(function(){var i=function(j){return this.$.getAttribute(j,2);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){var n=this;switch(j){case 'class':j='className';break;case 'http-equiv':j='httpEquiv';break;case 'name':return n.$.name;case 'tabindex':var k=i.call(n,j);if(k!==0&&n.$.tabIndex===0)k=null;return k;break;case 'checked':var l=n.$.attributes.getNamedItem(j),m=l.specified?l.nodeValue:n.$.checked;return m?'checked':null;case 'hspace':case 'value':return n.$[j];case 'style':return n.$.style.cssText;case 'contenteditable':case 'contentEditable':return n.$.attributes.getNamedItem('contentEditable').specified?n.$.getAttribute('contentEditable'):null;}return i.call(n,j);};else return i;})(),getChildren:function(){return new d.nodeList(this.$.childNodes);},getComputedStyle:c?function(i){return this.$.currentStyle[e.cssStyleToDomStyle(i)];}:function(i){return this.getWindow().$.getComputedStyle(this.$,'').getPropertyValue(i);},getDtd:function(){var i=f[this.getName()];this.getDtd=function(){return i;};return i;},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var i=this.$.tabIndex;if(i===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)i=-1;return i;}:b.webkit?function(){var i=this.$.tabIndex;if(i==undefined){i=parseInt(this.getAttribute('tabindex'),10);if(isNaN(i))i=-1;}return i;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var i=this.$.nodeName.toLowerCase();if(c&&!(document.documentMode>8)){var j=this.$.scopeName;if(j!='HTML')i=j.toLowerCase()+':'+i;}return(this.getName=function(){return i;})();},getValue:function(){return this.$.value;},getFirst:function(i){var j=this.$.firstChild,k=j&&new d.node(j);if(k&&i&&!i(k))k=k.getNext(i);return k;},getLast:function(i){var j=this.$.lastChild,k=j&&new d.node(j); -if(k&&i&&!i(k))k=k.getPrevious(i);return k;},getStyle:function(i){return this.$.style[e.cssStyleToDomStyle(i)];},is:function(){var i=this.getName();for(var j=0;j0&&(j>2||!k[i[0].nodeName]||j==2&&!k[i[1].nodeName]);},hasAttribute:(function(){function i(j){var k=this.$.attributes.getNamedItem(j);return!!(k&&k.specified);};return c&&b.version<8?function(j){if(j=='name')return!!this.$.name;return i.call(this,j);}:i;})(),hide:function(){this.setStyle('display','none');},moveChildren:function(i,j){var k=this.$;i=i.$;if(k==i)return;var l;if(j)while(l=k.lastChild)i.insertBefore(k.removeChild(l),i.firstChild);else while(l=k.firstChild)i.appendChild(k.removeChild(l));},mergeSiblings:(function(){function i(j,k,l){if(k&&k.type==1){var m=[]; -while(k.data('cke-bookmark')||k.isEmptyInlineRemoveable()){m.push(k);k=l?k.getNext():k.getPrevious();if(!k||k.type!=1)return;}if(j.isIdentical(k)){var n=l?j.getLast():j.getFirst();while(m.length)m.shift().move(j,!l);k.moveChildren(j,!l);k.remove();if(n&&n.type==1)n.mergeSiblings();}}};return function(j){var k=this;if(!(j===false||f.$removeEmpty[k.getName()]||k.is('a')))return;i(k,k.getNext(),true);i(k,k.getPrevious());};})(),show:function(){this.setStyles({display:'',visibility:''});},setAttribute:(function(){var i=function(j,k){this.$.setAttribute(j,k);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(j,k){var l=this;if(j=='class')l.$.className=k;else if(j=='style')l.$.style.cssText=k;else if(j=='tabindex')l.$.tabIndex=k;else if(j=='checked')l.$.checked=k;else if(j=='contenteditable')i.call(l,'contentEditable',k);else i.apply(l,arguments);return l;};else if(b.ie8Compat&&b.secure)return function(j,k){if(j=='src'&&k.match(/^http:\/\//))try{i.apply(this,arguments);}catch(l){}else i.apply(this,arguments);return this;};else return i;})(),setAttributes:function(i){for(var j in i)this.setAttribute(j,i[j]);return this;},setValue:function(i){this.$.value=i;return this;},removeAttribute:(function(){var i=function(j){this.$.removeAttribute(j);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){if(j=='class')j='className';else if(j=='tabindex')j='tabIndex';else if(j=='contenteditable')j='contentEditable';i.call(this,j);};else return i;})(),removeAttributes:function(i){if(e.isArray(i))for(var j=0;j=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:function(){if(c||b.opera){var i=this.$,j=i.getElementsByTagName('*'),k,l=0;i.unselectable='on';while(k=j[l++])switch(k.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break; -default:k.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument(),m=l.getBody(),n=l.$.compatMode=='BackCompat';if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=l.$,q=p.documentElement,r=q.clientTop||m.$.clientTop||0,s=q.clientLeft||m.$.clientLeft||0,t=true;if(c){var u=l.getDocumentElement().contains(D),v=l.getBody().contains(D);t=n&&v||!n&&u;}if(t){j=o.left+(!n&&q.scrollLeft||m.$.scrollLeft);j-=s;k=o.top+(!n&&q.scrollTop||m.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!n){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var j=this.getParent();if(!j)return;do{var k=j.$.clientWidth&&j.$.clientWidth0)n(0,j===true?x.y:j===false?y.y:x.y<0?x.y:y.y); -if(k&&(x.x<0||y.x>0))n(x.x<0?x.x:y.x,0);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});},getDirection:function(i){var j=this;return i?j.getComputedStyle('direction')||j.getDirection()||j.getDocument().$.dir||j.getDocument().getBody().getDirection(1):j.getStyle('direction')||j.getAttribute('dir');},data:function(i,j){i='data-'+i;if(j===undefined)return this.getAttribute(i);else if(j===false)this.removeAttribute(i);else this.setAttribute(i,j);return null;}});(function(){var i={width:['border-left-width','border-right-width','padding-left','padding-right'],height:['border-top-width','border-bottom-width','padding-top','padding-bottom']};function j(k){var l=0;for(var m=0,n=i[k].length;m',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,bidi,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,iframe,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,tab,table,tabletools,templates,toolbar,undo,wsc,wysiwygarea',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer; -j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language||k;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o){var p=typeof l=='string';if(p)l=[l];if(!n)n=a;var q=l.length,r=[],s=[],t=function(y){if(m)if(p)m.call(n,y);else m.call(n,r,s);};if(q===0){t(true);return;}var u=function(y,z){(z?r:s).push(y);if(--q<=0){o&&a.document.getDocumentElement().removeStyle('cursor');t(z);}},v=function(y,z){j[y]=1;var A=k[y];delete k[y];for(var B=0;B1)return;var A=new h('script');A.setAttributes({type:'text/javascript',src:y});if(m)if(c)A.$.onreadystatechange=function(){if(A.$.readyState=='loaded'||A.$.readyState=='complete'){A.$.onreadystatechange=null;v(y,true);}};else{A.$.onload=function(){setTimeout(function(){v(y,true);},0);};A.$.onerror=function(){v(y,false);};}A.appendTo(a.document.getHead());};o&&a.document.getDocumentElement().setStyle('cursor','wait');for(var x=0;x1)return;var w=!p.css||!p.css.length,x=!p.js||!p.js.length,y=function(){if(w&&x){p._isLoaded=1;for(var B=0;B=0?x.langCode:J[0];if(!I.langEntries||!I.langEntries[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.langEntries[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit']; -for(var N=0;N]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))",'g')};};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s);if(r)r.push(t);else A.onText(t);}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(''));r=null;}if(!r){A.onTagClose(p);continue;}}if(r){r.push(o[0]);continue;}if(p=o[3]){p=p.toLowerCase();if(/="/.test(p))continue;var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=='/');if(w)while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||'';if(!z&&m[y])u[y]=y;else u[y]=z;}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p])r=[];continue;}if(p=o[2])A.onComment(p);}if(n.length>q)A.onText(n.substring(q,n.length));}};})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n,this)))return;if(typeof n!='string'){n.parent=this.parent;n.writeHtml(l,m); -return;}}l.comment(n);}};(function(){a.htmlParser.text=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.text.prototype={type:3,writeHtml:function(l,m){var n=this.value;if(m&&!(n=m.onText(n,this)))return;l.text(n);}};})();(function(){a.htmlParser.cdata=function(l){this.value=l;};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value);}};})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var l=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),m=c&&b.version<8?{dd:1,dt:1}:{},n={ol:1,ul:1},o=e.extend({},{html:1},f.html,f.body,f.head,{style:1,script:1});function p(q){return q.name=='a'&&q.attributes.href||f.$removeEmpty[q.name];};a.htmlParser.fragment.fromHtml=function(q,r,s){var t=new a.htmlParser(),u=s||new a.htmlParser.fragment(),v=[],w=[],x=u,y=false,z=false;function A(D){var E;if(v.length>0)for(var F=0;F=0;E--){if(D==v[E].name){v.splice(E,1);return;}}var F=[],G=[],H=x;while(H!=u&&H.name!=D){if(!H._.isBlockLike)G.unshift(H);F.push(H);H=H.returnPoint||H.parent;}if(H!=u){for(E=0;E0?t.children[r-1]:null;if(s){if(q._.isBlockLike&&s.type==3){s.value=e.rtrim(s.value);if(s.value.length===0){t.children.pop();t.add(q);return;}}s.next=q;}q.previous=s;q.parent=t;t.children.splice(r,0,q);t._.hasInlineStarted=q.type==3||q.type==1&&!q._.isBlockLike;},writeHtml:function(q,r){var s;this.filterChildren=function(){var t=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,t,r,true);var u=t.getHtml();this.children=new a.htmlParser.fragment.fromHtml(u).children;s=1;};!this.name&&r&&r.onFragment(this);this.writeChildrenHtml(q,s?null:r);},writeChildrenHtml:function(q,r){for(var s=0;sn?1:0;};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes);},writeHtml:function(m,n){var o=this.attributes,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var B=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,B,n);p.children=new a.htmlParser.fragment.fromHtml(B.getHtml(),0,p.clone()).children;u=1;}};if(n){for(;;){if(!(q=n.onElementName(q)))return;p.name=q;if(!(p=n.onElement(p)))return;p.parent=this.parent;if(p.name==q)break;if(p.type!=1){p.writeHtml(m,n);return;}q=p.name;if(!q){for(var v=0,w=this.children.length;v=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=q.type||q instanceof a.htmlParser.fragment;for(var s=0;s');else this._.output.push('>');},attribute:function(l,m){if(typeof m=='string')m=e.htmlEncodeAttr(m);this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){this._.output.push('');},text:function(l){this._.output.push(l);},comment:function(l){this._.output.push('');},write:function(l){this._.output.push(l);},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(l){var m=this._.output.join('');if(l)this.reset();return m;}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on('focus',function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire('currentInstance');}});l.on('blur',function(){if(a.currentInstance==l){a.currentInstance=null;a.fire('currentInstance');}});};a.remove=function(l){delete a.instances[l.name];};a.on('instanceDestroyed',function(){if(e.isEmpty(this.instances))a.fire('reset'); -});a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=function(l,m){if(typeof l=='string')l=(m?m.$:document).createComment(l);d.domObject.call(this,l);};d.comment.prototype=new d.node();e.extend(d.comment.prototype,{type:8,getOuterHtml:function(){return '';}});(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1,legend:1,caption:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,form:1,fieldset:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q0)v=v.getChild(z-1);else v=A(v,true)===false?null:v.getPreviousSourceNode(true,C,A);}else{v=w;if(v.type==1)if(!(v=v.getChild(y)))v=A(w,true)===false?null:w.getNextSourceNode(true,C,A);}if(v&&A(v)===false)v=null;}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!t)return v;}else if(t&&this.evaluator)return false;v=v[D](false,C,A);}this.end();return this.current=null;};function m(s){var t,u=null;while(t=l.call(this,s))u=t;return u;};d.walker=e.createClass({$:function(s){this.range=s;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,1);},checkForward:function(){return l.call(this,0,1)!==false;},checkBackward:function(){return l.call(this,1,1)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,1);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1};h.prototype.isBlockBoundary=function(s){var t=s?e.extend({},f.$block,s||{}):f.$block;return this.getComputedStyle('float')=='none'&&n[this.getComputedStyle('display')]||t[this.getName()];};d.walker.blockBoundary=function(s){return function(t,u){return!(t.type==1&&t.isBlockBoundary(s));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmark=function(s,t){function u(v){return v&&v.getName&&v.getName()=='span'&&v.data('cke-bookmark');};return function(v){var w,x;w=v&&!v.getName&&(x=v.getParent())&&u(x);w=s?w:w||u(v);return!!(t^w);};};d.walker.whitespaces=function(s){return function(t){var u=t&&t.type==3&&!e.trim(t.getText()); -return!!(s^u);};};d.walker.invisible=function(s){var t=d.walker.whitespaces();return function(u){var v=t(u)||u.is&&!u.$.offsetHeight;return!!(s^v);};};d.walker.nodeType=function(s,t){return function(u){return!!(t^u.type==s);};};d.walker.bogus=function(s){function t(u){return!p(u)&&!q(u);};return function(u){var v=!c?u.is&&u.is('br'):u.getText&&o.test(u.getText());if(v){var w=u.getParent(),x=u.getNext(t);v=w.isBlockBoundary()&&(!x||x.type==1&&x.isBlockBoundary());}return!!(s^v);};};var o=/^[\t\r\n ]*(?: |\xa0)$/,p=d.walker.whitespaces(),q=d.walker.bookmark(),r=function(s){return q(s)||p(s)||s.type==1&&s.getName() in f.$inline&&!(s.getName() in f.$empty);};h.prototype.getBogus=function(){var s=this;do s=s.getPreviousSourceNode();while(r(s));if(s&&(!c?s.is&&s.is('br'):s.getText&&o.test(s.getText())))return s;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(u){u.collapsed=u.startContainer&&u.endContainer&&u.startContainer.equals(u.endContainer)&&u.startOffset==u.endOffset;},m=function(u,v,w,x){u.optimizeBookmark();var y=u.startContainer,z=u.endContainer,A=u.startOffset,B=u.endOffset,C,D;if(z.type==3)z=z.split(B);else if(z.getChildCount()>0)if(B>=z.getChildCount()){z=z.append(u.document.createText(''));D=true;}else z=z.getChild(B);if(y.type==3){y.split(A);if(y.equals(z))z=y.getNext();}else if(!A){y=y.getFirst().insertBeforeMe(u.document.createText(''));C=true;}else if(A>=y.getChildCount()){y=y.append(u.document.createText(''));C=true;}else y=y.getChild(A).getPrevious();var E=y.getParents(),F=z.getParents(),G,H,I;for(G=0;G0&&!K.equals(z))L=J.append(K.clone());if(!E[P]||K.$.parentNode!=E[P].$.parentNode){M=K.getPrevious();while(M){if(M.equals(E[P])||M.equals(y))break;N=M.getPrevious();if(v==2)J.$.insertBefore(M.$.cloneNode(true),J.$.firstChild);else{M.remove();if(v==1)J.$.insertBefore(M.$,J.$.firstChild);}M=N;}}if(J)J=L;}if(v==2){var Q=u.startContainer;if(Q.type==3){Q.$.data+=Q.$.nextSibling.data;Q.$.parentNode.removeChild(Q.$.nextSibling);}var R=u.endContainer;if(R.type==3&&R.$.nextSibling){R.$.data+=R.$.nextSibling.data; -R.$.parentNode.removeChild(R.$.nextSibling);}}else{if(H&&I&&(y.$.parentNode!=H.$.parentNode||z.$.parentNode!=I.$.parentNode)){var S=I.getIndex();if(C&&I.$.parentNode==y.$.parentNode)S--;if(x&&H.type==1){var T=h.createFromHtml(' ',u.document);T.insertAfter(H);H.mergeSiblings(false);u.moveToBookmark({startNode:T});}else u.setStart(I.getParent(),S);}u.collapse(true);}if(C)y.remove();if(D&&z.$.parentNode)z.remove();},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function o(u){var v=false,w=d.walker.bookmark(true),x=/^[\t\r\n ]*(?: |\xa0)$/;return function(y){if(w(y))return true;if(y.type==3){if(c&&x.test(y.getText())&&!v&&!(u&&y.getNext()))v=true;else if(y.hasAscendant('pre')||e.trim(y.getText()).length)return false;}else if(y.type==1)if(!n[y.getName()])if(!c&&y.is('br')&&!v&&!(u&&y.getNext()))v=true;else return false;return true;};};var p=d.walker.bogus();function q(u){return function(v){return!u&&p(v)||(v.type==3?!e.trim(v.getText())||!!v.getParent().data('cke-bookmark'):v.getName() in f.$removeEmpty);};};var r=new d.walker.whitespaces(),s=new d.walker.bookmark();function t(u){return!r(u)&&!s(u);};d.range.prototype={clone:function(){var v=this;var u=new d.range(v.document);u.startContainer=v.startContainer;u.startOffset=v.startOffset;u.endContainer=v.endContainer;u.endOffset=v.endOffset;u.collapsed=v.collapsed;return u;},collapse:function(u){var v=this;if(u){v.endContainer=v.startContainer;v.endOffset=v.startOffset;}else{v.startContainer=v.endContainer;v.startOffset=v.endOffset;}v.collapsed=true;},cloneContents:function(){var u=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,u);return u;},deleteContents:function(u){if(this.collapsed)return;m(this,0,null,u);},extractContents:function(u){var v=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,v,u);return v;},createBookmark:function(u){var A=this;var v,w,x,y,z=A.collapsed;v=A.document.createElement('span');v.data('cke-bookmark',1);v.setStyle('display','none');v.setHtml(' ');if(u){x='cke_bm_'+e.getNextNumber();v.setAttribute('id',x+(z?'C':'S'));}if(!z){w=v.clone();w.setHtml(' ');if(u)w.setAttribute('id',x+'E');y=A.clone();y.collapse();y.insertNode(w);}y=A.clone();y.collapse(true);y.insertNode(v);if(w){A.setStartAfter(v);A.setEndBefore(w);}else A.moveToPosition(v,4);return{startNode:u?x+(z?'C':'S'):v,endNode:u?x+'E':w,serializable:u,collapsed:z}; -},createBookmark2:function(u){var C=this;var v=C.startContainer,w=C.endContainer,x=C.startOffset,y=C.endOffset,z=C.collapsed,A,B;if(!v||!w)return{start:0,end:0};if(u){if(v.type==1){A=v.getChild(x);if(A&&A.type==3&&x>0&&A.getPrevious().type==3){v=A;x=0;}if(A&&A.type==1)x=A.getIndex(1);}while(v.type==3&&(B=v.getPrevious())&&B.type==3){v=B;x+=B.getLength();}if(!z){if(w.type==1){A=w.getChild(y);if(A&&A.type==3&&y>0&&A.getPrevious().type==3){w=A;y=0;}if(A&&A.type==1)y=A.getIndex(1);}while(w.type==3&&(B=w.getPrevious())&&B.type==3){w=B;y+=B.getLength();}}}return{start:v.getAddress(u),end:z?null:w.getAddress(u),startOffset:x,endOffset:y,normalized:u,collapsed:z,is2:true};},moveToBookmark:function(u){var C=this;if(u.is2){var v=C.document.getByAddress(u.start,u.normalized),w=u.startOffset,x=u.end&&C.document.getByAddress(u.end,u.normalized),y=u.endOffset;C.setStart(v,w);if(x)C.setEnd(x,y);else C.collapse(true);}else{var z=u.serializable,A=z?C.document.getById(u.startNode):u.startNode,B=z?C.document.getById(u.endNode):u.endNode;C.setStartBefore(A);A.remove();if(B){C.setEndBefore(B);B.remove();}else C.collapse(true);}},getBoundaryNodes:function(){var z=this;var u=z.startContainer,v=z.endContainer,w=z.startOffset,x=z.endOffset,y;if(u.type==1){y=u.getChildCount();if(y>w)u=u.getChild(w);else if(y<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);u=u.getNextSourceNode()||u;}}if(v.type==1){y=v.getChildCount();if(y>x)v=v.getChild(x).getPreviousSourceNode(true);else if(y<1)v=v.getPreviousSourceNode();else{v=v.$;while(v.lastChild)v=v.lastChild;v=new d.node(v);}}if(u.getPosition(v)&2)u=v;return{startNode:u,endNode:v};},getCommonAncestor:function(u,v){var z=this;var w=z.startContainer,x=z.endContainer,y;if(w.equals(x)){if(u&&w.type==1&&z.startOffset==z.endOffset-1)y=w.getChild(z.startOffset);else y=w;}else y=w.getCommonAncestor(x);return v&&!y.is?y.getParent():y;},optimize:function(){var w=this;var u=w.startContainer,v=w.startOffset;if(u.type!=1)if(!v)w.setStartBefore(u);else if(v>=u.getLength())w.setStartAfter(u);u=w.endContainer;v=w.endOffset;if(u.type!=1)if(!v)w.setEndBefore(u);else if(v>=u.getLength())w.setEndAfter(u);},optimizeBookmark:function(){var w=this;var u=w.startContainer,v=w.endContainer;if(u.is&&u.is('span')&&u.data('cke-bookmark'))w.setStartAt(u,3);if(v&&v.is&&v.is('span')&&v.data('cke-bookmark'))w.setEndAt(v,4);},trim:function(u,v){var C=this;var w=C.startContainer,x=C.startOffset,y=C.collapsed;if((!u||y)&&w&&w.type==3){if(!x){x=w.getIndex(); -w=w.getParent();}else if(x>=w.getLength()){x=w.getIndex()+1;w=w.getParent();}else{var z=w.split(x);x=w.getIndex()+1;w=w.getParent();if(C.startContainer.equals(C.endContainer))C.setEnd(z,C.endOffset-C.startOffset);else if(w.equals(C.endContainer))C.endOffset+=1;}C.setStart(w,x);if(y){C.collapse(true);return;}}var A=C.endContainer,B=C.endOffset;if(!(v||y)&&A&&A.type==3){if(!B){B=A.getIndex();A=A.getParent();}else if(B>=A.getLength()){B=A.getIndex()+1;A=A.getParent();}else{A.split(B);B=A.getIndex()+1;A=A.getParent();}C.setEnd(A,B);}},enlarge:function(u,v){switch(u){case 1:if(this.collapsed)return;var w=this.getCommonAncestor(),x=this.document.getBody(),y,z,A,B,C,D=false,E,F,G=this.startContainer,H=this.startOffset;if(G.type==3){if(H){G=!e.trim(G.substring(0,H)).length&&G;D=!!G;}if(G)if(!(B=G.getPrevious()))A=G.getParent();}else{if(H)B=G.getChild(H-1)||G.getLast();if(!B)A=G;}while(A||B){if(A&&!B){if(!C&&A.equals(w))C=true;if(!x.contains(A))break;if(!D||A.getComputedStyle('display')!='inline'){D=false;if(C)y=A;else this.setStartBefore(A);}B=A.getPrevious();}while(B){E=false;if(B.type==8){B=B.getPrevious();continue;}else if(B.type==3){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;E=/[\s\ufeff]$/.test(F);}else if((B.$.offsetWidth>0||v&&B.is('br'))&&!B.data('cke-bookmark'))if(D&&f.$removeEmpty[B.getName()]){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;else{var I=B.$.getElementsByTagName('*');for(var J=0,K;K=I[J++];){if(!f.$removeEmpty[K.nodeName.toLowerCase()]){B=null;break;}}}if(B)E=!!F.length;}else B=null;if(E)if(D){if(C)y=A;else if(A)this.setStartBefore(A);}else D=true;if(B){var L=B.getPrevious();if(!A&&!L){A=B;B=null;break;}B=L;}else A=null;}if(A)A=A.getParent();}G=this.endContainer;H=this.endOffset;A=B=null;C=D=false;if(G.type==3){G=!e.trim(G.substring(H)).length&&G;D=!(G&&G.getLength());if(G)if(!(B=G.getNext()))A=G.getParent();}else{B=G.getChild(H);if(!B)A=G;}while(A||B){if(A&&!B){if(!C&&A.equals(w))C=true;if(!x.contains(A))break;if(!D||A.getComputedStyle('display')!='inline'){D=false;if(C)z=A;else if(A)this.setEndAfter(A);}B=A.getNext();}while(B){E=false;if(B.type==3){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;E=/^[\s\ufeff]/.test(F);}else if(B.type==1){if((B.$.offsetWidth>0||v&&B.is('br'))&&!B.data('cke-bookmark'))if(D&&f.$removeEmpty[B.getName()]){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;else{I=B.$.getElementsByTagName('*');for(J=0;K=I[J++];){if(!f.$removeEmpty[K.nodeName.toLowerCase()]){B=null;break;}}}if(B)E=!!F.length;}else B=null;}else E=1;if(E)if(D)if(C)z=A; -else this.setEndAfter(A);if(B){L=B.getNext();if(!A&&!L){A=B;B=null;break;}B=L;}else A=null;}if(A)A=A.getParent();}if(y&&z){w=y.contains(z)?z:y;this.setStartBefore(w);this.setEndAfter(w);}break;case 2:case 3:var M=new d.range(this.document);x=this.document.getBody();M.setStartAt(x,1);M.setEnd(this.startContainer,this.startOffset);var N=new d.walker(M),O,P,Q=d.walker.blockBoundary(u==3?{br:1}:null),R=function(X){var Y=Q(X);if(!Y)O=X;return Y;},S=function(X){var Y=R(X);if(!Y&&X.is&&X.is('br'))P=X;return Y;};N.guard=R;A=N.lastBackward();O=O||x;this.setStartAt(O,!O.is('br')&&(!A&&this.checkStartOfBlock()||A&&O.contains(A))?1:4);if(u==3){var T=this.clone();N=new d.walker(T);var U=d.walker.whitespaces(),V=d.walker.bookmark();N.evaluator=function(X){return!U(X)&&!V(X);};var W=N.previous();if(W&&W.type==1&&W.is('br'))return;}M=this.clone();M.collapse();M.setEndAt(x,2);N=new d.walker(M);N.guard=u==3?S:R;O=null;A=N.lastForward();O=O||x;this.setEndAt(O,!A&&this.checkEndOfBlock()||A&&O.contains(A)?2:3);if(P)this.setEndAfter(P);}},shrink:function(u,v){if(!this.collapsed){u=u||2;var w=this.clone(),x=this.startContainer,y=this.endContainer,z=this.startOffset,A=this.endOffset,B=this.collapsed,C=1,D=1;if(x&&x.type==3)if(!z)w.setStartBefore(x);else if(z>=x.getLength())w.setStartAfter(x);else{w.setStartBefore(x);C=0;}if(y&&y.type==3)if(!A)w.setEndBefore(y);else if(A>=y.getLength())w.setEndAfter(y);else{w.setEndAfter(y);D=0;}var E=new d.walker(w),F=d.walker.bookmark();E.evaluator=function(J){return J.type==(u==1?1:3);};var G;E.guard=function(J,K){if(F(J))return true;if(u==1&&J.type==3)return false;if(K&&J.equals(G))return false;if(!K&&J.type==1)G=J;return true;};if(C){var H=E[u==1?'lastForward':'next']();H&&this.setStartAt(H,v?1:3);}if(D){E.reset();var I=E[u==1?'lastBackward':'previous']();I&&this.setEndAt(I,v?2:4);}return!!(C||D);}},insertNode:function(u){var y=this;y.optimizeBookmark();y.trim(false,true);var v=y.startContainer,w=y.startOffset,x=v.getChild(w);if(x)u.insertBefore(x);else v.append(u);if(u.getParent().equals(y.endContainer))y.endOffset++;y.setStartBefore(u);},moveToPosition:function(u,v){this.setStartAt(u,v);this.collapse(true);},selectNodeContents:function(u){this.setStart(u,0);this.setEnd(u,u.type==3?u.getLength():u.getChildCount());},setStart:function(u,v){var w=this;if(u.type==1&&f.$empty[u.getName()])v=u.getIndex(),u=u.getParent();w.startContainer=u;w.startOffset=v;if(!w.endContainer){w.endContainer=u;w.endOffset=v;}l(w);},setEnd:function(u,v){var w=this;if(u.type==1&&f.$empty[u.getName()])v=u.getIndex()+1,u=u.getParent(); -w.endContainer=u;w.endOffset=v;if(!w.startContainer){w.startContainer=u;w.startOffset=v;}l(w);},setStartAfter:function(u){this.setStart(u.getParent(),u.getIndex()+1);},setStartBefore:function(u){this.setStart(u.getParent(),u.getIndex());},setEndAfter:function(u){this.setEnd(u.getParent(),u.getIndex()+1);},setEndBefore:function(u){this.setEnd(u.getParent(),u.getIndex());},setStartAt:function(u,v){var w=this;switch(v){case 1:w.setStart(u,0);break;case 2:if(u.type==3)w.setStart(u,u.getLength());else w.setStart(u,u.getChildCount());break;case 3:w.setStartBefore(u);break;case 4:w.setStartAfter(u);}l(w);},setEndAt:function(u,v){var w=this;switch(v){case 1:w.setEnd(u,0);break;case 2:if(u.type==3)w.setEnd(u,u.getLength());else w.setEnd(u,u.getChildCount());break;case 3:w.setEndBefore(u);break;case 4:w.setEndAfter(u);}l(w);},fixBlock:function(u,v){var y=this;var w=y.createBookmark(),x=y.document.createElement(v);y.collapse(u);y.enlarge(2);y.extractContents().appendTo(x);x.trim();if(!c)x.appendBogus();y.insertNode(x);y.moveToBookmark(w);return x;},splitBlock:function(u){var E=this;var v=new d.elementPath(E.startContainer),w=new d.elementPath(E.endContainer),x=v.blockLimit,y=w.blockLimit,z=v.block,A=w.block,B=null;if(!x.equals(y))return null;if(u!='br'){if(!z){z=E.fixBlock(true,u);A=new d.elementPath(E.endContainer).block;}if(!A)A=E.fixBlock(false,u);}var C=z&&E.checkStartOfBlock(),D=A&&E.checkEndOfBlock();E.deleteContents();if(z&&z.equals(A))if(D){B=new d.elementPath(E.startContainer);E.moveToPosition(A,4);A=null;}else if(C){B=new d.elementPath(E.startContainer);E.moveToPosition(z,3);z=null;}else{A=E.splitElement(z);if(!c&&!z.is('ul','ol'))z.appendBogus();}return{previousBlock:z,nextBlock:A,wasStartOfBlock:C,wasEndOfBlock:D,elementPath:B};},splitElement:function(u){var x=this;if(!x.collapsed)return null;x.setEndAt(u,2);var v=x.extractContents(),w=u.clone(false);v.appendTo(w);w.insertAfter(u);x.moveToPosition(u,4);return w;},checkBoundaryOfElement:function(u,v){var w=v==1,x=this.clone();x.collapse(w);x[w?'setStartAt':'setEndAt'](u,w?1:2);var y=new d.walker(x);y.evaluator=q(w);return y[w?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var A=this;var u=A.startContainer,v=A.startOffset;if(v&&u.type==3){var w=e.ltrim(u.substring(0,v));if(w.length)return false;}var x=new d.elementPath(A.startContainer),y=A.clone();y.collapse(true);y.setStartAt(x.block||x.blockLimit,1);var z=new d.walker(y);z.evaluator=o(true);return z.checkBackward();},checkEndOfBlock:function(){var A=this; -var u=A.endContainer,v=A.endOffset;if(u.type==3){var w=e.rtrim(u.substring(v));if(w.length)return false;}var x=new d.elementPath(A.endContainer),y=A.clone();y.collapse(false);y.setEndAt(x.block||x.blockLimit,2);var z=new d.walker(y);z.evaluator=o(false);return z.checkForward();},checkReadOnly:(function(){function u(v,w){while(v){if(v.type==1)if(v.getAttribute('contentEditable')=='false'&&!v.data('cke-editable'))return 0;else if(v.is('html')||v.getAttribute('contentEditable')=='true'&&(v.contains(w)||v.equals(w)))break;v=v.getParent();}return 1;};return function(){var v=this.startContainer,w=this.endContainer;return!(u(v,w)&&u(w,v));};})(),moveToElementEditablePosition:function(u,v){var w=/^[\t\r\n ]*(?: |\xa0)$/;function x(z,A){var B;if(z.type==1&&z.isEditable(false))B=z[v?'getLast':'getFirst'](t);if(!A&&!B)B=z[v?'getPrevious':'getNext'](t);return B;};if(u.type==1&&!u.isEditable(false)){this.moveToPosition(u,v?4:3);return true;}var y=0;while(u){if(u.type==3){if(v&&this.checkEndOfBlock()&&w.test(u.getText()))this.moveToPosition(u,3);else this.moveToPosition(u,v?4:3);y=1;break;}if(u.type==1)if(u.isEditable()){this.moveToPosition(u,v?2:1);y=1;}else if(v&&u.is('br')&&this.checkEndOfBlock())this.moveToPosition(u,3);u=x(u,y);}return!!y;},moveToElementEditStart:function(u){return this.moveToElementEditablePosition(u);},moveToElementEditEnd:function(u){return this.moveToElementEditablePosition(u,true);},getEnclosedNode:function(){var u=this.clone();u.optimize();if(u.startContainer.type!=1||u.endContainer.type!=1)return null;var v=new d.walker(u),w=d.walker.bookmark(true),x=d.walker.whitespaces(true),y=function(A){return x(A)&&w(A);};u.evaluator=y;var z=v.next();v.reset();return z&&z.equals(v.previous())?z:null;},getTouchedStartNode:function(){var u=this.startContainer;if(this.collapsed||u.type!=1)return u;return u.getChild(this.startOffset)||u;},getTouchedEndNode:function(){var u=this.endContainer;if(this.collapsed||u.type!=1)return u;return u.getChild(this.endOffset-1)||u;}};})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){d.rangeList=function(n){if(n instanceof d.rangeList)return n;if(!n)n=[];else if(n instanceof d.range)n=[n];return e.extend(n,l);};var l={createIterator:function(){var n=this,o=d.walker.bookmark(),p=function(s){return!(s.is&&s.is('tr')); -},q=[],r;return{getNextRange:function(s){r=r==undefined?0:r+1;var t=n[r];if(t&&n.length>1){if(!r)for(var u=n.length-1;u>=0;u--)q.unshift(n[u].createBookmark(true));if(s){var v=0;while(n[r+v+1]){var w=t.document,x=0,y=w.getById(q[v].endNode),z=w.getById(q[v+1].startNode),A;while(1){A=y.getNextSourceNode(false);if(!z.equals(A)){if(o(A)||A.type==1&&A.isBlockBoundary()){y=A;continue;}}else x=1;break;}if(!x)break;v++;}}t.moveToBookmark(q.shift());while(v--){A=n[++r];A.moveToBookmark(q.shift());t.setEnd(A.endContainer,A.endOffset);}}return t;}};},createBookmarks:function(n){var s=this;var o=[],p;for(var q=0;q
    ',a.document);l.appendTo(a.document.getHead());try{b.hc=l.getComputedStyle('border-top-color')==l.getComputedStyle('border-right-color');}catch(m){b.hc=false;}if(b.hc)b.cssClass+=' cke_hc';l.remove();})();j.load(i.corePlugins.split(','),function(){a.status='loaded';a.fire('loaded');var l=a._.pending;if(l){delete a._.pending;for(var m=0;m0){z=A.shift();while(!z.getParent().equals(D))z=z.getParent();if(!z.equals(H))E.push(z);H=z;}while(E.length>0){z=E.shift();if(z.getName()=='blockquote'){var I=new d.documentFragment(q.document);while(z.getFirst()){I.append(z.getFirst().remove());A.push(I.getLast());}I.replace(z);}else A.push(z);}var J=q.document.createElement('blockquote');J.insertBefore(A[0]);while(A.length>0){z=A.shift();J.append(z);}}else if(r==1){var K=[],L={};while(z=y.getNextParagraph()){var M=null,N=null;while(z.getParent()){if(z.getParent().getName()=='blockquote'){M=z.getParent();N=z;break;}z=z.getParent();}if(M&&N&&!N.getCustomData('blockquote_moveout')){K.push(N);h.setMarker(L,N,'blockquote_moveout',true);}}h.clearAllMarkers(L);var O=[],P=[];L={};while(K.length>0){var Q=K.shift();J=Q.getParent();if(!Q.getPrevious())Q.remove().insertBefore(J);else if(!Q.getNext())Q.remove().insertAfter(J);else{Q.breakParent(Q.getParent());P.push(Q.getNext());}if(!J.getCustomData('blockquote_processed')){P.push(J);h.setMarker(L,J,'blockquote_processed',true);}O.push(Q);}h.clearAllMarkers(L);for(F=P.length-1;F>=0;F--){J=P[F];if(o(J))J.remove();}if(q.config.enterMode==2){var R=true;while(O.length){Q=O.shift();if(Q.getName()=='div'){I=new d.documentFragment(q.document);var S=R&&Q.getPrevious()&&!(Q.getPrevious().type==1&&Q.getPrevious().isBlockBoundary());if(S)I.append(q.document.createElement('br'));var T=Q.getNext()&&!(Q.getNext().type==1&&Q.getNext().isBlockBoundary());while(Q.getFirst())Q.getFirst().remove().appendTo(I);if(T)I.append(q.document.createElement('br'));I.replace(Q);R=false;}}}}s.selectBookmarks(u);q.focus();}};j.add('blockquote',{init:function(q){q.addCommand('blockquote',p);q.ui.addButton('Blockquote',{label:q.lang.blockquote,command:'blockquote'});q.on('selectionChange',n);},requires:['domiterator']});})();j.add('button',{beforeInit:function(m){m.ui.addHandler('button',k.button.handler); -}});a.UI_BUTTON='button';k.button=function(m){e.extend(this,m,{title:m.label,className:m.className||m.command&&'cke_button_'+m.command||'',click:m.click||(function(n){n.execCommand(m.command);})});this._={};};k.button.handler={create:function(m){return new k.button(m);}};(function(){k.button.prototype={render:function(m,n){var o=b,p=this._.id=e.getNextId(),q='',r=this.command,s;this._.editor=m;var t={id:p,button:this,editor:m,focus:function(){var z=a.document.getById(p);z.focus();},execute:function(){if(c&&b.version<7)e.setTimeout(function(){this.button.click(m);},0,this);else this.button.click(m);}},u=e.addFunction(function(z){if(t.onkey){z=new d.event(z);return t.onkey(t,z.getKeystroke())!==false;}}),v=e.addFunction(function(z){var A;if(t.onfocus)A=t.onfocus(t,new d.event(z))!==false;if(b.gecko&&b.version<10900)z.preventBubble();return A;});t.clickFn=s=e.addFunction(t.execute,t);if(this.modes){var w={};function x(){var z=m.mode;if(z){var A=this.modes[z]?w[z]!=undefined?w[z]:2:0;this.setState(m.readOnly&&!this.readOnly?0:A);}};m.on('beforeModeUnload',function(){if(m.mode&&this._.state!=0)w[m.mode]=this._.state;},this);m.on('mode',x,this);!this.readOnly&&m.on('readOnly',x,this);}else if(r){r=m.getCommand(r);if(r){r.on('state',function(){this.setState(r.state);},this);q+='cke_'+(r.state==1?'on':r.state==0?'disabled':'off');}}if(!r)q+='cke_off';if(this.className)q+=' '+this.className;n.push('','=10900&&!o.hc?'':'" href="javascript:void(\''+(this.title||'').replace("'",'')+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+p+'_label"'+(this.hasArrow?' aria-haspopup="true"':''));if(o.opera||o.gecko&&o.mac)n.push(' onkeypress="return false;"');if(o.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="return CKEDITOR.tools.callFunction(',u,', event);" onfocus="return CKEDITOR.tools.callFunction(',v,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',s,', this); return false;"> ',this.label,'');if(this.hasArrow)n.push(''+(b.hc?'▼':' ')+''); -n.push('','');if(this.onRender)this.onRender();return t;},setState:function(m){if(this._.state==m)return false;this._.state=m;var n=a.document.getById(this._.id);if(n){n.setState(m);m==0?n.setAttribute('aria-disabled',true):n.removeAttribute('aria-disabled');m==1?n.setAttribute('aria-pressed',true):n.removeAttribute('aria-pressed');return true;}else return false;}};})();k.prototype.addButton=function(m,n){this.add(m,'button',n);};(function(){var m=function(y,z){var A=y.document,B=A.getBody(),C=false,D=function(){C=true;};B.on(z,D);(b.version>7?A.$:A.$.selection.createRange()).execCommand(z);B.removeListener(z,D);return C;},n=c?function(y,z){return m(y,z);}:function(y,z){try{return y.document.$.execCommand(z,false,null);}catch(A){return false;}},o=function(y){var z=this;z.type=y;z.canUndo=z.type=='cut';z.startDisabled=true;};o.prototype={exec:function(y,z){this.type=='cut'&&t(y);var A=n(y,this.type);if(!A)alert(y.lang.clipboard[this.type+'Error']);return A;}};var p={canUndo:false,exec:c?function(y){y.focus();if(!y.document.getBody().fire('beforepaste')&&!m(y,'paste')){y.fire('pasteDialog');return false;}}:function(y){try{if(!y.document.getBody().fire('beforepaste')&&!y.document.$.execCommand('Paste',false,null))throw 0;}catch(z){setTimeout(function(){y.fire('pasteDialog');},0);return false;}}},q=function(y){if(this.mode!='wysiwyg')return;switch(y.data.keyCode){case 1114112+86:case 2228224+45:var z=this.document.getBody();if(b.opera||b.gecko)z.fire('paste');return;case 1114112+88:case 2228224+46:var A=this;this.fire('saveSnapshot');setTimeout(function(){A.fire('saveSnapshot');},0);}};function r(y){y.cancel();};function s(y,z,A){var B=this.document;if(B.getById('cke_pastebin'))return;if(z=='text'&&y.data&&y.data.$.clipboardData){var C=y.data.$.clipboardData.getData('text/plain');if(C){y.data.preventDefault();A(C);return;}}var D=this.getSelection(),E=new d.range(B),F=new h(z=='text'?'textarea':b.webkit?'body':'div',B);F.setAttribute('id','cke_pastebin');b.webkit&&F.append(B.createText('\xa0'));B.getBody().append(F);F.setStyles({position:'absolute',top:D.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});F.setStyle(this.config.contentsLangDirection=='ltr'?'left':'right','-1000px');var G=D.createBookmarks();this.on('selectionChange',r,null,null,0);if(z=='text')F.$.focus();else{E.setStartAt(F,1);E.setEndAt(F,2);E.select(true);}var H=this;window.setTimeout(function(){H.document.getBody().focus();H.removeListener('selectionChange',r); -if(b.ie7Compat){D.selectBookmarks(G);F.remove();}else{F.remove();D.selectBookmarks(G);}var I;F=b.webkit&&(I=F.getFirst())&&I.is&&I.hasClass('Apple-style-span')?I:F;A(F['get'+(z=='text'?'Value':'Html')]());},0);};function t(y){if(!c||b.quirks)return;var z=y.getSelection(),A;if(z.getType()==3&&(A=z.getSelectedElement())){var B=z.getRanges()[0],C=y.document.createText('');C.insertBefore(A);B.setStartBefore(C);B.setEndAfter(A);z.selectRanges([B]);setTimeout(function(){if(A.getParent()){C.remove();z.selectElement(A);}},0);}};var u,v;function w(y,z){var A;if(v&&y in {Paste:1,Cut:1})return 0;if(y=='Paste'){c&&(u=1);try{A=z.document.$.queryCommandEnabled(y)||b.webkit;}catch(D){}u=0;}else{var B=z.getSelection(),C=B&&B.getRanges();A=B&&!(C.length==1&&C[0].collapsed);}return A?2:0;};function x(){var z=this;if(z.mode!='wysiwyg')return;var y=w('Paste',z);z.getCommand('cut').setState(w('Cut',z));z.getCommand('copy').setState(w('Copy',z));z.getCommand('paste').setState(y);z.fire('pasteState',y);};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(y){y.on('paste',function(A){var B=A.data;if(B.html)y.insertHtml(B.html);else if(B.text)y.insertText(B.text);setTimeout(function(){y.fire('afterPaste');},0);},null,null,1000);y.on('pasteDialog',function(A){setTimeout(function(){y.openDialog('paste');},0);});y.on('pasteState',function(A){y.getCommand('paste').setState(A.data);});function z(A,B,C,D){var E=y.lang[B];y.addCommand(B,C);y.ui.addButton(A,{label:E,command:B});if(y.addMenuItems)y.addMenuItem(B,{label:E,command:B,group:'clipboard',order:D});};z('Cut','cut',new o('cut'),1);z('Copy','copy',new o('copy'),4);z('Paste','paste',p,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));y.on('key',q,y);y.on('contentDom',function(){var A=y.document.getBody();A.on(!c?'paste':'beforepaste',function(B){if(u)return;var C=B.data&&B.data.$;if(c&&C&&!C.ctrlKey)return;var D={mode:'html'};y.fire('beforePaste',D);s.call(y,B,D.mode,function(E){if(!(E=e.trim(E.replace(/]+data-cke-bookmark[^<]*?<\/span>/ig,''))))return;var F={};F[D.mode]=E;y.fire('paste',F);});});if(c){A.on('contextmenu',function(){u=1;setTimeout(function(){u=0;},0);});A.on('paste',function(B){if(!y.document.getById('cke_pastebin')){B.data.preventDefault();u=0;p.exec(y);}});}A.on('beforecut',function(){!u&&t(y);});A.on('mouseup',function(){setTimeout(function(){x.call(y);},0);},y);A.on('keyup',x,y);});y.on('selectionChange',function(A){v=A.data.selection.getRanges()[0].checkReadOnly();x.call(y); -});if(y.contextMenu)y.contextMenu.addListener(function(A,B){var C=B.getRanges()[0].checkReadOnly();return{cut:w('Cut',y),copy:w('Copy',y),paste:w('Paste',y)};});}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(m){var n=m.config,o=m.lang.colorButton,p;if(!b.hc){q('TextColor','fore',o.textColorTitle);q('BGColor','back',o.bgColorTitle);}function q(t,u,v){var w=e.getNextId()+'_colorBox';m.ui.add(t,'panelbutton',{label:v,title:v,className:'cke_button_'+t.toLowerCase(),modes:{wysiwyg:1},panel:{css:m.skin.editor.css,attributes:{role:'listbox','aria-label':o.panelTitle}},onBlock:function(x,y){y.autoSize=true;y.element.addClass('cke_colorblock');y.element.setHtml(r(x,u,w));y.element.getDocument().getBody().setStyle('overflow','hidden');k.fire('ready',this);var z=y.keys,A=m.lang.dir=='rtl';z[A?37:39]='next';z[40]='next';z[9]='next';z[A?39:37]='prev';z[38]='prev';z[2228224+9]='prev';z[32]='click';},onOpen:function(){var x=m.getSelection(),y=x&&x.getStartElement(),z=new d.elementPath(y),A;y=z.block||z.blockLimit||m.document.getBody();do A=y&&y.getComputedStyle(u=='back'?'background-color':'color')||'transparent';while(u=='back'&&A=='transparent'&&y&&(y=y.getParent()));if(!A||A=='transparent')A='#ffffff';this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color',A);}});};function r(t,u,v){var w=[],x=n.colorButton_colors.split(','),y=e.addFunction(function(E,F){if(E=='?'){var G=arguments.callee;function H(J){this.removeListener('ok',H);this.removeListener('cancel',H);J.name=='ok'&&G(this.getContentElement('picker','selectedColor').getValue(),F);};m.openDialog('colordialog',function(){this.on('ok',H);this.on('cancel',H);});return;}m.focus();t.hide(false);m.fire('saveSnapshot');new a.style(n['colorButton_'+F+'Style'],{color:'inherit'}).remove(m.document);if(E){var I=n['colorButton_'+F+'Style'];I.childRule=F=='back'?function(J){return s(J);}:function(J){return!(J.is('a')||J.getElementsByTag('a').count())||s(J);};new a.style(I,{color:E}).apply(m.document);}m.fire('saveSnapshot');});w.push('
    ',o.auto,'
    '); -for(var z=0;z');var A=x[z].split('/'),B=A[0],C=A[1]||B;if(!A[1])B='#'+B.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var D=m.lang.colors[C]||C;w.push('');}if(n.colorButton_enableMore===undefined||n.colorButton_enableMore)w.push('');w.push('
    ',o.more,'
    ');return w.join('');};function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={requires:['dialog'],init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('contextmenu',{requires:['menu'],onLoad:function(){j.contextMenu=e.createClass({base:a.menu,$:function(m){this.base.call(this,m,{panel:{className:m.skinClass+' cke_contextmenu',attributes:{'aria-label':m.lang.contextmenu.options}}});},proto:{addTarget:function(m,n){if(b.opera&&!('oncontextmenu' in document.body)){var o;m.on('mousedown',function(s){s=s.data;if(s.$.button!=2){if(s.getKeystroke()==1114112+1)m.fire('contextmenu',s);return;}if(n&&(b.mac?s.$.metaKey:s.$.ctrlKey))return;var t=s.getTarget();if(!o){var u=t.getDocument();o=u.createElement('input');o.$.type='button';u.getBody().append(o);}o.setAttribute('style','position:absolute;top:'+(s.$.clientY-2)+'px;left:'+(s.$.clientX-2)+'px;width:5px;height:5px;opacity:0.01');});m.on('mouseup',function(s){if(o){o.remove();o=undefined;m.fire('contextmenu',s.data);}});}m.on('contextmenu',function(s){var t=s.data; -if(n&&(b.webkit?p:b.mac?t.$.metaKey:t.$.ctrlKey))return;t.preventDefault();var u=t.getTarget().getDocument().getDocumentElement(),v=t.$.clientX,w=t.$.clientY;e.setTimeout(function(){this.open(u,null,v,w);},c?200:0,this);},this);if(b.opera)m.on('keypress',function(s){var t=s.data;if(t.$.keyCode===0)t.preventDefault();});if(b.webkit){var p,q=function(s){p=b.mac?s.data.$.metaKey:s.data.$.ctrlKey;},r=function(){p=0;};m.on('keydown',q);m.on('keyup',r);m.on('contextmenu',r);}},open:function(m,n,o,p){this.editor.focus();m=m||a.document.getDocumentElement();this.show(m,n,o,p);}}});},beforeInit:function(m){m.contextMenu=new j.contextMenu(m);m.addCommand('contextMenu',{exec:function(){m.contextMenu.open(m.document.getBody());}});}});(function(){function m(o){var p=this.att,q=o&&o.hasAttribute(p)&&o.getAttribute(p)||'';if(q!==undefined)this.setValue(q);};function n(){var o;for(var p=0;p ';j.add('elementspath',{requires:['selection'],init:function(o){var p='cke_path_'+o.name,q,r=function(){if(!q)q=a.document.getById(p);return q;},s='cke_elementspath_'+e.getNextNumber()+'_';o._.elementsPath={idBase:s,filters:[]};o.on('themeSpace',function(x){if(x.data.space=='bottom')x.data.html+=''+o.lang.elementsPath.eleLabel+''+'
    '+n+'
    ';});function t(x){o.focus();var y=o._.elementsPath.list[x];if(y.is('body')){var z=new d.range(o.document);z.selectNodeContents(y);z.select();}else o.getSelection().selectElement(y);};var u=e.addFunction(t),v=e.addFunction(function(x,y){var z=o._.elementsPath.idBase,A;y=new d.event(y);var B=o.lang.dir=='rtl';switch(y.getKeystroke()){case B?39:37:case 9:A=a.document.getById(z+(x+1));if(!A)A=a.document.getById(z+'0');A.focus();return false;case B?37:39:case 2228224+9:A=a.document.getById(z+(x-1));if(!A)A=a.document.getById(z+(o._.elementsPath.list.length-1));A.focus();return false;case 27:o.focus();return false;case 13:case 32:t(x);return false;}return true;});o.on('selectionChange',function(x){var y=b,z=x.data.selection,A=z.getStartElement(),B=[],C=x.editor,D=C._.elementsPath.list=[],E=C._.elementsPath.filters; -while(A){var F=0,G;if(A.data('cke-display-name'))G=A.data('cke-display-name');else if(A.data('cke-real-element-type'))G=A.data('cke-real-element-type');else G=A.getName();for(var H=0;H',G,''+L+'','');}if(G=='body')break;A=A.getParent();}var M=r();M.setHtml(B.join('')+n);C.fire('elementsPathUpdate',{space:M});});function w(){q&&q.setHtml(n);delete o._.elementsPath.list;};o.on('readOnly',w);o.on('contentDomUnload',w);o.addCommand('elementsPathFocus',m.toolbarFocus);}});})();(function(){j.add('enterkey',{requires:['keystrokes','indent'],init:function(t){t.addCommand('enter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){r(v);}});t.addCommand('shiftEnter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){q(v);}});var u=t.keystrokeHandler.keystrokes;u[13]='enter';u[2228224+13]='shiftEnter';}});j.enterkey={enterBlock:function(t,u,v,w){v=v||s(t);if(!v)return;var x=v.document,y=v.checkStartOfBlock(),z=v.checkEndOfBlock(),A=new d.elementPath(v.startContainer),B=A.block;if(y&&z){if(B&&(B.is('li')||B.getParent().is('li'))){t.execCommand('outdent');return;}if(B&&B.getParent().is('blockquote')){B.breakParent(B.getParent());if(!B.getPrevious().getFirst(d.walker.invisible(1)))B.getPrevious().remove();if(!B.getNext().getFirst(d.walker.invisible(1)))B.getNext().remove();v.moveToElementEditStart(B);v.select();return;}}else if(B&&B.is('pre')){if(!z){n(t,u,v,w);return;}}else if(B&&f.$captionBlock[B.getName()]){n(t,u,v,w);return;}var C=u==3?'div':'p',D=v.splitBlock(C);if(!D)return;var E=D.previousBlock,F=D.nextBlock,G=D.wasStartOfBlock,H=D.wasEndOfBlock,I;if(F){I=F.getParent();if(I.is('li')){F.breakParent(I);F.move(F.getNext(),1);}}else if(E&&(I=E.getParent())&&I.is('li')){E.breakParent(I);I=E.getNext();v.moveToElementEditStart(I);E.move(E.getPrevious());}if(!G&&!H){if(F.is('li')&&(I=F.getFirst(d.walker.invisible(true)))&&I.is&&I.is('ul','ol'))(c?x.createText('\xa0'):x.createElement('br')).insertBefore(I); -if(F)v.moveToElementEditStart(F);}else{var J,K;if(E){if(E.is('li')||!(p.test(E.getName())||E.is('pre')))J=E.clone();}else if(F)J=F.clone();if(!J){if(I&&I.is('li'))J=I;else{J=x.createElement(C);if(E&&(K=E.getDirection()))J.setAttribute('dir',K);}}else if(w&&!J.is('li'))J.renameNode(C);var L=D.elementPath;if(L)for(var M=0,N=L.elements.length;M0;v--)u[v].deleteContents();return u[0];};})();(function(){var m='nbsp,gt,lt,amp',n='quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',o='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',p='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv'; -function q(r,s){var t={},u=[],v={nbsp:'\xa0',shy:'­',gt:'>',lt:'<',amp:'&',apos:"'",quot:'"'};r=r.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(A,B){var C=s?'&'+B+';':v[B],D=s?v[B]:'&'+B+';';t[C]=D;u.push(C);return '';});if(!s&&r){r=r.split(',');var w=document.createElement('div'),x;w.innerHTML='&'+r.join(';&')+';';x=w.innerHTML;w=null;for(var y=0;y0;case 'checked':return!!q.$.checked;case 'value':var p=q.getAttribute('type');return p=='checkbox'||p=='radio'?q.$.value!='on':q.$.value;}return m.apply(q,arguments);};});(function(){var m={canUndo:false,exec:function(o){var p=o.document.createElement('hr');o.insertElement(p);}},n='horizontalrule';j.add(n,{init:function(o){o.addCommand(n,m);o.ui.addButton('HorizontalRule',{label:o.lang.horizontalrule,command:n});}});})();(function(){var m=/^[\t\r\n ]*(?: |\xa0)$/,n='{cke_protected}';function o(T){var U=T.children.length,V=T.children[U-1];while(V&&V.type==3&&!e.trim(V.value))V=T.children[--U];return V;};function p(T,U){var V=T.children,W=o(T);if(W){if((U||!c)&&W.type==1&&W.name=='br')V.pop();if(W.type==3&&m.test(W.value))V.pop();}};function q(T,U,V){if(!U&&(!V||typeof V=='function'&&V(T)===false))return false;if(U&&c&&(document.documentMode>7||T.name in f.tr||T.name in f.$listItem))return false;var W=o(T);return!W||W&&(W.type==1&&W.name=='br'||T.name=='form'&&W.name=='input');};function r(T,U){return function(V){p(V,!T);if(q(V,!T,U))if(T||c)V.add(new a.htmlParser.text('\xa0'));else V.add(new a.htmlParser.element('br',{}));};};var s=f,t=['caption','colgroup','col','thead','tfoot','tbody'],u=e.extend({},s.$block,s.$listItem,s.$tableContent);for(var v in u){if(!('br' in s[v]))delete u[v];}delete u.pre;var w={elements:{},attributeNames:[[/^on/,'data-cke-pa-on']]},x={elements:{}};for(v in u)x.elements[v]=r();var y={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^data-cke-(saved|pa)-/,''],[/^data-cke-.*/,''],['hidefocus','']],elements:{$:function(T){var U=T.attributes;if(U){if(U['data-cke-temp'])return false;var V=['name','href','src'],W; -for(var X=0;Xe.indexOf(t,W.name)?1:-1:0;});},embed:function(T){var U=T.parent;if(U&&U.name=='object'){var V=U.attributes.width,W=U.attributes.height;V&&(T.attributes.width=V);W&&(T.attributes.height=W);}},param:function(T){T.children=[];T.isEmpty=true;return T;},a:function(T){if(!(T.children.length||T.attributes.name||T.attributes['data-cke-saved-name']))return false;},span:function(T){if(T.attributes['class']=='Apple-style-span')delete T.name;},pre:function(T){c&&p(T);},html:function(T){delete T.attributes.contenteditable;delete T.attributes['class'];},body:function(T){delete T.attributes.spellcheck;delete T.attributes.contenteditable;},style:function(T){var U=T.children[0];U&&U.value&&(U.value=e.trim(U.value));if(!T.attributes.type)T.attributes.type='text/css';},title:function(T){var U=T.children[0];U&&(U.value=T.attributes['data-cke-title']||'');}},attributes:{'class':function(T,U){return e.ltrim(T.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}}};if(c)y.attributes.style=function(T,U){return T.replace(/(^|;)([^\:]+)/g,function(V){return V.toLowerCase();});};function z(T){var U=T.attributes;if(U.contenteditable!='false')U['data-cke-editable']=U.contenteditable?'true':1;U.contenteditable='false';};function A(T){var U=T.attributes;switch(U['data-cke-editable']){case 'true':U.contenteditable='true';break;case '1':delete U.contenteditable;break;}};for(v in {input:1,textarea:1}){w.elements[v]=z;y.elements[v]=A;}var B=/<(a|area|img|input)\b([^>]*)>/gi,C=/\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,D=/(?:])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,E=/([^<]*)<\/cke:encoded>/gi,F=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,G=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,H=/]*?)\/?>(?!\s*<\/cke:\1)/gi;function I(T){return T.replace(B,function(U,V,W){return '<'+V+W.replace(C,function(X,Y){if(!/^on/.test(Y)&&W.indexOf('data-cke-saved-'+Y)==-1)return ' data-cke-saved-'+X+' data-cke-'+a.rnd+'-'+X;return X;})+'>';});};function J(T){return T.replace(D,function(U){return ''+encodeURIComponent(U)+'';});};function K(T){return T.replace(E,function(U,V){return decodeURIComponent(V);});};function L(T){return T.replace(F,'$1cke:$2');};function M(T){return T.replace(G,'$1$2'); -};function N(T){return T.replace(H,'');};function O(T){return T.replace(/(]*>)(\r\n|\n)/g,'$1$2$2');};function P(T){return T.replace(//g,function(U){return '';});};function Q(T){return T.replace(//g,function(U,V){return decodeURIComponent(V);});};function R(T,U){var V=U._.dataStore;return T.replace(//g,function(W,X){return decodeURIComponent(X);}).replace(/\{cke_protected_(\d+)\}/g,function(W,X){return V&&V[X]||'';});};function S(T,U){var V=[],W=U.config.protectedSource,X=U._.dataStore||(U._.dataStore={id:1}),Y=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,Z=[//gi,//gi].concat(W);T=T.replace(//g,function(ab){return '';});for(var aa=0;aa';});T=T.replace(Y,function(ab,ac,ad){return '';});return T.replace(/(['"]).*?\1/g,function(ab){return ab.replace(//g,function(ac,ad){X[X.id]=decodeURIComponent(ad);return '{cke_protected_'+X.id++ +'}';});});};j.add('htmldataprocessor',{requires:['htmlwriter'],init:function(T){var U=T.dataProcessor=new a.htmlDataProcessor(T);U.writer.forceSimpleAmpersand=T.config.forceSimpleAmpersand;U.dataFilter.addRules(w);U.dataFilter.addRules(x);U.htmlFilter.addRules(y);var V={elements:{}};for(v in u)V.elements[v]=r(true,T.config.fillEmptyBlocks);U.htmlFilter.addRules(V);},onLoad:function(){!('fillEmptyBlocks' in i)&&(i.fillEmptyBlocks=1);}});a.htmlDataProcessor=function(T){var U=this;U.editor=T;U.writer=new a.htmlWriter();U.dataFilter=new a.htmlParser.filter();U.htmlFilter=new a.htmlParser.filter();};a.htmlDataProcessor.prototype={toHtml:function(T,U){T=S(T,this.editor);T=I(T);T=J(T);T=L(T);T=N(T);T=O(T);var V=new h('div');V.setHtml('a'+T);T=V.getHtml().substr(1);T=T.replace(new RegExp(' data-cke-'+a.rnd+'-','ig'),' ');T=M(T);T=K(T);T=Q(T);var W=a.htmlParser.fragment.fromHtml(T,U),X=new a.htmlParser.basicWriter();W.writeHtml(X,this.dataFilter);T=X.getHtml(true);T=P(T);return T;},toDataFormat:function(T,U){var V=this.writer,W=a.htmlParser.fragment.fromHtml(T,U);V.reset(); -W.writeHtml(V,this.htmlFilter);var X=V.getHtml(true);X=Q(X);X=R(X,this.editor);return X;}};})();(function(){j.add('iframe',{requires:['dialog','fakeobjects'],init:function(m){var n='iframe',o=m.lang.iframe;a.dialog.add(n,this.path+'dialogs/iframe.js');m.addCommand(n,new a.dialogCommand(n));m.addCss('img.cke_iframe{background-image: url('+a.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');m.ui.addButton('Iframe',{label:o.toolbar,command:n});m.on('doubleclick',function(p){var q=p.data.element;if(q.is('img')&&q.data('cke-real-element-type')=='iframe')p.data.dialog='iframe';});if(m.addMenuItems)m.addMenuItems({iframe:{label:o.title,command:'iframe',group:'image'}});if(m.contextMenu)m.contextMenu.addListener(function(p,q){if(p&&p.is('img')&&p.data('cke-real-element-type')=='iframe')return{iframe:2};});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter;if(o)o.addRules({elements:{iframe:function(p){return m.createFakeParserElement(p,'cke_iframe','iframe',true);}}});}});})();(function(){j.add('image',{requires:['dialog'],init:function(o){var p='image';a.dialog.add(p,this.path+'dialogs/image.js');o.addCommand(p,new a.dialogCommand(p));o.ui.addButton('Image',{label:o.lang.common.image,command:p});o.on('doubleclick',function(q){var r=q.data.element;if(r.is('img')&&!r.data('cke-realelement')&&!r.isReadOnly())q.data.dialog='image';});if(o.addMenuItems)o.addMenuItems({image:{label:o.lang.image.menu,command:'image',group:'image'}});if(o.contextMenu)o.contextMenu.addListener(function(q,r){if(m(o,q))return{image:2};});},afterInit:function(o){p('left');p('right');p('center');p('block');function p(q){var r=o.getCommand('justify'+q);if(r){if(q=='left'||q=='right')r.on('exec',function(s){var t=m(o),u;if(t){u=n(t);if(u==q){t.removeStyle('float');if(q==n(t))t.removeAttribute('align');}else t.setStyle('float',q);s.cancel();}});r.on('refresh',function(s){var t=m(o),u;if(t){u=n(t);this.setState(u==q?1:q=='right'||q=='left'?2:0);s.cancel();}});}};}});function m(o,p){if(!p){var q=o.getSelection();p=q.getType()==3&&q.getSelectedElement();}if(p&&p.is('img')&&!p.data('cke-realelement')&&!p.isReadOnly())return p;};function n(o){var p=o.getStyle('float');if(p=='inherit'||p=='none')p=0;if(!p)p=o.getAttribute('align');return p;};})();i.image_removeLinkByEmptyURL=true;(function(){var m={ol:1,ul:1},n=d.walker.whitespaces(true),o=d.walker.bookmark(false,true); -function p(t){var B=this;if(t.editor.readOnly)return null;var u=t.editor,v=t.data.path,w=v&&v.contains(m),x=v.block||v.blockLimit;if(w)return B.setState(2);if(!B.useIndentClasses&&B.name=='indent')return B.setState(2);if(!x)return B.setState(0);if(B.useIndentClasses){var y=x.$.className.match(B.classNameRegex),z=0;if(y){y=y[1];z=B.indentClassMap[y];}if(B.name=='outdent'&&!z||B.name=='indent'&&z==u.config.indentClasses.length)return B.setState(0);return B.setState(2);}else{var A=parseInt(x.getStyle(r(x)),10);if(isNaN(A))A=0;if(A<=0)return B.setState(0);return B.setState(2);}};function q(t,u){var w=this;w.name=u;w.useIndentClasses=t.config.indentClasses&&t.config.indentClasses.length>0;if(w.useIndentClasses){w.classNameRegex=new RegExp('(?:^|\\s+)('+t.config.indentClasses.join('|')+')(?=$|\\s)');w.indentClassMap={};for(var v=0;v0){var Z=X[T].parent;X[T].parent=new h(Z.getName(),Z.getDocument());}}for(T=W.getCustomData('listarray_index')+1;TY;T++)X[T].indent+=U;var aa=j.list.arrayToList(X,v,null,t.config.enterMode,M.getDirection());if(u.name=='outdent'){var ab;if((ab=M.getParent())&&ab.is('li')){var ac=aa.listNode.getChildren(),ad=[],ae=ac.count(),af;for(T=ae-1;T>=0;T--){if((af=ac.getItem(T))&&af.is&&af.is('li'))ad.push(af);}}}if(aa)aa.listNode.replace(M);if(ad&&ad.length)for(T=0;T0)M.addClass(t.config.indentClasses[P-1]);}else{var Q=r(M,N),R=parseInt(M.getStyle(Q),10);if(isNaN(R))R=0;var S=t.config.indentOffset||40;R+=(u.name=='indent'?1:-1)*S;if(R<0)return false;R=Math.max(R,0);R=Math.ceil(R/S)*S;M.setStyle(Q,R?R+(t.config.indentUnit||'px'):'');if(M.getAttribute('style')==='')M.removeAttribute('style');}h.setMarker(v,M,'indent_processed',1);return true;};var z=t.getSelection(),A=z.createBookmarks(1),B=z&&z.getRanges(1),C,D=B.createIterator();while(C=D.getNextRange()){var E=C.getCommonAncestor(),F=E;while(F&&!(F.type==1&&m[F.getName()]))F=F.getParent();if(!F){var G=C.getEnclosedNode();if(G&&G.type==1&&G.getName() in m){C.setStartAt(G,1);C.setEndAt(G,2);F=G;}}if(F&&C.startContainer.type==1&&C.startContainer.getName() in m){var H=new d.walker(C);H.evaluator=s;C.startContainer=H.next();}if(F&&C.endContainer.type==1&&C.endContainer.getName() in m){H=new d.walker(C);H.evaluator=s;C.endContainer=H.previous();}if(F){var I=F.getFirst(s),J=!!I.getNext(s),K=C.startContainer,L=I.equals(K)||I.contains(K);if(!(L&&(u.name=='indent'||u.useIndentClasses||parseInt(F.getStyle(r(F)),10))&&y(F,!J&&I.getDirection())))w(F);}else x();}h.clearAllMarkers(v);t.forceNextSelectionCheck();z.selectBookmarks(A);}};j.add('indent',{init:function(t){var u=t.addCommand('indent',new q(t,'indent')),v=t.addCommand('outdent',new q(t,'outdent'));t.ui.addButton('Indent',{label:t.lang.indent,command:'indent'});t.ui.addButton('Outdent',{label:t.lang.outdent,command:'outdent'});t.on('selectionChange',e.bind(p,u));t.on('selectionChange',e.bind(p,v));if(b.ie6Compat||b.ie7Compat)t.addCss('ul,ol{\tmargin-left: 0px;\tpadding-left: 40px;}');t.on('dirChanged',function(w){var x=new d.range(t.document);x.setStartBefore(w.data.node);x.setEndAfter(w.data.node);var y=new d.walker(x),z;while(z=y.next()){if(z.type==1){if(!z.equals(w.data.node)&&z.getDirection()){x.setStartAfter(z);y=new d.walker(x);continue;}var A=t.config.indentClasses;if(A){var B=w.data.dir=='ltr'?['_rtl','']:['','_rtl'];for(var C=0;C=0;z--){w=u[z].createIterator();w.enlargeBr=s!=2;while(x=w.getNextParagraph(s==1?'p':'div')){x.removeAttribute('align');x.removeStyle('text-align');var A=v&&(x.$.className=e.ltrim(x.$.className.replace(C.cssClassRegex,''))),B=C.state==2&&(!y||m(x,true)!=C.value);if(v){if(B)x.addClass(v);else if(!A)x.removeAttribute('class');}else if(B)x.setStyle('text-align',C.value);}}q.focus();q.forceNextSelectionCheck();r.selectBookmarks(t);},refresh:function(q){var r=q.block||q.blockLimit;this.setState(r.getName()!='body'&&m(r,this.editor.config.useComputedState)==this.value?1:2);}};j.add('justify',{init:function(q){var r=new o(q,'justifyleft','left'),s=new o(q,'justifycenter','center'),t=new o(q,'justifyright','right'),u=new o(q,'justifyblock','justify'); -q.addCommand('justifyleft',r);q.addCommand('justifycenter',s);q.addCommand('justifyright',t);q.addCommand('justifyblock',u);q.ui.addButton('JustifyLeft',{label:q.lang.justify.left,command:'justifyleft'});q.ui.addButton('JustifyCenter',{label:q.lang.justify.center,command:'justifycenter'});q.ui.addButton('JustifyRight',{label:q.lang.justify.right,command:'justifyright'});q.ui.addButton('JustifyBlock',{label:q.lang.justify.block,command:'justifyblock'});q.on('selectionChange',e.bind(n,r));q.on('selectionChange',e.bind(n,t));q.on('selectionChange',e.bind(n,s));q.on('selectionChange',e.bind(n,u));q.on('dirChanged',p);},requires:['domiterator']});})();j.add('keystrokes',{beforeInit:function(m){m.keystrokeHandler=new a.keystrokeHandler(m);m.specialKeys={};},init:function(m){var n=m.config.keystrokes,o=m.config.blockedKeystrokes,p=m.keystrokeHandler.keystrokes,q=m.keystrokeHandler.blockedKeystrokes;for(var r=0;r7))Y.append(T.createText('\xa0'));Y.append(af.listNode);W=af.nextIndex;}else if(ac.indent==-1&&!P&&ad){if(m[ad.getName()]){Y=ac.element.clone(false,true);if(Z!=ad.getDirection(1))Y.setAttribute('dir',Z);}else Y=new d.documentFragment(T);var ag=ad.getDirection(1)!=Z,ah=ac.element,ai=ah.getAttribute('class'),aj=ah.getAttribute('style'),ak=Y.type==11&&(Q!=2||ag||aj||ai),al,am=ac.contents.length;for(S=0;SQ[S-1].indent+1){var W=Q[S-1].indent+1-Q[S].indent,X=Q[S].indent;while(Q[S]&&Q[S].indent>=X){Q[S].indent+=W;S++;}S--;}}var Y=j.list.arrayToList(Q,P,null,N.config.enterMode,O.root.getAttribute('dir')),Z=Y.listNode,aa,ab;function ac(ad){if((aa=Z[ad?'getFirst':'getLast']())&&!(aa.is&&aa.isBlockBoundary())&&(ab=O.root[ad?'getPrevious':'getNext'](d.walker.whitespaces(true)))&&!(ab.is&&ab.isBlockBoundary({br:1})))N.document.createElement('br')[ad?'insertBefore':'insertAfter'](aa);};ac(true);ac();Z.replace(O.root);};function z(N,O){this.name=N;this.type=O;};var A=d.walker.nodeType(1);function B(N,O,P,Q){var R,S; -while(R=N[Q?'getLast':'getFirst'](A)){if((S=R.getDirection(1))!==O.getDirection(1))R.setAttribute('dir',S);R.remove();P?R[Q?'insertBefore':'insertAfter'](P):O.append(R,Q);}};z.prototype={exec:function(N){var aq=this;var O=N.document,P=N.config,Q=N.getSelection(),R=Q&&Q.getRanges(true);if(!R||R.length<1)return;if(aq.state==2){var S=O.getBody();if(!S.getFirst(q)){P.enterMode==2?S.appendBogus():R[0].fixBlock(1,P.enterMode==1?'p':'div');Q.selectRanges(R);}else{var T=R.length==1&&R[0],U=T&&T.getEnclosedNode();if(U&&U.is&&aq.type==U.getName())aq.setState(1);}}var V=Q.createBookmarks(true),W=[],X={},Y=R.createIterator(),Z=0;while((T=Y.getNextRange())&&++Z){var aa=T.getBoundaryNodes(),ab=aa.startNode,ac=aa.endNode;if(ab.type==1&&ab.getName()=='td')T.setStartAt(aa.startNode,1);if(ac.type==1&&ac.getName()=='td')T.setEndAt(aa.endNode,2);var ad=T.createIterator(),ae;ad.forceBrBreak=aq.state==2;while(ae=ad.getNextParagraph()){if(ae.getCustomData('list_block'))continue;else h.setMarker(X,ae,'list_block',1);var af=new d.elementPath(ae),ag=af.elements,ah=ag.length,ai=null,aj=0,ak=af.blockLimit,al;for(var am=ah-1;am>=0&&(al=ag[am]);am--){if(m[al.getName()]&&ak.contains(al)){ak.removeCustomData('list_group_object_'+Z);var an=al.getCustomData('list_group_object');if(an)an.contents.push(ae);else{an={root:al,contents:[ae]};W.push(an);h.setMarker(X,al,'list_group_object',an);}aj=1;break;}}if(aj)continue;var ao=ak;if(ao.getCustomData('list_group_object_'+Z))ao.getCustomData('list_group_object_'+Z).contents.push(ae);else{an={root:ao,contents:[ae]};h.setMarker(X,ao,'list_group_object_'+Z,an);W.push(an);}}}var ap=[];while(W.length>0){an=W.shift();if(aq.state==2){if(m[an.root.getName()])v.call(aq,N,an,X,ap);else x.call(aq,N,an,ap);}else if(aq.state==1&&m[an.root.getName()])y.call(aq,N,an,X);}for(am=0;am0)for(var u=t.length-1;u>=0;u--){var v=t[u][0],w=t[u][1];if(w)v.insertBefore(w);else v.appendTo(s);}};function o(s,t){var u=m(s),v={},w=s.$;if(!t){v['class']=w.className||'';w.className='';}v.inline=w.style.cssText||'';if(!t)w.style.cssText='position: static; overflow: visible';n(u);return v;};function p(s,t){var u=m(s),v=s.$;if('class' in t)v.className=t['class'];if('inline' in t)v.style.cssText=t.inline;n(u);};function q(s){var t=a.instances;for(var u in t){var v=t[u];if(v.mode=='wysiwyg'&&!v.readOnly){var w=v.document.getBody();w.setAttribute('contentEditable',false);w.setAttribute('contentEditable',true);}}if(s.focusManager.hasFocus){s.toolbox.focus();s.focus();}};function r(s){if(!c||b.version>6)return null;var t=h.createFromHtml(''); -return s.append(t,true);};j.add('maximize',{init:function(s){var t=s.lang,u=a.document,v=u.getWindow(),w,x,y,z;function A(){var C=v.getViewPaneSize();z&&z.setStyles({width:C.width+'px',height:C.height+'px'});s.resize(C.width,C.height,null,true);};var B=2;s.addCommand('maximize',{modes:{wysiwyg:!b.iOS,source:!b.iOS},readOnly:1,editorFocus:false,exec:function(){var C=s.container.getChild(1),D=s.getThemeSpace('contents');if(s.mode=='wysiwyg'){var E=s.getSelection();w=E&&E.getRanges();x=v.getScrollPosition();}else{var F=s.textarea.$;w=!c&&[F.selectionStart,F.selectionEnd];x=[F.scrollLeft,F.scrollTop];}if(this.state==2){v.on('resize',A);y=v.getScrollPosition();var G=s.container;while(G=G.getParent()){G.setCustomData('maximize_saved_styles',o(G));G.setStyle('z-index',s.config.baseFloatZIndex-1);}D.setCustomData('maximize_saved_styles',o(D,true));C.setCustomData('maximize_saved_styles',o(C,true));var H={overflow:b.webkit?'':'hidden',width:0,height:0};u.getDocumentElement().setStyles(H);!b.gecko&&u.getDocumentElement().setStyle('position','fixed');!(b.gecko&&b.quirks)&&u.getBody().setStyles(H);c?setTimeout(function(){v.$.scrollTo(0,0);},0):v.$.scrollTo(0,0);C.setStyle('position',b.gecko&&b.quirks?'fixed':'absolute');C.$.offsetLeft;C.setStyles({'z-index':s.config.baseFloatZIndex-1,left:'0px',top:'0px'});z=r(C);C.addClass('cke_maximized');A();var I=C.getDocumentPosition();C.setStyles({left:-1*I.x+'px',top:-1*I.y+'px'});b.gecko&&q(s);}else if(this.state==1){v.removeListener('resize',A);var J=[D,C];for(var K=0;K ');s.children.length=0;s.add(u);var v=s.attributes;delete v['aria-label'];delete v.contenteditable;delete v.title;}return t;}}},5);if(p)p.addRules({elements:{div:function(r){var s=r.attributes,t=s&&s.style,u=t&&r.children.length==1&&r.children[0],v=u&&u.name=='span'&&u.attributes.style;if(v&&/page-break-after\s*:\s*always/i.test(t)&&/display\s*:\s*none/i.test(v)){s.contenteditable='false';s['class']='cke_pagebreak';s['data-cke-display-name']='pagebreak';s['aria-label']=n;s.title=n;r.children.length=0;}}}});},requires:['fakeobjects']});j.pagebreakCmd={exec:function(m){var n=m.lang.pagebreakAlt,o=h.createFromHtml('
    '+'
    ',m.document),p=m.getSelection().getRanges(true);m.fire('saveSnapshot');for(var q,r=p.length-1;r>=0;r--){q=p[r];if(r1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.width*parseInt(n,10)/100,10);if(typeof o=='string'&&o.length>1&&o.substr(o.length-1,1)=='%')o=parseInt(window.screen.height*parseInt(o,10)/100,10);if(n<640)n=640;if(o<420)o=420;var q=parseInt((window.screen.height-o)/2,10),r=parseInt((window.screen.width-n)/2,10); -p=(p||'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes')+',width='+n+',height='+o+',top='+q+',left='+r;var s=window.open('',null,p,true);if(!s)return false;try{var t=navigator.userAgent.toLowerCase();if(t.indexOf(' chrome/')==-1){s.moveTo(r,q);s.resizeTo(n,o);}s.focus();s.location.href=m;}catch(u){s=window.open(m,null,p,true);}return true;}});(function(){var m,n={modes:{wysiwyg:1,source:1},canUndo:false,readOnly:1,exec:function(p){var q,r=p.config,s=r.baseHref?'':'',t=b.isCustomDomain();if(r.fullPage)q=p.getData().replace(//,'$&'+s).replace(/[^>]*(?=<\/title>)/,'$& — '+p.lang.preview);else{var u=''+''+s+''+p.lang.preview+''+e.buildStyleHtml(p.config.contentsCss)+''+u+p.getData()+'';}var w=640,x=420,y=80;try{var z=window.screen;w=Math.round(z.width*0.8);x=Math.round(z.height*0.7);y=Math.round(z.width*0.1);}catch(D){}var A='';if(t){window._cke_htmlToLoad=q;A='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}if(b.gecko){window._cke_htmlToLoad=q;A=m+'preview.html';}var B=window.open(A,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+w+',height='+x+',left='+y);if(!t&&!b.gecko){var C=B.document;C.open();C.write(q);C.close();b.webkit&&setTimeout(function(){C.body.innerHTML+='';},0);}}},o='preview';j.add(o,{init:function(p){m=this.path;p.addCommand(o,n);p.ui.addButton('Preview',{label:p.lang.preview,command:o});}});})();j.add('print',{init:function(m){var n='print',o=m.addCommand(n,j.print);m.ui.addButton('Print',{label:m.lang.print,command:n});}});j.print={exec:function(m){if(b.opera)return;else if(b.gecko)m.window.$.print();else m.document.$.execCommand('Print');},canUndo:false,readOnly:1,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(m){m.addCommand('removeFormat',j.removeformat.commands.removeformat);m.ui.addButton('RemoveFormat',{label:m.lang.removeFormat,command:'removeFormat'});m._.removeFormat={filters:[]};}});j.removeformat={commands:{removeformat:{exec:function(m){var n=m._.removeFormatRegex||(m._.removeFormatRegex=new RegExp('^(?:'+m.config.removeFormatTags.replace(/,/g,'|')+')$','i')),o=m._.removeAttributes||(m._.removeAttributes=m.config.removeFormatAttributes.split(',')),p=j.removeformat.filter,q=m.getSelection().getRanges(1),r=q.createIterator(),s; -while(s=r.getNextRange()){if(!s.collapsed)s.enlarge(1);var t=s.createBookmark(),u=t.startNode,v=t.endNode,w,x=function(z){var A=new d.elementPath(z),B=A.elements;for(var C=1,D;D=B[C];C++){if(D.equals(A.block)||D.equals(A.blockLimit))break;if(n.test(D.getName())&&p(m,D))z.breakParent(D);}};x(u);if(v){x(v);w=u.getNextSourceNode(true,1);while(w){if(w.equals(v))break;var y=w.getNextSourceNode(false,1);if(!(w.getName()=='img'&&w.data('cke-realelement'))&&p(m,w))if(n.test(w.getName()))w.remove(1);else{w.removeAttributes(o);m.fire('removeFormatCleanup',w);}w=y;}}s.moveToBookmark(t);}m.getSelection().selectRanges(q);}}},filter:function(m,n){var o=m._.removeFormat.filters;for(var p=0;pr.width&&(n.resize_minWidth=r.width);n.resize_minHeight>r.height&&(n.resize_minHeight=r.height);a.document.on('mousemove',u);a.document.on('mouseup',v);if(m.document){m.document.on('mousemove',u);m.document.on('mouseup',v);}});m.on('destroy',function(){e.removeFunction(w);});m.on('themeSpace',function(x){if(x.data.space=='bottom'){var y=''; -if(s&&!t)y=' cke_resizer_horizontal';if(!s&&t)y=' cke_resizer_vertical';var z='
    ';o=='ltr'&&y=='ltr'?x.data.html+=z:x.data.html=z+x.data.html;}},m,null,100);}}});(function(){var m={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(o){var p=o.element.$.form;if(p)try{p.submit();}catch(q){if(p.submit.click)p.submit.click();}}},n='save';j.add(n,{init:function(o){var p=o.addCommand(n,m);p.modes={wysiwyg:!!o.element.$.form};o.ui.addButton('Save',{label:o.lang.save,command:n});}});})();(function(){var m='scaytcheck',n='';function o(t,u){var v=0,w;for(w in u){if(u[w]==t){v=1;break;}}return v;};var p=function(){var t=this,u=function(){var y=t.config,z={};z.srcNodeRef=t.document.getWindow().$.frameElement;z.assocApp='CKEDITOR.'+a.version+'@'+a.revision;z.customerid=y.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';z.customDictionaryIds=y.scayt_customDictionaryIds||'';z.userDictionaryName=y.scayt_userDictionaryName||'';z.sLang=y.scayt_sLang||'en_US';z.onLoad=function(){if(!(c&&b.version<8))this.addStyle(this.selectorCss(),'padding-bottom: 2px !important;');if(t.focusManager.hasFocus&&!q.isControlRestored(t))this.focus();};z.onBeforeChange=function(){if(q.getScayt(t)&&!t.checkDirty())setTimeout(function(){t.resetDirty();},0);};var A=window.scayt_custom_params;if(typeof A=='object')for(var B in A)z[B]=A[B];if(q.getControlId(t))z.id=q.getControlId(t);var C=new window.scayt(z);C.afterMarkupRemove.push(function(E){new h(E,C.document).mergeSiblings();});var D=q.instances[t.name];if(D){C.sLang=D.sLang;C.option(D.option());C.paused=D.paused;}q.instances[t.name]=C;try{C.setDisabled(q.isPaused(t)===false);}catch(E){}t.fire('showScaytState');};t.on('contentDom',u);t.on('contentDomUnload',function(){var y=a.document.getElementsByTag('script'),z=/^dojoIoScript(\d+)$/i,A=/^https?:\/\/svc\.webspellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var B=0;B=0){this.setState(0);q.loadEngine(t);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(t){var u=t.config.scayt_contextMenuItemsOrder||'suggest|moresuggest|control',v='';u=u.split('|');if(u&&u.length)for(var w=0;w tr > td, .%1 table.%2 > tr > th,','.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,','.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,','.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th','{','border : #d3d3d3 1px dotted','}']).join(''); -n=o.replace(/%2/g,m).replace(/%1/g,'cke_show_borders ');var p={preserveState:true,editorFocus:false,readOnly:1,exec:function(q){this.toggleState();this.refresh(q);},refresh:function(q){if(q.document){var r=this.state==1?'addClass':'removeClass';q.document.getBody()[r]('cke_show_borders');}}};j.add('showborders',{requires:['wysiwygarea'],modes:{wysiwyg:1},init:function(q){var r=q.addCommand('showborders',p);r.canUndo=false;if(q.config.startupShowBorders!==false)r.setState(1);q.addCss(n);q.on('mode',function(){if(r.state!=0)r.refresh(q);},null,null,100);q.on('contentDom',function(){if(r.state!=0)r.refresh(q);});q.on('removeFormatCleanup',function(s){var t=s.data;if(q.getCommand('showborders').state==1&&t.is('table')&&(!t.hasAttribute('border')||parseInt(t.getAttribute('border'),10)<=0))t.addClass(m);});},afterInit:function(q){var r=q.dataProcessor,s=r&&r.dataFilter,t=r&&r.htmlFilter;if(s)s.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'],x=parseInt(v.border,10);if((!x||x<=0)&&(!w||w.indexOf(m)==-1))v['class']=(w||'')+' '+m;}}});if(t)t.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'];w&&(v['class']=w.replace(m,'').replace(/\s{2}/,' ').replace(/^\s+|\s+$/,''));}}});}});a.on('dialogDefinition',function(q){var r=q.data.name;if(r=='table'||r=='tableProperties'){var s=q.data.definition,t=s.getContents('info'),u=t.get('txtBorder'),v=u.commit;u.commit=e.override(v,function(y){return function(z,A){y.apply(this,arguments);var B=parseInt(this.getValue(),10);A[!B||B<=0?'addClass':'removeClass'](m);};});var w=s.getContents('advanced'),x=w&&w.get('advCSSClasses');if(x){x.setup=e.override(x.setup,function(y){return function(){y.apply(this,arguments);this.setValue(this.getValue().replace(/cke_show_border/,''));};});x.commit=e.override(x.commit,function(y){return function(z,A){y.apply(this,arguments);if(!parseInt(A.getAttribute('border'),10))A.addClass('cke_show_border');};});}}});})();j.add('sourcearea',{requires:['editingblock'],init:function(m){var n=j.sourcearea,o=a.document.getWindow();m.on('editingBlockReady',function(){var p,q;m.addMode('source',{load:function(r,s){if(c&&b.version<8)r.setStyle('position','relative');m.textarea=p=new h('textarea');p.setAttributes({dir:'ltr',tabIndex:b.webkit?-1:m.tabIndex,role:'textbox','aria-label':m.lang.editorTitle.replace('%1',m.name)});p.addClass('cke_source');p.addClass('cke_enable_context_menu');m.readOnly&&p.setAttribute('readOnly','readonly');var t={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'}; -if(c){q=function(){p.hide();p.setStyle('height',r.$.clientHeight+'px');p.setStyle('width',r.$.clientWidth+'px');p.show();};m.on('resize',q);o.on('resize',q);setTimeout(q,0);}r.setHtml('');r.append(p);p.setStyles(t);m.fire('ariaWidget',p);p.on('blur',function(){m.focusManager.blur();});p.on('focus',function(){m.focusManager.focus();});m.mayBeDirty=true;this.loadData(s);var u=m.keystrokeHandler;if(u)u.attach(p);setTimeout(function(){m.mode='source';m.fire('mode',{previousMode:m._.previousMode});},b.gecko||b.webkit?100:0);},loadData:function(r){p.setValue(r);m.fire('dataReady');},getData:function(){return p.getValue();},getSnapshotData:function(){return p.getValue();},unload:function(r){p.clearCustomData();m.textarea=p=null;if(q){m.removeListener('resize',q);o.removeListener('resize',q);}if(c&&b.version<8)r.removeStyle('position');},focus:function(){p.focus();}});});m.on('readOnly',function(){if(m.mode=='source')if(m.readOnly)m.textarea.setAttribute('readOnly','readonly');else m.textarea.removeAttribute('readOnly');});m.addCommand('source',n.commands.source);if(m.ui.addButton)m.ui.addButton('Source',{label:m.lang.source,command:'source'});m.on('mode',function(){m.getCommand('source').setState(m.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,readOnly:1,exec:function(m){if(m.mode=='wysiwyg')m.fire('saveSnapshot');m.getCommand('source').setState(0);m.setMode(m.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(n){var o=n.config,p=n.lang.stylesCombo,q={},r=[],s;function t(u){n.getStylesSet(function(v){if(!r.length){var w,x;for(var y=0,z=v.length;y0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true);I.push(S);}};for(var L=0;L1&&V&&U[Y]==V[Y]){Z=U[Y];Z.rowSpan+=1;}else{Z=new h(U[Y]).clone();Z.removeAttribute('rowSpan');!c&&Z.appendBogus();X.append(Z);Z=Z.$;}Y+=Z.colSpan-1;}H?X.insertBefore(S):X.insertAfter(S);};function q(G){if(G instanceof d.selection){var H=n(G),I=H[0],J=I.getAscendant('table'),K=e.buildTableMap(J),L=H[0].getParent(),M=L.$.rowIndex,N=H[H.length-1],O=N.getParent().$.rowIndex+N.$.rowSpan-1,P=[];for(var Q=M;Q<=O;Q++){var R=K[Q],S=new h(J.$.rows[Q]);for(var T=0;T0?X[M-1]:null)||J.$.parentNode);for(Q=P.length;Q>=0;Q--)q(P[Q]);return Y;}else if(G instanceof h){J=G.getAscendant('table');if(J.$.rows.length==1)J.remove();else G.remove();}return null;};function r(G,H){var I=G.getParent(),J=I.$.cells,K=0;for(var L=0;LI)I=K;}return I;};function t(G,H){var I=n(G),J=I[0],K=J.getAscendant('table'),L=s(I,1),M=s(I),N=H?L:M,O=e.buildTableMap(K),P=[],Q=[],R=O.length;for(var S=0;S1&&Q.length&&Q[S]==P[S]){U=P[S];U.colSpan+=1;}else{U=new h(P[S]).clone();U.removeAttribute('colSpan');!c&&U.appendBogus();U[H?'insertBefore':'insertAfter'].call(U,new h(P[S]));U=U.$;}S+=U.rowSpan-1;}};function u(G){var H=n(G),I=H[0],J=H[H.length-1],K=I.getAscendant('table'),L=e.buildTableMap(K),M,N,O=[];for(var P=0,Q=L.length;P1){L=H[J-1]+1;break;}}if(!L)L=H[0]>0?H[0]-1:H[H.length-1]+1;var N=I.$.rows;for(J=0,K=N.length;J=0;K--)x(H[K]);if(J)z(J,true);else if(I)I.remove();}else if(G instanceof h){var L=G.getParent();if(L.getChildCount()==1)L.remove();else G.remove();}};function y(G){var H=G.getBogus();H&&H.remove();G.trim();};function z(G,H){var I=new d.range(G.getDocument());if(!I['moveToElementEdit'+(H?'End':'Start')](G)){I.selectNodeContents(G);I.collapse(H?false:true);}I.select(true);};function A(G,H,I){var J=G[H];if(typeof I=='undefined')return J;for(var K=0;J&&K1)J+=K[H].rowSpan-1;}return I;};function C(G,H,I){var J=n(G),K;if((H?J.length!=1:J.length<2)||(K=G.getCommonAncestor())&&K.type==1&&K.is('table'))return false;var L,M=J[0],N=M.getAscendant('table'),O=e.buildTableMap(N),P=O.length,Q=O[0].length,R=M.getParent().$.rowIndex,S=A(O,R,M);if(H){var T;try{var U=parseInt(M.getAttribute('rowspan'),10)||1,V=parseInt(M.getAttribute('colspan'),10)||1;T=O[H=='up'?R-U:H=='down'?R+U:R][H=='left'?S-V:H=='right'?S+V:S];}catch(an){return false;}if(!T||M.$==T)return false;J[H=='up'||H=='left'?'unshift':'push'](new h(T));}var W=M.getDocument(),X=R,Y=0,Z=0,aa=!I&&new d.documentFragment(W),ab=0;for(var ac=0;ac=Q)M.removeAttribute('rowSpan');else M.$.rowSpan=Y;if(Y>=P)M.removeAttribute('colSpan');else M.$.colSpan=Z;var ak=new d.nodeList(N.$.rows),al=ak.count();for(ac=al-1;ac>=0;ac--){var am=ak.getItem(ac);if(!am.$.cells.length){am.remove();al++;continue;}}return M;}else return Y*Z==ab;};function D(G,H){var I=n(G);if(I.length>1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.rowSpan,Q,R,S,T;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);T=N+R;var U=new h(L.$.rows[T]),V=A(M,T),W;Q=J.clone();for(var X=0;XO){Q.insertBefore(new h(W));break;}else W=null;}if(!W)U.append(Q,true);}else{S=R=1;U=K.clone();U.insertAfter(K);U.append(Q=J.clone());var Y=A(M,N);for(var Z=0;Z1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.colSpan,Q,R,S;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);}else{S=R=1;var T=B(M,O);for(var U=0;U0?2:0};}},tablecell_insertBefore:{label:H.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:H.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:H.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:H.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:H.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:H.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:H.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:H.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:H.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:H.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:H.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:H.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:H.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:H.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2}; -}},tablecolumn_insertBefore:{label:H.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:H.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:H.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(G.contextMenu)G.contextMenu.addListener(function(I,J){if(!I||I.isReadOnly())return null;while(I){if(I.getName() in F)return{tablecell:2,tablerow:2,tablecolumn:2};I=I.getParent();}return null;});},getSelectedCells:n};j.add('tabletools',j.tabletools);})();e.buildTableMap=function(m){var n=m.$.rows,o=-1,p=[];for(var q=0;qp&&(!s||!t||vt){s=v;t=u;}}else{if(q&&u==p){s=v;break;}if(ut)){s=v;t=u;}}}if(s)s.focus();};(function(){j.add('templates',{requires:['dialog'],init:function(o){a.dialog.add('templates',a.getUrl(this.path+'dialogs/templates.js'));o.addCommand('templates',new a.dialogCommand('templates'));o.ui.addButton('Templates',{label:o.lang.templates.button,command:'templates'});}});var m={},n={};a.addTemplates=function(o,p){m[o]=p;};a.getTemplates=function(o){return m[o];};a.loadTemplates=function(o,p){var q=[];for(var r=0,s=o.length;r':' style="display:none">');t.push('',o.lang.toolbars,'');var w=o.toolbox.toolbars,x=o.config.toolbar instanceof Array?o.config.toolbar:o.config['toolbar_'+o.config.toolbar];for(var y=0;y');v=0;}if(C==='/'){t.push('
    ');continue;}D=C.items||C;for(var E=0;E');B&&t.push('',B,'');t.push('');var I=w.push(A)-1;if(I>0){A.previous=w[I-1];A.previous.next=A;}}if(H){if(!v){t.push('');v=1;}}else if(v){t.push('');v=0;}var J=F.render(o,t);I=A.items.push(J)-1;if(I>0){J.previous=A.items[I-1];J.previous.next=J;}J.toolbar=A;J.onkey=q;J.onfocus=function(){if(!o.toolbox.focusCommandExecuted)o.focus();};}}if(v){t.push('');v=0;}if(A)t.push('');}t.push('
    ');if(o.config.toolbarCanCollapse){var K=e.addFunction(function(){o.execCommand('toolbarCollapse');});o.on('destroy',function(){e.removeFunction(K);});var L=e.getNextId();o.addCommand('toolbarCollapse',{readOnly:1,exec:function(M){var N=a.document.getById(L),O=N.getPrevious(),P=M.getThemeSpace('contents'),Q=O.getParent(),R=parseInt(P.$.style.height,10),S=Q.$.offsetHeight,T=!O.isVisible();if(!T){O.hide();N.addClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarExpand);}else{O.show();N.removeClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarCollapse);}N.getFirst().setText(T?'▲':'◀');var U=Q.$.offsetHeight-S;P.setStyle('height',R-U+'px');M.fire('resize');},modes:{wysiwyg:1,source:1}});t.push('','','');}r.data.html+=t.join('');}});o.on('destroy',function(){var r,s=0,t,u,v;r=this.toolbox.toolbars;for(;s');return{};}};}});}});})();a.UI_SEPARATOR='separator';i.toolbarLocation='top';i.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];i.toolbar_Full=[{name:'document',items:['Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates']},{name:'clipboard',items:['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']},{name:'editing',items:['Find','Replace','-','SelectAll','-','SpellChecker','Scayt']},{name:'forms',items:['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField']},'/',{name:'basicstyles',items:['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']},{name:'paragraph',items:['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl']},{name:'links',items:['Link','Unlink','Anchor']},{name:'insert',items:['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe']},'/',{name:'styles',items:['Styles','Format','Font','FontSize']},{name:'colors',items:['TextColor','BGColor']},{name:'tools',items:['Maximize','ShowBlocks','-','About']}];i.toolbar='Full';i.toolbarCanCollapse=true;(function(){j.add('undo',{requires:['selection','wysiwygarea'],init:function(s){var t=new o(s),u=s.addCommand('undo',{exec:function(){if(t.undo()){s.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),v=s.addCommand('redo',{exec:function(){if(t.redo()){s.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});t.onChange=function(){u.setState(t.undoable()?2:0);v.setState(t.redoable()?2:0);};function w(x){if(t.enabled&&x.data.command.canUndo!==false)t.save();};s.on('beforeCommandExec',w);s.on('afterCommandExec',w);s.on('saveSnapshot',function(x){t.save(x.data&&x.data.contentOnly);});s.on('contentDom',function(){s.document.on('keydown',function(x){if(!x.data.$.ctrlKey&&!x.data.$.metaKey)t.type(x);});});s.on('beforeModeUnload',function(){s.mode=='wysiwyg'&&t.save(true);});s.on('mode',function(){t.enabled=s.readOnly?false:s.mode=='wysiwyg';t.onChange();});s.ui.addButton('Undo',{label:s.lang.undo,command:'undo'});s.ui.addButton('Redo',{label:s.lang.redo,command:'redo'}); -s.resetUndo=function(){t.reset();s.fire('saveSnapshot');};s.on('updateSnapshot',function(){if(t.currentImage)t.update();});}});j.undo={};var m=j.undo.Image=function(s){this.editor=s;s.fire('beforeUndoImage');var t=s.getSnapshot(),u=t&&s.getSelection();c&&t&&(t=t.replace(/\s+data-cke-expando=".*?"/g,''));this.contents=t;this.bookmarks=u&&u.createBookmarks2(true);s.fire('afterUndoImage');},n=/\b(?:href|src|name)="[^"]*?"/gi;m.prototype={equals:function(s,t){var u=this.contents,v=s.contents;if(c&&(b.ie7Compat||b.ie6Compat)){u=u.replace(n,'');v=v.replace(n,'');}if(u!=v)return false;if(t)return true;var w=this.bookmarks,x=s.bookmarks;if(w||x){if(!w||!x||w.length!=x.length)return false;for(var y=0;y25){this.save(false,null,false);this.modifiersCount=1;}}else if(!y){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var s=this;s.lastKeystroke=0;s.snapshots=[];s.index=-1;s.limit=s.editor.config.undoStackSize||20;s.currentImage=null;s.hasUndo=false;s.hasRedo=false;s.resetType();},resetType:function(){var s=this;s.typing=false;delete s.lastKeystroke;s.typesCount=0;s.modifiersCount=0;},fireChange:function(){var s=this;s.hasUndo=!!s.getNextImage(true);s.hasRedo=!!s.getNextImage(false);s.resetType();s.onChange();},save:function(s,t,u){var w=this;var v=w.snapshots;if(!t)t=new m(w.editor);if(t.contents===false)return false;if(w.currentImage&&t.equals(w.currentImage,s))return false;v.splice(w.index+1,v.length-w.index-1);if(v.length==w.limit)v.shift(); -w.index=v.push(t)-1;w.currentImage=t;if(u!==false)w.fireChange();return true;},restoreImage:function(s){var w=this;var t=w.editor,u;if(s.bookmarks){t.focus();u=t.getSelection();}w.editor.loadSnapshot(s.contents);if(s.bookmarks)u.selectBookmarks(s.bookmarks);else if(c){var v=w.editor.document.getBody().$.createTextRange();v.collapse(true);v.select();}w.index=s.index;w.update();w.fireChange();},getNextImage:function(s){var x=this;var t=x.snapshots,u=x.currentImage,v,w;if(u)if(s)for(w=x.index-1;w>=0;w--){v=t[w];if(!u.equals(v,true)){v.index=w;return v;}}else for(w=x.index+1;w]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true),o=d.walker.bogus(true),p=function(E){return n(E)&&o(E);};function q(E){return E.isBlockBoundary()&&f.$empty[E.getName()];};function r(E){return function(F){if(this.mode=='wysiwyg'){this.focus();var G=this.getSelection(),H=G.isLocked;H&&G.unlock();this.fire('saveSnapshot');E.call(this,F.data);H&&this.getSelection().lock();e.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};};function s(E){var N=this;if(N.dataProcessor)E=N.dataProcessor.toHtml(E);if(!E)return;var F=N.getSelection(),G=F.getRanges()[0];if(G.checkReadOnly())return;if(b.opera){var H=new d.elementPath(G.startContainer);if(H.block){var I=a.htmlParser.fragment.fromHtml(E,false).children;for(var J=0,K=I.length;J'+Q+'';});I=I.replace(/\n/g,'
    ');if(!(H||c))I=I.replace(new RegExp('
    (?=)'),function(O){return e.repeat(O,2);});if(b.gecko||b.webkit){var K=new d.elementPath(F.getStartElement()),L=[];for(var M=0;M/));else if(N in f.$block)break;}I=L.join('')+I;}s.call(this,I);};function u(E){var F=this.getSelection(),G=F.getRanges(),H=E.getName(),I=f.$block[H],J=F.isLocked;if(J)F.unlock();var K,L,M,N;for(var O=G.length-1;O>=0;O--){K=G[O];if(!K.checkReadOnly()){K.deleteContents(1);L=!O&&E||E.clone(1);var P,Q;if(I)while((P=K.getCommonAncestor(0,1))&&(Q=f[P.getName()])&&!(Q&&Q[H])){if(P.getName() in f.span)K.splitElement(P);else if(K.checkStartOfBlock()&&K.checkEndOfBlock()){K.setStartBefore(P);K.collapse(true);P.remove();}else K.splitBlock();}K.insertNode(L);if(!M)M=L;}}if(M){K.moveToPosition(M,4);if(I){var R=M.getNext(p),S=R&&R.type==1&&R.getName();if(S&&f.$block[S]){if(f[S]['#'])K.moveToElementEditStart(R);else K.moveToElementEditEnd(M);}else if(!R){R=K.fixBlock(true,this.config.enterMode==3?'div':'p');K.moveToElementEditStart(R);}}}F.selectRanges([K]);if(J)this.getSelection().lock();};function v(E){if(!E.checkDirty())setTimeout(function(){E.resetDirty();},0);};var w=d.walker.whitespaces(true),x=d.walker.bookmark(false,true);function y(E){return w(E)&&x(E);};function z(E){return E.type==3&&e.trim(E.getText()).match(/^(?: |\xa0)$/);};function A(E){if(E.isLocked){E.unlock();setTimeout(function(){E.lock();},0);}};function B(E){return E.getOuterHtml().match(m);};w=d.walker.whitespaces(true);function C(E){var F=E.window,G=E.document,H=E.document.getBody(),I=H.getFirst(),J=H.getChildren().count();if(!J||J==1&&I.type==1&&I.hasAttribute('_moz_editor_bogus_node')){v(E);var K=E.element.getDocument(),L=K.getDocumentElement(),M=L.$.scrollTop,N=L.$.scrollLeft,O=G.$.createEvent('KeyEvents'); -O.initKeyEvent('keypress',true,true,F.$,false,false,false,false,0,32);G.$.dispatchEvent(O);if(M!=L.$.scrollTop||N!=L.$.scrollLeft)K.getWindow().$.scrollTo(N,M);J&&H.getFirst().remove();G.getBody().appendBogus();var P=new d.range(G);P.setStartAt(H,1);P.select();}};function D(E){var F=E.editor,G=E.data.path,H=G.blockLimit,I=E.data.selection,J=I.getRanges()[0],K=F.document.getBody(),L=F.config.enterMode;if(b.gecko){C(F);var M=G.block||G.blockLimit,N=M&&M.getLast(y);if(M&&M.isBlockBoundary()&&!(N&&N.type==1&&N.isBlockBoundary())&&!M.is('pre')&&!M.getBogus())M.appendBogus();}if(F.config.autoParagraph!==false&&L!=2&&J.collapsed&&H.getName()=='body'&&!G.block){var O=J.fixBlock(true,F.config.enterMode==3?'div':'p');if(c){var P=O.getFirst(y);P&&z(P)&&P.remove();}if(B(O)){var Q=O.getNext(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditStart(Q);O.remove();}else{Q=O.getPrevious(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditEnd(Q);O.remove();}}}J.select();E.cancel();}var R=new d.range(F.document);R.moveToElementEditEnd(F.document.getBody());var S=new d.elementPath(R.startContainer);if(!S.blockLimit.is('body')){var T;if(L!=2)T=K.append(F.document.createElement(L==1?'p':'div'));else T=K;if(!c)T.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(E){var F=E.config.enterMode!=2&&E.config.autoParagraph!==false?E.config.enterMode==3?'div':'p':false,G=E.lang.editorTitle.replace('%1',E.name),H=E.lang.editorHelp;if(c)G+=', '+H;var I=a.document.getWindow(),J;E.on('editingBlockReady',function(){var M,N,O,P,Q,R,S,T=b.isCustomDomain(),U=function(X){if(N)N.remove();var Y='document.open();'+(T?'document.domain="'+document.domain+'";':'')+'document.close();';Y=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(Y)+'}())':'';var Z=e.getNextId();N=h.createFromHtml('');if(document.location.protocol=='chrome:')a.event.useCapture=true;N.on('load',function(aa){Q=1;aa.removeListener();var ab=N.getFrameDocument();ab.write(X);b.air&&W(ab.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;M.append(h.createFromHtml(''+H+''));M.append(N);if(b.webkit){S=function(){M.setStyle('width','100%');N.hide();N.setSize('width',M.getSize('width'));M.removeStyle('width');N.show();};I.on('resize',S); -}};J=e.addFunction(W);var V='';function W(X){if(!Q)return;Q=0;E.fire('ariaWidget',N);var Y=X.document,Z=Y.body,aa=Y.getElementById('cke_actscrpt');aa&&aa.parentNode.removeChild(aa);Z.spellcheck=!E.config.disableNativeSpellChecker;var ab=!E.readOnly;if(c){Z.hideFocus=true;Z.disabled=true;Z.contentEditable=ab;Z.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)Y.$.body.contentEditable=ab;else if(b.webkit)Y.$.body.parentNode.contentEditable=ab;else Y.$.designMode=ab?'off':'on';},0);ab&&b.gecko&&e.setTimeout(C,0,null,E);X=E.window=new d.window(X);Y=E.document=new g(Y);ab&&Y.on('dblclick',function(ag){var ah=ag.data.getTarget(),ai={element:ah,dialog:''};E.fire('doubleclick',ai);ai.dialog&&E.openDialog(ai.dialog);});c&&Y.on('click',function(ag){var ah=ag.data.getTarget();if(ah.is('input')){var ai=ah.getAttribute('type');if(ai=='submit'||ai=='reset')ag.data.preventDefault();}});if(!(c||b.opera))Y.on('mousedown',function(ag){var ah=ag.data.getTarget();if(ah.is('img','hr','input','textarea','select'))E.getSelection().selectElement(ah);});if(b.gecko)Y.on('mouseup',function(ag){if(ag.data.$.button==2){var ah=ag.data.getTarget();if(!ah.getOuterHtml().replace(m,'')){var ai=new d.range(Y);ai.moveToElementEditStart(ah);ai.select(true);}}});Y.on('click',function(ag){ag=ag.data;if(ag.getTarget().is('a')&&ag.$.button!=2)ag.preventDefault();});if(b.webkit){Y.on('mousedown',function(){ad=1;});Y.on('click',function(ag){if(ag.data.getTarget().is('input','select'))ag.data.preventDefault();});Y.on('mouseup',function(ag){if(ag.data.getTarget().is('input','textarea'))ag.data.preventDefault();});}var ac=c?N:X;ac.on('blur',function(){E.focusManager.blur();});var ad;ac.on('focus',function(){var ag=E.document;if(b.gecko||b.opera)ag.getBody().focus();else if(b.webkit)if(!ad){E.document.getDocumentElement().focus();ad=1;}E.focusManager.focus();});var ae=E.keystrokeHandler;ae.blockedKeystrokes[8]=!ab;ae.attach(Y);Y.getDocumentElement().addClass(Y.$.compatMode);ab&&Y.on('keydown',function(ag){var ah=ag.data.getKeystroke();if(ah in {8:1,46:1}){var ai=E.getSelection(),aj=ai.getSelectedElement(),ak=ai.getRanges()[0],al=new d.elementPath(ak.startContainer),am,an,ao,ap=ah==8;if(aj){E.fire('saveSnapshot');ak.moveToPosition(aj,3);aj.remove();ak.select();E.fire('saveSnapshot'); -ag.data.preventDefault();}else if((am=al.block)&&ak[ap?'checkStartOfBlock':'checkEndOfBlock']()&&(ao=am[ap?'getPrevious':'getNext'](n))&&ao.is('table')){E.fire('saveSnapshot');if(ak[ap?'checkEndOfBlock':'checkStartOfBlock']())am.remove();ak['moveToElementEdit'+(ap?'End':'Start')](ao);ak.select();E.fire('saveSnapshot');ag.data.preventDefault();}else if(al.blockLimit.is('td')&&(an=al.blockLimit.getAscendant('table'))&&ak.checkBoundaryOfElement(an,ap?1:2)&&(ao=an[ap?'getPrevious':'getNext'](n))){E.fire('saveSnapshot');ak['moveToElementEdit'+(ap?'End':'Start')](ao);if(ak.checkStartOfBlock()&&ak.checkEndOfBlock())ao.remove();else ak.select();E.fire('saveSnapshot');ag.data.preventDefault();}}if(ah==33||ah==34)if(b.gecko){var aq=Y.getBody();if(X.$.innerHeight>aq.$.offsetHeight){ak=new d.range(Y);ak[ah==33?'moveToElementEditStart':'moveToElementEditEnd'](aq);ak.select();ag.data.preventDefault();}}});if(c&&Y.$.compatMode=='CSS1Compat'){var af={33:1,34:1};Y.on('keydown',function(ag){if(ag.data.getKeystroke() in af)setTimeout(function(){E.getSelection().scrollIntoView();},0);});}if(c&&E.config.enterMode!=1)Y.on('selectionchange',function(){var ag=Y.getBody(),ah=E.getSelection(),ai=ah&&ah.getRanges()[0];if(ai&&ag.getHtml().match(/^

     <\/p>$/i)&&ai.startContainer.equals(ag))setTimeout(function(){ai=E.getSelection().getRanges()[0];if(!ai.startContainer.equals('body')){ag.getFirst().remove(1);ai.moveToElementEditEnd(ag);ai.select(1);}},0);});if(E.contextMenu)E.contextMenu.addTarget(Y,E.config.browserContextMenuOnCtrl!==false);setTimeout(function(){E.fire('contentDom');if(R){E.mode='wysiwyg';E.fire('mode',{previousMode:E._.previousMode});R=false;}O=false;if(P){E.focus();P=false;}setTimeout(function(){E.fire('dataReady');},0);try{E.document.$.execCommand('2D-position',false,true);}catch(ag){}try{E.document.$.execCommand('enableInlineTableEditing',false,!E.config.disableNativeTableHandles);}catch(ah){}if(E.config.disableObjectResizing)try{E.document.$.execCommand('enableObjectResizing',false,false);}catch(ai){E.document.getBody().on(c?'resizestart':'resize',function(aj){aj.data.preventDefault();});}if(c)setTimeout(function(){if(E.document){var aj=E.document.$.body;aj.runtimeStyle.marginBottom='0px';aj.runtimeStyle.marginBottom='';}},1000);},0);};E.addMode('wysiwyg',{load:function(X,Y,Z){M=X;if(c&&b.quirks)X.setStyle('position','relative');E.mayBeDirty=true;R=true;if(Z)this.loadSnapshotData(Y);else this.loadData(Y);},loadData:function(X){O=true;E._.dataStore={id:1};var Y=E.config,Z=Y.fullPage,aa=Y.docType,ab=''; -!Z&&(ab=e.buildStyleHtml(E.config.contentsCss)+ab);var ac=Y.baseHref?'':'';if(Z)X=X.replace(/]*>/i,function(ad){E.docType=aa=ad;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ad){E.xmlDeclaration=ad;return '';});if(E.dataProcessor)X=E.dataProcessor.toHtml(X,F);if(Z){if(!/]/.test(X))X=''+X;if(!/]/.test(X))X=''+X+'';if(!/]/.test(X))X=X.replace(/]*>/,'$&');else if(!/]/.test(X))X=X.replace(/]*>/,'$&');ac&&(X=X.replace(//,'$&'+ac));X=X.replace(/<\/head\s*>/,ab+'$&');X=aa+X;}else X=Y.docType+''+''+''+G+''+ac+ab+''+''+X+'';if(b.gecko)X=X.replace(/
    (?=\s*<\/(:?html|body)>)/,'$&
    ');X+=V;this.onDispose();U(X);},getData:function(){var X=E.config,Y=X.fullPage,Z=Y&&E.docType,aa=Y&&E.xmlDeclaration,ab=N.getFrameDocument(),ac=Y?ab.getDocumentElement().getOuterHtml():ab.getBody().getHtml();if(b.gecko)ac=ac.replace(/
    (?=\s*(:?$|<\/body>))/,'');if(E.dataProcessor)ac=E.dataProcessor.toDataFormat(ac,F);if(X.ignoreEmptyParagraph)ac=ac.replace(m,function(ad,ae){return ae;});if(aa)ac=aa+'\n'+ac;if(Z)ac=Z+'\n'+ac;return ac;},getSnapshotData:function(){return N.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(X){N.getFrameDocument().getBody().setHtml(X);},onDispose:function(){if(!E.document)return;E.document.getDocumentElement().clearCustomData();E.document.getBody().clearCustomData();E.window.clearCustomData();E.document.clearCustomData();N.clearCustomData();N.remove();},unload:function(X){this.onDispose();if(S)I.removeListener('resize',S);E.window=E.document=N=M=P=null;E.fire('contentDomUnload');},focus:function(){var X=E.window;if(O)P=true;else if(X){var Y=E.getSelection(),Z=Y&&Y.getNative();if(Z&&Z.type=='Control')return;b.air?setTimeout(function(){X.focus();},0):X.focus();E.selectionChange();}}});E.on('insertHtml',r(s),null,null,20);E.on('insertElement',r(u),null,null,20);E.on('insertText',r(t),null,null,20);E.on('selectionChange',function(X){if(E.readOnly)return;var Y=E.getSelection();if(Y&&!Y.isLocked){var Z=E.checkDirty();E.fire('saveSnapshot',{contentOnly:1});D.call(this,X);E.fire('updateSnapshot');!Z&&E.resetDirty();}},null,null,1);});E.on('contentDom',function(){var M=E.document.getElementsByTag('title').getItem(0); -M.data('cke-title',E.document.$.title);c&&(E.document.$.title=G);});E.on('readOnly',function(){if(E.mode=='wysiwyg'){var M=E.getMode();M.loadData(M.getData());}});if(a.document.$.documentMode>=8){E.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var K=[];for(var L in f.$removeEmpty)K.push('html.CSS1Compat '+L+'[contenteditable=false]');E.addCss(K.join(',')+'{ display:inline-block;}');}else if(b.gecko){E.addCss('html { height: 100% !important; }');E.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\tmin-width : 24px; min-height : 24px; }');}else if(c&&b.version<8&&E.config.contentsLangDirection=='ltr')E.addCss('body{margin-right:0;}');E.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');E.addCss('img, input, textarea { cursor: default;}');E.on('insertElement',function(M){var N=M.data;if(N.type==1&&(N.is('input')||N.is('textarea'))){var O=N.getAttribute('contenteditable')=='false';if(!O){N.data('cke-editable',N.hasAttribute('contenteditable')?'true':'1');N.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var E=document.body;if(!E)window.addEventListener('load',arguments.callee,false);else{var F=E.getAttribute('onpageshow');E.setAttribute('onpageshow',(F?F+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();');}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(Q){return!!this._.tabs[Q][0].$.offsetHeight;};function o(){var U=this;var Q=U._.currentTabId,R=U._.tabIdList.length,S=e.indexOf(U._.tabIdList,Q)+R;for(var T=S-1;T>S-R;T--){if(n.call(U,U._.tabIdList[T%R]))return U._.tabIdList[T%R]; -}return null;};function p(){var U=this;var Q=U._.currentTabId,R=U._.tabIdList.length,S=e.indexOf(U._.tabIdList,Q);for(var T=S+1;T1){ag._.tabBarMode=true;ag._.tabs[ag._.currentTabId][0].focus();Y=1;}else if((ar==37||ar==39)&&ag._.tabBarMode){av=ar==(as?39:37)?o.call(ag):p.call(ag);ag.selectPage(av);ag._.tabs[av][0].focus();Y=1;}else if((ar==13||ar==32)&&ag._.tabBarMode){ax.selectPage(ax._.currentTabId);ax._.tabBarMode=false;ax._.currentFocusIndex=-1;aj(1);Y=1;}else if(ar==13){var aw=aq.data.getTarget();if(!aw.is('a','button','select')&&(!aw.is('input')||aw.$.type!='button')){at=ax.getButton('ok');at&&e.setTimeout(at.click,0,at);Y=1;}Z=1;}else if(ar==27){at=ax.getButton('cancel');if(at)e.setTimeout(at.click,0,at);else if(ax.fire('cancel',{hide:true}).hide!==false)ax.hide();Z=1;}else return;al(aq);};function al(aq){if(Y)aq.data.preventDefault(1);else if(Z)aq.data.stopPropagation();};var am=this._.element;this.on('show',function(){am.on('keydown',ak,this);if(b.opera||b.gecko)am.on('keypress',al,this);});this.on('hide',function(){am.removeListener('keydown',ak); -if(b.opera||b.gecko)am.removeListener('keypress',al);ah(function(aq){s.apply(aq);});});this.on('iframeAdded',function(aq){var ar=new g(aq.data.iframe.$.contentWindow.document);ar.on('keydown',ak,this,null,0);});this.on('show',function(){var au=this;ai();if(Q.config.dialog_startupFocusTab&&ag._.pageCount>1){ag._.tabBarMode=true;ag._.tabs[ag._.currentTabId][0].focus();}else if(!au._.hasFocus){au._.currentFocusIndex=-1;if(S.onFocus){var aq=S.onFocus.call(au);aq&&aq.focus();}else aj(1);if(au._.editor.mode=='wysiwyg'&&c){var ar=Q.document.$.selection,as=ar.createRange();if(as)if(as.parentElement&&as.parentElement().ownerDocument==Q.document.$||as.item&&as.item(0).ownerDocument==Q.document.$){var at=document.body.createTextRange();at.moveToElementText(au.getElement().getFirst().$);at.collapse(true);at.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(aq){var ar=this.getElement(),as=ar.getFirst();as.remove();as.appendTo(ar);},this);A(this);B(this);new d.text(S.title,a.document).appendTo(this.parts.title);for(X=0;X0?S:0)+'px'};Z[V?'right':'left']=(R>0?R:0)+'px';U.setStyles(Z);T&&(aa._.moved=1);};})(),getPosition:function(){return e.extend({},this._.position);},show:function(){var Q=this._.element,R=this.definition;if(!(Q.getParent()&&Q.getParent().equals(a.document.getBody())))Q.appendTo(a.document.getBody());else Q.setStyle('display','block');if(b.gecko&&b.version<10900){var S=this.parts.dialog;S.setStyle('position','absolute');setTimeout(function(){S.setStyle('position','fixed');},0);}this.resize(this._.contentSize&&this._.contentSize.width||R.width||R.minWidth,this._.contentSize&&this._.contentSize.height||R.height||R.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;G(this._.editor);}else{this._.parentDialog=a.dialog._.currentTop;var T=this._.parentDialog.getElement().getFirst();T.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}Q.on('keydown',K);Q.on(b.opera?'keypress':'keyup',L);this._.hasFocus=false;e.setTimeout(function(){this.layout();this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});k.fire('ready',this);this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(U){U.setInitValue&&U.setInitValue();});},100,this);},layout:function(){var S=this;var Q=a.document.getWindow().getViewPaneSize(),R=S.getSize();S.move(S._.moved?S._.position.x:(Q.width-R.width)/2,S._.moved?S._.position.y:(Q.height-R.height)/2);},foreach:function(Q){var T=this;for(var R in T._.contents)for(var S in T._.contents[R])Q.call(T,T._.contents[R][S]);return T;},reset:(function(){var Q=function(R){if(R.reset)R.reset(1);};return function(){this.foreach(Q); -return this;};})(),setupContent:function(){var Q=arguments;this.foreach(function(R){if(R.setup)R.setup.apply(R,Q);});},commitContent:function(){var Q=arguments;this.foreach(function(R){if(c&&this._.currentFocusIndex==R.focusIndex)R.getInputElement().$.blur();if(R.commit)R.commit.apply(R,Q);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);this.selectPage(this._.tabIdList[0]);var Q=this._.element;Q.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');N(this);while(a.dialog._.currentTop!=this)a.dialog._.currentTop.hide();if(!this._.parentDialog)H();else{var R=this._.parentDialog.getElement().getFirst();R.setStyle('z-index',parseInt(R.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;Q.removeListener('keydown',K);Q.removeListener(b.opera?'keypress':'keyup',L);var S=this._.editor;S.focus();if(S.mode=='wysiwyg'&&c){var T=S.getSelection();T&&T.unlock(true);}}else a.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(U){U.resetInitValue&&U.resetInitValue();});},addPage:function(Q){var ac=this;var R=[],S=Q.label?' title="'+e.htmlEncode(Q.label)+'"':'',T=Q.elements,U=a.dialog._.uiElementBuilders.vbox.build(ac,{type:'vbox',className:'cke_dialog_page_contents',children:Q.elements,expand:!!Q.expand,padding:Q.padding,style:Q.style||'width: 100%;height:100%'},R),V=h.createFromHtml(R.join(''));V.setAttribute('role','tabpanel');var W=b,X='cke_'+Q.id+'_'+e.getNextNumber(),Y=h.createFromHtml(['0?' cke_last':'cke_first',S,!!Q.hidden?' style="display:none"':'',' id="',X,'"',W.gecko&&W.version>=10900&&!W.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',Q.label,''].join(''));V.setAttribute('aria-labelledby',X);ac._.tabs[Q.id]=[Y,V];ac._.tabIdList.push(Q.id);!Q.hidden&&ac._.pageCount++;ac._.lastTab=Y;ac.updateStyle();var Z=ac._.contents[Q.id]={},aa,ab=U.getChild();while(aa=ab.shift()){Z[aa.id]=aa;if(typeof aa.getChild=='function')ab.push.apply(ab,aa.getChild());}V.setAttribute('name',Q.id);V.appendTo(ac.parts.contents);Y.unselectable();ac.parts.tabs.append(Y);if(Q.accessKey){M(ac,ac,'CTRL+'+Q.accessKey,P,O);ac._.accessKeyMap['CTRL+'+Q.accessKey]=Q.id;}},selectPage:function(Q){if(this._.currentTabId==Q)return;if(this.fire('selectPage',{page:Q,currentPage:this._.currentTabId})===true)return; -for(var R in this._.tabs){var S=this._.tabs[R][0],T=this._.tabs[R][1];if(R!=Q){S.removeClass('cke_dialog_tab_selected');T.hide();}T.setAttribute('aria-hidden',R!=Q);}var U=this._.tabs[Q];U[0].addClass('cke_dialog_tab_selected');if(b.ie6Compat||b.ie7Compat){q(U[1]);U[1].show();setTimeout(function(){q(U[1],1);},0);}else U[1].show();this._.currentTabId=Q;this._.currentTabIndex=e.indexOf(this._.tabIdList,Q);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(Q){var S=this;var R=S._.tabs[Q]&&S._.tabs[Q][0];if(!R||S._.pageCount==1||!R.isVisible())return;else if(Q==S._.currentTabId)S.selectPage(o.call(S));R.hide();S._.pageCount--;S.updateStyle();},showPage:function(Q){var S=this;var R=S._.tabs[Q]&&S._.tabs[Q][0];if(!R)return;R.show();S._.pageCount++;S.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(Q,R){var S=this._.contents[Q];return S&&S[R];},getValueOf:function(Q,R){return this.getContentElement(Q,R).getValue();},setValueOf:function(Q,R,S){return this.getContentElement(Q,R).setValue(S);},getButton:function(Q){return this._.buttons[Q];},click:function(Q){return this._.buttons[Q].click();},disableButton:function(Q){return this._.buttons[Q].disable();},enableButton:function(Q){return this._.buttons[Q].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(Q,R){var T=this;if(typeof R=='undefined'){R=T._.focusList.length;T._.focusList.push(new t(T,Q,R));}else{T._.focusList.splice(R,0,new t(T,Q,R));for(var S=R+1;Sab.width-aa.width-V)ag=ab.width-aa.width+(U.lang.dir=='rtl'?0:W[1]);else ag=S.x;if(S.y+W[0]ab.height-aa.height-V)ah=ab.height-aa.height+W[2];else ah=S.y;Q.move(ag,ah,1);Z.data.preventDefault();};function Y(Z){a.document.removeListener('mousemove',X);a.document.removeListener('mouseup',Y);if(b.ie6Compat){var aa=E.getChild(0).getFrameDocument();aa.removeListener('mousemove',X);aa.removeListener('mouseup',Y);}};Q.parts.title.on('mousedown',function(Z){R={x:Z.data.$.screenX,y:Z.data.$.screenY}; -a.document.on('mousemove',X);a.document.on('mouseup',Y);S=Q.getPosition();if(b.ie6Compat){var aa=E.getChild(0).getFrameDocument();aa.on('mousemove',X);aa.on('mouseup',Y);}Z.data.preventDefault();},Q);};function B(Q){var R=Q.definition,S=R.resizable;if(S==0)return;var T=Q.getParentEditor(),U,V,W,X,Y,Z,aa=e.addFunction(function(ad){Y=Q.getSize();var ae=Q.parts.contents,af=ae.$.getElementsByTagName('iframe').length;if(af){Z=h.createFromHtml('

    ');ae.append(Z);}V=Y.height-Q.parts.contents.getSize('height',!(b.gecko||b.opera||c&&b.quirks));U=Y.width-Q.parts.contents.getSize('width',1);X={x:ad.screenX,y:ad.screenY};W=a.document.getWindow().getViewPaneSize();a.document.on('mousemove',ab);a.document.on('mouseup',ac);if(b.ie6Compat){var ag=E.getChild(0).getFrameDocument();ag.on('mousemove',ab);ag.on('mouseup',ac);}ad.preventDefault&&ad.preventDefault();});Q.on('load',function(){var ad='';if(S==1)ad=' cke_resizer_horizontal';else if(S==2)ad=' cke_resizer_vertical';var ae=h.createFromHtml('
    ');Q.parts.footer.append(ae,1);});T.on('destroy',function(){e.removeFunction(aa);});function ab(ad){var ae=T.lang.dir=='rtl',af=(ad.data.$.screenX-X.x)*(ae?-1:1),ag=ad.data.$.screenY-X.y,ah=Y.width,ai=Y.height,aj=ah+af*(Q._.moved?1:2),ak=ai+ag*(Q._.moved?1:2),al=Q._.element.getFirst(),am=ae&&al.getComputedStyle('right'),an=Q.getPosition();if(an.y+ak>W.height)ak=W.height-an.y;if((ae?am:an.x)+aj>W.width)aj=W.width-(ae?am:an.x);if(S==1||S==3)ah=Math.max(R.minWidth||0,aj-U);if(S==2||S==3)ai=Math.max(R.minHeight||0,ak-V);Q.resize(ah,ai);if(!Q._.moved)Q.layout();ad.data.preventDefault();};function ac(){a.document.removeListener('mouseup',ac);a.document.removeListener('mousemove',ab);if(Z){Z.remove();Z=null;}if(b.ie6Compat){var ad=E.getChild(0).getFrameDocument();ad.removeListener('mouseup',ac);ad.removeListener('mousemove',ab);}};};var C,D={},E;function F(Q){Q.data.preventDefault(1);};function G(Q){var R=a.document.getWindow(),S=Q.config,T=S.dialog_backgroundCoverColor||'white',U=S.dialog_backgroundCoverOpacity,V=S.baseFloatZIndex,W=e.genKey(T,U,V),X=D[W];if(!X){var Y=['
    ']; -if(b.ie6Compat){var Z=b.isCustomDomain(),aa="";Y.push('');}Y.push('
    ');X=h.createFromHtml(Y.join(''));X.setOpacity(U!=undefined?U:0.5);X.on('keydown',F);X.on('keypress',F);X.on('keyup',F);X.appendTo(a.document.getBody());D[W]=X;}else X.show();E=X;var ab=function(){var ae=R.getViewPaneSize();X.setStyles({width:ae.width+'px',height:ae.height+'px'});},ac=function(){var ae=R.getScrollPosition(),af=a.dialog._.currentTop;X.setStyles({left:ae.x+'px',top:ae.y+'px'});if(af)do{var ag=af.getPosition();af.move(ag.x,ag.y);}while(af=af._.parentDialog)};C=ab;R.on('resize',ab);ab();if(!(b.mac&&b.webkit))X.focus();if(b.ie6Compat){var ad=function(){ac();arguments.callee.prevScrollHandler.apply(this,arguments);};R.$.setTimeout(function(){ad.prevScrollHandler=window.onscroll||(function(){});window.onscroll=ad;},0);ac();}};function H(){if(!E)return;var Q=a.document.getWindow();E.hide();Q.removeListener('resize',C);if(b.ie6Compat)Q.$.setTimeout(function(){var R=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=R||null;},0);C=null;};function I(){for(var Q in D)D[Q].remove();D={};};var J={},K=function(Q){var R=Q.data.$.ctrlKey||Q.data.$.metaKey,S=Q.data.$.altKey,T=Q.data.$.shiftKey,U=String.fromCharCode(Q.data.$.keyCode),V=J[(R?'CTRL+':'')+(S?'ALT+':'')+(T?'SHIFT+':'')+U];if(!V||!V.length)return;V=V[V.length-1];V.keydown&&V.keydown.call(V.uiElement,V.dialog,V.key);Q.data.preventDefault();},L=function(Q){var R=Q.data.$.ctrlKey||Q.data.$.metaKey,S=Q.data.$.altKey,T=Q.data.$.shiftKey,U=String.fromCharCode(Q.data.$.keyCode),V=J[(R?'CTRL+':'')+(S?'ALT+':'')+(T?'SHIFT+':'')+U];if(!V||!V.length)return;V=V[V.length-1];if(V.keyup){V.keyup.call(V.uiElement,V.dialog,V.key);Q.data.preventDefault();}},M=function(Q,R,S,T,U){var V=J[S]||(J[S]=[]);V.push({uiElement:Q,dialog:R,key:S,keyup:U||Q.accessKeyUp,keydown:T||Q.accessKeyDown});},N=function(Q){for(var R in J){var S=J[R];for(var T=S.length-1;T>=0;T--){if(S[T].dialog==Q||S[T].uiElement==Q)S.splice(T,1);}if(S.length===0)delete J[R];}},O=function(Q,R){if(Q._.accessKeyMap[R])Q.selectPage(Q._.accessKeyMap[R]); -},P=function(Q,R){};(function(){k.dialog={uiElement:function(Q,R,S,T,U,V,W){if(arguments.length<4)return;var X=(T.call?T(R):T)||'div',Y=['<',X,' '],Z=(U&&U.call?U(R):U)||{},aa=(V&&V.call?V(R):V)||{},ab=(W&&W.call?W.call(this,Q,R):W)||'',ac=this.domId=aa.id||e.getNextId()+'_uiElement',ad=this.id=R.id,ae;aa.id=ac;var af={};if(R.type)af['cke_dialog_ui_'+R.type]=1;if(R.className)af[R.className]=1;if(R.disabled)af.cke_disabled=1;var ag=aa['class']&&aa['class'].split?aa['class'].split(' '):[];for(ae=0;ae=0;ae--){if(ai[ae]==='')ai.splice(ae,1);}if(ai.length>0)aa.style=(aa.style?aa.style+'; ':'')+ai.join('; ');for(ae in aa)Y.push(ae+'="'+e.htmlEncode(aa[ae])+'" ');Y.push('>',ab,'');S.push(Y.join(''));(this._||(this._={})).dialog=Q;if(typeof R.isChanged=='boolean')this.isChanged=function(){return R.isChanged;};if(typeof R.isChanged=='function')this.isChanged=R.isChanged;if(typeof R.setValue=='function')this.setValue=e.override(this.setValue,function(al){return function(am){al.call(this,R.setValue.call(this,am));};});if(typeof R.getValue=='function')this.getValue=e.override(this.getValue,function(al){return function(){return R.getValue.call(this,al.call(this));};});a.event.implementOn(this);this.registerEvents(R);if(this.accessKeyUp&&this.accessKeyDown&&R.accessKey)M(this,Q,'CTRL+'+R.accessKey);var ak=this;Q.on('load',function(){var al=ak.getInputElement();if(al){var am=ak.type in {checkbox:1,ratio:1}&&c&&b.version<8?'cke_dialog_ui_focused':'';al.on('focus',function(){Q._.tabBarMode=false;Q._.hasFocus=true;ak.fire('focus');am&&this.addClass(am);});al.on('blur',function(){ak.fire('blur');am&&this.removeClass(am);});}});if(this.keyboardFocusable){this.tabIndex=R.tabIndex||0;this.focusIndex=Q._.focusList.push(this)-1;this.on('focus',function(){Q._.currentFocusIndex=ak.focusIndex;});}e.extend(this,R);},hbox:function(Q,R,S,T,U){if(arguments.length<4)return;this._||(this._={});var V=this._.children=R,W=U&&U.widths||null,X=U&&U.height||null,Y={},Z,aa=function(){var ac=[''];for(Z=0;Z0)ac.push('style="'+ae.join('; ')+'" ');ac.push('>',S[Z],'');}ac.push('');return ac.join('');},ab={role:'presentation'};U&&U.align&&(ab.align=U.align);k.dialog.uiElement.call(this,Q,U||{type:'hbox'},T,'table',Y,ab,aa);},vbox:function(Q,R,S,T,U){if(arguments.length<3)return;this._||(this._={});var V=this._.children=R,W=U&&U.width||null,X=U&&U.heights||null,Y=function(){var Z=['');for(var aa=0;aa');}Z.push('
    0)Z.push('style="',ab.join('; '),'" ');Z.push(' class="cke_dialog_ui_vbox_child">',S[aa],'
    ');return Z.join('');};k.dialog.uiElement.call(this,Q,U||{type:'vbox'},T,'div',null,{role:'presentation'},Y);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(Q,R){this.getInputElement().setValue(Q);!R&&this.fire('change',{value:Q});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var T=this;var Q=T.getInputElement(),R=Q,S;while((R=R.getParent())&&R.$.className.search('cke_dialog_page_contents')==-1){}if(!R)return T;S=R.getAttribute('name');if(T._.dialog._.currentTabId!=S)T._.dialog.selectPage(S);return T;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(Q){var R=/^on([A-Z]\w+)/,S,T=function(V,W,X,Y){W.on('load',function(){V.getInputElement().on(X,Y,V);});};for(var U in Q){if(!(S=U.match(R)))continue;if(this.eventProcessors[U])this.eventProcessors[U].call(this,this._.dialog,Q[U]); -else T(this,this._.dialog,S[1].toLowerCase(),Q[U]);}return this;},eventProcessors:{onLoad:function(Q,R){Q.on('load',R,this);},onShow:function(Q,R){Q.on('show',R,this);},onHide:function(Q,R){Q.on('hide',R,this);}},accessKeyDown:function(Q,R){this.focus();},accessKeyUp:function(Q,R){},disable:function(){var Q=this.getElement(),R=this.getInputElement();R.setAttribute('disabled','true');Q.addClass('cke_disabled');},enable:function(){var Q=this.getElement(),R=this.getInputElement();R.removeAttribute('disabled');Q.removeClass('cke_disabled');},isEnabled:function(){return!this.getElement().hasClass('cke_disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(Q){var R=this;if(arguments.length<1)return R._.children.concat();if(!Q.splice)Q=[Q];if(Q.length<2)return R._.children[Q[0]];else return R._.children[Q[0]]&&R._.children[Q[0]].getChild?R._.children[Q[0]].getChild(Q.slice(1,Q.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var Q={build:function(R,S,T){var U=S.children,V,W=[],X=[];for(var Y=0;Y',T||U.name,'');return V.join('');}};a.style.getStyleText=function(T){var U=T._ST;if(U)return U;U=T.styles;var V=T.attributes&&T.attributes.style||'',W='';if(V.length)V=V.replace(o,';');for(var X in U){var Y=U[X],Z=(X+':'+Y).replace(o,';');if(Y=='inherit')W+=Z;else V+=Z;}if(V.length)V=P(V);V+=W;return T._ST=V; -};function s(T){var U,V;while(T=T.getParent()){if(T.getName()=='body')break;if(T.getAttribute('data-nostyle'))U=T;else if(!V){var W=T.getAttribute('contentEditable');if(W=='false')U=T;else if(W=='true')V=1;}}return U;};function t(T){var ay=this;var U=T.document;if(T.collapsed){var V=J(ay,U);T.insertNode(V);T.moveToPosition(V,2);return;}var W=ay.element,X=ay._.definition,Y,Z=X.ignoreReadonly,aa=Z||X.includeReadonly;if(aa==undefined)aa=U.getCustomData('cke_includeReadonly');var ab=f[W]||(Y=true,f.span);T.enlarge(1,1);T.trim();var ac=T.createBookmark(),ad=ac.startNode,ae=ac.endNode,af=ad,ag;if(!Z){var ah=s(ad),ai=s(ae);if(ah)af=ah.getNextSourceNode(true);if(ai)ae=ai;}if(af.getPosition(ae)==2)af=0;while(af){var aj=false;if(af.equals(ae)){af=null;aj=true;}else{var ak=af.type,al=ak==1?af.getName():null,am=al&&af.getAttribute('contentEditable')=='false',an=al&&af.getAttribute('data-nostyle');if(al&&af.data('cke-bookmark')){af=af.getNextSourceNode(true);continue;}if(!al||ab[al]&&!an&&(!am||aa)&&(af.getPosition(ae)|4|0|8)==4+0+8&&(!X.childRule||X.childRule(af))){var ao=af.getParent();if(ao&&((ao.getDtd()||f.span)[W]||Y)&&(!X.parentRule||X.parentRule(ao))){if(!ag&&(!al||!f.$removeEmpty[al]||(af.getPosition(ae)|4|0|8)==4+0+8)){ag=new d.range(U);ag.setStartBefore(af);}if(ak==3||am||ak==1&&!af.getChildCount()){var ap=af,aq;while((aj=!ap.getNext(q))&&(aq=ap.getParent(),ab[aq.getName()])&&(aq.getPosition(ad)|2|0|8)==2+0+8&&(!X.childRule||X.childRule(aq)))ap=aq;ag.setEndAfter(ap);}}else aj=true;}else aj=true;af=af.getNextSourceNode(an||am);}if(aj&&ag&&!ag.collapsed){var ar=J(ay,U),as=ar.hasAttributes(),at=ag.getCommonAncestor(),au={styles:{},attrs:{},blockedStyles:{},blockedAttrs:{}},av,aw,ax;while(ar&&at){if(at.getName()==W){for(av in X.attributes){if(au.blockedAttrs[av]||!(ax=at.getAttribute(aw)))continue;if(ar.getAttribute(av)==ax)au.attrs[av]=1;else au.blockedAttrs[av]=1;}for(aw in X.styles){if(au.blockedStyles[aw]||!(ax=at.getStyle(aw)))continue;if(ar.getStyle(aw)==ax)au.styles[aw]=1;else au.blockedStyles[aw]=1;}}at=at.getParent();}for(av in au.attrs)ar.removeAttribute(av);for(aw in au.styles)ar.removeStyle(aw);if(as&&!ar.hasAttributes())ar=null;if(ar){ag.extractContents().appendTo(ar);G(ay,ar);ag.insertNode(ar);ar.mergeSiblings();if(!c)ar.$.normalize();}else{ar=new h('span');ag.extractContents().appendTo(ar);ag.insertNode(ar);G(ay,ar);ar.remove(true);}ag=null;}}T.moveToBookmark(ac);T.shrink(2);};function u(T){T.enlarge(1,1);var U=T.createBookmark(),V=U.startNode;if(T.collapsed){var W=new d.elementPath(V.getParent()),X; -for(var Y=0,Z;Y'+V+'';else T.setHtml(V);U.remove();};function B(T){var U=/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,V=T.getName(),W=C(T.getOuterHtml(),U,function(Y,Z,aa){return Z+''+aa+'
    ';}),X=[];W.replace(/([\s\S]*?)<\/pre>/gi,function(Y,Z){X.push(Z);});return X;};function C(T,U,V){var W='',X='';T=T.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(Y,Z,aa){Z&&(W=Z);aa&&(X=aa);return '';});return W+T.replace(U,V)+X;};function D(T,U){var V;if(T.length>1)V=new d.documentFragment(U.getDocument());for(var W=0;W');X=X.replace(/[ \t]{2,}/g,function(Z){return e.repeat(' ',Z.length-1)+' ';});if(V){var Y=U.clone();Y.setHtml(X);V.append(Y);}else U.setHtml(X);}return V||U;};function E(T,U){var V=T.getBogus();V&&V.remove();var W=T.getHtml();W=C(W,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');W=W.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');W=W.replace(/([ \t\n\r]+| )/g,' ');W=W.replace(/]*>/gi,'\n');if(c){var X=T.getDocument().createElement('div');X.append(U);U.$.outerHTML='
    '+W+'
    ';U.copyAttributes(X.getFirst());U=X.getFirst().remove();}else U.setHtml(W);return U;};function F(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T)[U.getName()],Z=e.isEmpty(W)&&e.isEmpty(X);for(var aa in W){if((aa=='class'||T._.definition.fullMatch)&&U.getAttribute(aa)!=O(aa,W[aa]))continue;Z=U.hasAttribute(aa);U.removeAttribute(aa);}for(var ab in X){if(T._.definition.fullMatch&&U.getStyle(ab)!=O(ab,X[ab],true))continue;Z=Z||!!U.getStyle(ab);U.removeStyle(ab);}H(U,Y,m[U.getName()]);if(Z)!f.$block[U.getName()]||T._.enterMode==2&&!U.hasAttributes()?I(U):U.renameNode(T._.enterMode==1?'p':'div');};function G(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T),Z=U.getElementsByTag(T.element);for(var aa=Z.count();--aa>=0;)F(T,Z.getItem(aa));for(var ab in Y){if(ab!=T.element){Z=U.getElementsByTag(ab);for(aa=Z.count()-1;aa>=0;aa--){var ac=Z.getItem(aa);H(ac,Y[ab]);}}}};function H(T,U,V){var W=U&&U.attributes; -if(W)for(var X=0;X0)H+=(F.$.offsetWidth||0)-(F.$.clientWidth||0)+3;H+=4;F.setStyle('width',H+'px');v.element.addClass('cke_frameLoaded');var I=v.element.$.scrollHeight;if(c&&b.quirks&&I>0)I+=(F.$.offsetHeight||0)-(F.$.clientHeight||0)+3;F.setStyle('height',I+'px');u._.currentBlock.element.setStyle('display','none').removeStyle('display');}else F.removeStyle('height');if(A)B-=w.$.offsetWidth;w.setStyle('left',B+'px');var J=u.element,K=J.getWindow(),L=w.$.getBoundingClientRect(),M=K.getViewPaneSize(),N=L.width||L.right-L.left,O=L.height||L.bottom-L.top,P=A?L.right:M.width-L.left,Q=A?M.width-L.right:L.left;if(A){if(PN)B+=N;else if(M.width>N)B-=L.left;else B=B-L.right+M.width;}else if(PN)B-=N;else if(M.width>N)B=B-L.right+M.width;else B-=L.left;var R=M.height-L.top,S=L.top;if(RO)C-=O;else if(M.height>O)C=C-L.bottom+M.height;else C-=L.top;if(c){var T=new h(w.$.offsetParent),U=T;if(U.getName()=='html')U=U.getDocument().getBody();if(U.getComputedStyle('direction')=='rtl')if(b.ie8Compat)B-=w.getDocument().getDocumentElement().$.scrollLeft*2;else B-=T.$.scrollWidth-T.$.clientWidth;}var V=w.getFirst(),W;if(W=V.getCustomData('activePanel'))W.onHide&&W.onHide.call(this,1);V.setCustomData('activePanel',this);w.setStyles({top:C+'px',left:B+'px'});w.setOpacity(1);},this);u.isLoaded?E():u.onLoad=E;e.setTimeout(function(){x.$.contentWindow.focus();this.allowBlur(true);},0,this);},b.air?200:0,this);this.visible=1;if(this.onShow)this.onShow.call(this);n=0;},hide:function(p){var r=this;if(r.visible&&(!r.onHide||r.onHide.call(r)!==true)){r.hideChild();b.gecko&&r._.iframe.getFrameDocument().$.activeElement.blur();r.element.setStyle('display','none');r.visible=0;r.element.getFirst().removeCustomData('activePanel');var q=p!==false&&r._.returnFocus;if(q){if(b.webkit&&q.type)q.getWindow().$.focus();q.focus();}}},allowBlur:function(p){var q=this._.panel;if(p!=undefined)q.allowBlur=p;return q.allowBlur;},showAsChild:function(p,q,r,s,t,u){if(this._.activeChild==p&&p._.panel._.offsetParentId==r.getId())return;this.hideChild();p.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide(); -},0,this);},this);this._.activeChild=p;this._.focused=false;p.showBlock(q,r,s,t,u);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){p.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var p=this._.activeChild;if(p){delete p.onHide;delete p._.returnFocus;delete this._.activeChild;p.hide();}}}});a.on('instanceDestroyed',function(){var p=e.isEmpty(a.instances);for(var q in m){var r=m[q];if(p)r.destroy();else r.element.hide();}p&&(m={});});})();j.add('menu',{beforeInit:function(m){var n=m.config.menu_groups.split(','),o=m._.menuGroups={},p=m._.menuItems={};for(var q=0;q'],B=r.length,C=B&&r[0].group;for(var D=0;D
    ');C=E.group;}E.render(this,D,A);}A.push('
    ');u.setHtml(A.join(''));k.fire('ready',this);if(this.parent)this.parent._.panel.showAsChild(t,this.id,n,o,p,q);else t.showBlock(this.id,n,o,p,q);s.fire('menuShow',[t]);},addListener:function(n){this._.listeners.push(n);},hide:function(n){var o=this;o._.onHide&&o._.onHide();o._.panel&&o._.panel.hide(n);}}});function m(n){n.sort(function(o,p){if(o.groupp.group)return 1;return o.orderp.order?1:0;});};a.menuItem=e.createClass({$:function(n,o,p){var q=this;e.extend(q,p,{order:0,className:'cke_button_'+o});q.group=n._.menuGroups[q.group];q.editor=n;q.name=o;},proto:{render:function(n,o,p){var w=this;var q=n.id+String(o),r=typeof w.state=='undefined'?2:w.state,s=' cke_'+(r==1?'on':r==0?'disabled':'off'),t=w.label;if(w.className)s+=' '+w.className; -var u=w.getItems;p.push(''+''+'');if(u)p.push('','&#',w.editor.lang.dir=='rtl'?'9668':'9658',';','');p.push(t,'');}}});})();i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='
    ';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;n.getMode().loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){if(n.mode){o();n.removeListener('mode',arguments.callee);}});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(n.getMode().getData(),null,1);m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=n.getMode().getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)n.getMode().loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);},0);});n.on('destroy',function(){var o=this;if(o.mode)o._.modes[o.mode].unload(o.getThemeSpace('contents'));});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n; -(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){this.fire('beforeSetMode',{newMode:n});var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this._.previousMode=this.mode;this.fire('beforeModeUnload');var r=this.getMode();o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=this.getMode(n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.getMode=function(n){return this._.modes&&this._.modes[n||this.mode];};a.editor.prototype.focus=function(){this.forceNextSelectionCheck();var n=this.getMode();if(n)n.focus();};})();i.startupMode='wysiwyg';i.editingBlock=true;(function(){function m(){var C=this;try{var z=C.getSelection();if(!z||!z.document.getWindow().$)return;var A=z.getStartElement(),B=new d.elementPath(A);if(!B.compare(C._.selectionPreviousPath)){C._.selectionPreviousPath=B;C.fire('selectionChange',{selection:z,path:B,element:A});}}catch(D){}};var n,o;function p(){o=true;if(n)return;q.call(this);n=e.setTimeout(q,200,this);};function q(){n=null;if(o){e.setTimeout(m,0,this);o=false;}};function r(z){function A(E){return E&&E.type==1&&E.getName() in f.$removeEmpty;};function B(E){var F=z.document.getBody();return!E.is('body')&&F.getChildCount()==1;};var C=z.startContainer,D=z.startOffset;if(C.type==3)return false;return!e.trim(C.getHtml())?A(C)||B(C):A(C.getChild(D-1))||A(C.getChild(D));};var s={modes:{wysiwyg:1,source:1},readOnly:c||b.webkit,exec:function(z){switch(z.mode){case 'wysiwyg':z.document.$.execCommand('SelectAll',false,null);z.forceNextSelectionCheck();z.selectionChange();break;case 'source':var A=z.textarea.$;if(c)A.createTextRange().execCommand('SelectAll');else{A.selectionStart=0;A.selectionEnd=A.value.length;}A.focus();}},canUndo:false};function t(z){w(z);var A=z.createText('​');z.setCustomData('cke-fillingChar',A);return A;};function u(z){return z&&z.getCustomData('cke-fillingChar');};function v(z){var A=z&&u(z);if(A)if(A.getCustomData('ready'))w(z);else A.setCustomData('ready',1);};function w(z){var A=z&&z.removeCustomData('cke-fillingChar');if(A){var B,C=z.getSelection().getNative(),D=C&&C.type!='None'&&C.getRangeAt(0);if(A.getLength()>1&&D&&D.intersectsNode(A.$)){B=[C.anchorOffset,C.focusOffset];var E=C.anchorNode==A.$&&C.anchorOffset>0,F=C.focusNode==A.$&&C.focusOffset>0;E&&B[0]--;F&&B[1]--; -x(C)&&B.unshift(B.pop());}A.setText(A.getText().replace(/\u200B/g,''));if(B){var G=C.getRangeAt(0);G.setStart(G.startContainer,B[0]);G.setEnd(G.startContainer,B[1]);C.removeAllRanges();C.addRange(G);}}};function x(z){if(!z.isCollapsed){var A=z.getRangeAt(0);A.setStart(z.anchorNode,z.anchorOffset);A.setEnd(z.focusNode,z.focusOffset);return A.collapsed;}};j.add('selection',{init:function(z){if(b.webkit){z.on('selectionChange',function(){v(z.document);});z.on('beforeSetMode',function(){w(z.document);});var A,B;function C(){var E=z.document,F=u(E);if(F){var G=E.$.defaultView.getSelection();if(G.type=='Caret'&&G.anchorNode==F.$)B=1;A=F.getText();F.setText(A.replace(/\u200B/g,''));}};function D(){var E=z.document,F=u(E);if(F){F.setText(A);if(B){E.$.defaultView.getSelection().setPosition(F.$,F.getLength());B=0;}}};z.on('beforeUndoImage',C);z.on('afterUndoImage',D);z.on('beforeGetData',C,null,null,0);z.on('getData',D);}z.on('contentDom',function(){var E=z.document,F=E.getBody(),G=E.getDocumentElement();if(c){var H,I,J=1;F.on('focusin',function(O){if(O.data.$.srcElement.nodeName!='BODY')return;var P=E.getCustomData('cke_locked_selection');if(P){P.unlock(1);P.lock();}else if(H&&J){try{H.select();}catch(Q){}H=null;}});F.on('focus',function(){I=1;N();});F.on('beforedeactivate',function(O){if(O.data.$.toElement)return;I=0;J=1;});c&&z.on('blur',function(){try{E.$.selection.empty();}catch(O){}});G.on('mousedown',function(){J=0;});G.on('mouseup',function(){J=1;});var K;F.on('mousedown',function(O){if(O.data.$.button==2){var P=z.document.$.selection;if(P.type=='None')K=z.window.getScrollPosition();}M();});F.on('mouseup',function(O){if(O.data.$.button==2&&K){z.document.$.documentElement.scrollLeft=K.x;z.document.$.documentElement.scrollTop=K.y;}K=null;I=1;setTimeout(function(){N(true);},0);});F.on('keydown',M);F.on('keyup',function(){I=1;N();});if((b.ie7Compat||b.ie6Compat)&&E.$.compatMode!='BackCompat'){function L(O,P,Q){try{O.moveToPoint(P,Q);}catch(R){}};G.on('mousedown',function(O){function P(R){R=R.data.$;if(Q){var S=F.$.createTextRange();L(S,R.x,R.y);Q.setEndPoint(Q.compareEndPoints('StartToStart',S)<0?'EndToEnd':'StartToStart',S);Q.select();}};O=O.data.$;if(O.yF.$.offsetTop+F.$.clientHeight&&O.x0)L=M-1;else if(N<0)K=M+1;else if(b.ie9Compat&&H.tagName=='BR'){var Q=F.defaultView.getSelection();return{container:Q[D?'anchorNode':'focusNode'],offset:Q[D?'anchorOffset':'focusOffset']};}else return{container:E,offset:A(H)};}if(M==-1||M==G.length-1&&N<0){J.moveToElementText(E);J.setEndPoint('StartToStart',C);O=J.text.replace(/(\r\n|\r)/g,'\n').length;G=E.childNodes;if(!O){H=G[G.length-1];if(H.nodeType!=3)return{container:E,offset:G.length};else return{container:H,offset:H.nodeValue.length};}var R=G.length;while(O>0&&R>0){I=G[--R];if(I.nodeType==3){P=I;O-=I.nodeValue.length;}}return{container:P,offset:-O};}else{J.collapse(N>0?true:false);J.setEndPoint(N>0?'StartToStart':'EndToStart',C);O=J.text.replace(/(\r\n|\r)/g,'\n').length;if(!O)return{container:E,offset:A(H)+(N>0?0:1)};while(O>0)try{I=H[N>0?'previousSibling':'nextSibling'];if(I.nodeType==3){O-=I.nodeValue.length;P=I;}H=I;}catch(S){return{container:E,offset:A(H)};}return{container:P,offset:N>0?-O:P.nodeValue.length+O};}};return function(){var M=this;var C=M.getNative(),D=C&&C.createRange(),E=M.getType(),F;if(!C)return[];if(E==2){F=new d.range(M.document);var G=B(D,true);F.setStart(new d.node(G.container),G.offset);G=B(D);F.setEnd(new d.node(G.container),G.offset);if(F.endContainer.getPosition(F.startContainer)&4&&F.endOffset<=F.startContainer.getIndex())F.collapse();return[F];}else if(E==3){var H=[];for(var I=0;I=H.getLength())L.setStartAfter(H);else L.setStartBefore(H);if(I&&I.type==3)if(!K)L.setEndBefore(I);else L.setEndAfter(I);var M=new d.walker(L);M.evaluator=function(N){if(N.type==1&&N.isReadOnly()){var O=E.clone();E.setEndBefore(N);if(E.collapsed)C.splice(D--,1);if(!(N.getPosition(L.endContainer)&16)){O.setStartAfter(N);if(!O.collapsed)C.splice(D+1,0,O);}return true;}return false;};M.next();}}return B.ranges;};})(),getStartElement:function(){var G=this;var z=G._.cache;if(z.startElement!==undefined)return z.startElement;var A,B=G.getNative();switch(G.getType()){case 3:return G.getSelectedElement();case 2:var C=G.getRanges()[0];if(C){if(!C.collapsed){C.optimize();while(1){var D=C.startContainer,E=C.startOffset;if(E==(D.getChildCount?D.getChildCount():D.getLength())&&!D.isBlockBoundary())C.setStartAfter(D);else break;}A=C.startContainer;if(A.type!=1)return A.getParent();A=A.getChild(C.startOffset);if(!A||A.type!=1)A=C.startContainer;else{var F=A.getFirst();while(F&&F.type==1){A=F;F=F.getFirst();}}}else{A=C.startContainer;if(A.type!=1)A=A.getParent();}A=A.$;}}return z.startElement=A?new h(A):null;},getSelectedElement:function(){var z=this._.cache;if(z.selectedElement!==undefined)return z.selectedElement;var A=this,B=e.tryThese(function(){return A.getNative().createRange().item(0);},function(){var C,D,E=A.getRanges()[0],F=E.getCommonAncestor(1,1),G={table:1,ul:1,ol:1,dl:1};for(var H in G){if(C=F.getAscendant(H,1))break;}if(C){var I=new d.range(this.document);I.setStartAt(C,1);I.setEnd(E.startContainer,E.startOffset);var J=e.extend(G,f.$listItem,f.$tableContent),K=new d.walker(I),L=function(M,N){return function(O,P){if(O.type==3&&(!e.trim(O.getText())||O.getParent().data('cke-bookmark')))return true;var Q;if(O.type==1){Q=O.getName();if(Q=='br'&&N&&O.equals(O.getParent().getBogus()))return true;if(P&&Q in J||Q in f.$removeEmpty)return true;}M.halted=1;return false;};};K.guard=L(K);if(K.checkBackward()&&!K.halted){K=new d.walker(I);I.setStart(E.endContainer,E.endOffset);I.setEndAt(C,2);K.guard=L(K,1);if(K.checkForward()&&!K.halted)D=C.$; -}}if(!D)throw 0;return D;},function(){var C=A.getRanges()[0],D,E;for(var F=2;F&&!((D=C.getEnclosedNode())&&D.type==1&&y[D.getName()]&&(E=D));F--)C.shrink(1);return E.$;});return z.selectedElement=B?new h(B):null;},getSelectedText:function(){var z=this._.cache;if(z.selectedText!==undefined)return z.selectedText;var A='',B=this.getNative();if(this.getType()==2)A=c?B.createRange().text:B.toString();return z.selectedText=A;},lock:function(){var z=this;z.getRanges();z.getStartElement();z.getSelectedElement();z.getSelectedText();z._.cache.nativeSel={};z.isLocked=1;z.document.setCustomData('cke_locked_selection',z);},unlock:function(z){var E=this;var A=E.document,B=A.getCustomData('cke_locked_selection');if(B){A.setCustomData('cke_locked_selection',null);if(z){var C=B.getSelectedElement(),D=!C&&B.getRanges();E.isLocked=0;E.reset();if(C)E.selectElement(C);else E.selectRanges(D);}}if(!B||!z){E.isLocked=0;E.reset();}},reset:function(){this._.cache={};},selectElement:function(z){var B=this;if(B.isLocked){var A=new d.range(B.document);A.setStartBefore(z);A.setEndAfter(z);B._.cache.selectedElement=z;B._.cache.startElement=z;B._.cache.ranges=new d.rangeList(A);B._.cache.type=3;return;}A=new d.range(z.getDocument());A.setStartBefore(z);A.setEndAfter(z);A.select();B.document.fire('selectionchange');B.reset();},selectRanges:function(z){var N=this;if(N.isLocked){N._.cache.selectedElement=null;N._.cache.startElement=z[0]&&z[0].getTouchedStartNode();N._.cache.ranges=new d.rangeList(z);N._.cache.type=2;return;}if(c){if(z.length>1){var A=z[z.length-1];z[0].setEnd(A.endContainer,A.endOffset);z.length=1;}if(z[0])z[0].select();N.reset();}else{var B=N.getNative();if(!B)return;if(z.length){B.removeAllRanges();b.webkit&&w(N.document);}for(var C=0;C=0){I.collapse(1);J.setEnd(I.endContainer.$,I.endOffset);}else throw O;}B.addRange(J);}N.document.fire('selectionchange');N.reset();}},createBookmarks:function(z){return this.getRanges().createBookmarks(z);},createBookmarks2:function(z){return this.getRanges().createBookmarks2(z);},selectBookmarks:function(z){var A=[];for(var B=0;B','','',this.label,'','=10900&&!o.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',p,'_label" aria-describedby="',p,'_text" aria-haspopup="true"');if(b.opera||b.gecko&&b.mac)n.push(' onkeypress="return false;"');if(b.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="CKEDITOR.tools.callFunction( ',t,', event, this );" onfocus="return CKEDITOR.tools.callFunction(',u,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',q,', this); return false;">'+this.label+''+''+''+(b.hc?'▼':b.air?' ':'')+''+''+''+'');if(this.onRender)this.onRender();return r;},createPanel:function(m){if(this._.panel)return;var n=this._.panelDefinition,o=this._.panelDefinition.block,p=n.parent||a.document.getBody(),q=new k.floatPanel(m,p,n),r=q.addListBlock(this.id,o),s=this;q.onShow=function(){if(s.className)this.element.getFirst().addClass(s.className+'_panel');s.setState(1);r.focus(!s.multiSelect&&s.getValue());s._.on=1;if(s.onOpen)s.onOpen();};q.onHide=function(t){if(s.className)this.element.getFirst().removeClass(s.className+'_panel');s.setState(s.modes&&s.modes[m.mode]?2:0);s._.on=0;if(!t&&s.onClose)s.onClose();};q.onEscape=function(){q.hide();};r.onClick=function(t,u){s.document.getWindow().focus();if(s.onClick)s.onClick.call(s,t,u);if(u)s.setValue(t,s._.items[t]); -else s.setValue('');q.hide(false);};this._.panel=q;this._.list=r;q.getBlock(this.id).onHide=function(){s._.on=0;s.setState(2);};if(this.init)this.init();},setValue:function(m,n){var p=this;p._.value=m;var o=p.document.getById('cke_'+p.id+'_text');if(o){if(!(m||n)){n=p.label;o.addClass('cke_inline_label');}else o.removeClass('cke_inline_label');o.setHtml(typeof n!='undefined'?n:m);}},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(m){this._.list.mark(m);},hideItem:function(m){this._.list.hideItem(m);},hideGroup:function(m){this._.list.hideGroup(m);},showAll:function(){this._.list.showAll();},add:function(m,n,o){this._.items[m]=o||m;this._.list.add(m,n,o);},startGroup:function(m){this._.list.startGroup(m);},commit:function(){var m=this;if(!m._.committed){m._.list.commit();m._.committed=1;k.fire('ready',m);}m._.committed=1;},setState:function(m){var n=this;if(n._.state==m)return;n.document.getById('cke_'+n.id).setState(m);n._.state=m;}}});k.prototype.addRichCombo=function(m,n){this.add(m,'richcombo',n);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var o=this;o.base();o.indentationChars='\t';o.selfClosingEnd=' />';o.lineBreakChars='\n';o.forceSimpleAmpersand=0;o.sortAttributes=1;o._.indent=0;o._.indentation='';o._.inPre=0;o._.rules={};var m=f;for(var n in e.extend({},m.$nonBodyContent,m.$block,m.$listItem,m.$tableContent))o.setRules(n,{indent:1,breakBeforeOpen:1,breakAfterOpen:1,breakBeforeClose:!m[n]['#'],breakAfterClose:1});o.setRules('br',{breakAfterOpen:1});o.setRules('title',{indent:0,breakAfterOpen:0});o.setRules('style',{indent:0,breakBeforeClose:1});o.setRules('pre',{indent:0});},proto:{openTag:function(m,n){var p=this;var o=p._.rules[m];if(p._.indent)p.indentation();else if(o&&o.breakBeforeOpen){p.lineBreak();p.indentation();}p._.output.push('<',m);},openTagClose:function(m,n){var p=this;var o=p._.rules[m];if(n)p._.output.push(p.selfClosingEnd);else{p._.output.push('>');if(o&&o.indent)p._.indentation+=p.indentationChars;}if(o&&o.breakAfterOpen)p.lineBreak();m=='pre'&&(p._.inPre=1);},attribute:function(m,n){if(typeof n=='string'){this.forceSimpleAmpersand&&(n=n.replace(/&/g,'&'));n=e.htmlEncodeAttr(n);}this._.output.push(' ',m,'="',n,'"');},closeTag:function(m){var o=this;var n=o._.rules[m];if(n&&n.indent)o._.indentation=o._.indentation.substr(o.indentationChars.length);if(o._.indent)o.indentation();else if(n&&n.breakBeforeClose){o.lineBreak();o.indentation(); -}o._.output.push('');m=='pre'&&(o._.inPre=0);if(n&&n.breakAfterClose)o.lineBreak();},text:function(m){var n=this;if(n._.indent){n.indentation();!n._.inPre&&(m=e.ltrim(m));}n._.output.push(m);},comment:function(m){if(this._.indent)this.indentation();this._.output.push('');},lineBreak:function(){var m=this;if(!m._.inPre&&m._.output.length>0)m._.output.push(m.lineBreakChars);m._.indent=1;},indentation:function(){var m=this;if(!m._.inPre)m._.output.push(m._.indentation);m._.indent=0;},setRules:function(m,n){var o=this._.rules[m];if(o)e.extend(o,n,true);else this._.rules[m]=n;}}});j.add('menubutton',{requires:['button','menu'],beforeInit:function(m){m.ui.addHandler('menubutton',k.menuButton.handler);}});a.UI_MENUBUTTON='menubutton';(function(){var m=function(n){var o=this._;if(o.state===0)return;o.previousState=o.state;var p=o.menu;if(!p){p=o.menu=new a.menu(n,{panel:{className:n.skinClass+' cke_contextmenu',attributes:{'aria-label':n.lang.common.options}}});p.onHide=e.bind(function(){this.setState(this.modes&&this.modes[n.mode]?o.previousState:0);},this);if(this.onMenu)p.addListener(this.onMenu);}if(o.on){p.hide();return;}this.setState(1);p.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(n){var o=n.panel;delete n.panel;this.base(n);this.hasArrow=true;this.click=m;},statics:{handler:{create:function(n){return new k.menuButton(n);}}}});})();j.add('dialogui');(function(){var m=function(u){var x=this;x._||(x._={});x._['default']=x._.initValue=u['default']||'';x._.required=u.required||false;var v=[x._];for(var w=1;w',v.label,'','');else{var D={type:'hbox',widths:v.widths,padding:0,children:[{type:'html',html:'
    ');return o;},getHolderElement:function(){var m=this._.holder;if(!m){if(this.forceIFrame||this.css.length){var n=this.document.getById(this.id+'_frame'),o=n.getParent(),p=o.getAttribute('dir'),q=o.getParent().getAttribute('class'),r=o.getParent().getAttribute('lang'),s=n.getFrameDocument();b.iOS&&o.setStyles({overflow:'scroll','-webkit-overflow-scrolling':'touch'});var t=e.addFunction(e.bind(function(w){this.isLoaded=true;if(this.onLoad)this.onLoad();},this)),u=''+''+''+e.buildStyleHtml(this.css)+''+''+'';s.write(u);var v=s.getWindow();v.$.CKEDITOR=a;s.on('key'+(b.opera?'press':'down'),function(w){var z=this;var x=w.data.getKeystroke(),y=z.document.getById(z.id).getAttribute('dir');if(z._.onKeyDown&&z._.onKeyDown(x)===false){w.data.preventDefault();return;}if(x==27||x==(y=='rtl'?39:37))if(z.onEscape&&z.onEscape(x)===false)w.data.preventDefault();},this);m=s.getBody();m.unselectable();b.air&&e.callFunction(t);}else m=this.document.getById(this.id);this._.holder=m;}return m;},addBlock:function(m,n){var o=this;n=o._.blocks[m]=n instanceof k.panel.block?n:new k.panel.block(o.getHolderElement(),n);if(!o._.currentBlock)o.showBlock(m);return n;},getBlock:function(m){return this._.blocks[m];},showBlock:function(m){var r=this;var n=r._.blocks,o=n[m],p=r._.currentBlock,q=!r.forceIFrame||c?r._.holder:r.document.getById(r.id+'_frame'); -if(p){q.removeAttributes(p.attributes);p.hide();}r._.currentBlock=o;q.setAttributes(o.attributes);a.fire('ariaWidget',q);o._.focusIndex=-1;r._.onKeyDown=o.onKeyDown&&e.bind(o.onKeyDown,o);o.show();return o;},destroy:function(){this.element&&this.element.remove();}};k.panel.block=e.createClass({$:function(m,n){var o=this;o.element=m.append(m.getDocument().createElement('div',{attributes:{tabIndex:-1,'class':'cke_panel_block',role:'presentation'},styles:{display:'none'}}));if(n)e.extend(o,n);if(!o.attributes.title)o.attributes.title=o.attributes['aria-label'];o.keys={};o._.focusIndex=-1;o.element.disableContextMenu();},_:{markItem:function(m){var p=this;if(m==-1)return;var n=p.element.getElementsByTag('a'),o=n.getItem(p._.focusIndex=m);if(b.webkit||b.opera)o.getDocument().getWindow().focus();o.focus();p.onMark&&p.onMark(o);}},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var m=this;if(!m.onHide||m.onHide.call(m)!==true)m.element.setStyle('display','none');},onKeyDown:function(m){var r=this;var n=r.keys[m];switch(n){case 'next':var o=r._.focusIndex,p=r.element.getElementsByTag('a'),q;while(q=p.getItem(++o)){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'prev':o=r._.focusIndex;p=r.element.getElementsByTag('a');while(o>0&&(q=p.getItem(--o))){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'click':case 'mouseup':o=r._.focusIndex;q=o>=0&&r.element.getElementsByTag('a').getItem(o);if(q)q.$[n]?q.$[n]():q.$['on'+n]();return false;}return true;}}});j.add('listblock',{requires:['panel'],onLoad:function(){k.panel.prototype.addListBlock=function(m,n){return this.addBlock(m,new k.listBlock(this.getHolderElement(),n));};k.listBlock=e.createClass({base:k.panel.block,$:function(m,n){var q=this;n=n||{};var o=n.attributes||(n.attributes={});(q.multiSelect=!!n.multiSelect)&&(o['aria-multiselectable']=true);!o.role&&(o.role='listbox');q.base.apply(q,arguments);var p=q.keys;p[40]='next';p[9]='next';p[38]='prev';p[2228224+9]='prev';p[32]=c?'mouseup':'click';c&&(p[13]='mouseup');q._.pendingHtml=[];q._.items={};q._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=e.addFunction(function(m){var o=this;var n=true;if(o.multiSelect)n=o.toggle(m);else o.mark(m);if(o.onClick)o.onClick(m,n);},this);return this._.click;}},proto:{add:function(m,n,o){var r=this; -var p=r._.pendingHtml,q=e.getNextId();if(!r._.started){p.push('
    ',a.document);a.document.getBody().append(f);}if(!/%$/.test(g)){f.setStyle('width',g);return f.$.clientWidth;}return g;};})(),repeat:function(f,g){return new Array(g+1).join(f);},tryThese:function(){var f;for(var g=0,h=arguments.length;g8))&&i)h=i+':'+h;return new d.nodeList(this.$.getElementsByTagName(h));},getHead:function(){var h=this.$.getElementsByTagName('head')[0];if(!h)h=this.getDocumentElement().append(new d.element('head'),true);else h=new d.element(h);return(this.getHead=function(){return h;})();},getBody:function(){var h=new d.element(this.$.body);return(this.getBody=function(){return h;})();},getDocumentElement:function(){var h=new d.element(this.$.documentElement);return(this.getDocumentElement=function(){return h;})();},getWindow:function(){var h=new d.window(this.$.parentWindow||this.$.defaultView);return(this.getWindow=function(){return h;})();},write:function(h){var i=this;i.$.open('text/html','replace');b.isCustomDomain()&&(i.$.domain=document.domain);i.$.write(h);i.$.close();}});d.node=function(h){if(h){var i=h.nodeType==9?'document':h.nodeType==1?'element':h.nodeType==3?'text':h.nodeType==8?'comment':'domObject';return new d[i](h);}return this;};d.node.prototype=new d.domObject();a.NODE_ELEMENT=1;a.NODE_DOCUMENT=9;a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1; +a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h;},clone:function(h,i){var j=this.$.cloneNode(h),k=function(l){if(l.nodeType!=1)return;if(!i)l.removeAttribute('id',false);l.removeAttribute('data-cke-expando',false);if(h){var m=l.childNodes;for(var n=0;n]*>/g,''):i;},getOuterHtml:function(){var j=this;if(j.$.outerHTML)return j.$.outerHTML.replace(/<\?[^>]*>/,'');var i=j.$.ownerDocument.createElement('div');i.appendChild(j.$.cloneNode(true));return i.innerHTML;},setHtml:function(i){return this.$.innerHTML=i;},setText:function(i){h.prototype.setText=this.$.innerText!=undefined?function(j){return this.$.innerText=j;}:function(j){return this.$.textContent=j;};return this.setText(i);},getAttribute:(function(){var i=function(j){return this.$.getAttribute(j,2);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){var n=this;switch(j){case 'class':j='className';break;case 'http-equiv':j='httpEquiv';break;case 'name':return n.$.name;case 'tabindex':var k=i.call(n,j);if(k!==0&&n.$.tabIndex===0)k=null;return k;break;case 'checked':var l=n.$.attributes.getNamedItem(j),m=l.specified?l.nodeValue:n.$.checked;return m?'checked':null;case 'hspace':case 'value':return n.$[j];case 'style':return n.$.style.cssText;case 'contenteditable':case 'contentEditable':return n.$.attributes.getNamedItem('contentEditable').specified?n.$.getAttribute('contentEditable'):null;}return i.call(n,j);};else return i;})(),getChildren:function(){return new d.nodeList(this.$.childNodes);},getComputedStyle:c?function(i){return this.$.currentStyle[e.cssStyleToDomStyle(i)];}:function(i){return this.getWindow().$.getComputedStyle(this.$,'').getPropertyValue(i);},getDtd:function(){var i=f[this.getName()];this.getDtd=function(){return i;};return i;},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var i=this.$.tabIndex;if(i===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)i=-1;return i;}:b.webkit?function(){var i=this.$.tabIndex;if(i==undefined){i=parseInt(this.getAttribute('tabindex'),10);if(isNaN(i))i=-1;}return i;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var i=this.$.nodeName.toLowerCase();if(c&&!(document.documentMode>8)){var j=this.$.scopeName;if(j!='HTML')i=j.toLowerCase()+':'+i;}return(this.getName=function(){return i;})();},getValue:function(){return this.$.value;},getFirst:function(i){var j=this.$.firstChild,k=j&&new d.node(j);if(k&&i&&!i(k))k=k.getNext(i);return k;},getLast:function(i){var j=this.$.lastChild,k=j&&new d.node(j); +if(k&&i&&!i(k))k=k.getPrevious(i);return k;},getStyle:function(i){return this.$.style[e.cssStyleToDomStyle(i)];},is:function(){var i=this.getName();for(var j=0;j0&&(j>2||!k[i[0].nodeName]||j==2&&!k[i[1].nodeName]);},hasAttribute:(function(){function i(j){var k=this.$.attributes.getNamedItem(j);return!!(k&&k.specified);};return c&&b.version<8?function(j){if(j=='name')return!!this.$.name;return i.call(this,j);}:i;})(),hide:function(){this.setStyle('display','none');},moveChildren:function(i,j){var k=this.$;i=i.$;if(k==i)return;var l;if(j)while(l=k.lastChild)i.insertBefore(k.removeChild(l),i.firstChild);else while(l=k.firstChild)i.appendChild(k.removeChild(l));},mergeSiblings:(function(){function i(j,k,l){if(k&&k.type==1){var m=[]; +while(k.data('cke-bookmark')||k.isEmptyInlineRemoveable()){m.push(k);k=l?k.getNext():k.getPrevious();if(!k||k.type!=1)return;}if(j.isIdentical(k)){var n=l?j.getLast():j.getFirst();while(m.length)m.shift().move(j,!l);k.moveChildren(j,!l);k.remove();if(n&&n.type==1)n.mergeSiblings();}}};return function(j){var k=this;if(!(j===false||f.$removeEmpty[k.getName()]||k.is('a')))return;i(k,k.getNext(),true);i(k,k.getPrevious());};})(),show:function(){this.setStyles({display:'',visibility:''});},setAttribute:(function(){var i=function(j,k){this.$.setAttribute(j,k);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(j,k){var l=this;if(j=='class')l.$.className=k;else if(j=='style')l.$.style.cssText=k;else if(j=='tabindex')l.$.tabIndex=k;else if(j=='checked')l.$.checked=k;else if(j=='contenteditable')i.call(l,'contentEditable',k);else i.apply(l,arguments);return l;};else if(b.ie8Compat&&b.secure)return function(j,k){if(j=='src'&&k.match(/^http:\/\//))try{i.apply(this,arguments);}catch(l){}else i.apply(this,arguments);return this;};else return i;})(),setAttributes:function(i){for(var j in i)this.setAttribute(j,i[j]);return this;},setValue:function(i){this.$.value=i;return this;},removeAttribute:(function(){var i=function(j){this.$.removeAttribute(j);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){if(j=='class')j='className';else if(j=='tabindex')j='tabIndex';else if(j=='contenteditable')j='contentEditable';i.call(this,j);};else return i;})(),removeAttributes:function(i){if(e.isArray(i))for(var j=0;j=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:function(){if(c||b.opera){var i=this.$,j=i.getElementsByTagName('*'),k,l=0;i.unselectable='on';while(k=j[l++])switch(k.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break; +default:k.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument(),m=l.getBody(),n=l.$.compatMode=='BackCompat';if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=l.$,q=p.documentElement,r=q.clientTop||m.$.clientTop||0,s=q.clientLeft||m.$.clientLeft||0,t=true;if(c){var u=l.getDocumentElement().contains(D),v=l.getBody().contains(D);t=n&&v||!n&&u;}if(t){j=o.left+(!n&&q.scrollLeft||m.$.scrollLeft);j-=s;k=o.top+(!n&&q.scrollTop||m.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!n){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var j=this.getParent();if(!j)return;do{var k=j.$.clientWidth&&j.$.clientWidth0)n(0,j===true?x.y:j===false?y.y:x.y<0?x.y:y.y); +if(k&&(x.x<0||y.x>0))n(x.x<0?x.x:y.x,0);},setState:function(i){var j=this;switch(i){case 1:j.addClass('cke_on');j.removeClass('cke_off');j.removeClass('cke_disabled');break;case 0:j.addClass('cke_disabled');j.removeClass('cke_off');j.removeClass('cke_on');break;default:j.addClass('cke_off');j.removeClass('cke_on');j.removeClass('cke_disabled');break;}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document;}catch(j){i.src=i.src;if(c&&b.version<7)window.showModalDialog('javascript:document.write("")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});},getDirection:function(i){var j=this;return i?j.getComputedStyle('direction')||j.getDirection()||j.getDocument().$.dir||j.getDocument().getBody().getDirection(1):j.getStyle('direction')||j.getAttribute('dir');},data:function(i,j){i='data-'+i;if(j===undefined)return this.getAttribute(i);else if(j===false)this.removeAttribute(i);else this.setAttribute(i,j);return null;}});(function(){var i={width:['border-left-width','border-right-width','padding-left','padding-right'],height:['border-top-width','border-bottom-width','padding-top','padding-bottom']};function j(k){var l=0;for(var m=0,n=i[k].length;m',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,bidi,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,iframe,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,showblocks,showborders,smiley,sourcearea,specialchar,stylescombo,tab,table,tabletools,templates,toolbar,undo,wsc,wysiwygarea',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer; +j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k);if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language||k;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o){var p=typeof l=='string';if(p)l=[l];if(!n)n=a;var q=l.length,r=[],s=[],t=function(y){if(m)if(p)m.call(n,y);else m.call(n,r,s);};if(q===0){t(true);return;}var u=function(y,z){(z?r:s).push(y);if(--q<=0){o&&a.document.getDocumentElement().removeStyle('cursor');t(z);}},v=function(y,z){j[y]=1;var A=k[y];delete k[y];for(var B=0;B1)return;var A=new h('script');A.setAttributes({type:'text/javascript',src:y});if(m)if(c)A.$.onreadystatechange=function(){if(A.$.readyState=='loaded'||A.$.readyState=='complete'){A.$.onreadystatechange=null;v(y,true);}};else{A.$.onload=function(){setTimeout(function(){v(y,true);},0);};A.$.onerror=function(){v(y,false);};}A.appendTo(a.document.getHead());};o&&a.document.getDocumentElement().setStyle('cursor','wait');for(var x=0;x1)return;var w=!p.css||!p.css.length,x=!p.js||!p.js.length,y=function(){if(w&&x){p._isLoaded=1;for(var B=0;B=0?x.langCode:J[0];if(!I.langEntries||!I.langEntries[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.langEntries[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit']; +for(var N=0;N]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))",'g')};};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s);if(r)r.push(t);else A.onText(t);}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(''));r=null;}if(!r){A.onTagClose(p);continue;}}if(r){r.push(o[0]);continue;}if(p=o[3]){p=p.toLowerCase();if(/="/.test(p))continue;var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=='/');if(w)while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||'';if(!z&&m[y])u[y]=y;else u[y]=z;}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p])r=[];continue;}if(p=o[2])A.onComment(p);}if(n.length>q)A.onText(n.substring(q,n.length));}};})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n,this)))return;if(typeof n!='string'){n.parent=this.parent;n.writeHtml(l,m); +return;}}l.comment(n);}};(function(){a.htmlParser.text=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.text.prototype={type:3,writeHtml:function(l,m){var n=this.value;if(m&&!(n=m.onText(n,this)))return;l.text(n);}};})();(function(){a.htmlParser.cdata=function(l){this.value=l;};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value);}};})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var l=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),m=c&&b.version<8?{dd:1,dt:1}:{},n={ol:1,ul:1},o=e.extend({},{html:1},f.html,f.body,f.head,{style:1,script:1});function p(q){return q.name=='a'&&q.attributes.href||f.$removeEmpty[q.name];};a.htmlParser.fragment.fromHtml=function(q,r,s){var t=new a.htmlParser(),u=s||new a.htmlParser.fragment(),v=[],w=[],x=u,y=false,z=false;function A(D){var E;if(v.length>0)for(var F=0;F=0;E--){if(D==v[E].name){v.splice(E,1);return;}}var F=[],G=[],H=x;while(H!=u&&H.name!=D){if(!H._.isBlockLike)G.unshift(H);F.push(H);H=H.returnPoint||H.parent;}if(H!=u){for(E=0;E0?t.children[r-1]:null;if(s){if(q._.isBlockLike&&s.type==3){s.value=e.rtrim(s.value);if(s.value.length===0){t.children.pop();t.add(q);return;}}s.next=q;}q.previous=s;q.parent=t;t.children.splice(r,0,q);t._.hasInlineStarted=q.type==3||q.type==1&&!q._.isBlockLike;},writeHtml:function(q,r){var s;this.filterChildren=function(){var t=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,t,r,true);var u=t.getHtml();this.children=new a.htmlParser.fragment.fromHtml(u).children;s=1;};!this.name&&r&&r.onFragment(this);this.writeChildrenHtml(q,s?null:r);},writeChildrenHtml:function(q,r){for(var s=0;sn?1:0;};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes);},writeHtml:function(m,n){var o=this.attributes,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var B=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,B,n);p.children=new a.htmlParser.fragment.fromHtml(B.getHtml(),0,p.clone()).children;u=1;}};if(n){for(;;){if(!(q=n.onElementName(q)))return;p.name=q;if(!(p=n.onElement(p)))return;p.parent=this.parent;if(p.name==q)break;if(p.type!=1){p.writeHtml(m,n);return;}q=p.name;if(!q){for(var v=0,w=this.children.length;v=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=q.type||q instanceof a.htmlParser.fragment;for(var s=0;s');else this._.output.push('>');},attribute:function(l,m){if(typeof m=='string')m=e.htmlEncodeAttr(m);this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){this._.output.push('');},text:function(l){this._.output.push(l);},comment:function(l){this._.output.push('');},write:function(l){this._.output.push(l);},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(l){var m=this._.output.join('');if(l)this.reset();return m;}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on('focus',function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire('currentInstance');}});l.on('blur',function(){if(a.currentInstance==l){a.currentInstance=null;a.fire('currentInstance');}});};a.remove=function(l){delete a.instances[l.name];};a.on('instanceDestroyed',function(){if(e.isEmpty(this.instances))a.fire('reset'); +});a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=function(l,m){if(typeof l=='string')l=(m?m.$:document).createComment(l);d.domObject.call(this,l);};d.comment.prototype=new d.node();e.extend(d.comment.prototype,{type:8,getOuterHtml:function(){return '';}});(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1,legend:1,caption:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,form:1,fieldset:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q0)v=v.getChild(z-1);else v=A(v,true)===false?null:v.getPreviousSourceNode(true,C,A);}else{v=w;if(v.type==1)if(!(v=v.getChild(y)))v=A(w,true)===false?null:w.getNextSourceNode(true,C,A);}if(v&&A(v)===false)v=null;}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!t)return v;}else if(t&&this.evaluator)return false;v=v[D](false,C,A);}this.end();return this.current=null;};function m(s){var t,u=null;while(t=l.call(this,s))u=t;return u;};d.walker=e.createClass({$:function(s){this.range=s;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,1);},checkForward:function(){return l.call(this,0,1)!==false;},checkBackward:function(){return l.call(this,1,1)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,1);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1};h.prototype.isBlockBoundary=function(s){var t=s?e.extend({},f.$block,s||{}):f.$block;return this.getComputedStyle('float')=='none'&&n[this.getComputedStyle('display')]||t[this.getName()];};d.walker.blockBoundary=function(s){return function(t,u){return!(t.type==1&&t.isBlockBoundary(s));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmark=function(s,t){function u(v){return v&&v.getName&&v.getName()=='span'&&v.data('cke-bookmark');};return function(v){var w,x;w=v&&!v.getName&&(x=v.getParent())&&u(x);w=s?w:w||u(v);return!!(t^w);};};d.walker.whitespaces=function(s){return function(t){var u=t&&t.type==3&&!e.trim(t.getText()); +return!!(s^u);};};d.walker.invisible=function(s){var t=d.walker.whitespaces();return function(u){var v=t(u)||u.is&&!u.$.offsetHeight;return!!(s^v);};};d.walker.nodeType=function(s,t){return function(u){return!!(t^u.type==s);};};d.walker.bogus=function(s){function t(u){return!p(u)&&!q(u);};return function(u){var v=!c?u.is&&u.is('br'):u.getText&&o.test(u.getText());if(v){var w=u.getParent(),x=u.getNext(t);v=w.isBlockBoundary()&&(!x||x.type==1&&x.isBlockBoundary());}return!!(s^v);};};var o=/^[\t\r\n ]*(?: |\xa0)$/,p=d.walker.whitespaces(),q=d.walker.bookmark(),r=function(s){return q(s)||p(s)||s.type==1&&s.getName() in f.$inline&&!(s.getName() in f.$empty);};h.prototype.getBogus=function(){var s=this;do s=s.getPreviousSourceNode();while(r(s));if(s&&(!c?s.is&&s.is('br'):s.getText&&o.test(s.getText())))return s;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(u){u.collapsed=u.startContainer&&u.endContainer&&u.startContainer.equals(u.endContainer)&&u.startOffset==u.endOffset;},m=function(u,v,w,x){u.optimizeBookmark();var y=u.startContainer,z=u.endContainer,A=u.startOffset,B=u.endOffset,C,D;if(z.type==3)z=z.split(B);else if(z.getChildCount()>0)if(B>=z.getChildCount()){z=z.append(u.document.createText(''));D=true;}else z=z.getChild(B);if(y.type==3){y.split(A);if(y.equals(z))z=y.getNext();}else if(!A){y=y.getFirst().insertBeforeMe(u.document.createText(''));C=true;}else if(A>=y.getChildCount()){y=y.append(u.document.createText(''));C=true;}else y=y.getChild(A).getPrevious();var E=y.getParents(),F=z.getParents(),G,H,I;for(G=0;G0&&!K.equals(z))L=J.append(K.clone());if(!E[P]||K.$.parentNode!=E[P].$.parentNode){M=K.getPrevious();while(M){if(M.equals(E[P])||M.equals(y))break;N=M.getPrevious();if(v==2)J.$.insertBefore(M.$.cloneNode(true),J.$.firstChild);else{M.remove();if(v==1)J.$.insertBefore(M.$,J.$.firstChild);}M=N;}}if(J)J=L;}if(v==2){var Q=u.startContainer;if(Q.type==3){Q.$.data+=Q.$.nextSibling.data;Q.$.parentNode.removeChild(Q.$.nextSibling);}var R=u.endContainer;if(R.type==3&&R.$.nextSibling){R.$.data+=R.$.nextSibling.data; +R.$.parentNode.removeChild(R.$.nextSibling);}}else{if(H&&I&&(y.$.parentNode!=H.$.parentNode||z.$.parentNode!=I.$.parentNode)){var S=I.getIndex();if(C&&I.$.parentNode==y.$.parentNode)S--;if(x&&H.type==1){var T=h.createFromHtml(' ',u.document);T.insertAfter(H);H.mergeSiblings(false);u.moveToBookmark({startNode:T});}else u.setStart(I.getParent(),S);}u.collapse(true);}if(C)y.remove();if(D&&z.$.parentNode)z.remove();},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function o(u){var v=false,w=d.walker.bookmark(true),x=/^[\t\r\n ]*(?: |\xa0)$/;return function(y){if(w(y))return true;if(y.type==3){if(c&&x.test(y.getText())&&!v&&!(u&&y.getNext()))v=true;else if(y.hasAscendant('pre')||e.trim(y.getText()).length)return false;}else if(y.type==1)if(!n[y.getName()])if(!c&&y.is('br')&&!v&&!(u&&y.getNext()))v=true;else return false;return true;};};var p=d.walker.bogus();function q(u){return function(v){return!u&&p(v)||(v.type==3?!e.trim(v.getText())||!!v.getParent().data('cke-bookmark'):v.getName() in f.$removeEmpty);};};var r=new d.walker.whitespaces(),s=new d.walker.bookmark();function t(u){return!r(u)&&!s(u);};d.range.prototype={clone:function(){var v=this;var u=new d.range(v.document);u.startContainer=v.startContainer;u.startOffset=v.startOffset;u.endContainer=v.endContainer;u.endOffset=v.endOffset;u.collapsed=v.collapsed;return u;},collapse:function(u){var v=this;if(u){v.endContainer=v.startContainer;v.endOffset=v.startOffset;}else{v.startContainer=v.endContainer;v.startOffset=v.endOffset;}v.collapsed=true;},cloneContents:function(){var u=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,u);return u;},deleteContents:function(u){if(this.collapsed)return;m(this,0,null,u);},extractContents:function(u){var v=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,v,u);return v;},createBookmark:function(u){var A=this;var v,w,x,y,z=A.collapsed;v=A.document.createElement('span');v.data('cke-bookmark',1);v.setStyle('display','none');v.setHtml(' ');if(u){x='cke_bm_'+e.getNextNumber();v.setAttribute('id',x+(z?'C':'S'));}if(!z){w=v.clone();w.setHtml(' ');if(u)w.setAttribute('id',x+'E');y=A.clone();y.collapse();y.insertNode(w);}y=A.clone();y.collapse(true);y.insertNode(v);if(w){A.setStartAfter(v);A.setEndBefore(w);}else A.moveToPosition(v,4);return{startNode:u?x+(z?'C':'S'):v,endNode:u?x+'E':w,serializable:u,collapsed:z}; +},createBookmark2:function(u){var C=this;var v=C.startContainer,w=C.endContainer,x=C.startOffset,y=C.endOffset,z=C.collapsed,A,B;if(!v||!w)return{start:0,end:0};if(u){if(v.type==1){A=v.getChild(x);if(A&&A.type==3&&x>0&&A.getPrevious().type==3){v=A;x=0;}if(A&&A.type==1)x=A.getIndex(1);}while(v.type==3&&(B=v.getPrevious())&&B.type==3){v=B;x+=B.getLength();}if(!z){if(w.type==1){A=w.getChild(y);if(A&&A.type==3&&y>0&&A.getPrevious().type==3){w=A;y=0;}if(A&&A.type==1)y=A.getIndex(1);}while(w.type==3&&(B=w.getPrevious())&&B.type==3){w=B;y+=B.getLength();}}}return{start:v.getAddress(u),end:z?null:w.getAddress(u),startOffset:x,endOffset:y,normalized:u,collapsed:z,is2:true};},moveToBookmark:function(u){var C=this;if(u.is2){var v=C.document.getByAddress(u.start,u.normalized),w=u.startOffset,x=u.end&&C.document.getByAddress(u.end,u.normalized),y=u.endOffset;C.setStart(v,w);if(x)C.setEnd(x,y);else C.collapse(true);}else{var z=u.serializable,A=z?C.document.getById(u.startNode):u.startNode,B=z?C.document.getById(u.endNode):u.endNode;C.setStartBefore(A);A.remove();if(B){C.setEndBefore(B);B.remove();}else C.collapse(true);}},getBoundaryNodes:function(){var z=this;var u=z.startContainer,v=z.endContainer,w=z.startOffset,x=z.endOffset,y;if(u.type==1){y=u.getChildCount();if(y>w)u=u.getChild(w);else if(y<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);u=u.getNextSourceNode()||u;}}if(v.type==1){y=v.getChildCount();if(y>x)v=v.getChild(x).getPreviousSourceNode(true);else if(y<1)v=v.getPreviousSourceNode();else{v=v.$;while(v.lastChild)v=v.lastChild;v=new d.node(v);}}if(u.getPosition(v)&2)u=v;return{startNode:u,endNode:v};},getCommonAncestor:function(u,v){var z=this;var w=z.startContainer,x=z.endContainer,y;if(w.equals(x)){if(u&&w.type==1&&z.startOffset==z.endOffset-1)y=w.getChild(z.startOffset);else y=w;}else y=w.getCommonAncestor(x);return v&&!y.is?y.getParent():y;},optimize:function(){var w=this;var u=w.startContainer,v=w.startOffset;if(u.type!=1)if(!v)w.setStartBefore(u);else if(v>=u.getLength())w.setStartAfter(u);u=w.endContainer;v=w.endOffset;if(u.type!=1)if(!v)w.setEndBefore(u);else if(v>=u.getLength())w.setEndAfter(u);},optimizeBookmark:function(){var w=this;var u=w.startContainer,v=w.endContainer;if(u.is&&u.is('span')&&u.data('cke-bookmark'))w.setStartAt(u,3);if(v&&v.is&&v.is('span')&&v.data('cke-bookmark'))w.setEndAt(v,4);},trim:function(u,v){var C=this;var w=C.startContainer,x=C.startOffset,y=C.collapsed;if((!u||y)&&w&&w.type==3){if(!x){x=w.getIndex(); +w=w.getParent();}else if(x>=w.getLength()){x=w.getIndex()+1;w=w.getParent();}else{var z=w.split(x);x=w.getIndex()+1;w=w.getParent();if(C.startContainer.equals(C.endContainer))C.setEnd(z,C.endOffset-C.startOffset);else if(w.equals(C.endContainer))C.endOffset+=1;}C.setStart(w,x);if(y){C.collapse(true);return;}}var A=C.endContainer,B=C.endOffset;if(!(v||y)&&A&&A.type==3){if(!B){B=A.getIndex();A=A.getParent();}else if(B>=A.getLength()){B=A.getIndex()+1;A=A.getParent();}else{A.split(B);B=A.getIndex()+1;A=A.getParent();}C.setEnd(A,B);}},enlarge:function(u,v){switch(u){case 1:if(this.collapsed)return;var w=this.getCommonAncestor(),x=this.document.getBody(),y,z,A,B,C,D=false,E,F,G=this.startContainer,H=this.startOffset;if(G.type==3){if(H){G=!e.trim(G.substring(0,H)).length&&G;D=!!G;}if(G)if(!(B=G.getPrevious()))A=G.getParent();}else{if(H)B=G.getChild(H-1)||G.getLast();if(!B)A=G;}while(A||B){if(A&&!B){if(!C&&A.equals(w))C=true;if(!x.contains(A))break;if(!D||A.getComputedStyle('display')!='inline'){D=false;if(C)y=A;else this.setStartBefore(A);}B=A.getPrevious();}while(B){E=false;if(B.type==8){B=B.getPrevious();continue;}else if(B.type==3){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;E=/[\s\ufeff]$/.test(F);}else if((B.$.offsetWidth>0||v&&B.is('br'))&&!B.data('cke-bookmark'))if(D&&f.$removeEmpty[B.getName()]){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;else{var I=B.$.getElementsByTagName('*');for(var J=0,K;K=I[J++];){if(!f.$removeEmpty[K.nodeName.toLowerCase()]){B=null;break;}}}if(B)E=!!F.length;}else B=null;if(E)if(D){if(C)y=A;else if(A)this.setStartBefore(A);}else D=true;if(B){var L=B.getPrevious();if(!A&&!L){A=B;B=null;break;}B=L;}else A=null;}if(A)A=A.getParent();}G=this.endContainer;H=this.endOffset;A=B=null;C=D=false;if(G.type==3){G=!e.trim(G.substring(H)).length&&G;D=!(G&&G.getLength());if(G)if(!(B=G.getNext()))A=G.getParent();}else{B=G.getChild(H);if(!B)A=G;}while(A||B){if(A&&!B){if(!C&&A.equals(w))C=true;if(!x.contains(A))break;if(!D||A.getComputedStyle('display')!='inline'){D=false;if(C)z=A;else if(A)this.setEndAfter(A);}B=A.getNext();}while(B){E=false;if(B.type==3){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;E=/^[\s\ufeff]/.test(F);}else if(B.type==1){if((B.$.offsetWidth>0||v&&B.is('br'))&&!B.data('cke-bookmark'))if(D&&f.$removeEmpty[B.getName()]){F=B.getText();if(/[^\s\ufeff]/.test(F))B=null;else{I=B.$.getElementsByTagName('*');for(J=0;K=I[J++];){if(!f.$removeEmpty[K.nodeName.toLowerCase()]){B=null;break;}}}if(B)E=!!F.length;}else B=null;}else E=1;if(E)if(D)if(C)z=A; +else this.setEndAfter(A);if(B){L=B.getNext();if(!A&&!L){A=B;B=null;break;}B=L;}else A=null;}if(A)A=A.getParent();}if(y&&z){w=y.contains(z)?z:y;this.setStartBefore(w);this.setEndAfter(w);}break;case 2:case 3:var M=new d.range(this.document);x=this.document.getBody();M.setStartAt(x,1);M.setEnd(this.startContainer,this.startOffset);var N=new d.walker(M),O,P,Q=d.walker.blockBoundary(u==3?{br:1}:null),R=function(X){var Y=Q(X);if(!Y)O=X;return Y;},S=function(X){var Y=R(X);if(!Y&&X.is&&X.is('br'))P=X;return Y;};N.guard=R;A=N.lastBackward();O=O||x;this.setStartAt(O,!O.is('br')&&(!A&&this.checkStartOfBlock()||A&&O.contains(A))?1:4);if(u==3){var T=this.clone();N=new d.walker(T);var U=d.walker.whitespaces(),V=d.walker.bookmark();N.evaluator=function(X){return!U(X)&&!V(X);};var W=N.previous();if(W&&W.type==1&&W.is('br'))return;}M=this.clone();M.collapse();M.setEndAt(x,2);N=new d.walker(M);N.guard=u==3?S:R;O=null;A=N.lastForward();O=O||x;this.setEndAt(O,!A&&this.checkEndOfBlock()||A&&O.contains(A)?2:3);if(P)this.setEndAfter(P);}},shrink:function(u,v){if(!this.collapsed){u=u||2;var w=this.clone(),x=this.startContainer,y=this.endContainer,z=this.startOffset,A=this.endOffset,B=this.collapsed,C=1,D=1;if(x&&x.type==3)if(!z)w.setStartBefore(x);else if(z>=x.getLength())w.setStartAfter(x);else{w.setStartBefore(x);C=0;}if(y&&y.type==3)if(!A)w.setEndBefore(y);else if(A>=y.getLength())w.setEndAfter(y);else{w.setEndAfter(y);D=0;}var E=new d.walker(w),F=d.walker.bookmark();E.evaluator=function(J){return J.type==(u==1?1:3);};var G;E.guard=function(J,K){if(F(J))return true;if(u==1&&J.type==3)return false;if(K&&J.equals(G))return false;if(!K&&J.type==1)G=J;return true;};if(C){var H=E[u==1?'lastForward':'next']();H&&this.setStartAt(H,v?1:3);}if(D){E.reset();var I=E[u==1?'lastBackward':'previous']();I&&this.setEndAt(I,v?2:4);}return!!(C||D);}},insertNode:function(u){var y=this;y.optimizeBookmark();y.trim(false,true);var v=y.startContainer,w=y.startOffset,x=v.getChild(w);if(x)u.insertBefore(x);else v.append(u);if(u.getParent().equals(y.endContainer))y.endOffset++;y.setStartBefore(u);},moveToPosition:function(u,v){this.setStartAt(u,v);this.collapse(true);},selectNodeContents:function(u){this.setStart(u,0);this.setEnd(u,u.type==3?u.getLength():u.getChildCount());},setStart:function(u,v){var w=this;if(u.type==1&&f.$empty[u.getName()])v=u.getIndex(),u=u.getParent();w.startContainer=u;w.startOffset=v;if(!w.endContainer){w.endContainer=u;w.endOffset=v;}l(w);},setEnd:function(u,v){var w=this;if(u.type==1&&f.$empty[u.getName()])v=u.getIndex()+1,u=u.getParent(); +w.endContainer=u;w.endOffset=v;if(!w.startContainer){w.startContainer=u;w.startOffset=v;}l(w);},setStartAfter:function(u){this.setStart(u.getParent(),u.getIndex()+1);},setStartBefore:function(u){this.setStart(u.getParent(),u.getIndex());},setEndAfter:function(u){this.setEnd(u.getParent(),u.getIndex()+1);},setEndBefore:function(u){this.setEnd(u.getParent(),u.getIndex());},setStartAt:function(u,v){var w=this;switch(v){case 1:w.setStart(u,0);break;case 2:if(u.type==3)w.setStart(u,u.getLength());else w.setStart(u,u.getChildCount());break;case 3:w.setStartBefore(u);break;case 4:w.setStartAfter(u);}l(w);},setEndAt:function(u,v){var w=this;switch(v){case 1:w.setEnd(u,0);break;case 2:if(u.type==3)w.setEnd(u,u.getLength());else w.setEnd(u,u.getChildCount());break;case 3:w.setEndBefore(u);break;case 4:w.setEndAfter(u);}l(w);},fixBlock:function(u,v){var y=this;var w=y.createBookmark(),x=y.document.createElement(v);y.collapse(u);y.enlarge(2);y.extractContents().appendTo(x);x.trim();if(!c)x.appendBogus();y.insertNode(x);y.moveToBookmark(w);return x;},splitBlock:function(u){var E=this;var v=new d.elementPath(E.startContainer),w=new d.elementPath(E.endContainer),x=v.blockLimit,y=w.blockLimit,z=v.block,A=w.block,B=null;if(!x.equals(y))return null;if(u!='br'){if(!z){z=E.fixBlock(true,u);A=new d.elementPath(E.endContainer).block;}if(!A)A=E.fixBlock(false,u);}var C=z&&E.checkStartOfBlock(),D=A&&E.checkEndOfBlock();E.deleteContents();if(z&&z.equals(A))if(D){B=new d.elementPath(E.startContainer);E.moveToPosition(A,4);A=null;}else if(C){B=new d.elementPath(E.startContainer);E.moveToPosition(z,3);z=null;}else{A=E.splitElement(z);if(!c&&!z.is('ul','ol'))z.appendBogus();}return{previousBlock:z,nextBlock:A,wasStartOfBlock:C,wasEndOfBlock:D,elementPath:B};},splitElement:function(u){var x=this;if(!x.collapsed)return null;x.setEndAt(u,2);var v=x.extractContents(),w=u.clone(false);v.appendTo(w);w.insertAfter(u);x.moveToPosition(u,4);return w;},checkBoundaryOfElement:function(u,v){var w=v==1,x=this.clone();x.collapse(w);x[w?'setStartAt':'setEndAt'](u,w?1:2);var y=new d.walker(x);y.evaluator=q(w);return y[w?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var A=this;var u=A.startContainer,v=A.startOffset;if(v&&u.type==3){var w=e.ltrim(u.substring(0,v));if(w.length)return false;}var x=new d.elementPath(A.startContainer),y=A.clone();y.collapse(true);y.setStartAt(x.block||x.blockLimit,1);var z=new d.walker(y);z.evaluator=o(true);return z.checkBackward();},checkEndOfBlock:function(){var A=this; +var u=A.endContainer,v=A.endOffset;if(u.type==3){var w=e.rtrim(u.substring(v));if(w.length)return false;}var x=new d.elementPath(A.endContainer),y=A.clone();y.collapse(false);y.setEndAt(x.block||x.blockLimit,2);var z=new d.walker(y);z.evaluator=o(false);return z.checkForward();},checkReadOnly:(function(){function u(v,w){while(v){if(v.type==1)if(v.getAttribute('contentEditable')=='false'&&!v.data('cke-editable'))return 0;else if(v.is('html')||v.getAttribute('contentEditable')=='true'&&(v.contains(w)||v.equals(w)))break;v=v.getParent();}return 1;};return function(){var v=this.startContainer,w=this.endContainer;return!(u(v,w)&&u(w,v));};})(),moveToElementEditablePosition:function(u,v){var w=/^[\t\r\n ]*(?: |\xa0)$/;function x(z,A){var B;if(z.type==1&&z.isEditable(false))B=z[v?'getLast':'getFirst'](t);if(!A&&!B)B=z[v?'getPrevious':'getNext'](t);return B;};if(u.type==1&&!u.isEditable(false)){this.moveToPosition(u,v?4:3);return true;}var y=0;while(u){if(u.type==3){if(v&&this.checkEndOfBlock()&&w.test(u.getText()))this.moveToPosition(u,3);else this.moveToPosition(u,v?4:3);y=1;break;}if(u.type==1)if(u.isEditable()){this.moveToPosition(u,v?2:1);y=1;}else if(v&&u.is('br')&&this.checkEndOfBlock())this.moveToPosition(u,3);u=x(u,y);}return!!y;},moveToElementEditStart:function(u){return this.moveToElementEditablePosition(u);},moveToElementEditEnd:function(u){return this.moveToElementEditablePosition(u,true);},getEnclosedNode:function(){var u=this.clone();u.optimize();if(u.startContainer.type!=1||u.endContainer.type!=1)return null;var v=new d.walker(u),w=d.walker.bookmark(true),x=d.walker.whitespaces(true),y=function(A){return x(A)&&w(A);};u.evaluator=y;var z=v.next();v.reset();return z&&z.equals(v.previous())?z:null;},getTouchedStartNode:function(){var u=this.startContainer;if(this.collapsed||u.type!=1)return u;return u.getChild(this.startOffset)||u;},getTouchedEndNode:function(){var u=this.endContainer;if(this.collapsed||u.type!=1)return u;return u.getChild(this.endOffset-1)||u;}};})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){d.rangeList=function(n){if(n instanceof d.rangeList)return n;if(!n)n=[];else if(n instanceof d.range)n=[n];return e.extend(n,l);};var l={createIterator:function(){var n=this,o=d.walker.bookmark(),p=function(s){return!(s.is&&s.is('tr')); +},q=[],r;return{getNextRange:function(s){r=r==undefined?0:r+1;var t=n[r];if(t&&n.length>1){if(!r)for(var u=n.length-1;u>=0;u--)q.unshift(n[u].createBookmark(true));if(s){var v=0;while(n[r+v+1]){var w=t.document,x=0,y=w.getById(q[v].endNode),z=w.getById(q[v+1].startNode),A;while(1){A=y.getNextSourceNode(false);if(!z.equals(A)){if(o(A)||A.type==1&&A.isBlockBoundary()){y=A;continue;}}else x=1;break;}if(!x)break;v++;}}t.moveToBookmark(q.shift());while(v--){A=n[++r];A.moveToBookmark(q.shift());t.setEnd(A.endContainer,A.endOffset);}}return t;}};},createBookmarks:function(n){var s=this;var o=[],p;for(var q=0;q
    ',a.document);l.appendTo(a.document.getHead());try{b.hc=l.getComputedStyle('border-top-color')==l.getComputedStyle('border-right-color');}catch(m){b.hc=false;}if(b.hc)b.cssClass+=' cke_hc';l.remove();})();j.load(i.corePlugins.split(','),function(){a.status='loaded';a.fire('loaded');var l=a._.pending;if(l){delete a._.pending;for(var m=0;m0){z=A.shift();while(!z.getParent().equals(D))z=z.getParent();if(!z.equals(H))E.push(z);H=z;}while(E.length>0){z=E.shift();if(z.getName()=='blockquote'){var I=new d.documentFragment(q.document);while(z.getFirst()){I.append(z.getFirst().remove());A.push(I.getLast());}I.replace(z);}else A.push(z);}var J=q.document.createElement('blockquote');J.insertBefore(A[0]);while(A.length>0){z=A.shift();J.append(z);}}else if(r==1){var K=[],L={};while(z=y.getNextParagraph()){var M=null,N=null;while(z.getParent()){if(z.getParent().getName()=='blockquote'){M=z.getParent();N=z;break;}z=z.getParent();}if(M&&N&&!N.getCustomData('blockquote_moveout')){K.push(N);h.setMarker(L,N,'blockquote_moveout',true);}}h.clearAllMarkers(L);var O=[],P=[];L={};while(K.length>0){var Q=K.shift();J=Q.getParent();if(!Q.getPrevious())Q.remove().insertBefore(J);else if(!Q.getNext())Q.remove().insertAfter(J);else{Q.breakParent(Q.getParent());P.push(Q.getNext());}if(!J.getCustomData('blockquote_processed')){P.push(J);h.setMarker(L,J,'blockquote_processed',true);}O.push(Q);}h.clearAllMarkers(L);for(F=P.length-1;F>=0;F--){J=P[F];if(o(J))J.remove();}if(q.config.enterMode==2){var R=true;while(O.length){Q=O.shift();if(Q.getName()=='div'){I=new d.documentFragment(q.document);var S=R&&Q.getPrevious()&&!(Q.getPrevious().type==1&&Q.getPrevious().isBlockBoundary());if(S)I.append(q.document.createElement('br'));var T=Q.getNext()&&!(Q.getNext().type==1&&Q.getNext().isBlockBoundary());while(Q.getFirst())Q.getFirst().remove().appendTo(I);if(T)I.append(q.document.createElement('br'));I.replace(Q);R=false;}}}}s.selectBookmarks(u);q.focus();}};j.add('blockquote',{init:function(q){q.addCommand('blockquote',p);q.ui.addButton('Blockquote',{label:q.lang.blockquote,command:'blockquote'});q.on('selectionChange',n);},requires:['domiterator']});})();j.add('button',{beforeInit:function(m){m.ui.addHandler('button',k.button.handler); +}});a.UI_BUTTON='button';k.button=function(m){e.extend(this,m,{title:m.label,className:m.className||m.command&&'cke_button_'+m.command||'',click:m.click||(function(n){n.execCommand(m.command);})});this._={};};k.button.handler={create:function(m){return new k.button(m);}};(function(){k.button.prototype={render:function(m,n){var o=b,p=this._.id=e.getNextId(),q='',r=this.command,s;this._.editor=m;var t={id:p,button:this,editor:m,focus:function(){var z=a.document.getById(p);z.focus();},execute:function(){if(c&&b.version<7)e.setTimeout(function(){this.button.click(m);},0,this);else this.button.click(m);}},u=e.addFunction(function(z){if(t.onkey){z=new d.event(z);return t.onkey(t,z.getKeystroke())!==false;}}),v=e.addFunction(function(z){var A;if(t.onfocus)A=t.onfocus(t,new d.event(z))!==false;if(b.gecko&&b.version<10900)z.preventBubble();return A;});t.clickFn=s=e.addFunction(t.execute,t);if(this.modes){var w={};function x(){var z=m.mode;if(z){var A=this.modes[z]?w[z]!=undefined?w[z]:2:0;this.setState(m.readOnly&&!this.readOnly?0:A);}};m.on('beforeModeUnload',function(){if(m.mode&&this._.state!=0)w[m.mode]=this._.state;},this);m.on('mode',x,this);!this.readOnly&&m.on('readOnly',x,this);}else if(r){r=m.getCommand(r);if(r){r.on('state',function(){this.setState(r.state);},this);q+='cke_'+(r.state==1?'on':r.state==0?'disabled':'off');}}if(!r)q+='cke_off';if(this.className)q+=' '+this.className;n.push('','=10900&&!o.hc?'':'" href="javascript:void(\''+(this.title||'').replace("'",'')+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+p+'_label"'+(this.hasArrow?' aria-haspopup="true"':''));if(o.opera||o.gecko&&o.mac)n.push(' onkeypress="return false;"');if(o.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="return CKEDITOR.tools.callFunction(',u,', event);" onfocus="return CKEDITOR.tools.callFunction(',v,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',s,', this); return false;"> ',this.label,'');if(this.hasArrow)n.push(''+(b.hc?'▼':' ')+''); +n.push('','');if(this.onRender)this.onRender();return t;},setState:function(m){if(this._.state==m)return false;this._.state=m;var n=a.document.getById(this._.id);if(n){n.setState(m);m==0?n.setAttribute('aria-disabled',true):n.removeAttribute('aria-disabled');m==1?n.setAttribute('aria-pressed',true):n.removeAttribute('aria-pressed');return true;}else return false;}};})();k.prototype.addButton=function(m,n){this.add(m,'button',n);};(function(){var m=function(y,z){var A=y.document,B=A.getBody(),C=false,D=function(){C=true;};B.on(z,D);(b.version>7?A.$:A.$.selection.createRange()).execCommand(z);B.removeListener(z,D);return C;},n=c?function(y,z){return m(y,z);}:function(y,z){try{return y.document.$.execCommand(z,false,null);}catch(A){return false;}},o=function(y){var z=this;z.type=y;z.canUndo=z.type=='cut';z.startDisabled=true;};o.prototype={exec:function(y,z){this.type=='cut'&&t(y);var A=n(y,this.type);if(!A)alert(y.lang.clipboard[this.type+'Error']);return A;}};var p={canUndo:false,exec:c?function(y){y.focus();if(!y.document.getBody().fire('beforepaste')&&!m(y,'paste')){y.fire('pasteDialog');return false;}}:function(y){try{if(!y.document.getBody().fire('beforepaste')&&!y.document.$.execCommand('Paste',false,null))throw 0;}catch(z){setTimeout(function(){y.fire('pasteDialog');},0);return false;}}},q=function(y){if(this.mode!='wysiwyg')return;switch(y.data.keyCode){case 1114112+86:case 2228224+45:var z=this.document.getBody();if(b.opera||b.gecko)z.fire('paste');return;case 1114112+88:case 2228224+46:var A=this;this.fire('saveSnapshot');setTimeout(function(){A.fire('saveSnapshot');},0);}};function r(y){y.cancel();};function s(y,z,A){var B=this.document;if(B.getById('cke_pastebin'))return;if(z=='text'&&y.data&&y.data.$.clipboardData){var C=y.data.$.clipboardData.getData('text/plain');if(C){y.data.preventDefault();A(C);return;}}var D=this.getSelection(),E=new d.range(B),F=new h(z=='text'?'textarea':b.webkit?'body':'div',B);F.setAttribute('id','cke_pastebin');b.webkit&&F.append(B.createText('\xa0'));B.getBody().append(F);F.setStyles({position:'absolute',top:D.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});F.setStyle(this.config.contentsLangDirection=='ltr'?'left':'right','-1000px');var G=D.createBookmarks();this.on('selectionChange',r,null,null,0);if(z=='text')F.$.focus();else{E.setStartAt(F,1);E.setEndAt(F,2);E.select(true);}var H=this;window.setTimeout(function(){H.document.getBody().focus();H.removeListener('selectionChange',r); +if(b.ie7Compat){D.selectBookmarks(G);F.remove();}else{F.remove();D.selectBookmarks(G);}var I;F=b.webkit&&(I=F.getFirst())&&I.is&&I.hasClass('Apple-style-span')?I:F;A(F['get'+(z=='text'?'Value':'Html')]());},0);};function t(y){if(!c||b.quirks)return;var z=y.getSelection(),A;if(z.getType()==3&&(A=z.getSelectedElement())){var B=z.getRanges()[0],C=y.document.createText('');C.insertBefore(A);B.setStartBefore(C);B.setEndAfter(A);z.selectRanges([B]);setTimeout(function(){if(A.getParent()){C.remove();z.selectElement(A);}},0);}};var u,v;function w(y,z){var A;if(v&&y in {Paste:1,Cut:1})return 0;if(y=='Paste'){c&&(u=1);try{A=z.document.$.queryCommandEnabled(y)||b.webkit;}catch(D){}u=0;}else{var B=z.getSelection(),C=B&&B.getRanges();A=B&&!(C.length==1&&C[0].collapsed);}return A?2:0;};function x(){var z=this;if(z.mode!='wysiwyg')return;var y=w('Paste',z);z.getCommand('cut').setState(w('Cut',z));z.getCommand('copy').setState(w('Copy',z));z.getCommand('paste').setState(y);z.fire('pasteState',y);};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(y){y.on('paste',function(A){var B=A.data;if(B.html)y.insertHtml(B.html);else if(B.text)y.insertText(B.text);setTimeout(function(){y.fire('afterPaste');},0);},null,null,1000);y.on('pasteDialog',function(A){setTimeout(function(){y.openDialog('paste');},0);});y.on('pasteState',function(A){y.getCommand('paste').setState(A.data);});function z(A,B,C,D){var E=y.lang[B];y.addCommand(B,C);y.ui.addButton(A,{label:E,command:B});if(y.addMenuItems)y.addMenuItem(B,{label:E,command:B,group:'clipboard',order:D});};z('Cut','cut',new o('cut'),1);z('Copy','copy',new o('copy'),4);z('Paste','paste',p,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));y.on('key',q,y);y.on('contentDom',function(){var A=y.document.getBody();A.on(!c?'paste':'beforepaste',function(B){if(u)return;var C=B.data&&B.data.$;if(c&&C&&!C.ctrlKey)return;var D={mode:'html'};y.fire('beforePaste',D);s.call(y,B,D.mode,function(E){if(!(E=e.trim(E.replace(/]+data-cke-bookmark[^<]*?<\/span>/ig,''))))return;var F={};F[D.mode]=E;y.fire('paste',F);});});if(c){A.on('contextmenu',function(){u=1;setTimeout(function(){u=0;},0);});A.on('paste',function(B){if(!y.document.getById('cke_pastebin')){B.data.preventDefault();u=0;p.exec(y);}});}A.on('beforecut',function(){!u&&t(y);});A.on('mouseup',function(){setTimeout(function(){x.call(y);},0);},y);A.on('keyup',x,y);});y.on('selectionChange',function(A){v=A.data.selection.getRanges()[0].checkReadOnly();x.call(y); +});if(y.contextMenu)y.contextMenu.addListener(function(A,B){var C=B.getRanges()[0].checkReadOnly();return{cut:w('Cut',y),copy:w('Copy',y),paste:w('Paste',y)};});}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(m){var n=m.config,o=m.lang.colorButton,p;if(!b.hc){q('TextColor','fore',o.textColorTitle);q('BGColor','back',o.bgColorTitle);}function q(t,u,v){var w=e.getNextId()+'_colorBox';m.ui.add(t,'panelbutton',{label:v,title:v,className:'cke_button_'+t.toLowerCase(),modes:{wysiwyg:1},panel:{css:m.skin.editor.css,attributes:{role:'listbox','aria-label':o.panelTitle}},onBlock:function(x,y){y.autoSize=true;y.element.addClass('cke_colorblock');y.element.setHtml(r(x,u,w));y.element.getDocument().getBody().setStyle('overflow','hidden');k.fire('ready',this);var z=y.keys,A=m.lang.dir=='rtl';z[A?37:39]='next';z[40]='next';z[9]='next';z[A?39:37]='prev';z[38]='prev';z[2228224+9]='prev';z[32]='click';},onOpen:function(){var x=m.getSelection(),y=x&&x.getStartElement(),z=new d.elementPath(y),A;y=z.block||z.blockLimit||m.document.getBody();do A=y&&y.getComputedStyle(u=='back'?'background-color':'color')||'transparent';while(u=='back'&&A=='transparent'&&y&&(y=y.getParent()));if(!A||A=='transparent')A='#ffffff';this._.panel._.iframe.getFrameDocument().getById(w).setStyle('background-color',A);}});};function r(t,u,v){var w=[],x=n.colorButton_colors.split(','),y=e.addFunction(function(E,F){if(E=='?'){var G=arguments.callee;function H(J){this.removeListener('ok',H);this.removeListener('cancel',H);J.name=='ok'&&G(this.getContentElement('picker','selectedColor').getValue(),F);};m.openDialog('colordialog',function(){this.on('ok',H);this.on('cancel',H);});return;}m.focus();t.hide(false);m.fire('saveSnapshot');new a.style(n['colorButton_'+F+'Style'],{color:'inherit'}).remove(m.document);if(E){var I=n['colorButton_'+F+'Style'];I.childRule=F=='back'?function(J){return s(J);}:function(J){return!(J.is('a')||J.getElementsByTag('a').count())||s(J);};new a.style(I,{color:E}).apply(m.document);}m.fire('saveSnapshot');});w.push('
    ',o.auto,'
    '); +for(var z=0;z');var A=x[z].split('/'),B=A[0],C=A[1]||B;if(!A[1])B='#'+B.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var D=m.lang.colors[C]||C;w.push('');}if(n.colorButton_enableMore===undefined||n.colorButton_enableMore)w.push('');w.push('
    ',o.more,'
    ');return w.join('');};function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={requires:['dialog'],init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('contextmenu',{requires:['menu'],onLoad:function(){j.contextMenu=e.createClass({base:a.menu,$:function(m){this.base.call(this,m,{panel:{className:m.skinClass+' cke_contextmenu',attributes:{'aria-label':m.lang.contextmenu.options}}});},proto:{addTarget:function(m,n){if(b.opera&&!('oncontextmenu' in document.body)){var o;m.on('mousedown',function(s){s=s.data;if(s.$.button!=2){if(s.getKeystroke()==1114112+1)m.fire('contextmenu',s);return;}if(n&&(b.mac?s.$.metaKey:s.$.ctrlKey))return;var t=s.getTarget();if(!o){var u=t.getDocument();o=u.createElement('input');o.$.type='button';u.getBody().append(o);}o.setAttribute('style','position:absolute;top:'+(s.$.clientY-2)+'px;left:'+(s.$.clientX-2)+'px;width:5px;height:5px;opacity:0.01');});m.on('mouseup',function(s){if(o){o.remove();o=undefined;m.fire('contextmenu',s.data);}});}m.on('contextmenu',function(s){var t=s.data; +if(n&&(b.webkit?p:b.mac?t.$.metaKey:t.$.ctrlKey))return;t.preventDefault();var u=t.getTarget().getDocument().getDocumentElement(),v=t.$.clientX,w=t.$.clientY;e.setTimeout(function(){this.open(u,null,v,w);},c?200:0,this);},this);if(b.opera)m.on('keypress',function(s){var t=s.data;if(t.$.keyCode===0)t.preventDefault();});if(b.webkit){var p,q=function(s){p=b.mac?s.data.$.metaKey:s.data.$.ctrlKey;},r=function(){p=0;};m.on('keydown',q);m.on('keyup',r);m.on('contextmenu',r);}},open:function(m,n,o,p){this.editor.focus();m=m||a.document.getDocumentElement();this.show(m,n,o,p);}}});},beforeInit:function(m){m.contextMenu=new j.contextMenu(m);m.addCommand('contextMenu',{exec:function(){m.contextMenu.open(m.document.getBody());}});}});(function(){function m(o){var p=this.att,q=o&&o.hasAttribute(p)&&o.getAttribute(p)||'';if(q!==undefined)this.setValue(q);};function n(){var o;for(var p=0;p ';j.add('elementspath',{requires:['selection'],init:function(o){var p='cke_path_'+o.name,q,r=function(){if(!q)q=a.document.getById(p);return q;},s='cke_elementspath_'+e.getNextNumber()+'_';o._.elementsPath={idBase:s,filters:[]};o.on('themeSpace',function(x){if(x.data.space=='bottom')x.data.html+=''+o.lang.elementsPath.eleLabel+''+'
    '+n+'
    ';});function t(x){o.focus();var y=o._.elementsPath.list[x];if(y.is('body')){var z=new d.range(o.document);z.selectNodeContents(y);z.select();}else o.getSelection().selectElement(y);};var u=e.addFunction(t),v=e.addFunction(function(x,y){var z=o._.elementsPath.idBase,A;y=new d.event(y);var B=o.lang.dir=='rtl';switch(y.getKeystroke()){case B?39:37:case 9:A=a.document.getById(z+(x+1));if(!A)A=a.document.getById(z+'0');A.focus();return false;case B?37:39:case 2228224+9:A=a.document.getById(z+(x-1));if(!A)A=a.document.getById(z+(o._.elementsPath.list.length-1));A.focus();return false;case 27:o.focus();return false;case 13:case 32:t(x);return false;}return true;});o.on('selectionChange',function(x){var y=b,z=x.data.selection,A=z.getStartElement(),B=[],C=x.editor,D=C._.elementsPath.list=[],E=C._.elementsPath.filters; +while(A){var F=0,G;if(A.data('cke-display-name'))G=A.data('cke-display-name');else if(A.data('cke-real-element-type'))G=A.data('cke-real-element-type');else G=A.getName();for(var H=0;H',G,''+L+'','');}if(G=='body')break;A=A.getParent();}var M=r();M.setHtml(B.join('')+n);C.fire('elementsPathUpdate',{space:M});});function w(){q&&q.setHtml(n);delete o._.elementsPath.list;};o.on('readOnly',w);o.on('contentDomUnload',w);o.addCommand('elementsPathFocus',m.toolbarFocus);}});})();(function(){j.add('enterkey',{requires:['keystrokes','indent'],init:function(t){t.addCommand('enter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){r(v);}});t.addCommand('shiftEnter',{modes:{wysiwyg:1},editorFocus:false,exec:function(v){q(v);}});var u=t.keystrokeHandler.keystrokes;u[13]='enter';u[2228224+13]='shiftEnter';}});j.enterkey={enterBlock:function(t,u,v,w){v=v||s(t);if(!v)return;var x=v.document,y=v.checkStartOfBlock(),z=v.checkEndOfBlock(),A=new d.elementPath(v.startContainer),B=A.block;if(y&&z){if(B&&(B.is('li')||B.getParent().is('li'))){t.execCommand('outdent');return;}if(B&&B.getParent().is('blockquote')){B.breakParent(B.getParent());if(!B.getPrevious().getFirst(d.walker.invisible(1)))B.getPrevious().remove();if(!B.getNext().getFirst(d.walker.invisible(1)))B.getNext().remove();v.moveToElementEditStart(B);v.select();return;}}else if(B&&B.is('pre')){if(!z){n(t,u,v,w);return;}}else if(B&&f.$captionBlock[B.getName()]){n(t,u,v,w);return;}var C=u==3?'div':'p',D=v.splitBlock(C);if(!D)return;var E=D.previousBlock,F=D.nextBlock,G=D.wasStartOfBlock,H=D.wasEndOfBlock,I;if(F){I=F.getParent();if(I.is('li')){F.breakParent(I);F.move(F.getNext(),1);}}else if(E&&(I=E.getParent())&&I.is('li')){E.breakParent(I);I=E.getNext();v.moveToElementEditStart(I);E.move(E.getPrevious());}if(!G&&!H){if(F.is('li')&&(I=F.getFirst(d.walker.invisible(true)))&&I.is&&I.is('ul','ol'))(c?x.createText('\xa0'):x.createElement('br')).insertBefore(I); +if(F)v.moveToElementEditStart(F);}else{var J,K;if(E){if(E.is('li')||!(p.test(E.getName())||E.is('pre')))J=E.clone();}else if(F)J=F.clone();if(!J){if(I&&I.is('li'))J=I;else{J=x.createElement(C);if(E&&(K=E.getDirection()))J.setAttribute('dir',K);}}else if(w&&!J.is('li'))J.renameNode(C);var L=D.elementPath;if(L)for(var M=0,N=L.elements.length;M0;v--)u[v].deleteContents();return u[0];};})();(function(){var m='nbsp,gt,lt,amp',n='quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',o='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',p='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv'; +function q(r,s){var t={},u=[],v={nbsp:'\xa0',shy:'­',gt:'>',lt:'<',amp:'&',apos:"'",quot:'"'};r=r.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(A,B){var C=s?'&'+B+';':v[B],D=s?v[B]:'&'+B+';';t[C]=D;u.push(C);return '';});if(!s&&r){r=r.split(',');var w=document.createElement('div'),x;w.innerHTML='&'+r.join(';&')+';';x=w.innerHTML;w=null;for(var y=0;y0;case 'checked':return!!q.$.checked;case 'value':var p=q.getAttribute('type');return p=='checkbox'||p=='radio'?q.$.value!='on':q.$.value;}return m.apply(q,arguments);};});(function(){var m={canUndo:false,exec:function(o){var p=o.document.createElement('hr');o.insertElement(p);}},n='horizontalrule';j.add(n,{init:function(o){o.addCommand(n,m);o.ui.addButton('HorizontalRule',{label:o.lang.horizontalrule,command:n});}});})();(function(){var m=/^[\t\r\n ]*(?: |\xa0)$/,n='{cke_protected}';function o(T){var U=T.children.length,V=T.children[U-1];while(V&&V.type==3&&!e.trim(V.value))V=T.children[--U];return V;};function p(T,U){var V=T.children,W=o(T);if(W){if((U||!c)&&W.type==1&&W.name=='br')V.pop();if(W.type==3&&m.test(W.value))V.pop();}};function q(T,U,V){if(!U&&(!V||typeof V=='function'&&V(T)===false))return false;if(U&&c&&(document.documentMode>7||T.name in f.tr||T.name in f.$listItem))return false;var W=o(T);return!W||W&&(W.type==1&&W.name=='br'||T.name=='form'&&W.name=='input');};function r(T,U){return function(V){p(V,!T);if(q(V,!T,U))if(T||c)V.add(new a.htmlParser.text('\xa0'));else V.add(new a.htmlParser.element('br',{}));};};var s=f,t=['caption','colgroup','col','thead','tfoot','tbody'],u=e.extend({},s.$block,s.$listItem,s.$tableContent);for(var v in u){if(!('br' in s[v]))delete u[v];}delete u.pre;var w={elements:{},attributeNames:[[/^on/,'data-cke-pa-on']]},x={elements:{}};for(v in u)x.elements[v]=r();var y={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^data-cke-(saved|pa)-/,''],[/^data-cke-.*/,''],['hidefocus','']],elements:{$:function(T){var U=T.attributes;if(U){if(U['data-cke-temp'])return false;var V=['name','href','src'],W; +for(var X=0;Xe.indexOf(t,W.name)?1:-1:0;});},embed:function(T){var U=T.parent;if(U&&U.name=='object'){var V=U.attributes.width,W=U.attributes.height;V&&(T.attributes.width=V);W&&(T.attributes.height=W);}},param:function(T){T.children=[];T.isEmpty=true;return T;},a:function(T){if(!(T.children.length||T.attributes.name||T.attributes['data-cke-saved-name']))return false;},span:function(T){if(T.attributes['class']=='Apple-style-span')delete T.name;},pre:function(T){c&&p(T);},html:function(T){delete T.attributes.contenteditable;delete T.attributes['class'];},body:function(T){delete T.attributes.spellcheck;delete T.attributes.contenteditable;},style:function(T){var U=T.children[0];U&&U.value&&(U.value=e.trim(U.value));if(!T.attributes.type)T.attributes.type='text/css';},title:function(T){var U=T.children[0];U&&(U.value=T.attributes['data-cke-title']||'');}},attributes:{'class':function(T,U){return e.ltrim(T.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}}};if(c)y.attributes.style=function(T,U){return T.replace(/(^|;)([^\:]+)/g,function(V){return V.toLowerCase();});};function z(T){var U=T.attributes;if(U.contenteditable!='false')U['data-cke-editable']=U.contenteditable?'true':1;U.contenteditable='false';};function A(T){var U=T.attributes;switch(U['data-cke-editable']){case 'true':U.contenteditable='true';break;case '1':delete U.contenteditable;break;}};for(v in {input:1,textarea:1}){w.elements[v]=z;y.elements[v]=A;}var B=/<(a|area|img|input)\b([^>]*)>/gi,C=/\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,D=/(?:])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,E=/([^<]*)<\/cke:encoded>/gi,F=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,G=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,H=/]*?)\/?>(?!\s*<\/cke:\1)/gi;function I(T){return T.replace(B,function(U,V,W){return '<'+V+W.replace(C,function(X,Y){if(!/^on/.test(Y)&&W.indexOf('data-cke-saved-'+Y)==-1)return ' data-cke-saved-'+X+' data-cke-'+a.rnd+'-'+X;return X;})+'>';});};function J(T){return T.replace(D,function(U){return ''+encodeURIComponent(U)+'';});};function K(T){return T.replace(E,function(U,V){return decodeURIComponent(V);});};function L(T){return T.replace(F,'$1cke:$2');};function M(T){return T.replace(G,'$1$2'); +};function N(T){return T.replace(H,'');};function O(T){return T.replace(/(]*>)(\r\n|\n)/g,'$1$2$2');};function P(T){return T.replace(//g,function(U){return '';});};function Q(T){return T.replace(//g,function(U,V){return decodeURIComponent(V);});};function R(T,U){var V=U._.dataStore;return T.replace(//g,function(W,X){return decodeURIComponent(X);}).replace(/\{cke_protected_(\d+)\}/g,function(W,X){return V&&V[X]||'';});};function S(T,U){var V=[],W=U.config.protectedSource,X=U._.dataStore||(U._.dataStore={id:1}),Y=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,Z=[//gi,//gi].concat(W);T=T.replace(//g,function(ab){return '';});for(var aa=0;aa';});T=T.replace(Y,function(ab,ac,ad){return '';});return T.replace(/(['"]).*?\1/g,function(ab){return ab.replace(//g,function(ac,ad){X[X.id]=decodeURIComponent(ad);return '{cke_protected_'+X.id++ +'}';});});};j.add('htmldataprocessor',{requires:['htmlwriter'],init:function(T){var U=T.dataProcessor=new a.htmlDataProcessor(T);U.writer.forceSimpleAmpersand=T.config.forceSimpleAmpersand;U.dataFilter.addRules(w);U.dataFilter.addRules(x);U.htmlFilter.addRules(y);var V={elements:{}};for(v in u)V.elements[v]=r(true,T.config.fillEmptyBlocks);U.htmlFilter.addRules(V);},onLoad:function(){!('fillEmptyBlocks' in i)&&(i.fillEmptyBlocks=1);}});a.htmlDataProcessor=function(T){var U=this;U.editor=T;U.writer=new a.htmlWriter();U.dataFilter=new a.htmlParser.filter();U.htmlFilter=new a.htmlParser.filter();};a.htmlDataProcessor.prototype={toHtml:function(T,U){T=S(T,this.editor);T=I(T);T=J(T);T=L(T);T=N(T);T=O(T);var V=new h('div');V.setHtml('a'+T);T=V.getHtml().substr(1);T=T.replace(new RegExp(' data-cke-'+a.rnd+'-','ig'),' ');T=M(T);T=K(T);T=Q(T);var W=a.htmlParser.fragment.fromHtml(T,U),X=new a.htmlParser.basicWriter();W.writeHtml(X,this.dataFilter);T=X.getHtml(true);T=P(T);return T;},toDataFormat:function(T,U){var V=this.writer,W=a.htmlParser.fragment.fromHtml(T,U);V.reset(); +W.writeHtml(V,this.htmlFilter);var X=V.getHtml(true);X=Q(X);X=R(X,this.editor);return X;}};})();(function(){j.add('iframe',{requires:['dialog','fakeobjects'],init:function(m){var n='iframe',o=m.lang.iframe;a.dialog.add(n,this.path+'dialogs/iframe.js');m.addCommand(n,new a.dialogCommand(n));m.addCss('img.cke_iframe{background-image: url('+a.getUrl(this.path+'images/placeholder.png')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 80px;'+'height: 80px;'+'}');m.ui.addButton('Iframe',{label:o.toolbar,command:n});m.on('doubleclick',function(p){var q=p.data.element;if(q.is('img')&&q.data('cke-real-element-type')=='iframe')p.data.dialog='iframe';});if(m.addMenuItems)m.addMenuItems({iframe:{label:o.title,command:'iframe',group:'image'}});if(m.contextMenu)m.contextMenu.addListener(function(p,q){if(p&&p.is('img')&&p.data('cke-real-element-type')=='iframe')return{iframe:2};});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter;if(o)o.addRules({elements:{iframe:function(p){return m.createFakeParserElement(p,'cke_iframe','iframe',true);}}});}});})();(function(){j.add('image',{requires:['dialog'],init:function(o){var p='image';a.dialog.add(p,this.path+'dialogs/image.js');o.addCommand(p,new a.dialogCommand(p));o.ui.addButton('Image',{label:o.lang.common.image,command:p});o.on('doubleclick',function(q){var r=q.data.element;if(r.is('img')&&!r.data('cke-realelement')&&!r.isReadOnly())q.data.dialog='image';});if(o.addMenuItems)o.addMenuItems({image:{label:o.lang.image.menu,command:'image',group:'image'}});if(o.contextMenu)o.contextMenu.addListener(function(q,r){if(m(o,q))return{image:2};});},afterInit:function(o){p('left');p('right');p('center');p('block');function p(q){var r=o.getCommand('justify'+q);if(r){if(q=='left'||q=='right')r.on('exec',function(s){var t=m(o),u;if(t){u=n(t);if(u==q){t.removeStyle('float');if(q==n(t))t.removeAttribute('align');}else t.setStyle('float',q);s.cancel();}});r.on('refresh',function(s){var t=m(o),u;if(t){u=n(t);this.setState(u==q?1:q=='right'||q=='left'?2:0);s.cancel();}});}};}});function m(o,p){if(!p){var q=o.getSelection();p=q.getType()==3&&q.getSelectedElement();}if(p&&p.is('img')&&!p.data('cke-realelement')&&!p.isReadOnly())return p;};function n(o){var p=o.getStyle('float');if(p=='inherit'||p=='none')p=0;if(!p)p=o.getAttribute('align');return p;};})();i.image_removeLinkByEmptyURL=true;(function(){var m={ol:1,ul:1},n=d.walker.whitespaces(true),o=d.walker.bookmark(false,true); +function p(t){var B=this;if(t.editor.readOnly)return null;var u=t.editor,v=t.data.path,w=v&&v.contains(m),x=v.block||v.blockLimit;if(w)return B.setState(2);if(!B.useIndentClasses&&B.name=='indent')return B.setState(2);if(!x)return B.setState(0);if(B.useIndentClasses){var y=x.$.className.match(B.classNameRegex),z=0;if(y){y=y[1];z=B.indentClassMap[y];}if(B.name=='outdent'&&!z||B.name=='indent'&&z==u.config.indentClasses.length)return B.setState(0);return B.setState(2);}else{var A=parseInt(x.getStyle(r(x)),10);if(isNaN(A))A=0;if(A<=0)return B.setState(0);return B.setState(2);}};function q(t,u){var w=this;w.name=u;w.useIndentClasses=t.config.indentClasses&&t.config.indentClasses.length>0;if(w.useIndentClasses){w.classNameRegex=new RegExp('(?:^|\\s+)('+t.config.indentClasses.join('|')+')(?=$|\\s)');w.indentClassMap={};for(var v=0;v0){var Z=X[T].parent;X[T].parent=new h(Z.getName(),Z.getDocument());}}for(T=W.getCustomData('listarray_index')+1;TY;T++)X[T].indent+=U;var aa=j.list.arrayToList(X,v,null,t.config.enterMode,M.getDirection());if(u.name=='outdent'){var ab;if((ab=M.getParent())&&ab.is('li')){var ac=aa.listNode.getChildren(),ad=[],ae=ac.count(),af;for(T=ae-1;T>=0;T--){if((af=ac.getItem(T))&&af.is&&af.is('li'))ad.push(af);}}}if(aa)aa.listNode.replace(M);if(ad&&ad.length)for(T=0;T0)M.addClass(t.config.indentClasses[P-1]);}else{var Q=r(M,N),R=parseInt(M.getStyle(Q),10);if(isNaN(R))R=0;var S=t.config.indentOffset||40;R+=(u.name=='indent'?1:-1)*S;if(R<0)return false;R=Math.max(R,0);R=Math.ceil(R/S)*S;M.setStyle(Q,R?R+(t.config.indentUnit||'px'):'');if(M.getAttribute('style')==='')M.removeAttribute('style');}h.setMarker(v,M,'indent_processed',1);return true;};var z=t.getSelection(),A=z.createBookmarks(1),B=z&&z.getRanges(1),C,D=B.createIterator();while(C=D.getNextRange()){var E=C.getCommonAncestor(),F=E;while(F&&!(F.type==1&&m[F.getName()]))F=F.getParent();if(!F){var G=C.getEnclosedNode();if(G&&G.type==1&&G.getName() in m){C.setStartAt(G,1);C.setEndAt(G,2);F=G;}}if(F&&C.startContainer.type==1&&C.startContainer.getName() in m){var H=new d.walker(C);H.evaluator=s;C.startContainer=H.next();}if(F&&C.endContainer.type==1&&C.endContainer.getName() in m){H=new d.walker(C);H.evaluator=s;C.endContainer=H.previous();}if(F){var I=F.getFirst(s),J=!!I.getNext(s),K=C.startContainer,L=I.equals(K)||I.contains(K);if(!(L&&(u.name=='indent'||u.useIndentClasses||parseInt(F.getStyle(r(F)),10))&&y(F,!J&&I.getDirection())))w(F);}else x();}h.clearAllMarkers(v);t.forceNextSelectionCheck();z.selectBookmarks(A);}};j.add('indent',{init:function(t){var u=t.addCommand('indent',new q(t,'indent')),v=t.addCommand('outdent',new q(t,'outdent'));t.ui.addButton('Indent',{label:t.lang.indent,command:'indent'});t.ui.addButton('Outdent',{label:t.lang.outdent,command:'outdent'});t.on('selectionChange',e.bind(p,u));t.on('selectionChange',e.bind(p,v));if(b.ie6Compat||b.ie7Compat)t.addCss('ul,ol{\tmargin-left: 0px;\tpadding-left: 40px;}');t.on('dirChanged',function(w){var x=new d.range(t.document);x.setStartBefore(w.data.node);x.setEndAfter(w.data.node);var y=new d.walker(x),z;while(z=y.next()){if(z.type==1){if(!z.equals(w.data.node)&&z.getDirection()){x.setStartAfter(z);y=new d.walker(x);continue;}var A=t.config.indentClasses;if(A){var B=w.data.dir=='ltr'?['_rtl','']:['','_rtl'];for(var C=0;C=0;z--){w=u[z].createIterator();w.enlargeBr=s!=2;while(x=w.getNextParagraph(s==1?'p':'div')){x.removeAttribute('align');x.removeStyle('text-align');var A=v&&(x.$.className=e.ltrim(x.$.className.replace(C.cssClassRegex,''))),B=C.state==2&&(!y||m(x,true)!=C.value);if(v){if(B)x.addClass(v);else if(!A)x.removeAttribute('class');}else if(B)x.setStyle('text-align',C.value);}}q.focus();q.forceNextSelectionCheck();r.selectBookmarks(t);},refresh:function(q){var r=q.block||q.blockLimit;this.setState(r.getName()!='body'&&m(r,this.editor.config.useComputedState)==this.value?1:2);}};j.add('justify',{init:function(q){var r=new o(q,'justifyleft','left'),s=new o(q,'justifycenter','center'),t=new o(q,'justifyright','right'),u=new o(q,'justifyblock','justify'); +q.addCommand('justifyleft',r);q.addCommand('justifycenter',s);q.addCommand('justifyright',t);q.addCommand('justifyblock',u);q.ui.addButton('JustifyLeft',{label:q.lang.justify.left,command:'justifyleft'});q.ui.addButton('JustifyCenter',{label:q.lang.justify.center,command:'justifycenter'});q.ui.addButton('JustifyRight',{label:q.lang.justify.right,command:'justifyright'});q.ui.addButton('JustifyBlock',{label:q.lang.justify.block,command:'justifyblock'});q.on('selectionChange',e.bind(n,r));q.on('selectionChange',e.bind(n,t));q.on('selectionChange',e.bind(n,s));q.on('selectionChange',e.bind(n,u));q.on('dirChanged',p);},requires:['domiterator']});})();j.add('keystrokes',{beforeInit:function(m){m.keystrokeHandler=new a.keystrokeHandler(m);m.specialKeys={};},init:function(m){var n=m.config.keystrokes,o=m.config.blockedKeystrokes,p=m.keystrokeHandler.keystrokes,q=m.keystrokeHandler.blockedKeystrokes;for(var r=0;r7))Y.append(T.createText('\xa0'));Y.append(af.listNode);W=af.nextIndex;}else if(ac.indent==-1&&!P&&ad){if(m[ad.getName()]){Y=ac.element.clone(false,true);if(Z!=ad.getDirection(1))Y.setAttribute('dir',Z);}else Y=new d.documentFragment(T);var ag=ad.getDirection(1)!=Z,ah=ac.element,ai=ah.getAttribute('class'),aj=ah.getAttribute('style'),ak=Y.type==11&&(Q!=2||ag||aj||ai),al,am=ac.contents.length;for(S=0;SQ[S-1].indent+1){var W=Q[S-1].indent+1-Q[S].indent,X=Q[S].indent;while(Q[S]&&Q[S].indent>=X){Q[S].indent+=W;S++;}S--;}}var Y=j.list.arrayToList(Q,P,null,N.config.enterMode,O.root.getAttribute('dir')),Z=Y.listNode,aa,ab;function ac(ad){if((aa=Z[ad?'getFirst':'getLast']())&&!(aa.is&&aa.isBlockBoundary())&&(ab=O.root[ad?'getPrevious':'getNext'](d.walker.whitespaces(true)))&&!(ab.is&&ab.isBlockBoundary({br:1})))N.document.createElement('br')[ad?'insertBefore':'insertAfter'](aa);};ac(true);ac();Z.replace(O.root);};function z(N,O){this.name=N;this.type=O;};var A=d.walker.nodeType(1);function B(N,O,P,Q){var R,S; +while(R=N[Q?'getLast':'getFirst'](A)){if((S=R.getDirection(1))!==O.getDirection(1))R.setAttribute('dir',S);R.remove();P?R[Q?'insertBefore':'insertAfter'](P):O.append(R,Q);}};z.prototype={exec:function(N){var aq=this;var O=N.document,P=N.config,Q=N.getSelection(),R=Q&&Q.getRanges(true);if(!R||R.length<1)return;if(aq.state==2){var S=O.getBody();if(!S.getFirst(q)){P.enterMode==2?S.appendBogus():R[0].fixBlock(1,P.enterMode==1?'p':'div');Q.selectRanges(R);}else{var T=R.length==1&&R[0],U=T&&T.getEnclosedNode();if(U&&U.is&&aq.type==U.getName())aq.setState(1);}}var V=Q.createBookmarks(true),W=[],X={},Y=R.createIterator(),Z=0;while((T=Y.getNextRange())&&++Z){var aa=T.getBoundaryNodes(),ab=aa.startNode,ac=aa.endNode;if(ab.type==1&&ab.getName()=='td')T.setStartAt(aa.startNode,1);if(ac.type==1&&ac.getName()=='td')T.setEndAt(aa.endNode,2);var ad=T.createIterator(),ae;ad.forceBrBreak=aq.state==2;while(ae=ad.getNextParagraph()){if(ae.getCustomData('list_block'))continue;else h.setMarker(X,ae,'list_block',1);var af=new d.elementPath(ae),ag=af.elements,ah=ag.length,ai=null,aj=0,ak=af.blockLimit,al;for(var am=ah-1;am>=0&&(al=ag[am]);am--){if(m[al.getName()]&&ak.contains(al)){ak.removeCustomData('list_group_object_'+Z);var an=al.getCustomData('list_group_object');if(an)an.contents.push(ae);else{an={root:al,contents:[ae]};W.push(an);h.setMarker(X,al,'list_group_object',an);}aj=1;break;}}if(aj)continue;var ao=ak;if(ao.getCustomData('list_group_object_'+Z))ao.getCustomData('list_group_object_'+Z).contents.push(ae);else{an={root:ao,contents:[ae]};h.setMarker(X,ao,'list_group_object_'+Z,an);W.push(an);}}}var ap=[];while(W.length>0){an=W.shift();if(aq.state==2){if(m[an.root.getName()])v.call(aq,N,an,X,ap);else x.call(aq,N,an,ap);}else if(aq.state==1&&m[an.root.getName()])y.call(aq,N,an,X);}for(am=0;am0)for(var u=t.length-1;u>=0;u--){var v=t[u][0],w=t[u][1];if(w)v.insertBefore(w);else v.appendTo(s);}};function o(s,t){var u=m(s),v={},w=s.$;if(!t){v['class']=w.className||'';w.className='';}v.inline=w.style.cssText||'';if(!t)w.style.cssText='position: static; overflow: visible';n(u);return v;};function p(s,t){var u=m(s),v=s.$;if('class' in t)v.className=t['class'];if('inline' in t)v.style.cssText=t.inline;n(u);};function q(s){var t=a.instances;for(var u in t){var v=t[u];if(v.mode=='wysiwyg'&&!v.readOnly){var w=v.document.getBody();w.setAttribute('contentEditable',false);w.setAttribute('contentEditable',true);}}if(s.focusManager.hasFocus){s.toolbox.focus();s.focus();}};function r(s){if(!c||b.version>6)return null;var t=h.createFromHtml(''); +return s.append(t,true);};j.add('maximize',{init:function(s){var t=s.lang,u=a.document,v=u.getWindow(),w,x,y,z;function A(){var C=v.getViewPaneSize();z&&z.setStyles({width:C.width+'px',height:C.height+'px'});s.resize(C.width,C.height,null,true);};var B=2;s.addCommand('maximize',{modes:{wysiwyg:!b.iOS,source:!b.iOS},readOnly:1,editorFocus:false,exec:function(){var C=s.container.getChild(1),D=s.getThemeSpace('contents');if(s.mode=='wysiwyg'){var E=s.getSelection();w=E&&E.getRanges();x=v.getScrollPosition();}else{var F=s.textarea.$;w=!c&&[F.selectionStart,F.selectionEnd];x=[F.scrollLeft,F.scrollTop];}if(this.state==2){v.on('resize',A);y=v.getScrollPosition();var G=s.container;while(G=G.getParent()){G.setCustomData('maximize_saved_styles',o(G));G.setStyle('z-index',s.config.baseFloatZIndex-1);}D.setCustomData('maximize_saved_styles',o(D,true));C.setCustomData('maximize_saved_styles',o(C,true));var H={overflow:b.webkit?'':'hidden',width:0,height:0};u.getDocumentElement().setStyles(H);!b.gecko&&u.getDocumentElement().setStyle('position','fixed');!(b.gecko&&b.quirks)&&u.getBody().setStyles(H);c?setTimeout(function(){v.$.scrollTo(0,0);},0):v.$.scrollTo(0,0);C.setStyle('position',b.gecko&&b.quirks?'fixed':'absolute');C.$.offsetLeft;C.setStyles({'z-index':s.config.baseFloatZIndex-1,left:'0px',top:'0px'});z=r(C);C.addClass('cke_maximized');A();var I=C.getDocumentPosition();C.setStyles({left:-1*I.x+'px',top:-1*I.y+'px'});b.gecko&&q(s);}else if(this.state==1){v.removeListener('resize',A);var J=[D,C];for(var K=0;K ');s.children.length=0;s.add(u);var v=s.attributes;delete v['aria-label'];delete v.contenteditable;delete v.title;}return t;}}},5);if(p)p.addRules({elements:{div:function(r){var s=r.attributes,t=s&&s.style,u=t&&r.children.length==1&&r.children[0],v=u&&u.name=='span'&&u.attributes.style;if(v&&/page-break-after\s*:\s*always/i.test(t)&&/display\s*:\s*none/i.test(v)){s.contenteditable='false';s['class']='cke_pagebreak';s['data-cke-display-name']='pagebreak';s['aria-label']=n;s.title=n;r.children.length=0;}}}});},requires:['fakeobjects']});j.pagebreakCmd={exec:function(m){var n=m.lang.pagebreakAlt,o=h.createFromHtml('
    '+'
    ',m.document),p=m.getSelection().getRanges(true);m.fire('saveSnapshot');for(var q,r=p.length-1;r>=0;r--){q=p[r];if(r1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.width*parseInt(n,10)/100,10);if(typeof o=='string'&&o.length>1&&o.substr(o.length-1,1)=='%')o=parseInt(window.screen.height*parseInt(o,10)/100,10);if(n<640)n=640;if(o<420)o=420;var q=parseInt((window.screen.height-o)/2,10),r=parseInt((window.screen.width-n)/2,10); +p=(p||'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes')+',width='+n+',height='+o+',top='+q+',left='+r;var s=window.open('',null,p,true);if(!s)return false;try{var t=navigator.userAgent.toLowerCase();if(t.indexOf(' chrome/')==-1){s.moveTo(r,q);s.resizeTo(n,o);}s.focus();s.location.href=m;}catch(u){s=window.open(m,null,p,true);}return true;}});(function(){var m,n={modes:{wysiwyg:1,source:1},canUndo:false,readOnly:1,exec:function(p){var q,r=p.config,s=r.baseHref?'':'',t=b.isCustomDomain();if(r.fullPage)q=p.getData().replace(//,'$&'+s).replace(/[^>]*(?=<\/title>)/,'$& — '+p.lang.preview);else{var u=''+''+s+''+p.lang.preview+''+e.buildStyleHtml(p.config.contentsCss)+''+u+p.getData()+'';}var w=640,x=420,y=80;try{var z=window.screen;w=Math.round(z.width*0.8);x=Math.round(z.height*0.7);y=Math.round(z.width*0.1);}catch(D){}var A='';if(t){window._cke_htmlToLoad=q;A='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}if(b.gecko){window._cke_htmlToLoad=q;A=m+'preview.html';}var B=window.open(A,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+w+',height='+x+',left='+y);if(!t&&!b.gecko){var C=B.document;C.open();C.write(q);C.close();b.webkit&&setTimeout(function(){C.body.innerHTML+='';},0);}}},o='preview';j.add(o,{init:function(p){m=this.path;p.addCommand(o,n);p.ui.addButton('Preview',{label:p.lang.preview,command:o});}});})();j.add('print',{init:function(m){var n='print',o=m.addCommand(n,j.print);m.ui.addButton('Print',{label:m.lang.print,command:n});}});j.print={exec:function(m){if(b.opera)return;else if(b.gecko)m.window.$.print();else m.document.$.execCommand('Print');},canUndo:false,readOnly:1,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(m){m.addCommand('removeFormat',j.removeformat.commands.removeformat);m.ui.addButton('RemoveFormat',{label:m.lang.removeFormat,command:'removeFormat'});m._.removeFormat={filters:[]};}});j.removeformat={commands:{removeformat:{exec:function(m){var n=m._.removeFormatRegex||(m._.removeFormatRegex=new RegExp('^(?:'+m.config.removeFormatTags.replace(/,/g,'|')+')$','i')),o=m._.removeAttributes||(m._.removeAttributes=m.config.removeFormatAttributes.split(',')),p=j.removeformat.filter,q=m.getSelection().getRanges(1),r=q.createIterator(),s; +while(s=r.getNextRange()){if(!s.collapsed)s.enlarge(1);var t=s.createBookmark(),u=t.startNode,v=t.endNode,w,x=function(z){var A=new d.elementPath(z),B=A.elements;for(var C=1,D;D=B[C];C++){if(D.equals(A.block)||D.equals(A.blockLimit))break;if(n.test(D.getName())&&p(m,D))z.breakParent(D);}};x(u);if(v){x(v);w=u.getNextSourceNode(true,1);while(w){if(w.equals(v))break;var y=w.getNextSourceNode(false,1);if(!(w.getName()=='img'&&w.data('cke-realelement'))&&p(m,w))if(n.test(w.getName()))w.remove(1);else{w.removeAttributes(o);m.fire('removeFormatCleanup',w);}w=y;}}s.moveToBookmark(t);}m.getSelection().selectRanges(q);}}},filter:function(m,n){var o=m._.removeFormat.filters;for(var p=0;pr.width&&(n.resize_minWidth=r.width);n.resize_minHeight>r.height&&(n.resize_minHeight=r.height);a.document.on('mousemove',u);a.document.on('mouseup',v);if(m.document){m.document.on('mousemove',u);m.document.on('mouseup',v);}});m.on('destroy',function(){e.removeFunction(w);});m.on('themeSpace',function(x){if(x.data.space=='bottom'){var y=''; +if(s&&!t)y=' cke_resizer_horizontal';if(!s&&t)y=' cke_resizer_vertical';var z='
    ';o=='ltr'&&y=='ltr'?x.data.html+=z:x.data.html=z+x.data.html;}},m,null,100);}}});(function(){var m={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(o){var p=o.element.$.form;if(p)try{p.submit();}catch(q){if(p.submit.click)p.submit.click();}}},n='save';j.add(n,{init:function(o){var p=o.addCommand(n,m);p.modes={wysiwyg:!!o.element.$.form};o.ui.addButton('Save',{label:o.lang.save,command:n});}});})();(function(){var m='scaytcheck',n='';function o(t,u){var v=0,w;for(w in u){if(u[w]==t){v=1;break;}}return v;};var p=function(){var t=this,u=function(){var y=t.config,z={};z.srcNodeRef=t.document.getWindow().$.frameElement;z.assocApp='CKEDITOR.'+a.version+'@'+a.revision;z.customerid=y.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';z.customDictionaryIds=y.scayt_customDictionaryIds||'';z.userDictionaryName=y.scayt_userDictionaryName||'';z.sLang=y.scayt_sLang||'en_US';z.onLoad=function(){if(!(c&&b.version<8))this.addStyle(this.selectorCss(),'padding-bottom: 2px !important;');if(t.focusManager.hasFocus&&!q.isControlRestored(t))this.focus();};z.onBeforeChange=function(){if(q.getScayt(t)&&!t.checkDirty())setTimeout(function(){t.resetDirty();},0);};var A=window.scayt_custom_params;if(typeof A=='object')for(var B in A)z[B]=A[B];if(q.getControlId(t))z.id=q.getControlId(t);var C=new window.scayt(z);C.afterMarkupRemove.push(function(E){new h(E,C.document).mergeSiblings();});var D=q.instances[t.name];if(D){C.sLang=D.sLang;C.option(D.option());C.paused=D.paused;}q.instances[t.name]=C;try{C.setDisabled(q.isPaused(t)===false);}catch(E){}t.fire('showScaytState');};t.on('contentDom',u);t.on('contentDomUnload',function(){var y=a.document.getElementsByTag('script'),z=/^dojoIoScript(\d+)$/i,A=/^https?:\/\/svc\.webspellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var B=0;B=0){this.setState(0);q.loadEngine(t);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(t){var u=t.config.scayt_contextMenuItemsOrder||'suggest|moresuggest|control',v='';u=u.split('|');if(u&&u.length)for(var w=0;w tr > td, .%1 table.%2 > tr > th,','.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,','.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,','.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th','{','border : #d3d3d3 1px dotted','}']).join(''); +n=o.replace(/%2/g,m).replace(/%1/g,'cke_show_borders ');var p={preserveState:true,editorFocus:false,readOnly:1,exec:function(q){this.toggleState();this.refresh(q);},refresh:function(q){if(q.document){var r=this.state==1?'addClass':'removeClass';q.document.getBody()[r]('cke_show_borders');}}};j.add('showborders',{requires:['wysiwygarea'],modes:{wysiwyg:1},init:function(q){var r=q.addCommand('showborders',p);r.canUndo=false;if(q.config.startupShowBorders!==false)r.setState(1);q.addCss(n);q.on('mode',function(){if(r.state!=0)r.refresh(q);},null,null,100);q.on('contentDom',function(){if(r.state!=0)r.refresh(q);});q.on('removeFormatCleanup',function(s){var t=s.data;if(q.getCommand('showborders').state==1&&t.is('table')&&(!t.hasAttribute('border')||parseInt(t.getAttribute('border'),10)<=0))t.addClass(m);});},afterInit:function(q){var r=q.dataProcessor,s=r&&r.dataFilter,t=r&&r.htmlFilter;if(s)s.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'],x=parseInt(v.border,10);if((!x||x<=0)&&(!w||w.indexOf(m)==-1))v['class']=(w||'')+' '+m;}}});if(t)t.addRules({elements:{table:function(u){var v=u.attributes,w=v['class'];w&&(v['class']=w.replace(m,'').replace(/\s{2}/,' ').replace(/^\s+|\s+$/,''));}}});}});a.on('dialogDefinition',function(q){var r=q.data.name;if(r=='table'||r=='tableProperties'){var s=q.data.definition,t=s.getContents('info'),u=t.get('txtBorder'),v=u.commit;u.commit=e.override(v,function(y){return function(z,A){y.apply(this,arguments);var B=parseInt(this.getValue(),10);A[!B||B<=0?'addClass':'removeClass'](m);};});var w=s.getContents('advanced'),x=w&&w.get('advCSSClasses');if(x){x.setup=e.override(x.setup,function(y){return function(){y.apply(this,arguments);this.setValue(this.getValue().replace(/cke_show_border/,''));};});x.commit=e.override(x.commit,function(y){return function(z,A){y.apply(this,arguments);if(!parseInt(A.getAttribute('border'),10))A.addClass('cke_show_border');};});}}});})();j.add('sourcearea',{requires:['editingblock'],init:function(m){var n=j.sourcearea,o=a.document.getWindow();m.on('editingBlockReady',function(){var p,q;m.addMode('source',{load:function(r,s){if(c&&b.version<8)r.setStyle('position','relative');m.textarea=p=new h('textarea');p.setAttributes({dir:'ltr',tabIndex:b.webkit?-1:m.tabIndex,role:'textbox','aria-label':m.lang.editorTitle.replace('%1',m.name)});p.addClass('cke_source');p.addClass('cke_enable_context_menu');m.readOnly&&p.setAttribute('readOnly','readonly');var t={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'}; +if(c){q=function(){p.hide();p.setStyle('height',r.$.clientHeight+'px');p.setStyle('width',r.$.clientWidth+'px');p.show();};m.on('resize',q);o.on('resize',q);setTimeout(q,0);}r.setHtml('');r.append(p);p.setStyles(t);m.fire('ariaWidget',p);p.on('blur',function(){m.focusManager.blur();});p.on('focus',function(){m.focusManager.focus();});m.mayBeDirty=true;this.loadData(s);var u=m.keystrokeHandler;if(u)u.attach(p);setTimeout(function(){m.mode='source';m.fire('mode',{previousMode:m._.previousMode});},b.gecko||b.webkit?100:0);},loadData:function(r){p.setValue(r);m.fire('dataReady');},getData:function(){return p.getValue();},getSnapshotData:function(){return p.getValue();},unload:function(r){p.clearCustomData();m.textarea=p=null;if(q){m.removeListener('resize',q);o.removeListener('resize',q);}if(c&&b.version<8)r.removeStyle('position');},focus:function(){p.focus();}});});m.on('readOnly',function(){if(m.mode=='source')if(m.readOnly)m.textarea.setAttribute('readOnly','readonly');else m.textarea.removeAttribute('readOnly');});m.addCommand('source',n.commands.source);if(m.ui.addButton)m.ui.addButton('Source',{label:m.lang.source,command:'source'});m.on('mode',function(){m.getCommand('source').setState(m.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,readOnly:1,exec:function(m){if(m.mode=='wysiwyg')m.fire('saveSnapshot');m.getCommand('source').setState(0);m.setMode(m.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(n){var o=n.config,p=n.lang.stylesCombo,q={},r=[],s;function t(u){n.getStylesSet(function(v){if(!r.length){var w,x;for(var y=0,z=v.length;y0)return;if(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true);I.push(S);}};for(var L=0;L1&&V&&U[Y]==V[Y]){Z=U[Y];Z.rowSpan+=1;}else{Z=new h(U[Y]).clone();Z.removeAttribute('rowSpan');!c&&Z.appendBogus();X.append(Z);Z=Z.$;}Y+=Z.colSpan-1;}H?X.insertBefore(S):X.insertAfter(S);};function q(G){if(G instanceof d.selection){var H=n(G),I=H[0],J=I.getAscendant('table'),K=e.buildTableMap(J),L=H[0].getParent(),M=L.$.rowIndex,N=H[H.length-1],O=N.getParent().$.rowIndex+N.$.rowSpan-1,P=[];for(var Q=M;Q<=O;Q++){var R=K[Q],S=new h(J.$.rows[Q]);for(var T=0;T0?X[M-1]:null)||J.$.parentNode);for(Q=P.length;Q>=0;Q--)q(P[Q]);return Y;}else if(G instanceof h){J=G.getAscendant('table');if(J.$.rows.length==1)J.remove();else G.remove();}return null;};function r(G,H){var I=G.getParent(),J=I.$.cells,K=0;for(var L=0;LI)I=K;}return I;};function t(G,H){var I=n(G),J=I[0],K=J.getAscendant('table'),L=s(I,1),M=s(I),N=H?L:M,O=e.buildTableMap(K),P=[],Q=[],R=O.length;for(var S=0;S1&&Q.length&&Q[S]==P[S]){U=P[S];U.colSpan+=1;}else{U=new h(P[S]).clone();U.removeAttribute('colSpan');!c&&U.appendBogus();U[H?'insertBefore':'insertAfter'].call(U,new h(P[S]));U=U.$;}S+=U.rowSpan-1;}};function u(G){var H=n(G),I=H[0],J=H[H.length-1],K=I.getAscendant('table'),L=e.buildTableMap(K),M,N,O=[];for(var P=0,Q=L.length;P1){L=H[J-1]+1;break;}}if(!L)L=H[0]>0?H[0]-1:H[H.length-1]+1;var N=I.$.rows;for(J=0,K=N.length;J=0;K--)x(H[K]);if(J)z(J,true);else if(I)I.remove();}else if(G instanceof h){var L=G.getParent();if(L.getChildCount()==1)L.remove();else G.remove();}};function y(G){var H=G.getBogus();H&&H.remove();G.trim();};function z(G,H){var I=new d.range(G.getDocument());if(!I['moveToElementEdit'+(H?'End':'Start')](G)){I.selectNodeContents(G);I.collapse(H?false:true);}I.select(true);};function A(G,H,I){var J=G[H];if(typeof I=='undefined')return J;for(var K=0;J&&K1)J+=K[H].rowSpan-1;}return I;};function C(G,H,I){var J=n(G),K;if((H?J.length!=1:J.length<2)||(K=G.getCommonAncestor())&&K.type==1&&K.is('table'))return false;var L,M=J[0],N=M.getAscendant('table'),O=e.buildTableMap(N),P=O.length,Q=O[0].length,R=M.getParent().$.rowIndex,S=A(O,R,M);if(H){var T;try{var U=parseInt(M.getAttribute('rowspan'),10)||1,V=parseInt(M.getAttribute('colspan'),10)||1;T=O[H=='up'?R-U:H=='down'?R+U:R][H=='left'?S-V:H=='right'?S+V:S];}catch(an){return false;}if(!T||M.$==T)return false;J[H=='up'||H=='left'?'unshift':'push'](new h(T));}var W=M.getDocument(),X=R,Y=0,Z=0,aa=!I&&new d.documentFragment(W),ab=0;for(var ac=0;ac=Q)M.removeAttribute('rowSpan');else M.$.rowSpan=Y;if(Y>=P)M.removeAttribute('colSpan');else M.$.colSpan=Z;var ak=new d.nodeList(N.$.rows),al=ak.count();for(ac=al-1;ac>=0;ac--){var am=ak.getItem(ac);if(!am.$.cells.length){am.remove();al++;continue;}}return M;}else return Y*Z==ab;};function D(G,H){var I=n(G);if(I.length>1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.rowSpan,Q,R,S,T;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);T=N+R;var U=new h(L.$.rows[T]),V=A(M,T),W;Q=J.clone();for(var X=0;XO){Q.insertBefore(new h(W));break;}else W=null;}if(!W)U.append(Q,true);}else{S=R=1;U=K.clone();U.insertAfter(K);U.append(Q=J.clone());var Y=A(M,N);for(var Z=0;Z1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=e.buildTableMap(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.colSpan,Q,R,S;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);}else{S=R=1;var T=B(M,O);for(var U=0;U0?2:0};}},tablecell_insertBefore:{label:H.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:H.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:H.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:H.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:H.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:H.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:H.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:H.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:H.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:H.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:H.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:H.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:H.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:H.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2}; +}},tablecolumn_insertBefore:{label:H.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:H.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:H.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(G.contextMenu)G.contextMenu.addListener(function(I,J){if(!I||I.isReadOnly())return null;while(I){if(I.getName() in F)return{tablecell:2,tablerow:2,tablecolumn:2};I=I.getParent();}return null;});},getSelectedCells:n};j.add('tabletools',j.tabletools);})();e.buildTableMap=function(m){var n=m.$.rows,o=-1,p=[];for(var q=0;qp&&(!s||!t||vt){s=v;t=u;}}else{if(q&&u==p){s=v;break;}if(ut)){s=v;t=u;}}}if(s)s.focus();};(function(){j.add('templates',{requires:['dialog'],init:function(o){a.dialog.add('templates',a.getUrl(this.path+'dialogs/templates.js'));o.addCommand('templates',new a.dialogCommand('templates'));o.ui.addButton('Templates',{label:o.lang.templates.button,command:'templates'});}});var m={},n={};a.addTemplates=function(o,p){m[o]=p;};a.getTemplates=function(o){return m[o];};a.loadTemplates=function(o,p){var q=[];for(var r=0,s=o.length;r':' style="display:none">');t.push('',o.lang.toolbars,'');var w=o.toolbox.toolbars,x=o.config.toolbar instanceof Array?o.config.toolbar:o.config['toolbar_'+o.config.toolbar];for(var y=0;y');v=0;}if(C==='/'){t.push('
    ');continue;}D=C.items||C;for(var E=0;E');B&&t.push('',B,'');t.push('');var I=w.push(A)-1;if(I>0){A.previous=w[I-1];A.previous.next=A;}}if(H){if(!v){t.push('');v=1;}}else if(v){t.push('');v=0;}var J=F.render(o,t);I=A.items.push(J)-1;if(I>0){J.previous=A.items[I-1];J.previous.next=J;}J.toolbar=A;J.onkey=q;J.onfocus=function(){if(!o.toolbox.focusCommandExecuted)o.focus();};}}if(v){t.push('');v=0;}if(A)t.push('');}t.push('
    ');if(o.config.toolbarCanCollapse){var K=e.addFunction(function(){o.execCommand('toolbarCollapse');});o.on('destroy',function(){e.removeFunction(K);});var L=e.getNextId();o.addCommand('toolbarCollapse',{readOnly:1,exec:function(M){var N=a.document.getById(L),O=N.getPrevious(),P=M.getThemeSpace('contents'),Q=O.getParent(),R=parseInt(P.$.style.height,10),S=Q.$.offsetHeight,T=!O.isVisible();if(!T){O.hide();N.addClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarExpand);}else{O.show();N.removeClass('cke_toolbox_collapser_min');N.setAttribute('title',M.lang.toolbarCollapse);}N.getFirst().setText(T?'▲':'◀');var U=Q.$.offsetHeight-S;P.setStyle('height',R-U+'px');M.fire('resize');},modes:{wysiwyg:1,source:1}});t.push('','','');}r.data.html+=t.join('');}});o.on('destroy',function(){var r,s=0,t,u,v;r=this.toolbox.toolbars;for(;s');return{};}};}});}});})();a.UI_SEPARATOR='separator';i.toolbarLocation='top';i.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];i.toolbar_Full=[{name:'document',items:['Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates']},{name:'clipboard',items:['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']},{name:'editing',items:['Find','Replace','-','SelectAll','-','SpellChecker','Scayt']},{name:'forms',items:['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField']},'/',{name:'basicstyles',items:['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']},{name:'paragraph',items:['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl']},{name:'links',items:['Link','Unlink','Anchor']},{name:'insert',items:['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe']},'/',{name:'styles',items:['Styles','Format','Font','FontSize']},{name:'colors',items:['TextColor','BGColor']},{name:'tools',items:['Maximize','ShowBlocks','-','About']}];i.toolbar='Full';i.toolbarCanCollapse=true;(function(){j.add('undo',{requires:['selection','wysiwygarea'],init:function(s){var t=new o(s),u=s.addCommand('undo',{exec:function(){if(t.undo()){s.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),v=s.addCommand('redo',{exec:function(){if(t.redo()){s.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});t.onChange=function(){u.setState(t.undoable()?2:0);v.setState(t.redoable()?2:0);};function w(x){if(t.enabled&&x.data.command.canUndo!==false)t.save();};s.on('beforeCommandExec',w);s.on('afterCommandExec',w);s.on('saveSnapshot',function(x){t.save(x.data&&x.data.contentOnly);});s.on('contentDom',function(){s.document.on('keydown',function(x){if(!x.data.$.ctrlKey&&!x.data.$.metaKey)t.type(x);});});s.on('beforeModeUnload',function(){s.mode=='wysiwyg'&&t.save(true);});s.on('mode',function(){t.enabled=s.readOnly?false:s.mode=='wysiwyg';t.onChange();});s.ui.addButton('Undo',{label:s.lang.undo,command:'undo'});s.ui.addButton('Redo',{label:s.lang.redo,command:'redo'}); +s.resetUndo=function(){t.reset();s.fire('saveSnapshot');};s.on('updateSnapshot',function(){if(t.currentImage)t.update();});}});j.undo={};var m=j.undo.Image=function(s){this.editor=s;s.fire('beforeUndoImage');var t=s.getSnapshot(),u=t&&s.getSelection();c&&t&&(t=t.replace(/\s+data-cke-expando=".*?"/g,''));this.contents=t;this.bookmarks=u&&u.createBookmarks2(true);s.fire('afterUndoImage');},n=/\b(?:href|src|name)="[^"]*?"/gi;m.prototype={equals:function(s,t){var u=this.contents,v=s.contents;if(c&&(b.ie7Compat||b.ie6Compat)){u=u.replace(n,'');v=v.replace(n,'');}if(u!=v)return false;if(t)return true;var w=this.bookmarks,x=s.bookmarks;if(w||x){if(!w||!x||w.length!=x.length)return false;for(var y=0;y25){this.save(false,null,false);this.modifiersCount=1;}}else if(!y){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var s=this;s.lastKeystroke=0;s.snapshots=[];s.index=-1;s.limit=s.editor.config.undoStackSize||20;s.currentImage=null;s.hasUndo=false;s.hasRedo=false;s.resetType();},resetType:function(){var s=this;s.typing=false;delete s.lastKeystroke;s.typesCount=0;s.modifiersCount=0;},fireChange:function(){var s=this;s.hasUndo=!!s.getNextImage(true);s.hasRedo=!!s.getNextImage(false);s.resetType();s.onChange();},save:function(s,t,u){var w=this;var v=w.snapshots;if(!t)t=new m(w.editor);if(t.contents===false)return false;if(w.currentImage&&t.equals(w.currentImage,s))return false;v.splice(w.index+1,v.length-w.index-1);if(v.length==w.limit)v.shift(); +w.index=v.push(t)-1;w.currentImage=t;if(u!==false)w.fireChange();return true;},restoreImage:function(s){var w=this;var t=w.editor,u;if(s.bookmarks){t.focus();u=t.getSelection();}w.editor.loadSnapshot(s.contents);if(s.bookmarks)u.selectBookmarks(s.bookmarks);else if(c){var v=w.editor.document.getBody().$.createTextRange();v.collapse(true);v.select();}w.index=s.index;w.update();w.fireChange();},getNextImage:function(s){var x=this;var t=x.snapshots,u=x.currentImage,v,w;if(u)if(s)for(w=x.index-1;w>=0;w--){v=t[w];if(!u.equals(v,true)){v.index=w;return v;}}else for(w=x.index+1;w]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true),o=d.walker.bogus(true),p=function(E){return n(E)&&o(E);};function q(E){return E.isBlockBoundary()&&f.$empty[E.getName()];};function r(E){return function(F){if(this.mode=='wysiwyg'){this.focus();var G=this.getSelection(),H=G.isLocked;H&&G.unlock();this.fire('saveSnapshot');E.call(this,F.data);H&&this.getSelection().lock();e.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};};function s(E){var N=this;if(N.dataProcessor)E=N.dataProcessor.toHtml(E);if(!E)return;var F=N.getSelection(),G=F.getRanges()[0];if(G.checkReadOnly())return;if(b.opera){var H=new d.elementPath(G.startContainer);if(H.block){var I=a.htmlParser.fragment.fromHtml(E,false).children;for(var J=0,K=I.length;J'+Q+'';});I=I.replace(/\n/g,'
    ');if(!(H||c))I=I.replace(new RegExp('
    (?=)'),function(O){return e.repeat(O,2);});if(b.gecko||b.webkit){var K=new d.elementPath(F.getStartElement()),L=[];for(var M=0;M/));else if(N in f.$block)break;}I=L.join('')+I;}s.call(this,I);};function u(E){var F=this.getSelection(),G=F.getRanges(),H=E.getName(),I=f.$block[H],J=F.isLocked;if(J)F.unlock();var K,L,M,N;for(var O=G.length-1;O>=0;O--){K=G[O];if(!K.checkReadOnly()){K.deleteContents(1);L=!O&&E||E.clone(1);var P,Q;if(I)while((P=K.getCommonAncestor(0,1))&&(Q=f[P.getName()])&&!(Q&&Q[H])){if(P.getName() in f.span)K.splitElement(P);else if(K.checkStartOfBlock()&&K.checkEndOfBlock()){K.setStartBefore(P);K.collapse(true);P.remove();}else K.splitBlock();}K.insertNode(L);if(!M)M=L;}}if(M){K.moveToPosition(M,4);if(I){var R=M.getNext(p),S=R&&R.type==1&&R.getName();if(S&&f.$block[S]){if(f[S]['#'])K.moveToElementEditStart(R);else K.moveToElementEditEnd(M);}else if(!R){R=K.fixBlock(true,this.config.enterMode==3?'div':'p');K.moveToElementEditStart(R);}}}F.selectRanges([K]);if(J)this.getSelection().lock();};function v(E){if(!E.checkDirty())setTimeout(function(){E.resetDirty();},0);};var w=d.walker.whitespaces(true),x=d.walker.bookmark(false,true);function y(E){return w(E)&&x(E);};function z(E){return E.type==3&&e.trim(E.getText()).match(/^(?: |\xa0)$/);};function A(E){if(E.isLocked){E.unlock();setTimeout(function(){E.lock();},0);}};function B(E){return E.getOuterHtml().match(m);};w=d.walker.whitespaces(true);function C(E){var F=E.window,G=E.document,H=E.document.getBody(),I=H.getFirst(),J=H.getChildren().count();if(!J||J==1&&I.type==1&&I.hasAttribute('_moz_editor_bogus_node')){v(E);var K=E.element.getDocument(),L=K.getDocumentElement(),M=L.$.scrollTop,N=L.$.scrollLeft,O=G.$.createEvent('KeyEvents'); +O.initKeyEvent('keypress',true,true,F.$,false,false,false,false,0,32);G.$.dispatchEvent(O);if(M!=L.$.scrollTop||N!=L.$.scrollLeft)K.getWindow().$.scrollTo(N,M);J&&H.getFirst().remove();G.getBody().appendBogus();var P=new d.range(G);P.setStartAt(H,1);P.select();}};function D(E){var F=E.editor,G=E.data.path,H=G.blockLimit,I=E.data.selection,J=I.getRanges()[0],K=F.document.getBody(),L=F.config.enterMode;if(b.gecko){C(F);var M=G.block||G.blockLimit,N=M&&M.getLast(y);if(M&&M.isBlockBoundary()&&!(N&&N.type==1&&N.isBlockBoundary())&&!M.is('pre')&&!M.getBogus())M.appendBogus();}if(F.config.autoParagraph!==false&&L!=2&&J.collapsed&&H.getName()=='body'&&!G.block){var O=J.fixBlock(true,F.config.enterMode==3?'div':'p');if(c){var P=O.getFirst(y);P&&z(P)&&P.remove();}if(B(O)){var Q=O.getNext(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditStart(Q);O.remove();}else{Q=O.getPrevious(w);if(Q&&Q.type==1&&!q(Q)){J.moveToElementEditEnd(Q);O.remove();}}}J.select();E.cancel();}var R=new d.range(F.document);R.moveToElementEditEnd(F.document.getBody());var S=new d.elementPath(R.startContainer);if(!S.blockLimit.is('body')){var T;if(L!=2)T=K.append(F.document.createElement(L==1?'p':'div'));else T=K;if(!c)T.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(E){var F=E.config.enterMode!=2&&E.config.autoParagraph!==false?E.config.enterMode==3?'div':'p':false,G=E.lang.editorTitle.replace('%1',E.name),H=E.lang.editorHelp;if(c)G+=', '+H;var I=a.document.getWindow(),J;E.on('editingBlockReady',function(){var M,N,O,P,Q,R,S,T=b.isCustomDomain(),U=function(X){if(N)N.remove();var Y='document.open();'+(T?'document.domain="'+document.domain+'";':'')+'document.close();';Y=b.air?'javascript:void(0)':c?'javascript:void(function(){'+encodeURIComponent(Y)+'}())':'';var Z=e.getNextId();N=h.createFromHtml('');if(document.location.protocol=='chrome:')a.event.useCapture=true;N.on('load',function(aa){Q=1;aa.removeListener();var ab=N.getFrameDocument();ab.write(X);b.air&&W(ab.getWindow().$);});if(document.location.protocol=='chrome:')a.event.useCapture=false;M.append(h.createFromHtml(''+H+''));M.append(N);if(b.webkit){S=function(){M.setStyle('width','100%');N.hide();N.setSize('width',M.getSize('width'));M.removeStyle('width');N.show();};I.on('resize',S); +}};J=e.addFunction(W);var V='';function W(X){if(!Q)return;Q=0;E.fire('ariaWidget',N);var Y=X.document,Z=Y.body,aa=Y.getElementById('cke_actscrpt');aa&&aa.parentNode.removeChild(aa);Z.spellcheck=!E.config.disableNativeSpellChecker;var ab=!E.readOnly;if(c){Z.hideFocus=true;Z.disabled=true;Z.contentEditable=ab;Z.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)Y.$.body.contentEditable=ab;else if(b.webkit)Y.$.body.parentNode.contentEditable=ab;else Y.$.designMode=ab?'off':'on';},0);ab&&b.gecko&&e.setTimeout(C,0,null,E);X=E.window=new d.window(X);Y=E.document=new g(Y);ab&&Y.on('dblclick',function(ag){var ah=ag.data.getTarget(),ai={element:ah,dialog:''};E.fire('doubleclick',ai);ai.dialog&&E.openDialog(ai.dialog);});c&&Y.on('click',function(ag){var ah=ag.data.getTarget();if(ah.is('input')){var ai=ah.getAttribute('type');if(ai=='submit'||ai=='reset')ag.data.preventDefault();}});if(!(c||b.opera))Y.on('mousedown',function(ag){var ah=ag.data.getTarget();if(ah.is('img','hr','input','textarea','select'))E.getSelection().selectElement(ah);});if(b.gecko)Y.on('mouseup',function(ag){if(ag.data.$.button==2){var ah=ag.data.getTarget();if(!ah.getOuterHtml().replace(m,'')){var ai=new d.range(Y);ai.moveToElementEditStart(ah);ai.select(true);}}});Y.on('click',function(ag){ag=ag.data;if(ag.getTarget().is('a')&&ag.$.button!=2)ag.preventDefault();});if(b.webkit){Y.on('mousedown',function(){ad=1;});Y.on('click',function(ag){if(ag.data.getTarget().is('input','select'))ag.data.preventDefault();});Y.on('mouseup',function(ag){if(ag.data.getTarget().is('input','textarea'))ag.data.preventDefault();});}var ac=c?N:X;ac.on('blur',function(){E.focusManager.blur();});var ad;ac.on('focus',function(){var ag=E.document;if(b.gecko||b.opera)ag.getBody().focus();else if(b.webkit)if(!ad){E.document.getDocumentElement().focus();ad=1;}E.focusManager.focus();});var ae=E.keystrokeHandler;ae.blockedKeystrokes[8]=!ab;ae.attach(Y);Y.getDocumentElement().addClass(Y.$.compatMode);ab&&Y.on('keydown',function(ag){var ah=ag.data.getKeystroke();if(ah in {8:1,46:1}){var ai=E.getSelection(),aj=ai.getSelectedElement(),ak=ai.getRanges()[0],al=new d.elementPath(ak.startContainer),am,an,ao,ap=ah==8;if(aj){E.fire('saveSnapshot');ak.moveToPosition(aj,3);aj.remove();ak.select();E.fire('saveSnapshot'); +ag.data.preventDefault();}else if((am=al.block)&&ak[ap?'checkStartOfBlock':'checkEndOfBlock']()&&(ao=am[ap?'getPrevious':'getNext'](n))&&ao.is('table')){E.fire('saveSnapshot');if(ak[ap?'checkEndOfBlock':'checkStartOfBlock']())am.remove();ak['moveToElementEdit'+(ap?'End':'Start')](ao);ak.select();E.fire('saveSnapshot');ag.data.preventDefault();}else if(al.blockLimit.is('td')&&(an=al.blockLimit.getAscendant('table'))&&ak.checkBoundaryOfElement(an,ap?1:2)&&(ao=an[ap?'getPrevious':'getNext'](n))){E.fire('saveSnapshot');ak['moveToElementEdit'+(ap?'End':'Start')](ao);if(ak.checkStartOfBlock()&&ak.checkEndOfBlock())ao.remove();else ak.select();E.fire('saveSnapshot');ag.data.preventDefault();}}if(ah==33||ah==34)if(b.gecko){var aq=Y.getBody();if(X.$.innerHeight>aq.$.offsetHeight){ak=new d.range(Y);ak[ah==33?'moveToElementEditStart':'moveToElementEditEnd'](aq);ak.select();ag.data.preventDefault();}}});if(c&&Y.$.compatMode=='CSS1Compat'){var af={33:1,34:1};Y.on('keydown',function(ag){if(ag.data.getKeystroke() in af)setTimeout(function(){E.getSelection().scrollIntoView();},0);});}if(c&&E.config.enterMode!=1)Y.on('selectionchange',function(){var ag=Y.getBody(),ah=E.getSelection(),ai=ah&&ah.getRanges()[0];if(ai&&ag.getHtml().match(/^

     <\/p>$/i)&&ai.startContainer.equals(ag))setTimeout(function(){ai=E.getSelection().getRanges()[0];if(!ai.startContainer.equals('body')){ag.getFirst().remove(1);ai.moveToElementEditEnd(ag);ai.select(1);}},0);});if(E.contextMenu)E.contextMenu.addTarget(Y,E.config.browserContextMenuOnCtrl!==false);setTimeout(function(){E.fire('contentDom');if(R){E.mode='wysiwyg';E.fire('mode',{previousMode:E._.previousMode});R=false;}O=false;if(P){E.focus();P=false;}setTimeout(function(){E.fire('dataReady');},0);try{E.document.$.execCommand('2D-position',false,true);}catch(ag){}try{E.document.$.execCommand('enableInlineTableEditing',false,!E.config.disableNativeTableHandles);}catch(ah){}if(E.config.disableObjectResizing)try{E.document.$.execCommand('enableObjectResizing',false,false);}catch(ai){E.document.getBody().on(c?'resizestart':'resize',function(aj){aj.data.preventDefault();});}if(c)setTimeout(function(){if(E.document){var aj=E.document.$.body;aj.runtimeStyle.marginBottom='0px';aj.runtimeStyle.marginBottom='';}},1000);},0);};E.addMode('wysiwyg',{load:function(X,Y,Z){M=X;if(c&&b.quirks)X.setStyle('position','relative');E.mayBeDirty=true;R=true;if(Z)this.loadSnapshotData(Y);else this.loadData(Y);},loadData:function(X){O=true;E._.dataStore={id:1};var Y=E.config,Z=Y.fullPage,aa=Y.docType,ab=''; +!Z&&(ab=e.buildStyleHtml(E.config.contentsCss)+ab);var ac=Y.baseHref?'':'';if(Z)X=X.replace(/]*>/i,function(ad){E.docType=aa=ad;return '';}).replace(/<\?xml\s[^\?]*\?>/i,function(ad){E.xmlDeclaration=ad;return '';});if(E.dataProcessor)X=E.dataProcessor.toHtml(X,F);if(Z){if(!/]/.test(X))X=''+X;if(!/]/.test(X))X=''+X+'';if(!/]/.test(X))X=X.replace(/]*>/,'$&');else if(!/]/.test(X))X=X.replace(/]*>/,'$&');ac&&(X=X.replace(//,'$&'+ac));X=X.replace(/<\/head\s*>/,ab+'$&');X=aa+X;}else X=Y.docType+''+''+''+G+''+ac+ab+''+''+X+'';if(b.gecko)X=X.replace(/
    (?=\s*<\/(:?html|body)>)/,'$&
    ');X+=V;this.onDispose();U(X);},getData:function(){var X=E.config,Y=X.fullPage,Z=Y&&E.docType,aa=Y&&E.xmlDeclaration,ab=N.getFrameDocument(),ac=Y?ab.getDocumentElement().getOuterHtml():ab.getBody().getHtml();if(b.gecko)ac=ac.replace(/
    (?=\s*(:?$|<\/body>))/,'');if(E.dataProcessor)ac=E.dataProcessor.toDataFormat(ac,F);if(X.ignoreEmptyParagraph)ac=ac.replace(m,function(ad,ae){return ae;});if(aa)ac=aa+'\n'+ac;if(Z)ac=Z+'\n'+ac;return ac;},getSnapshotData:function(){return N.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(X){N.getFrameDocument().getBody().setHtml(X);},onDispose:function(){if(!E.document)return;E.document.getDocumentElement().clearCustomData();E.document.getBody().clearCustomData();E.window.clearCustomData();E.document.clearCustomData();N.clearCustomData();N.remove();},unload:function(X){this.onDispose();if(S)I.removeListener('resize',S);E.window=E.document=N=M=P=null;E.fire('contentDomUnload');},focus:function(){var X=E.window;if(O)P=true;else if(X){var Y=E.getSelection(),Z=Y&&Y.getNative();if(Z&&Z.type=='Control')return;b.air?setTimeout(function(){X.focus();},0):X.focus();E.selectionChange();}}});E.on('insertHtml',r(s),null,null,20);E.on('insertElement',r(u),null,null,20);E.on('insertText',r(t),null,null,20);E.on('selectionChange',function(X){if(E.readOnly)return;var Y=E.getSelection();if(Y&&!Y.isLocked){var Z=E.checkDirty();E.fire('saveSnapshot',{contentOnly:1});D.call(this,X);E.fire('updateSnapshot');!Z&&E.resetDirty();}},null,null,1);});E.on('contentDom',function(){var M=E.document.getElementsByTag('title').getItem(0); +M.data('cke-title',E.document.$.title);c&&(E.document.$.title=G);});E.on('readOnly',function(){if(E.mode=='wysiwyg'){var M=E.getMode();M.loadData(M.getData());}});if(a.document.$.documentMode>=8){E.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var K=[];for(var L in f.$removeEmpty)K.push('html.CSS1Compat '+L+'[contenteditable=false]');E.addCss(K.join(',')+'{ display:inline-block;}');}else if(b.gecko){E.addCss('html { height: 100% !important; }');E.addCss('img:-moz-broken { -moz-force-broken-image-icon : 1;\tmin-width : 24px; min-height : 24px; }');}else if(c&&b.version<8&&E.config.contentsLangDirection=='ltr')E.addCss('body{margin-right:0;}');E.addCss('html {\t_overflow-y: scroll; cursor: text;\t*cursor:auto;}');E.addCss('img, input, textarea { cursor: default;}');E.on('insertElement',function(M){var N=M.data;if(N.type==1&&(N.is('input')||N.is('textarea'))){var O=N.getAttribute('contenteditable')=='false';if(!O){N.data('cke-editable',N.hasAttribute('contenteditable')?'true':'1');N.setAttribute('contenteditable',false);}}});}});if(b.gecko)(function(){var E=document.body;if(!E)window.addEventListener('load',arguments.callee,false);else{var F=E.getAttribute('onpageshow');E.setAttribute('onpageshow',(F?F+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();');}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(m){var n='checkspell',o=m.addCommand(n,new a.dialogCommand(n));o.modes={wysiwyg:!b.opera&&!b.air&&document.domain==window.location.hostname};m.ui.addButton('SpellChecker',{label:m.lang.spellCheck.toolbar,command:n});a.dialog.add(n,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){var m=e.cssLength;function n(Q){return!!this._.tabs[Q][0].$.offsetHeight;};function o(){var U=this;var Q=U._.currentTabId,R=U._.tabIdList.length,S=e.indexOf(U._.tabIdList,Q)+R;for(var T=S-1;T>S-R;T--){if(n.call(U,U._.tabIdList[T%R]))return U._.tabIdList[T%R]; +}return null;};function p(){var U=this;var Q=U._.currentTabId,R=U._.tabIdList.length,S=e.indexOf(U._.tabIdList,Q);for(var T=S+1;T1){ag._.tabBarMode=true;ag._.tabs[ag._.currentTabId][0].focus();Y=1;}else if((ar==37||ar==39)&&ag._.tabBarMode){av=ar==(as?39:37)?o.call(ag):p.call(ag);ag.selectPage(av);ag._.tabs[av][0].focus();Y=1;}else if((ar==13||ar==32)&&ag._.tabBarMode){ax.selectPage(ax._.currentTabId);ax._.tabBarMode=false;ax._.currentFocusIndex=-1;aj(1);Y=1;}else if(ar==13){var aw=aq.data.getTarget();if(!aw.is('a','button','select')&&(!aw.is('input')||aw.$.type!='button')){at=ax.getButton('ok');at&&e.setTimeout(at.click,0,at);Y=1;}Z=1;}else if(ar==27){at=ax.getButton('cancel');if(at)e.setTimeout(at.click,0,at);else if(ax.fire('cancel',{hide:true}).hide!==false)ax.hide();Z=1;}else return;al(aq);};function al(aq){if(Y)aq.data.preventDefault(1);else if(Z)aq.data.stopPropagation();};var am=this._.element;this.on('show',function(){am.on('keydown',ak,this);if(b.opera||b.gecko)am.on('keypress',al,this);});this.on('hide',function(){am.removeListener('keydown',ak); +if(b.opera||b.gecko)am.removeListener('keypress',al);ah(function(aq){s.apply(aq);});});this.on('iframeAdded',function(aq){var ar=new g(aq.data.iframe.$.contentWindow.document);ar.on('keydown',ak,this,null,0);});this.on('show',function(){var au=this;ai();if(Q.config.dialog_startupFocusTab&&ag._.pageCount>1){ag._.tabBarMode=true;ag._.tabs[ag._.currentTabId][0].focus();}else if(!au._.hasFocus){au._.currentFocusIndex=-1;if(S.onFocus){var aq=S.onFocus.call(au);aq&&aq.focus();}else aj(1);if(au._.editor.mode=='wysiwyg'&&c){var ar=Q.document.$.selection,as=ar.createRange();if(as)if(as.parentElement&&as.parentElement().ownerDocument==Q.document.$||as.item&&as.item(0).ownerDocument==Q.document.$){var at=document.body.createTextRange();at.moveToElementText(au.getElement().getFirst().$);at.collapse(true);at.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(aq){var ar=this.getElement(),as=ar.getFirst();as.remove();as.appendTo(ar);},this);A(this);B(this);new d.text(S.title,a.document).appendTo(this.parts.title);for(X=0;X0?S:0)+'px'};Z[V?'right':'left']=(R>0?R:0)+'px';U.setStyles(Z);T&&(aa._.moved=1);};})(),getPosition:function(){return e.extend({},this._.position);},show:function(){var Q=this._.element,R=this.definition;if(!(Q.getParent()&&Q.getParent().equals(a.document.getBody())))Q.appendTo(a.document.getBody());else Q.setStyle('display','block');if(b.gecko&&b.version<10900){var S=this.parts.dialog;S.setStyle('position','absolute');setTimeout(function(){S.setStyle('position','fixed');},0);}this.resize(this._.contentSize&&this._.contentSize.width||R.width||R.minWidth,this._.contentSize&&this._.contentSize.height||R.height||R.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;G(this._.editor);}else{this._.parentDialog=a.dialog._.currentTop;var T=this._.parentDialog.getElement().getFirst();T.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}Q.on('keydown',K);Q.on(b.opera?'keypress':'keyup',L);this._.hasFocus=false;e.setTimeout(function(){this.layout();this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});k.fire('ready',this);this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(U){U.setInitValue&&U.setInitValue();});},100,this);},layout:function(){var S=this;var Q=a.document.getWindow().getViewPaneSize(),R=S.getSize();S.move(S._.moved?S._.position.x:(Q.width-R.width)/2,S._.moved?S._.position.y:(Q.height-R.height)/2);},foreach:function(Q){var T=this;for(var R in T._.contents)for(var S in T._.contents[R])Q.call(T,T._.contents[R][S]);return T;},reset:(function(){var Q=function(R){if(R.reset)R.reset(1);};return function(){this.foreach(Q); +return this;};})(),setupContent:function(){var Q=arguments;this.foreach(function(R){if(R.setup)R.setup.apply(R,Q);});},commitContent:function(){var Q=arguments;this.foreach(function(R){if(c&&this._.currentFocusIndex==R.focusIndex)R.getInputElement().$.blur();if(R.commit)R.commit.apply(R,Q);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);this.selectPage(this._.tabIdList[0]);var Q=this._.element;Q.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');N(this);while(a.dialog._.currentTop!=this)a.dialog._.currentTop.hide();if(!this._.parentDialog)H();else{var R=this._.parentDialog.getElement().getFirst();R.setStyle('z-index',parseInt(R.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;Q.removeListener('keydown',K);Q.removeListener(b.opera?'keypress':'keyup',L);var S=this._.editor;S.focus();if(S.mode=='wysiwyg'&&c){var T=S.getSelection();T&&T.unlock(true);}}else a.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(U){U.resetInitValue&&U.resetInitValue();});},addPage:function(Q){var ac=this;var R=[],S=Q.label?' title="'+e.htmlEncode(Q.label)+'"':'',T=Q.elements,U=a.dialog._.uiElementBuilders.vbox.build(ac,{type:'vbox',className:'cke_dialog_page_contents',children:Q.elements,expand:!!Q.expand,padding:Q.padding,style:Q.style||'width: 100%;height:100%'},R),V=h.createFromHtml(R.join(''));V.setAttribute('role','tabpanel');var W=b,X='cke_'+Q.id+'_'+e.getNextNumber(),Y=h.createFromHtml(['0?' cke_last':'cke_first',S,!!Q.hidden?' style="display:none"':'',' id="',X,'"',W.gecko&&W.version>=10900&&!W.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',Q.label,''].join(''));V.setAttribute('aria-labelledby',X);ac._.tabs[Q.id]=[Y,V];ac._.tabIdList.push(Q.id);!Q.hidden&&ac._.pageCount++;ac._.lastTab=Y;ac.updateStyle();var Z=ac._.contents[Q.id]={},aa,ab=U.getChild();while(aa=ab.shift()){Z[aa.id]=aa;if(typeof aa.getChild=='function')ab.push.apply(ab,aa.getChild());}V.setAttribute('name',Q.id);V.appendTo(ac.parts.contents);Y.unselectable();ac.parts.tabs.append(Y);if(Q.accessKey){M(ac,ac,'CTRL+'+Q.accessKey,P,O);ac._.accessKeyMap['CTRL+'+Q.accessKey]=Q.id;}},selectPage:function(Q){if(this._.currentTabId==Q)return;if(this.fire('selectPage',{page:Q,currentPage:this._.currentTabId})===true)return; +for(var R in this._.tabs){var S=this._.tabs[R][0],T=this._.tabs[R][1];if(R!=Q){S.removeClass('cke_dialog_tab_selected');T.hide();}T.setAttribute('aria-hidden',R!=Q);}var U=this._.tabs[Q];U[0].addClass('cke_dialog_tab_selected');if(b.ie6Compat||b.ie7Compat){q(U[1]);U[1].show();setTimeout(function(){q(U[1],1);},0);}else U[1].show();this._.currentTabId=Q;this._.currentTabIndex=e.indexOf(this._.tabIdList,Q);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(Q){var S=this;var R=S._.tabs[Q]&&S._.tabs[Q][0];if(!R||S._.pageCount==1||!R.isVisible())return;else if(Q==S._.currentTabId)S.selectPage(o.call(S));R.hide();S._.pageCount--;S.updateStyle();},showPage:function(Q){var S=this;var R=S._.tabs[Q]&&S._.tabs[Q][0];if(!R)return;R.show();S._.pageCount++;S.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(Q,R){var S=this._.contents[Q];return S&&S[R];},getValueOf:function(Q,R){return this.getContentElement(Q,R).getValue();},setValueOf:function(Q,R,S){return this.getContentElement(Q,R).setValue(S);},getButton:function(Q){return this._.buttons[Q];},click:function(Q){return this._.buttons[Q].click();},disableButton:function(Q){return this._.buttons[Q].disable();},enableButton:function(Q){return this._.buttons[Q].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(Q,R){var T=this;if(typeof R=='undefined'){R=T._.focusList.length;T._.focusList.push(new t(T,Q,R));}else{T._.focusList.splice(R,0,new t(T,Q,R));for(var S=R+1;Sab.width-aa.width-V)ag=ab.width-aa.width+(U.lang.dir=='rtl'?0:W[1]);else ag=S.x;if(S.y+W[0]ab.height-aa.height-V)ah=ab.height-aa.height+W[2];else ah=S.y;Q.move(ag,ah,1);Z.data.preventDefault();};function Y(Z){a.document.removeListener('mousemove',X);a.document.removeListener('mouseup',Y);if(b.ie6Compat){var aa=E.getChild(0).getFrameDocument();aa.removeListener('mousemove',X);aa.removeListener('mouseup',Y);}};Q.parts.title.on('mousedown',function(Z){R={x:Z.data.$.screenX,y:Z.data.$.screenY}; +a.document.on('mousemove',X);a.document.on('mouseup',Y);S=Q.getPosition();if(b.ie6Compat){var aa=E.getChild(0).getFrameDocument();aa.on('mousemove',X);aa.on('mouseup',Y);}Z.data.preventDefault();},Q);};function B(Q){var R=Q.definition,S=R.resizable;if(S==0)return;var T=Q.getParentEditor(),U,V,W,X,Y,Z,aa=e.addFunction(function(ad){Y=Q.getSize();var ae=Q.parts.contents,af=ae.$.getElementsByTagName('iframe').length;if(af){Z=h.createFromHtml('

    ');ae.append(Z);}V=Y.height-Q.parts.contents.getSize('height',!(b.gecko||b.opera||c&&b.quirks));U=Y.width-Q.parts.contents.getSize('width',1);X={x:ad.screenX,y:ad.screenY};W=a.document.getWindow().getViewPaneSize();a.document.on('mousemove',ab);a.document.on('mouseup',ac);if(b.ie6Compat){var ag=E.getChild(0).getFrameDocument();ag.on('mousemove',ab);ag.on('mouseup',ac);}ad.preventDefault&&ad.preventDefault();});Q.on('load',function(){var ad='';if(S==1)ad=' cke_resizer_horizontal';else if(S==2)ad=' cke_resizer_vertical';var ae=h.createFromHtml('
    ');Q.parts.footer.append(ae,1);});T.on('destroy',function(){e.removeFunction(aa);});function ab(ad){var ae=T.lang.dir=='rtl',af=(ad.data.$.screenX-X.x)*(ae?-1:1),ag=ad.data.$.screenY-X.y,ah=Y.width,ai=Y.height,aj=ah+af*(Q._.moved?1:2),ak=ai+ag*(Q._.moved?1:2),al=Q._.element.getFirst(),am=ae&&al.getComputedStyle('right'),an=Q.getPosition();if(an.y+ak>W.height)ak=W.height-an.y;if((ae?am:an.x)+aj>W.width)aj=W.width-(ae?am:an.x);if(S==1||S==3)ah=Math.max(R.minWidth||0,aj-U);if(S==2||S==3)ai=Math.max(R.minHeight||0,ak-V);Q.resize(ah,ai);if(!Q._.moved)Q.layout();ad.data.preventDefault();};function ac(){a.document.removeListener('mouseup',ac);a.document.removeListener('mousemove',ab);if(Z){Z.remove();Z=null;}if(b.ie6Compat){var ad=E.getChild(0).getFrameDocument();ad.removeListener('mouseup',ac);ad.removeListener('mousemove',ab);}};};var C,D={},E;function F(Q){Q.data.preventDefault(1);};function G(Q){var R=a.document.getWindow(),S=Q.config,T=S.dialog_backgroundCoverColor||'white',U=S.dialog_backgroundCoverOpacity,V=S.baseFloatZIndex,W=e.genKey(T,U,V),X=D[W];if(!X){var Y=['
    ']; +if(b.ie6Compat){var Z=b.isCustomDomain(),aa="";Y.push('');}Y.push('
    ');X=h.createFromHtml(Y.join(''));X.setOpacity(U!=undefined?U:0.5);X.on('keydown',F);X.on('keypress',F);X.on('keyup',F);X.appendTo(a.document.getBody());D[W]=X;}else X.show();E=X;var ab=function(){var ae=R.getViewPaneSize();X.setStyles({width:ae.width+'px',height:ae.height+'px'});},ac=function(){var ae=R.getScrollPosition(),af=a.dialog._.currentTop;X.setStyles({left:ae.x+'px',top:ae.y+'px'});if(af)do{var ag=af.getPosition();af.move(ag.x,ag.y);}while(af=af._.parentDialog)};C=ab;R.on('resize',ab);ab();if(!(b.mac&&b.webkit))X.focus();if(b.ie6Compat){var ad=function(){ac();arguments.callee.prevScrollHandler.apply(this,arguments);};R.$.setTimeout(function(){ad.prevScrollHandler=window.onscroll||(function(){});window.onscroll=ad;},0);ac();}};function H(){if(!E)return;var Q=a.document.getWindow();E.hide();Q.removeListener('resize',C);if(b.ie6Compat)Q.$.setTimeout(function(){var R=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=R||null;},0);C=null;};function I(){for(var Q in D)D[Q].remove();D={};};var J={},K=function(Q){var R=Q.data.$.ctrlKey||Q.data.$.metaKey,S=Q.data.$.altKey,T=Q.data.$.shiftKey,U=String.fromCharCode(Q.data.$.keyCode),V=J[(R?'CTRL+':'')+(S?'ALT+':'')+(T?'SHIFT+':'')+U];if(!V||!V.length)return;V=V[V.length-1];V.keydown&&V.keydown.call(V.uiElement,V.dialog,V.key);Q.data.preventDefault();},L=function(Q){var R=Q.data.$.ctrlKey||Q.data.$.metaKey,S=Q.data.$.altKey,T=Q.data.$.shiftKey,U=String.fromCharCode(Q.data.$.keyCode),V=J[(R?'CTRL+':'')+(S?'ALT+':'')+(T?'SHIFT+':'')+U];if(!V||!V.length)return;V=V[V.length-1];if(V.keyup){V.keyup.call(V.uiElement,V.dialog,V.key);Q.data.preventDefault();}},M=function(Q,R,S,T,U){var V=J[S]||(J[S]=[]);V.push({uiElement:Q,dialog:R,key:S,keyup:U||Q.accessKeyUp,keydown:T||Q.accessKeyDown});},N=function(Q){for(var R in J){var S=J[R];for(var T=S.length-1;T>=0;T--){if(S[T].dialog==Q||S[T].uiElement==Q)S.splice(T,1);}if(S.length===0)delete J[R];}},O=function(Q,R){if(Q._.accessKeyMap[R])Q.selectPage(Q._.accessKeyMap[R]); +},P=function(Q,R){};(function(){k.dialog={uiElement:function(Q,R,S,T,U,V,W){if(arguments.length<4)return;var X=(T.call?T(R):T)||'div',Y=['<',X,' '],Z=(U&&U.call?U(R):U)||{},aa=(V&&V.call?V(R):V)||{},ab=(W&&W.call?W.call(this,Q,R):W)||'',ac=this.domId=aa.id||e.getNextId()+'_uiElement',ad=this.id=R.id,ae;aa.id=ac;var af={};if(R.type)af['cke_dialog_ui_'+R.type]=1;if(R.className)af[R.className]=1;if(R.disabled)af.cke_disabled=1;var ag=aa['class']&&aa['class'].split?aa['class'].split(' '):[];for(ae=0;ae=0;ae--){if(ai[ae]==='')ai.splice(ae,1);}if(ai.length>0)aa.style=(aa.style?aa.style+'; ':'')+ai.join('; ');for(ae in aa)Y.push(ae+'="'+e.htmlEncode(aa[ae])+'" ');Y.push('>',ab,'');S.push(Y.join(''));(this._||(this._={})).dialog=Q;if(typeof R.isChanged=='boolean')this.isChanged=function(){return R.isChanged;};if(typeof R.isChanged=='function')this.isChanged=R.isChanged;if(typeof R.setValue=='function')this.setValue=e.override(this.setValue,function(al){return function(am){al.call(this,R.setValue.call(this,am));};});if(typeof R.getValue=='function')this.getValue=e.override(this.getValue,function(al){return function(){return R.getValue.call(this,al.call(this));};});a.event.implementOn(this);this.registerEvents(R);if(this.accessKeyUp&&this.accessKeyDown&&R.accessKey)M(this,Q,'CTRL+'+R.accessKey);var ak=this;Q.on('load',function(){var al=ak.getInputElement();if(al){var am=ak.type in {checkbox:1,ratio:1}&&c&&b.version<8?'cke_dialog_ui_focused':'';al.on('focus',function(){Q._.tabBarMode=false;Q._.hasFocus=true;ak.fire('focus');am&&this.addClass(am);});al.on('blur',function(){ak.fire('blur');am&&this.removeClass(am);});}});if(this.keyboardFocusable){this.tabIndex=R.tabIndex||0;this.focusIndex=Q._.focusList.push(this)-1;this.on('focus',function(){Q._.currentFocusIndex=ak.focusIndex;});}e.extend(this,R);},hbox:function(Q,R,S,T,U){if(arguments.length<4)return;this._||(this._={});var V=this._.children=R,W=U&&U.widths||null,X=U&&U.height||null,Y={},Z,aa=function(){var ac=[''];for(Z=0;Z0)ac.push('style="'+ae.join('; ')+'" ');ac.push('>',S[Z],'');}ac.push('');return ac.join('');},ab={role:'presentation'};U&&U.align&&(ab.align=U.align);k.dialog.uiElement.call(this,Q,U||{type:'hbox'},T,'table',Y,ab,aa);},vbox:function(Q,R,S,T,U){if(arguments.length<3)return;this._||(this._={});var V=this._.children=R,W=U&&U.width||null,X=U&&U.heights||null,Y=function(){var Z=['');for(var aa=0;aa');}Z.push('
    0)Z.push('style="',ab.join('; '),'" ');Z.push(' class="cke_dialog_ui_vbox_child">',S[aa],'
    ');return Z.join('');};k.dialog.uiElement.call(this,Q,U||{type:'vbox'},T,'div',null,{role:'presentation'},Y);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(Q,R){this.getInputElement().setValue(Q);!R&&this.fire('change',{value:Q});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var T=this;var Q=T.getInputElement(),R=Q,S;while((R=R.getParent())&&R.$.className.search('cke_dialog_page_contents')==-1){}if(!R)return T;S=R.getAttribute('name');if(T._.dialog._.currentTabId!=S)T._.dialog.selectPage(S);return T;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(Q){var R=/^on([A-Z]\w+)/,S,T=function(V,W,X,Y){W.on('load',function(){V.getInputElement().on(X,Y,V);});};for(var U in Q){if(!(S=U.match(R)))continue;if(this.eventProcessors[U])this.eventProcessors[U].call(this,this._.dialog,Q[U]); +else T(this,this._.dialog,S[1].toLowerCase(),Q[U]);}return this;},eventProcessors:{onLoad:function(Q,R){Q.on('load',R,this);},onShow:function(Q,R){Q.on('show',R,this);},onHide:function(Q,R){Q.on('hide',R,this);}},accessKeyDown:function(Q,R){this.focus();},accessKeyUp:function(Q,R){},disable:function(){var Q=this.getElement(),R=this.getInputElement();R.setAttribute('disabled','true');Q.addClass('cke_disabled');},enable:function(){var Q=this.getElement(),R=this.getInputElement();R.removeAttribute('disabled');Q.removeClass('cke_disabled');},isEnabled:function(){return!this.getElement().hasClass('cke_disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(Q){var R=this;if(arguments.length<1)return R._.children.concat();if(!Q.splice)Q=[Q];if(Q.length<2)return R._.children[Q[0]];else return R._.children[Q[0]]&&R._.children[Q[0]].getChild?R._.children[Q[0]].getChild(Q.slice(1,Q.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var Q={build:function(R,S,T){var U=S.children,V,W=[],X=[];for(var Y=0;Y',T||U.name,'');return V.join('');}};a.style.getStyleText=function(T){var U=T._ST;if(U)return U;U=T.styles;var V=T.attributes&&T.attributes.style||'',W='';if(V.length)V=V.replace(o,';');for(var X in U){var Y=U[X],Z=(X+':'+Y).replace(o,';');if(Y=='inherit')W+=Z;else V+=Z;}if(V.length)V=P(V);V+=W;return T._ST=V; +};function s(T){var U,V;while(T=T.getParent()){if(T.getName()=='body')break;if(T.getAttribute('data-nostyle'))U=T;else if(!V){var W=T.getAttribute('contentEditable');if(W=='false')U=T;else if(W=='true')V=1;}}return U;};function t(T){var ay=this;var U=T.document;if(T.collapsed){var V=J(ay,U);T.insertNode(V);T.moveToPosition(V,2);return;}var W=ay.element,X=ay._.definition,Y,Z=X.ignoreReadonly,aa=Z||X.includeReadonly;if(aa==undefined)aa=U.getCustomData('cke_includeReadonly');var ab=f[W]||(Y=true,f.span);T.enlarge(1,1);T.trim();var ac=T.createBookmark(),ad=ac.startNode,ae=ac.endNode,af=ad,ag;if(!Z){var ah=s(ad),ai=s(ae);if(ah)af=ah.getNextSourceNode(true);if(ai)ae=ai;}if(af.getPosition(ae)==2)af=0;while(af){var aj=false;if(af.equals(ae)){af=null;aj=true;}else{var ak=af.type,al=ak==1?af.getName():null,am=al&&af.getAttribute('contentEditable')=='false',an=al&&af.getAttribute('data-nostyle');if(al&&af.data('cke-bookmark')){af=af.getNextSourceNode(true);continue;}if(!al||ab[al]&&!an&&(!am||aa)&&(af.getPosition(ae)|4|0|8)==4+0+8&&(!X.childRule||X.childRule(af))){var ao=af.getParent();if(ao&&((ao.getDtd()||f.span)[W]||Y)&&(!X.parentRule||X.parentRule(ao))){if(!ag&&(!al||!f.$removeEmpty[al]||(af.getPosition(ae)|4|0|8)==4+0+8)){ag=new d.range(U);ag.setStartBefore(af);}if(ak==3||am||ak==1&&!af.getChildCount()){var ap=af,aq;while((aj=!ap.getNext(q))&&(aq=ap.getParent(),ab[aq.getName()])&&(aq.getPosition(ad)|2|0|8)==2+0+8&&(!X.childRule||X.childRule(aq)))ap=aq;ag.setEndAfter(ap);}}else aj=true;}else aj=true;af=af.getNextSourceNode(an||am);}if(aj&&ag&&!ag.collapsed){var ar=J(ay,U),as=ar.hasAttributes(),at=ag.getCommonAncestor(),au={styles:{},attrs:{},blockedStyles:{},blockedAttrs:{}},av,aw,ax;while(ar&&at){if(at.getName()==W){for(av in X.attributes){if(au.blockedAttrs[av]||!(ax=at.getAttribute(aw)))continue;if(ar.getAttribute(av)==ax)au.attrs[av]=1;else au.blockedAttrs[av]=1;}for(aw in X.styles){if(au.blockedStyles[aw]||!(ax=at.getStyle(aw)))continue;if(ar.getStyle(aw)==ax)au.styles[aw]=1;else au.blockedStyles[aw]=1;}}at=at.getParent();}for(av in au.attrs)ar.removeAttribute(av);for(aw in au.styles)ar.removeStyle(aw);if(as&&!ar.hasAttributes())ar=null;if(ar){ag.extractContents().appendTo(ar);G(ay,ar);ag.insertNode(ar);ar.mergeSiblings();if(!c)ar.$.normalize();}else{ar=new h('span');ag.extractContents().appendTo(ar);ag.insertNode(ar);G(ay,ar);ar.remove(true);}ag=null;}}T.moveToBookmark(ac);T.shrink(2);};function u(T){T.enlarge(1,1);var U=T.createBookmark(),V=U.startNode;if(T.collapsed){var W=new d.elementPath(V.getParent()),X; +for(var Y=0,Z;Y'+V+'';else T.setHtml(V);U.remove();};function B(T){var U=/(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,V=T.getName(),W=C(T.getOuterHtml(),U,function(Y,Z,aa){return Z+''+aa+'
    ';}),X=[];W.replace(/([\s\S]*?)<\/pre>/gi,function(Y,Z){X.push(Z);});return X;};function C(T,U,V){var W='',X='';T=T.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi,function(Y,Z,aa){Z&&(W=Z);aa&&(X=aa);return '';});return W+T.replace(U,V)+X;};function D(T,U){var V;if(T.length>1)V=new d.documentFragment(U.getDocument());for(var W=0;W');X=X.replace(/[ \t]{2,}/g,function(Z){return e.repeat(' ',Z.length-1)+' ';});if(V){var Y=U.clone();Y.setHtml(X);V.append(Y);}else U.setHtml(X);}return V||U;};function E(T,U){var V=T.getBogus();V&&V.remove();var W=T.getHtml();W=C(W,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');W=W.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');W=W.replace(/([ \t\n\r]+| )/g,' ');W=W.replace(/]*>/gi,'\n');if(c){var X=T.getDocument().createElement('div');X.append(U);U.$.outerHTML='
    '+W+'
    ';U.copyAttributes(X.getFirst());U=X.getFirst().remove();}else U.setHtml(W);return U;};function F(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T)[U.getName()],Z=e.isEmpty(W)&&e.isEmpty(X);for(var aa in W){if((aa=='class'||T._.definition.fullMatch)&&U.getAttribute(aa)!=O(aa,W[aa]))continue;Z=U.hasAttribute(aa);U.removeAttribute(aa);}for(var ab in X){if(T._.definition.fullMatch&&U.getStyle(ab)!=O(ab,X[ab],true))continue;Z=Z||!!U.getStyle(ab);U.removeStyle(ab);}H(U,Y,m[U.getName()]);if(Z)!f.$block[U.getName()]||T._.enterMode==2&&!U.hasAttributes()?I(U):U.renameNode(T._.enterMode==1?'p':'div');};function G(T,U){var V=T._.definition,W=V.attributes,X=V.styles,Y=N(T),Z=U.getElementsByTag(T.element);for(var aa=Z.count();--aa>=0;)F(T,Z.getItem(aa));for(var ab in Y){if(ab!=T.element){Z=U.getElementsByTag(ab);for(aa=Z.count()-1;aa>=0;aa--){var ac=Z.getItem(aa);H(ac,Y[ab]);}}}};function H(T,U,V){var W=U&&U.attributes; +if(W)for(var X=0;X0)H+=(F.$.offsetWidth||0)-(F.$.clientWidth||0)+3;H+=4;F.setStyle('width',H+'px');v.element.addClass('cke_frameLoaded');var I=v.element.$.scrollHeight;if(c&&b.quirks&&I>0)I+=(F.$.offsetHeight||0)-(F.$.clientHeight||0)+3;F.setStyle('height',I+'px');u._.currentBlock.element.setStyle('display','none').removeStyle('display');}else F.removeStyle('height');if(A)B-=w.$.offsetWidth;w.setStyle('left',B+'px');var J=u.element,K=J.getWindow(),L=w.$.getBoundingClientRect(),M=K.getViewPaneSize(),N=L.width||L.right-L.left,O=L.height||L.bottom-L.top,P=A?L.right:M.width-L.left,Q=A?M.width-L.right:L.left;if(A){if(PN)B+=N;else if(M.width>N)B-=L.left;else B=B-L.right+M.width;}else if(PN)B-=N;else if(M.width>N)B=B-L.right+M.width;else B-=L.left;var R=M.height-L.top,S=L.top;if(RO)C-=O;else if(M.height>O)C=C-L.bottom+M.height;else C-=L.top;if(c){var T=new h(w.$.offsetParent),U=T;if(U.getName()=='html')U=U.getDocument().getBody();if(U.getComputedStyle('direction')=='rtl')if(b.ie8Compat)B-=w.getDocument().getDocumentElement().$.scrollLeft*2;else B-=T.$.scrollWidth-T.$.clientWidth;}var V=w.getFirst(),W;if(W=V.getCustomData('activePanel'))W.onHide&&W.onHide.call(this,1);V.setCustomData('activePanel',this);w.setStyles({top:C+'px',left:B+'px'});w.setOpacity(1);},this);u.isLoaded?E():u.onLoad=E;e.setTimeout(function(){x.$.contentWindow.focus();this.allowBlur(true);},0,this);},b.air?200:0,this);this.visible=1;if(this.onShow)this.onShow.call(this);n=0;},hide:function(p){var r=this;if(r.visible&&(!r.onHide||r.onHide.call(r)!==true)){r.hideChild();b.gecko&&r._.iframe.getFrameDocument().$.activeElement.blur();r.element.setStyle('display','none');r.visible=0;r.element.getFirst().removeCustomData('activePanel');var q=p!==false&&r._.returnFocus;if(q){if(b.webkit&&q.type)q.getWindow().$.focus();q.focus();}}},allowBlur:function(p){var q=this._.panel;if(p!=undefined)q.allowBlur=p;return q.allowBlur;},showAsChild:function(p,q,r,s,t,u){if(this._.activeChild==p&&p._.panel._.offsetParentId==r.getId())return;this.hideChild();p.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide(); +},0,this);},this);this._.activeChild=p;this._.focused=false;p.showBlock(q,r,s,t,u);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){p.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var p=this._.activeChild;if(p){delete p.onHide;delete p._.returnFocus;delete this._.activeChild;p.hide();}}}});a.on('instanceDestroyed',function(){var p=e.isEmpty(a.instances);for(var q in m){var r=m[q];if(p)r.destroy();else r.element.hide();}p&&(m={});});})();j.add('menu',{beforeInit:function(m){var n=m.config.menu_groups.split(','),o=m._.menuGroups={},p=m._.menuItems={};for(var q=0;q'],B=r.length,C=B&&r[0].group;for(var D=0;D
    ');C=E.group;}E.render(this,D,A);}A.push('
    ');u.setHtml(A.join(''));k.fire('ready',this);if(this.parent)this.parent._.panel.showAsChild(t,this.id,n,o,p,q);else t.showBlock(this.id,n,o,p,q);s.fire('menuShow',[t]);},addListener:function(n){this._.listeners.push(n);},hide:function(n){var o=this;o._.onHide&&o._.onHide();o._.panel&&o._.panel.hide(n);}}});function m(n){n.sort(function(o,p){if(o.groupp.group)return 1;return o.orderp.order?1:0;});};a.menuItem=e.createClass({$:function(n,o,p){var q=this;e.extend(q,p,{order:0,className:'cke_button_'+o});q.group=n._.menuGroups[q.group];q.editor=n;q.name=o;},proto:{render:function(n,o,p){var w=this;var q=n.id+String(o),r=typeof w.state=='undefined'?2:w.state,s=' cke_'+(r==1?'on':r==0?'disabled':'off'),t=w.label;if(w.className)s+=' '+w.className; +var u=w.getItems;p.push(''+''+'');if(u)p.push('','&#',w.editor.lang.dir=='rtl'?'9668':'9658',';','');p.push(t,'');}}});})();i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='
    ';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;n.getMode().loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){if(n.mode){o();n.removeListener('mode',arguments.callee);}});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(n.getMode().getData(),null,1);m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=n.getMode().getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)n.getMode().loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);},0);});n.on('destroy',function(){var o=this;if(o.mode)o._.modes[o.mode].unload(o.getThemeSpace('contents'));});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n; +(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){this.fire('beforeSetMode',{newMode:n});var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this._.previousMode=this.mode;this.fire('beforeModeUnload');var r=this.getMode();o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=this.getMode(n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.getMode=function(n){return this._.modes&&this._.modes[n||this.mode];};a.editor.prototype.focus=function(){this.forceNextSelectionCheck();var n=this.getMode();if(n)n.focus();};})();i.startupMode='wysiwyg';i.editingBlock=true;(function(){function m(){var C=this;try{var z=C.getSelection();if(!z||!z.document.getWindow().$)return;var A=z.getStartElement(),B=new d.elementPath(A);if(!B.compare(C._.selectionPreviousPath)){C._.selectionPreviousPath=B;C.fire('selectionChange',{selection:z,path:B,element:A});}}catch(D){}};var n,o;function p(){o=true;if(n)return;q.call(this);n=e.setTimeout(q,200,this);};function q(){n=null;if(o){e.setTimeout(m,0,this);o=false;}};function r(z){function A(E){return E&&E.type==1&&E.getName() in f.$removeEmpty;};function B(E){var F=z.document.getBody();return!E.is('body')&&F.getChildCount()==1;};var C=z.startContainer,D=z.startOffset;if(C.type==3)return false;return!e.trim(C.getHtml())?A(C)||B(C):A(C.getChild(D-1))||A(C.getChild(D));};var s={modes:{wysiwyg:1,source:1},readOnly:c||b.webkit,exec:function(z){switch(z.mode){case 'wysiwyg':z.document.$.execCommand('SelectAll',false,null);z.forceNextSelectionCheck();z.selectionChange();break;case 'source':var A=z.textarea.$;if(c)A.createTextRange().execCommand('SelectAll');else{A.selectionStart=0;A.selectionEnd=A.value.length;}A.focus();}},canUndo:false};function t(z){w(z);var A=z.createText('​');z.setCustomData('cke-fillingChar',A);return A;};function u(z){return z&&z.getCustomData('cke-fillingChar');};function v(z){var A=z&&u(z);if(A)if(A.getCustomData('ready'))w(z);else A.setCustomData('ready',1);};function w(z){var A=z&&z.removeCustomData('cke-fillingChar');if(A){var B,C=z.getSelection().getNative(),D=C&&C.type!='None'&&C.getRangeAt(0);if(A.getLength()>1&&D&&D.intersectsNode(A.$)){B=[C.anchorOffset,C.focusOffset];var E=C.anchorNode==A.$&&C.anchorOffset>0,F=C.focusNode==A.$&&C.focusOffset>0;E&&B[0]--;F&&B[1]--; +x(C)&&B.unshift(B.pop());}A.setText(A.getText().replace(/\u200B/g,''));if(B){var G=C.getRangeAt(0);G.setStart(G.startContainer,B[0]);G.setEnd(G.startContainer,B[1]);C.removeAllRanges();C.addRange(G);}}};function x(z){if(!z.isCollapsed){var A=z.getRangeAt(0);A.setStart(z.anchorNode,z.anchorOffset);A.setEnd(z.focusNode,z.focusOffset);return A.collapsed;}};j.add('selection',{init:function(z){if(b.webkit){z.on('selectionChange',function(){v(z.document);});z.on('beforeSetMode',function(){w(z.document);});var A,B;function C(){var E=z.document,F=u(E);if(F){var G=E.$.defaultView.getSelection();if(G.type=='Caret'&&G.anchorNode==F.$)B=1;A=F.getText();F.setText(A.replace(/\u200B/g,''));}};function D(){var E=z.document,F=u(E);if(F){F.setText(A);if(B){E.$.defaultView.getSelection().setPosition(F.$,F.getLength());B=0;}}};z.on('beforeUndoImage',C);z.on('afterUndoImage',D);z.on('beforeGetData',C,null,null,0);z.on('getData',D);}z.on('contentDom',function(){var E=z.document,F=E.getBody(),G=E.getDocumentElement();if(c){var H,I,J=1;F.on('focusin',function(O){if(O.data.$.srcElement.nodeName!='BODY')return;var P=E.getCustomData('cke_locked_selection');if(P){P.unlock(1);P.lock();}else if(H&&J){try{H.select();}catch(Q){}H=null;}});F.on('focus',function(){I=1;N();});F.on('beforedeactivate',function(O){if(O.data.$.toElement)return;I=0;J=1;});c&&z.on('blur',function(){try{E.$.selection.empty();}catch(O){}});G.on('mousedown',function(){J=0;});G.on('mouseup',function(){J=1;});var K;F.on('mousedown',function(O){if(O.data.$.button==2){var P=z.document.$.selection;if(P.type=='None')K=z.window.getScrollPosition();}M();});F.on('mouseup',function(O){if(O.data.$.button==2&&K){z.document.$.documentElement.scrollLeft=K.x;z.document.$.documentElement.scrollTop=K.y;}K=null;I=1;setTimeout(function(){N(true);},0);});F.on('keydown',M);F.on('keyup',function(){I=1;N();});if((b.ie7Compat||b.ie6Compat)&&E.$.compatMode!='BackCompat'){function L(O,P,Q){try{O.moveToPoint(P,Q);}catch(R){}};G.on('mousedown',function(O){function P(R){R=R.data.$;if(Q){var S=F.$.createTextRange();L(S,R.x,R.y);Q.setEndPoint(Q.compareEndPoints('StartToStart',S)<0?'EndToEnd':'StartToStart',S);Q.select();}};O=O.data.$;if(O.yF.$.offsetTop+F.$.clientHeight&&O.x0)L=M-1;else if(N<0)K=M+1;else if(b.ie9Compat&&H.tagName=='BR'){var Q=F.defaultView.getSelection();return{container:Q[D?'anchorNode':'focusNode'],offset:Q[D?'anchorOffset':'focusOffset']};}else return{container:E,offset:A(H)};}if(M==-1||M==G.length-1&&N<0){J.moveToElementText(E);J.setEndPoint('StartToStart',C);O=J.text.replace(/(\r\n|\r)/g,'\n').length;G=E.childNodes;if(!O){H=G[G.length-1];if(H.nodeType!=3)return{container:E,offset:G.length};else return{container:H,offset:H.nodeValue.length};}var R=G.length;while(O>0&&R>0){I=G[--R];if(I.nodeType==3){P=I;O-=I.nodeValue.length;}}return{container:P,offset:-O};}else{J.collapse(N>0?true:false);J.setEndPoint(N>0?'StartToStart':'EndToStart',C);O=J.text.replace(/(\r\n|\r)/g,'\n').length;if(!O)return{container:E,offset:A(H)+(N>0?0:1)};while(O>0)try{I=H[N>0?'previousSibling':'nextSibling'];if(I.nodeType==3){O-=I.nodeValue.length;P=I;}H=I;}catch(S){return{container:E,offset:A(H)};}return{container:P,offset:N>0?-O:P.nodeValue.length+O};}};return function(){var M=this;var C=M.getNative(),D=C&&C.createRange(),E=M.getType(),F;if(!C)return[];if(E==2){F=new d.range(M.document);var G=B(D,true);F.setStart(new d.node(G.container),G.offset);G=B(D);F.setEnd(new d.node(G.container),G.offset);if(F.endContainer.getPosition(F.startContainer)&4&&F.endOffset<=F.startContainer.getIndex())F.collapse();return[F];}else if(E==3){var H=[];for(var I=0;I=H.getLength())L.setStartAfter(H);else L.setStartBefore(H);if(I&&I.type==3)if(!K)L.setEndBefore(I);else L.setEndAfter(I);var M=new d.walker(L);M.evaluator=function(N){if(N.type==1&&N.isReadOnly()){var O=E.clone();E.setEndBefore(N);if(E.collapsed)C.splice(D--,1);if(!(N.getPosition(L.endContainer)&16)){O.setStartAfter(N);if(!O.collapsed)C.splice(D+1,0,O);}return true;}return false;};M.next();}}return B.ranges;};})(),getStartElement:function(){var G=this;var z=G._.cache;if(z.startElement!==undefined)return z.startElement;var A,B=G.getNative();switch(G.getType()){case 3:return G.getSelectedElement();case 2:var C=G.getRanges()[0];if(C){if(!C.collapsed){C.optimize();while(1){var D=C.startContainer,E=C.startOffset;if(E==(D.getChildCount?D.getChildCount():D.getLength())&&!D.isBlockBoundary())C.setStartAfter(D);else break;}A=C.startContainer;if(A.type!=1)return A.getParent();A=A.getChild(C.startOffset);if(!A||A.type!=1)A=C.startContainer;else{var F=A.getFirst();while(F&&F.type==1){A=F;F=F.getFirst();}}}else{A=C.startContainer;if(A.type!=1)A=A.getParent();}A=A.$;}}return z.startElement=A?new h(A):null;},getSelectedElement:function(){var z=this._.cache;if(z.selectedElement!==undefined)return z.selectedElement;var A=this,B=e.tryThese(function(){return A.getNative().createRange().item(0);},function(){var C,D,E=A.getRanges()[0],F=E.getCommonAncestor(1,1),G={table:1,ul:1,ol:1,dl:1};for(var H in G){if(C=F.getAscendant(H,1))break;}if(C){var I=new d.range(this.document);I.setStartAt(C,1);I.setEnd(E.startContainer,E.startOffset);var J=e.extend(G,f.$listItem,f.$tableContent),K=new d.walker(I),L=function(M,N){return function(O,P){if(O.type==3&&(!e.trim(O.getText())||O.getParent().data('cke-bookmark')))return true;var Q;if(O.type==1){Q=O.getName();if(Q=='br'&&N&&O.equals(O.getParent().getBogus()))return true;if(P&&Q in J||Q in f.$removeEmpty)return true;}M.halted=1;return false;};};K.guard=L(K);if(K.checkBackward()&&!K.halted){K=new d.walker(I);I.setStart(E.endContainer,E.endOffset);I.setEndAt(C,2);K.guard=L(K,1);if(K.checkForward()&&!K.halted)D=C.$; +}}if(!D)throw 0;return D;},function(){var C=A.getRanges()[0],D,E;for(var F=2;F&&!((D=C.getEnclosedNode())&&D.type==1&&y[D.getName()]&&(E=D));F--)C.shrink(1);return E.$;});return z.selectedElement=B?new h(B):null;},getSelectedText:function(){var z=this._.cache;if(z.selectedText!==undefined)return z.selectedText;var A='',B=this.getNative();if(this.getType()==2)A=c?B.createRange().text:B.toString();return z.selectedText=A;},lock:function(){var z=this;z.getRanges();z.getStartElement();z.getSelectedElement();z.getSelectedText();z._.cache.nativeSel={};z.isLocked=1;z.document.setCustomData('cke_locked_selection',z);},unlock:function(z){var E=this;var A=E.document,B=A.getCustomData('cke_locked_selection');if(B){A.setCustomData('cke_locked_selection',null);if(z){var C=B.getSelectedElement(),D=!C&&B.getRanges();E.isLocked=0;E.reset();if(C)E.selectElement(C);else E.selectRanges(D);}}if(!B||!z){E.isLocked=0;E.reset();}},reset:function(){this._.cache={};},selectElement:function(z){var B=this;if(B.isLocked){var A=new d.range(B.document);A.setStartBefore(z);A.setEndAfter(z);B._.cache.selectedElement=z;B._.cache.startElement=z;B._.cache.ranges=new d.rangeList(A);B._.cache.type=3;return;}A=new d.range(z.getDocument());A.setStartBefore(z);A.setEndAfter(z);A.select();B.document.fire('selectionchange');B.reset();},selectRanges:function(z){var N=this;if(N.isLocked){N._.cache.selectedElement=null;N._.cache.startElement=z[0]&&z[0].getTouchedStartNode();N._.cache.ranges=new d.rangeList(z);N._.cache.type=2;return;}if(c){if(z.length>1){var A=z[z.length-1];z[0].setEnd(A.endContainer,A.endOffset);z.length=1;}if(z[0])z[0].select();N.reset();}else{var B=N.getNative();if(!B)return;if(z.length){B.removeAllRanges();b.webkit&&w(N.document);}for(var C=0;C=0){I.collapse(1);J.setEnd(I.endContainer.$,I.endOffset);}else throw O;}B.addRange(J);}N.document.fire('selectionchange');N.reset();}},createBookmarks:function(z){return this.getRanges().createBookmarks(z);},createBookmarks2:function(z){return this.getRanges().createBookmarks2(z);},selectBookmarks:function(z){var A=[];for(var B=0;B','','',this.label,'','=10900&&!o.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',p,'_label" aria-describedby="',p,'_text" aria-haspopup="true"');if(b.opera||b.gecko&&b.mac)n.push(' onkeypress="return false;"');if(b.gecko)n.push(' onblur="this.style.cssText = this.style.cssText;"');n.push(' onkeydown="CKEDITOR.tools.callFunction( ',t,', event, this );" onfocus="return CKEDITOR.tools.callFunction(',u,', event);" '+(c?'onclick="return false;" onmouseup':'onclick')+'="CKEDITOR.tools.callFunction(',q,', this); return false;">'+this.label+''+''+''+(b.hc?'▼':b.air?' ':'')+''+''+''+'');if(this.onRender)this.onRender();return r;},createPanel:function(m){if(this._.panel)return;var n=this._.panelDefinition,o=this._.panelDefinition.block,p=n.parent||a.document.getBody(),q=new k.floatPanel(m,p,n),r=q.addListBlock(this.id,o),s=this;q.onShow=function(){if(s.className)this.element.getFirst().addClass(s.className+'_panel');s.setState(1);r.focus(!s.multiSelect&&s.getValue());s._.on=1;if(s.onOpen)s.onOpen();};q.onHide=function(t){if(s.className)this.element.getFirst().removeClass(s.className+'_panel');s.setState(s.modes&&s.modes[m.mode]?2:0);s._.on=0;if(!t&&s.onClose)s.onClose();};q.onEscape=function(){q.hide();};r.onClick=function(t,u){s.document.getWindow().focus();if(s.onClick)s.onClick.call(s,t,u);if(u)s.setValue(t,s._.items[t]); +else s.setValue('');q.hide(false);};this._.panel=q;this._.list=r;q.getBlock(this.id).onHide=function(){s._.on=0;s.setState(2);};if(this.init)this.init();},setValue:function(m,n){var p=this;p._.value=m;var o=p.document.getById('cke_'+p.id+'_text');if(o){if(!(m||n)){n=p.label;o.addClass('cke_inline_label');}else o.removeClass('cke_inline_label');o.setHtml(typeof n!='undefined'?n:m);}},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(m){this._.list.mark(m);},hideItem:function(m){this._.list.hideItem(m);},hideGroup:function(m){this._.list.hideGroup(m);},showAll:function(){this._.list.showAll();},add:function(m,n,o){this._.items[m]=o||m;this._.list.add(m,n,o);},startGroup:function(m){this._.list.startGroup(m);},commit:function(){var m=this;if(!m._.committed){m._.list.commit();m._.committed=1;k.fire('ready',m);}m._.committed=1;},setState:function(m){var n=this;if(n._.state==m)return;n.document.getById('cke_'+n.id).setState(m);n._.state=m;}}});k.prototype.addRichCombo=function(m,n){this.add(m,'richcombo',n);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var o=this;o.base();o.indentationChars='\t';o.selfClosingEnd=' />';o.lineBreakChars='\n';o.forceSimpleAmpersand=0;o.sortAttributes=1;o._.indent=0;o._.indentation='';o._.inPre=0;o._.rules={};var m=f;for(var n in e.extend({},m.$nonBodyContent,m.$block,m.$listItem,m.$tableContent))o.setRules(n,{indent:1,breakBeforeOpen:1,breakAfterOpen:1,breakBeforeClose:!m[n]['#'],breakAfterClose:1});o.setRules('br',{breakAfterOpen:1});o.setRules('title',{indent:0,breakAfterOpen:0});o.setRules('style',{indent:0,breakBeforeClose:1});o.setRules('pre',{indent:0});},proto:{openTag:function(m,n){var p=this;var o=p._.rules[m];if(p._.indent)p.indentation();else if(o&&o.breakBeforeOpen){p.lineBreak();p.indentation();}p._.output.push('<',m);},openTagClose:function(m,n){var p=this;var o=p._.rules[m];if(n)p._.output.push(p.selfClosingEnd);else{p._.output.push('>');if(o&&o.indent)p._.indentation+=p.indentationChars;}if(o&&o.breakAfterOpen)p.lineBreak();m=='pre'&&(p._.inPre=1);},attribute:function(m,n){if(typeof n=='string'){this.forceSimpleAmpersand&&(n=n.replace(/&/g,'&'));n=e.htmlEncodeAttr(n);}this._.output.push(' ',m,'="',n,'"');},closeTag:function(m){var o=this;var n=o._.rules[m];if(n&&n.indent)o._.indentation=o._.indentation.substr(o.indentationChars.length);if(o._.indent)o.indentation();else if(n&&n.breakBeforeClose){o.lineBreak();o.indentation(); +}o._.output.push('');m=='pre'&&(o._.inPre=0);if(n&&n.breakAfterClose)o.lineBreak();},text:function(m){var n=this;if(n._.indent){n.indentation();!n._.inPre&&(m=e.ltrim(m));}n._.output.push(m);},comment:function(m){if(this._.indent)this.indentation();this._.output.push('');},lineBreak:function(){var m=this;if(!m._.inPre&&m._.output.length>0)m._.output.push(m.lineBreakChars);m._.indent=1;},indentation:function(){var m=this;if(!m._.inPre)m._.output.push(m._.indentation);m._.indent=0;},setRules:function(m,n){var o=this._.rules[m];if(o)e.extend(o,n,true);else this._.rules[m]=n;}}});j.add('menubutton',{requires:['button','menu'],beforeInit:function(m){m.ui.addHandler('menubutton',k.menuButton.handler);}});a.UI_MENUBUTTON='menubutton';(function(){var m=function(n){var o=this._;if(o.state===0)return;o.previousState=o.state;var p=o.menu;if(!p){p=o.menu=new a.menu(n,{panel:{className:n.skinClass+' cke_contextmenu',attributes:{'aria-label':n.lang.common.options}}});p.onHide=e.bind(function(){this.setState(this.modes&&this.modes[n.mode]?o.previousState:0);},this);if(this.onMenu)p.addListener(this.onMenu);}if(o.on){p.hide();return;}this.setState(1);p.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(n){var o=n.panel;delete n.panel;this.base(n);this.hasArrow=true;this.click=m;},statics:{handler:{create:function(n){return new k.menuButton(n);}}}});})();j.add('dialogui');(function(){var m=function(u){var x=this;x._||(x._={});x._['default']=x._.initValue=u['default']||'';x._.required=u.required||false;var v=[x._];for(var w=1;w',v.label,'','');else{var D={type:'hbox',widths:v.widths,padding:0,children:[{type:'html',html:'
    ');return o;},getHolderElement:function(){var m=this._.holder;if(!m){if(this.forceIFrame||this.css.length){var n=this.document.getById(this.id+'_frame'),o=n.getParent(),p=o.getAttribute('dir'),q=o.getParent().getAttribute('class'),r=o.getParent().getAttribute('lang'),s=n.getFrameDocument();b.iOS&&o.setStyles({overflow:'scroll','-webkit-overflow-scrolling':'touch'});var t=e.addFunction(e.bind(function(w){this.isLoaded=true;if(this.onLoad)this.onLoad();},this)),u=''+''+''+e.buildStyleHtml(this.css)+''+''+'';s.write(u);var v=s.getWindow();v.$.CKEDITOR=a;s.on('key'+(b.opera?'press':'down'),function(w){var z=this;var x=w.data.getKeystroke(),y=z.document.getById(z.id).getAttribute('dir');if(z._.onKeyDown&&z._.onKeyDown(x)===false){w.data.preventDefault();return;}if(x==27||x==(y=='rtl'?39:37))if(z.onEscape&&z.onEscape(x)===false)w.data.preventDefault();},this);m=s.getBody();m.unselectable();b.air&&e.callFunction(t);}else m=this.document.getById(this.id);this._.holder=m;}return m;},addBlock:function(m,n){var o=this;n=o._.blocks[m]=n instanceof k.panel.block?n:new k.panel.block(o.getHolderElement(),n);if(!o._.currentBlock)o.showBlock(m);return n;},getBlock:function(m){return this._.blocks[m];},showBlock:function(m){var r=this;var n=r._.blocks,o=n[m],p=r._.currentBlock,q=!r.forceIFrame||c?r._.holder:r.document.getById(r.id+'_frame'); +if(p){q.removeAttributes(p.attributes);p.hide();}r._.currentBlock=o;q.setAttributes(o.attributes);a.fire('ariaWidget',q);o._.focusIndex=-1;r._.onKeyDown=o.onKeyDown&&e.bind(o.onKeyDown,o);o.show();return o;},destroy:function(){this.element&&this.element.remove();}};k.panel.block=e.createClass({$:function(m,n){var o=this;o.element=m.append(m.getDocument().createElement('div',{attributes:{tabIndex:-1,'class':'cke_panel_block',role:'presentation'},styles:{display:'none'}}));if(n)e.extend(o,n);if(!o.attributes.title)o.attributes.title=o.attributes['aria-label'];o.keys={};o._.focusIndex=-1;o.element.disableContextMenu();},_:{markItem:function(m){var p=this;if(m==-1)return;var n=p.element.getElementsByTag('a'),o=n.getItem(p._.focusIndex=m);if(b.webkit||b.opera)o.getDocument().getWindow().focus();o.focus();p.onMark&&p.onMark(o);}},proto:{show:function(){this.element.setStyle('display','');},hide:function(){var m=this;if(!m.onHide||m.onHide.call(m)!==true)m.element.setStyle('display','none');},onKeyDown:function(m){var r=this;var n=r.keys[m];switch(n){case 'next':var o=r._.focusIndex,p=r.element.getElementsByTag('a'),q;while(q=p.getItem(++o)){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'prev':o=r._.focusIndex;p=r.element.getElementsByTag('a');while(o>0&&(q=p.getItem(--o))){if(q.getAttribute('_cke_focus')&&q.$.offsetWidth){r._.focusIndex=o;q.focus();break;}}return false;case 'click':case 'mouseup':o=r._.focusIndex;q=o>=0&&r.element.getElementsByTag('a').getItem(o);if(q)q.$[n]?q.$[n]():q.$['on'+n]();return false;}return true;}}});j.add('listblock',{requires:['panel'],onLoad:function(){k.panel.prototype.addListBlock=function(m,n){return this.addBlock(m,new k.listBlock(this.getHolderElement(),n));};k.listBlock=e.createClass({base:k.panel.block,$:function(m,n){var q=this;n=n||{};var o=n.attributes||(n.attributes={});(q.multiSelect=!!n.multiSelect)&&(o['aria-multiselectable']=true);!o.role&&(o.role='listbox');q.base.apply(q,arguments);var p=q.keys;p[40]='next';p[9]='next';p[38]='prev';p[2228224+9]='prev';p[32]=c?'mouseup':'click';c&&(p[13]='mouseup');q._.pendingHtml=[];q._.items={};q._.groups={};},_:{close:function(){if(this._.started){this._.pendingHtml.push('');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=e.addFunction(function(m){var o=this;var n=true;if(o.multiSelect)n=o.toggle(m);else o.mark(m);if(o.onClick)o.onClick(m,n);},this);return this._.click;}},proto:{add:function(m,n,o){var r=this; +var p=r._.pendingHtml,q=e.getNextId();if(!r._.started){p.push('
    '+'',j=a.config.wsc_customLoaderScript||g+'//loader.webspellchecker.net/sproxy_fck/sproxy.php'+'?plugin=fck2'+'&customerid='+a.config.wsc_customerId+'&cmd=script&doc=wsc&schema=22';if(a.config.wsc_customLoaderScript)h+='

    '+a.lang.spellCheck.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+'

    ';function k(m,n){var o=0;return function(){if(typeof window.doSpell=='function'){if(typeof f!='undefined')window.clearInterval(f);l(m);}else if(o++==180)window._cancelOnError(n);};};window._cancelOnError=function(m){if(typeof window.WSC_Error=='undefined'){CKEDITOR.document.getById(c).setStyle('display','none');var n=CKEDITOR.document.getById(e);n.setStyle('display','block');n.setHtml(m||a.lang.spellCheck.notAvailable);}};function l(m){var n=new window._SP_FCK_LangCompare(),o=CKEDITOR.getUrl(a.plugins.wsc.path+'dialogs/'),p=o+'tmpFrameset.html';window.gFCKPluginName='wsc';n.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:d,lang:a.config.wsc_lang||n.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||n.getSPLangCode(a.langCode),winType:c,onCancel:function(){m.hide();},onFinish:function(q){a.focus();m.getParentEditor().setData(q.value);m.hide();},staticFrame:p,framesetPath:p,iframePath:o+'ciframe.html',schemaURI:o+'wsc.css',userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(','),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(e).setStyle('display','none');CKEDITOR.document.getById(c).setStyle('display','block');};return{title:a.config.wsc_dialogTitle||a.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var m=this.getContentElement('general','content').getElement();m.setHtml(i);m.getChild(2).setStyle('height',this._.contentSize.height+'px'); -if(typeof window.doSpell!='function')CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));var n=a.getData();CKEDITOR.document.getById(d).setValue(n);f=window.setInterval(k(this,h),250);},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false;},contents:[{id:'general',label:a.config.wsc_dialogTitle||a.lang.spellCheck.title,padding:0,elements:[{type:'html',id:'content',html:''}]}]};});CKEDITOR.dialog.on('resize',function(a){var b=a.data,c=b.dialog;if(c._.name=='checkspell'){var d=c.getContentElement('general','content').getElement(),e=d&&d.getChild(2);e&&e.setSize('height',b.height);e&&e.setSize('width',b.width);}}); +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.dialog.add('checkspell',function(a){var b=CKEDITOR.tools.getNextNumber(),c='cke_frame_'+b,d='cke_data_'+b,e='cke_error_'+b,f,g=document.location.protocol||'http:',h=a.lang.spellCheck.notAvailable,i='
    '+'',j=a.config.wsc_customLoaderScript||g+'//loader.webspellchecker.net/sproxy_fck/sproxy.php'+'?plugin=fck2'+'&customerid='+a.config.wsc_customerId+'&cmd=script&doc=wsc&schema=22';if(a.config.wsc_customLoaderScript)h+='

    '+a.lang.spellCheck.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+'

    ';function k(m,n){var o=0;return function(){if(typeof window.doSpell=='function'){if(typeof f!='undefined')window.clearInterval(f);l(m);}else if(o++==180)window._cancelOnError(n);};};window._cancelOnError=function(m){if(typeof window.WSC_Error=='undefined'){CKEDITOR.document.getById(c).setStyle('display','none');var n=CKEDITOR.document.getById(e);n.setStyle('display','block');n.setHtml(m||a.lang.spellCheck.notAvailable);}};function l(m){var n=new window._SP_FCK_LangCompare(),o=CKEDITOR.getUrl(a.plugins.wsc.path+'dialogs/'),p=o+'tmpFrameset.html';window.gFCKPluginName='wsc';n.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:d,lang:a.config.wsc_lang||n.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||n.getSPLangCode(a.langCode),winType:c,onCancel:function(){m.hide();},onFinish:function(q){a.focus();m.getParentEditor().setData(q.value);m.hide();},staticFrame:p,framesetPath:p,iframePath:o+'ciframe.html',schemaURI:o+'wsc.css',userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(','),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(e).setStyle('display','none');CKEDITOR.document.getById(c).setStyle('display','block');};return{title:a.config.wsc_dialogTitle||a.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var m=this.getContentElement('general','content').getElement();m.setHtml(i);m.getChild(2).setStyle('height',this._.contentSize.height+'px'); +if(typeof window.doSpell!='function')CKEDITOR.document.getHead().append(CKEDITOR.document.createElement('script',{attributes:{type:'text/javascript',src:j}}));var n=a.getData();CKEDITOR.document.getById(d).setValue(n);f=window.setInterval(k(this,h),250);},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false;},contents:[{id:'general',label:a.config.wsc_dialogTitle||a.lang.spellCheck.title,padding:0,elements:[{type:'html',id:'content',html:''}]}]};});CKEDITOR.dialog.on('resize',function(a){var b=a.data,c=b.dialog;if(c._.name=='checkspell'){var d=c.getContentElement('general','content').getElement(),e=d&&d.getChild(2);e&&e.setSize('height',b.height);e&&e.setSize('width',b.width);}}); diff --git a/htdocs/includes/ckeditor/plugins/xml/plugin.js b/htdocs/includes/ckeditor/plugins/xml/plugin.js index bad2b0a0d11..8f0f36b580a 100644 --- a/htdocs/includes/ckeditor/plugins/xml/plugin.js +++ b/htdocs/includes/ckeditor/plugins/xml/plugin.js @@ -1,6 +1,6 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -(function(){CKEDITOR.plugins.add('xml',{});CKEDITOR.xml=function(a){var b=null;if(typeof a=='object')b=a;else{var c=(a||'').replace(/ /g,'\xa0');if(window.DOMParser)b=new DOMParser().parseFromString(c,'text/xml');else if(window.ActiveXObject){try{b=new ActiveXObject('MSXML2.DOMDocument');}catch(d){try{b=new ActiveXObject('Microsoft.XmlDom');}catch(d){}}if(b){b.async=false;b.resolveExternals=false;b.validateOnParse=false;b.loadXML(c);}}}this.baseXml=b;};CKEDITOR.xml.prototype={selectSingleNode:function(a,b){var c=this.baseXml;if(b||(b=c))if(CKEDITOR.env.ie||b.selectSingleNode)return b.selectSingleNode(a);else if(c.evaluate){var d=c.evaluate(a,b,null,9,null);return d&&d.singleNodeValue||null;}return null;},selectNodes:function(a,b){var c=this.baseXml,d=[];if(b||(b=c))if(CKEDITOR.env.ie||b.selectNodes)return b.selectNodes(a);else if(c.evaluate){var e=c.evaluate(a,b,null,5,null);if(e){var f;while(f=e.iterateNext())d.push(f);}}return d;},getInnerXml:function(a,b){var c=this.selectSingleNode(a,b),d=[];if(c){c=c.firstChild;while(c){if(c.xml)d.push(c.xml);else if(window.XMLSerializer)d.push(new XMLSerializer().serializeToString(c));c=c.nextSibling;}}return d.length?d.join(''):null;}};})(); +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function(){CKEDITOR.plugins.add('xml',{});CKEDITOR.xml=function(a){var b=null;if(typeof a=='object')b=a;else{var c=(a||'').replace(/ /g,'\xa0');if(window.DOMParser)b=new DOMParser().parseFromString(c,'text/xml');else if(window.ActiveXObject){try{b=new ActiveXObject('MSXML2.DOMDocument');}catch(d){try{b=new ActiveXObject('Microsoft.XmlDom');}catch(d){}}if(b){b.async=false;b.resolveExternals=false;b.validateOnParse=false;b.loadXML(c);}}}this.baseXml=b;};CKEDITOR.xml.prototype={selectSingleNode:function(a,b){var c=this.baseXml;if(b||(b=c))if(CKEDITOR.env.ie||b.selectSingleNode)return b.selectSingleNode(a);else if(c.evaluate){var d=c.evaluate(a,b,null,9,null);return d&&d.singleNodeValue||null;}return null;},selectNodes:function(a,b){var c=this.baseXml,d=[];if(b||(b=c))if(CKEDITOR.env.ie||b.selectNodes)return b.selectNodes(a);else if(c.evaluate){var e=c.evaluate(a,b,null,5,null);if(e){var f;while(f=e.iterateNext())d.push(f);}}return d;},getInnerXml:function(a,b){var c=this.selectSingleNode(a,b),d=[];if(c){c=c.firstChild;while(c){if(c.xml)d.push(c.xml);else if(window.XMLSerializer)d.push(new XMLSerializer().serializeToString(c));c=c.nextSibling;}}return d.length?d.join(''):null;}};})(); diff --git a/htdocs/includes/ckeditor/skins/kama/skin.js b/htdocs/includes/ckeditor/skins/kama/skin.js index abf8a55800d..d99660fc2c7 100644 --- a/htdocs/includes/ckeditor/skins/kama/skin.js +++ b/htdocs/includes/ckeditor/skins/kama/skin.js @@ -1,7 +1,7 @@ -/* -Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -CKEDITOR.skins.add('kama',(function(){var a='cke_ui_color';return{editor:{css:['editor.css']},dialog:{css:['dialog.css']},richcombo:{canGroup:false},templates:{css:['templates.css']},margins:[0,0,0,0],init:function(b){if(b.config.width&&!isNaN(b.config.width))b.config.width-=12;var c=[],d=/\$color/g,e='/* UI Color Support */.cke_skin_kama .cke_menuitem .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{\tbackground-color: transparent !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuseparator{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{\tbackground-color: $color !important;}';if(CKEDITOR.env.webkit){e=e.split('}').slice(0,-1);for(var f=0;f'+''+''+''+''+'
    '+'
    ',h=f.append(CKEDITOR.dom.element.createFromHtml(g,f.getDocument()));if(f.getCustomData('cke_hasshared'))h.hide();else f.setCustomData('cke_hasshared',1);e=h.getChild([0,0,0,0]);!c.sharedSpaces&&(c.sharedSpaces={});c.sharedSpaces[d]=e;c.on('focus',function(){for(var i=0,j,k=f.getChildren();j=k.getItem(i);i++){if(j.type==CKEDITOR.NODE_ELEMENT&&!j.equals(h)&&j.hasClass('cke_shared'))j.hide();}h.show();});c.on('destroy',function(){h.remove();});}return e;};return{build:function(c,d){var e=c.name,f=c.element,g=c.elementMode;if(!f||g==CKEDITOR.ELEMENT_MODE_NONE)return;if(g==CKEDITOR.ELEMENT_MODE_REPLACE)f.hide();var h=c.fire('themeSpace',{space:'top',html:''}).html,i=c.fire('themeSpace',{space:'contents',html:''}).html,j=c.fireOnce('themeSpace',{space:'bottom',html:''}).html,k=i&&c.config.height,l=c.config.tabIndex||c.element.getAttribute('tabindex')||0;if(!i)k='auto';else if(!isNaN(k))k+='px';var m='',n=c.config.width;if(n){if(!isNaN(n))n+='px';m+='width: '+n+';';}var o=h&&b(c,'top'),p=b(c,'bottom');o&&(o.setHtml(h),h='');p&&(p.setHtml(j),j='');var q='';if(a[c.skinClass])q='';else a[c.skinClass]=1;var r=CKEDITOR.dom.element.createFromHtml([''+''+c.lang.editor+''+''+q+''+''+''].join('')); -r.getChild([1,0,0,0,0]).unselectable();r.getChild([1,0,0,0,2]).unselectable();if(g==CKEDITOR.ELEMENT_MODE_REPLACE)r.insertAfter(f);else f.append(r);c.container=r;r.disableContextMenu();c.on('contentDirChanged',function(s){var t=(c.lang.dir!=s.data?'add':'remove')+'Class';r.getChild(1)[t]('cke_mixed_dir_content');var u=this.sharedSpaces&&this.sharedSpaces[this.config.toolbarLocation];u&&u.getParent().getParent()[t]('cke_mixed_dir_content');});c.fireOnce('themeLoaded');c.fireOnce('uiReady');},buildDialog:function(c){var d=CKEDITOR.tools.getNextNumber(),e=CKEDITOR.dom.element.createFromHtml([''].join('').replace(/#/g,'_'+d).replace(/%/g,'cke_dialog_')),f=e.getChild([0,0,0,0,0]),g=f.getChild(0),h=f.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.ie6Compat){var i=CKEDITOR.env.isCustomDomain(),j='javascript:void(function(){'+encodeURIComponent('document.open();'+(i?'document.domain="'+document.domain+'";':'')+'document.close();')+'}())',k=CKEDITOR.dom.element.createFromHtml('');k.appendTo(f.getParent());}g.unselectable();h.unselectable();return{element:e,parts:{dialog:e.getChild(0),title:g,close:h,tabs:f.getChild(2),contents:f.getChild([3,0,0,0]),footer:f.getChild([3,0,1,0])}}; -},destroy:function(c){var d=c.container,e=c.element;if(d){d.clearCustomData();d.remove();}if(e){e.clearCustomData();c.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&e.show();delete c.element;}}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var j=this;var e=j.container,f=CKEDITOR.document.getById('cke_contents_'+j.name),g=CKEDITOR.env.webkit&&j.document&&j.document.getWindow().$.frameElement,h=d?e.getChild(1):e;h.setSize('width',a,true);g&&(g.style.width='1%');var i=c?0:(h.$.offsetHeight||0)-(f.$.clientHeight||0);f.setStyle('height',Math.max(b-i,0)+'px');g&&(g.style.width='100%');j.fire('resize');};CKEDITOR.editor.prototype.getResizable=function(a){return a?CKEDITOR.document.getById('cke_contents_'+this.name):this.container;}; +/* +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.themes.add('default',(function(){var a={};function b(c,d){var e,f;f=c.config.sharedSpaces;f=f&&f[d];f=f&&CKEDITOR.document.getById(f);if(f){var g=''+''+''+''+''+'
    '+'
    ',h=f.append(CKEDITOR.dom.element.createFromHtml(g,f.getDocument()));if(f.getCustomData('cke_hasshared'))h.hide();else f.setCustomData('cke_hasshared',1);e=h.getChild([0,0,0,0]);!c.sharedSpaces&&(c.sharedSpaces={});c.sharedSpaces[d]=e;c.on('focus',function(){for(var i=0,j,k=f.getChildren();j=k.getItem(i);i++){if(j.type==CKEDITOR.NODE_ELEMENT&&!j.equals(h)&&j.hasClass('cke_shared'))j.hide();}h.show();});c.on('destroy',function(){h.remove();});}return e;};return{build:function(c,d){var e=c.name,f=c.element,g=c.elementMode;if(!f||g==CKEDITOR.ELEMENT_MODE_NONE)return;if(g==CKEDITOR.ELEMENT_MODE_REPLACE)f.hide();var h=c.fire('themeSpace',{space:'top',html:''}).html,i=c.fire('themeSpace',{space:'contents',html:''}).html,j=c.fireOnce('themeSpace',{space:'bottom',html:''}).html,k=i&&c.config.height,l=c.config.tabIndex||c.element.getAttribute('tabindex')||0;if(!i)k='auto';else if(!isNaN(k))k+='px';var m='',n=c.config.width;if(n){if(!isNaN(n))n+='px';m+='width: '+n+';';}var o=h&&b(c,'top'),p=b(c,'bottom');o&&(o.setHtml(h),h='');p&&(p.setHtml(j),j='');var q='';if(a[c.skinClass])q='';else a[c.skinClass]=1;var r=CKEDITOR.dom.element.createFromHtml([''+''+c.lang.editor+''+''+q+''+''+''].join('')); +r.getChild([1,0,0,0,0]).unselectable();r.getChild([1,0,0,0,2]).unselectable();if(g==CKEDITOR.ELEMENT_MODE_REPLACE)r.insertAfter(f);else f.append(r);c.container=r;r.disableContextMenu();c.on('contentDirChanged',function(s){var t=(c.lang.dir!=s.data?'add':'remove')+'Class';r.getChild(1)[t]('cke_mixed_dir_content');var u=this.sharedSpaces&&this.sharedSpaces[this.config.toolbarLocation];u&&u.getParent().getParent()[t]('cke_mixed_dir_content');});c.fireOnce('themeLoaded');c.fireOnce('uiReady');},buildDialog:function(c){var d=CKEDITOR.tools.getNextNumber(),e=CKEDITOR.dom.element.createFromHtml([''].join('').replace(/#/g,'_'+d).replace(/%/g,'cke_dialog_')),f=e.getChild([0,0,0,0,0]),g=f.getChild(0),h=f.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.ie6Compat){var i=CKEDITOR.env.isCustomDomain(),j='javascript:void(function(){'+encodeURIComponent('document.open();'+(i?'document.domain="'+document.domain+'";':'')+'document.close();')+'}())',k=CKEDITOR.dom.element.createFromHtml('');k.appendTo(f.getParent());}g.unselectable();h.unselectable();return{element:e,parts:{dialog:e.getChild(0),title:g,close:h,tabs:f.getChild(2),contents:f.getChild([3,0,0,0]),footer:f.getChild([3,0,1,0])}}; +},destroy:function(c){var d=c.container,e=c.element;if(d){d.clearCustomData();d.remove();}if(e){e.clearCustomData();c.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&e.show();delete c.element;}}};})());CKEDITOR.editor.prototype.getThemeSpace=function(a){var b='cke_'+a,c=this._[b]||(this._[b]=CKEDITOR.document.getById(b+'_'+this.name));return c;};CKEDITOR.editor.prototype.resize=function(a,b,c,d){var j=this;var e=j.container,f=CKEDITOR.document.getById('cke_contents_'+j.name),g=CKEDITOR.env.webkit&&j.document&&j.document.getWindow().$.frameElement,h=d?e.getChild(1):e;h.setSize('width',a,true);g&&(g.style.width='1%');var i=c?0:(h.$.offsetHeight||0)-(f.$.clientHeight||0);f.setStyle('height',Math.max(b-i,0)+'px');g&&(g.style.width='100%');j.fire('resize');};CKEDITOR.editor.prototype.getResizable=function(a){return a?CKEDITOR.document.getById('cke_contents_'+this.name):this.container;}; diff --git a/htdocs/includes/jquery/js/jquery-latest.min.js b/htdocs/includes/jquery/js/jquery-latest.min.js index f65cf1dc457..bc3fbc81b26 100644 --- a/htdocs/includes/jquery/js/jquery-latest.min.js +++ b/htdocs/includes/jquery/js/jquery-latest.min.js @@ -1,2 +1,2 @@ -/*! jQuery v1.8.2 jquery.com | jquery.org/license */ +/*! jQuery v1.8.2 jquery.com | jquery.org/license */ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
    a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
    t
    ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
    ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.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,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
    ",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="

    ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
    ","
    "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
    ").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jpicker/Example.html b/htdocs/includes/jquery/plugins/jpicker/Example.html index 0c70908fc59..b93bd0152e3 100755 --- a/htdocs/includes/jquery/plugins/jpicker/Example.html +++ b/htdocs/includes/jquery/plugins/jpicker/Example.html @@ -1,374 +1,374 @@ - - - - - - Digital Magic Productions - jPicker - A jQuery Color Picker Plugin - - - - - - - -
    -

    jPicker - A jQuery Color Picker Plugin.

    -

    - jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects. It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework.

    - jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari, and Opera.

    - If you are updating a current version, you MUST always use the CSS and image files from the download as there may have been changes.

    - If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the Color object returned by the callback functions.

    - View John Dyer's prototype plugin here.

    - View jPicker details a docs below.

    - Check out the source from Google Code. -



    -

    jPicker Inline Example

    -

    - jPicker can be used inline by binding to any block level element.

    - jPicker() -- no arguments -

    -<script type="text/javascript">        
    -  $(document).ready(
    -    function()
    -    {
    -      $('#Inline').jPicker();
    -    });
    -</script>
    -<div id="Inline"></div>
    -
    -



    -

    jPicker Expandable Example

    -

    - jPicker can also display only a small picker icon that opens a popup for editing.

    - jPicker({ window: { expandable: true }}) -

    -<script type="text/javascript">
    -  $(document).ready(
    -    function()
    -    {
    -      $('#Expandable').jPicker(
    -        {
    -          window:
    -          {
    -            expandable: true
    -          }
    -        });
    -    });
    -</script>
    -<span id="Expandable"></span>
    - -



    -

    jPicker Alpha Channel Example

    -

    - jPicker can also pick colors with alpha (transparency) values.

    - jPicker({ window: { expandable: true }}) -

    -<script type="text/javascript">        
    -  $(document).ready(
    -    function()
    -    {
    -      $('#Alpha').jPicker(
    -        {
    -          window:
    -          {
    -            expandable: true
    -          },
    -          color:
    -          {
    -            alphaSupport: true,
    -            active: new $.jPicker.Color({ ahex: '99330099' })
    -          }
    -        });
    -    });
    -</script>
    -<span id="Alpha"></span>
    - -



    -

    jPicker Binded Example

    -

    - jPicker can also be binded to an input element.

    - jPicker() -- no arguments -

    -<script type="text/javascript">        
    -  $(document).ready(
    -    function()
    -    {
    -      $('#Binded').jPicker();
    -    });
    -</script>
    -<input id="Binded" type="text" value="e2ddcf" />
    - -



    -

    Multiple jPicker Binded Example

    -

    - jPicker can also be binded to multiple elements at a time.

    - jPicker() -- no arguments -

    -<script type="text/javascript">        
    -  $(document).ready(
    -    function()
    -    {
    -      $('.Multiple').jPicker();
    -    });
    -</script>
    -<input class="Multiple" type="text" value="e2ddcf" /><br />
    -<input class="Multiple" type="text" value="" /><br />
    -<input class="Multiple" type="text" value="fda0f7" />
    -
    -
    -
    -



    -

    jPicker Callback Functions

    -

    - Register for callback function to have it interact with your page.

    - jPicker([settings, [commitCallback, [liveCallback, [cancelCallback]]]]) -

    -<script type="text/javascript">
    -  $(document).ready(
    -    function()
    -    {
    -      var LiveCallbackElement = $('#Live'),
    -          LiveCallbackButton = $('#LiveButton');  // you don't want it searching this
    -                                                  // on every live callback!!!
    -      $('#Callbacks').jPicker(
    -        {},
    -        function(color, context)
    -        {
    -          var all = color.val('all');
    -          alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') +
    -            ' - alpha: ' + (all && all.a + '%' || 'none'));
    -          $('#Commit').css(
    -            {
    -              backgroundColor: all && '#' + all.hex || 'transparent'
    -            }); // prevent IE from throwing exception if hex is empty
    -        },
    -        function(color, context)
    -        {
    -          if (context == LiveCallbackButton.get(0)) alert('Color set from button');
    -          var hex = color.val('hex');
    -          LiveCallbackElement.css(
    -            {
    -              backgroundColor: hex && '#' + hex || 'transparent'
    -            }); // prevent IE from throwing exception if hex is empty
    -        },
    -        function(color, context)
    -        {
    -          alert('"Cancel" Button Clicked');
    -        });      
    -      $('#LiveButton').click(
    -        function()
    -        {
    -          $.jPicker.List[0].color.active.val('hex', 'e2ddcf', this);
    -        });
    -    });
    -</script>
    -<input id="Callbacks" type="text" value="e2ddcf" />
    -<span id="Commit" style="background-color: #e2ddcf; display: block; --
    -          float: left; height: 50px; margin: 10px; width: 50px;"> --
    -          Commit</span>
    -<span id="Live" style="display: block; float: left; height: 50px; --
    -          margin: 10px; width: 50px;">Live</span>
    -<input id="LiveButton" type="button" value="Set To #e2ddcf" />
    -
    - Commit - Live - -



    -

    jPicker Settings And Colors

    -

    - Use the "val" method on the active color for interaction with the picker.

    - (jQuery).jPicker.List[index] -

    -<script type="text/javascript">        
    -  $(document).ready(
    -    function()
    -    {
    -      $('#AlterColors').jPicker();
    -      $('#GetActiveColor').click(
    -        function()
    -        {
    -          alert($.jPicker.List[0].color.active.val('ahex'));
    -        });
    -      $('#GetRG').click(
    -        function()
    -        {
    -          var rg=$.jPicker.List[0].color.active.val('rg');
    -          alert('red: ' + rg.r + ', green: ' + rg.g);
    -        });
    -      $('#SetHue').click(
    -        function()
    -        {
    -          $.jPicker.List[0].color.active.val('h', 133);
    -        });
    -      $('#SetValue').click(
    -        function()
    -        {
    -          $.jPicker.List[0].color.active.val('v', 38);
    -        });
    -      $('#SetRG').click(
    -        function()
    -        {
    -          $.jPicker.List[0].color.active.val('rg', { r: 213, g: 118 });
    -        });
    -    });
    -</script>
    -<input id="AlterColors" type="text" value="e2ddcf" /><br />
    -<input id="GetActiveColor" type="button" value="Get Active Color" /><br />
    -<input id="GetRG" type="button" value="Get Red/Green Value" /><br />
    -<input id="SetHue" type="button" value="Set Hue To 133" /><br />
    -<input id="SetValue" type="button" value="Set Value To 38" /><br />
    -<input id="SetRG" type="button" value="Set Red/Green To 213, 118" />
    -
    -
    -
    -
    -
    - -



    -

    jPicker Core

    -

    - jPicker Core function - returns the jQuery object.

    - jPicker([settings, [commitCallback, [liveCallback, [cancelCallback]]]]) -



    -

    Settings

    -

    - settings [object]: (with defaults)
    -

    -{
    -  window: // used to define the position of the popup window
    -          // only useful in binded mode
    -  {
    -    title: null, // any title for the jPicker window itself - displays
    -                 // "Drag Markers To Pick A Color" if left null
    -    position:
    -    {
    -      x: 'screenCenter', // acceptable values "left", "center", "right",
    -                         // "screenCenter", or relative px value
    -      y: 'top', // acceptable values "top", "bottom", "center", or relative px
    -                // value
    -    },
    -    expandable: false, // default to large static picker - set to true to make an
    -                       // expandable picker (small icon with popup) - set
    -                       // automatically when binded to input element
    -    liveUpdate: true, // set false if you want the user to click "OK" before the
    -                      // binded input box updates values (always "true" for
    -                      // expandable picker)
    -    alphaSupport: false, // set to true to enable alpha picking
    -    alphaPrecision: 0, // set decimal precision for alpha percentage display -
    -                       // hex codes do not map directly to percentage integers -
    -                       // range 0-2
    -    updateInputColor: true // set to false to prevent binded input colors from
    -                           // changing
    -  },
    -  color:
    -  {
    -    mode: 'h', // acceptable values "h" (hue), "s" (saturation), "v" (brightness),
    -               // "r" (red), "g" (green), "b" (blue), "a" (alpha)
    -    active: new $.jPicker.Color({ hex: 'ffc000' }), // accepts any declared
    -               // jPicker.Color object or hex string WITH OR WITHOUT '#'
    -    quickList: // this list of quick pick colors - override for a different list
    -      [
    -        new $.jPicker.Color({ h: 360, s: 33, v: 100}), // accepts any declared
    -               // jPicker.Color object or hex string WITH OR WITHOUT '#'
    -        new $.jPicker.Color({ h: 360, s: 66, v: 100}),
    -        (...) // removed for brevity
    -        new $.jPicker.Color({ h: 330, s: 100, v: 50}),
    -        new $.jPicker.Color()
    -      ]
    -  },
    -  images
    -  {
    -    clientPath: '/jPicker/images/', // Path to image files
    -    colorMap: // colorMap size and arrow icon
    -    {
    -      width: 256, // Map width - don't override unless using a smaller image set
    -      height: 256, // Map height - don't override unles using a smaller image set
    -      arrow:
    -      {
    -        file: 'mappoint.gif', // Arrow icon image file
    -        width: 15, // Arrow icon width
    -        height: 15 // Arrow icon height
    -      }
    -    },
    -    colorBar: // colorBar size and arrow icon
    -    {
    -      width: 20, // Bar width - don't override unless using a smaller image set
    -      height: 256, // Bar height - don't override unless using a smaller image set
    -      arrow:
    -      {
    -        file: 'rangearrows.gif', // Arrow icon image file
    -        width: 40, // Arrow icon width
    -        height: 9 // Arrow icon height
    -      }
    -    },
    -    picker: // picker icon and size
    -    {
    -      file: 'picker.gif', // Picker icon image file
    -      width: 25, // Picker width - don't override unless using a smaller image set
    -      height: 24 // Picker height - don't override unless using a smaller image set
    -    }
    +
    +
    +
    +
    +  
    +  Digital Magic Productions - jPicker - A jQuery Color Picker Plugin
    +  
    +  
    +  
    +  
    +  
    +
    +
    +  
    +

    jPicker - A jQuery Color Picker Plugin.

    +

    + jPicker is a fast, lightweight jQuery plugin for including an advanced color picker in your web projects. It has been painstakenly ported from John Dyers' awesome work on his picker using the Prototype framework.

    + jPicker supports all current browsers and has been extensively tested in Chrome, Firefox, IE5.5+, Safari, and Opera.

    + If you are updating a current version, you MUST always use the CSS and image files from the download as there may have been changes.

    + If you are moving from a V1.0.* version, you MUST read the docs below to implement some changes to the Color object returned by the callback functions.

    + View John Dyer's prototype plugin here.

    + View jPicker details a docs below.

    + Check out the source from Google Code. +



    +

    jPicker Inline Example

    +

    + jPicker can be used inline by binding to any block level element.

    + jPicker() -- no arguments +

    +<script type="text/javascript">        
    +  $(document).ready(
    +    function()
    +    {
    +      $('#Inline').jPicker();
    +    });
    +</script>
    +<div id="Inline"></div>
    +
    +



    +

    jPicker Expandable Example

    +

    + jPicker can also display only a small picker icon that opens a popup for editing.

    + jPicker({ window: { expandable: true }}) +

    +<script type="text/javascript">
    +  $(document).ready(
    +    function()
    +    {
    +      $('#Expandable').jPicker(
    +        {
    +          window:
    +          {
    +            expandable: true
    +          }
    +        });
    +    });
    +</script>
    +<span id="Expandable"></span>
    + +



    +

    jPicker Alpha Channel Example

    +

    + jPicker can also pick colors with alpha (transparency) values.

    + jPicker({ window: { expandable: true }}) +

    +<script type="text/javascript">        
    +  $(document).ready(
    +    function()
    +    {
    +      $('#Alpha').jPicker(
    +        {
    +          window:
    +          {
    +            expandable: true
    +          },
    +          color:
    +          {
    +            alphaSupport: true,
    +            active: new $.jPicker.Color({ ahex: '99330099' })
    +          }
    +        });
    +    });
    +</script>
    +<span id="Alpha"></span>
    + +



    +

    jPicker Binded Example

    +

    + jPicker can also be binded to an input element.

    + jPicker() -- no arguments +

    +<script type="text/javascript">        
    +  $(document).ready(
    +    function()
    +    {
    +      $('#Binded').jPicker();
    +    });
    +</script>
    +<input id="Binded" type="text" value="e2ddcf" />
    + +



    +

    Multiple jPicker Binded Example

    +

    + jPicker can also be binded to multiple elements at a time.

    + jPicker() -- no arguments +

    +<script type="text/javascript">        
    +  $(document).ready(
    +    function()
    +    {
    +      $('.Multiple').jPicker();
    +    });
    +</script>
    +<input class="Multiple" type="text" value="e2ddcf" /><br />
    +<input class="Multiple" type="text" value="" /><br />
    +<input class="Multiple" type="text" value="fda0f7" />
    +
    +
    +
    +



    +

    jPicker Callback Functions

    +

    + Register for callback function to have it interact with your page.

    + jPicker([settings, [commitCallback, [liveCallback, [cancelCallback]]]]) +

    +<script type="text/javascript">
    +  $(document).ready(
    +    function()
    +    {
    +      var LiveCallbackElement = $('#Live'),
    +          LiveCallbackButton = $('#LiveButton');  // you don't want it searching this
    +                                                  // on every live callback!!!
    +      $('#Callbacks').jPicker(
    +        {},
    +        function(color, context)
    +        {
    +          var all = color.val('all');
    +          alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') +
    +            ' - alpha: ' + (all && all.a + '%' || 'none'));
    +          $('#Commit').css(
    +            {
    +              backgroundColor: all && '#' + all.hex || 'transparent'
    +            }); // prevent IE from throwing exception if hex is empty
    +        },
    +        function(color, context)
    +        {
    +          if (context == LiveCallbackButton.get(0)) alert('Color set from button');
    +          var hex = color.val('hex');
    +          LiveCallbackElement.css(
    +            {
    +              backgroundColor: hex && '#' + hex || 'transparent'
    +            }); // prevent IE from throwing exception if hex is empty
    +        },
    +        function(color, context)
    +        {
    +          alert('"Cancel" Button Clicked');
    +        });      
    +      $('#LiveButton').click(
    +        function()
    +        {
    +          $.jPicker.List[0].color.active.val('hex', 'e2ddcf', this);
    +        });
    +    });
    +</script>
    +<input id="Callbacks" type="text" value="e2ddcf" />
    +<span id="Commit" style="background-color: #e2ddcf; display: block; --
    +          float: left; height: 50px; margin: 10px; width: 50px;"> --
    +          Commit</span>
    +<span id="Live" style="display: block; float: left; height: 50px; --
    +          margin: 10px; width: 50px;">Live</span>
    +<input id="LiveButton" type="button" value="Set To #e2ddcf" />
    +
    + Commit + Live + +



    +

    jPicker Settings And Colors

    +

    + Use the "val" method on the active color for interaction with the picker.

    + (jQuery).jPicker.List[index] +

    +<script type="text/javascript">        
    +  $(document).ready(
    +    function()
    +    {
    +      $('#AlterColors').jPicker();
    +      $('#GetActiveColor').click(
    +        function()
    +        {
    +          alert($.jPicker.List[0].color.active.val('ahex'));
    +        });
    +      $('#GetRG').click(
    +        function()
    +        {
    +          var rg=$.jPicker.List[0].color.active.val('rg');
    +          alert('red: ' + rg.r + ', green: ' + rg.g);
    +        });
    +      $('#SetHue').click(
    +        function()
    +        {
    +          $.jPicker.List[0].color.active.val('h', 133);
    +        });
    +      $('#SetValue').click(
    +        function()
    +        {
    +          $.jPicker.List[0].color.active.val('v', 38);
    +        });
    +      $('#SetRG').click(
    +        function()
    +        {
    +          $.jPicker.List[0].color.active.val('rg', { r: 213, g: 118 });
    +        });
    +    });
    +</script>
    +<input id="AlterColors" type="text" value="e2ddcf" /><br />
    +<input id="GetActiveColor" type="button" value="Get Active Color" /><br />
    +<input id="GetRG" type="button" value="Get Red/Green Value" /><br />
    +<input id="SetHue" type="button" value="Set Hue To 133" /><br />
    +<input id="SetValue" type="button" value="Set Value To 38" /><br />
    +<input id="SetRG" type="button" value="Set Red/Green To 213, 118" />
    +
    +
    +
    +
    +
    + +



    +

    jPicker Core

    +

    + jPicker Core function - returns the jQuery object.

    + jPicker([settings, [commitCallback, [liveCallback, [cancelCallback]]]]) +



    +

    Settings

    +

    + settings [object]: (with defaults)
    +

    +{
    +  window: // used to define the position of the popup window
    +          // only useful in binded mode
    +  {
    +    title: null, // any title for the jPicker window itself - displays
    +                 // "Drag Markers To Pick A Color" if left null
    +    position:
    +    {
    +      x: 'screenCenter', // acceptable values "left", "center", "right",
    +                         // "screenCenter", or relative px value
    +      y: 'top', // acceptable values "top", "bottom", "center", or relative px
    +                // value
    +    },
    +    expandable: false, // default to large static picker - set to true to make an
    +                       // expandable picker (small icon with popup) - set
    +                       // automatically when binded to input element
    +    liveUpdate: true, // set false if you want the user to click "OK" before the
    +                      // binded input box updates values (always "true" for
    +                      // expandable picker)
    +    alphaSupport: false, // set to true to enable alpha picking
    +    alphaPrecision: 0, // set decimal precision for alpha percentage display -
    +                       // hex codes do not map directly to percentage integers -
    +                       // range 0-2
    +    updateInputColor: true // set to false to prevent binded input colors from
    +                           // changing
    +  },
    +  color:
    +  {
    +    mode: 'h', // acceptable values "h" (hue), "s" (saturation), "v" (brightness),
    +               // "r" (red), "g" (green), "b" (blue), "a" (alpha)
    +    active: new $.jPicker.Color({ hex: 'ffc000' }), // accepts any declared
    +               // jPicker.Color object or hex string WITH OR WITHOUT '#'
    +    quickList: // this list of quick pick colors - override for a different list
    +      [
    +        new $.jPicker.Color({ h: 360, s: 33, v: 100}), // accepts any declared
    +               // jPicker.Color object or hex string WITH OR WITHOUT '#'
    +        new $.jPicker.Color({ h: 360, s: 66, v: 100}),
    +        (...) // removed for brevity
    +        new $.jPicker.Color({ h: 330, s: 100, v: 50}),
    +        new $.jPicker.Color()
    +      ]
    +  },
    +  images
    +  {
    +    clientPath: '/jPicker/images/', // Path to image files
    +    colorMap: // colorMap size and arrow icon
    +    {
    +      width: 256, // Map width - don't override unless using a smaller image set
    +      height: 256, // Map height - don't override unles using a smaller image set
    +      arrow:
    +      {
    +        file: 'mappoint.gif', // Arrow icon image file
    +        width: 15, // Arrow icon width
    +        height: 15 // Arrow icon height
    +      }
    +    },
    +    colorBar: // colorBar size and arrow icon
    +    {
    +      width: 20, // Bar width - don't override unless using a smaller image set
    +      height: 256, // Bar height - don't override unless using a smaller image set
    +      arrow:
    +      {
    +        file: 'rangearrows.gif', // Arrow icon image file
    +        width: 40, // Arrow icon width
    +        height: 9 // Arrow icon height
    +      }
    +    },
    +    picker: // picker icon and size
    +    {
    +      file: 'picker.gif', // Picker icon image file
    +      width: 25, // Picker width - don't override unless using a smaller image set
    +      height: 24 // Picker height - don't override unless using a smaller image set
    +    }
       },
       localization:
       {
    @@ -433,115 +433,115 @@
             alpha: 'Enter A “Alpha” Value (#00-#ff)'
           }
         }
    -  }
    -}
    -



    -

    Callback Pattern

    -

    - function(jPicker.Color color, object context){...} -



    -

    jPicker List

    -

    - The list of active jPicker objects.

    - (jQuery).jPicker.List[] -



    -

    jPicker Color Class

    -

    - Definition of the jPicker.Color class.
    -

    -(jQuery).jPicker.Color()
    -(jQuery).jPicker.Color({ ahex: 'ffffffff' })
    -(jQuery).jPicker.Color({ hex: 'ffffff', [a: (0-255)] })
    -(jQuery).jPicker.Color({ r: (0-255), g: (0-255), b: (0-255), [a: (0-255)] })
    -(jQuery).jPicker.Color({ h: (0-360), s: (0-100), v: (0-100), [a: (0-255)] })
    -{
    -  val: function(name, value, context),
    -  bind: function(callback) where callback is function(color, [context]),
    -  unbind: function(callback)
    -}
    -
    -method "val" usage
    -
    -val(name) : get value
    -
    -  'r':     red         (0-255)
    -  'g':     green       (0-255)
    -  'b':     blue        (0-255)
    -  'a':     alpha       (0-255)
    -  'h':     hue         (0-360)
    -  's':     saturation  (0-100)
    -  'v':     value       (0-100)
    -  'hex':   hex         (000000-ffffff)
    -  'ahex':  ahex        (00000000-ffffffff)
    -  'all':   all         all
    -  
    -  ex. Usage
    -
    -    val('r'):     (0-255)
    -    val('h'):     (0-360)
    -    val('hex'):   (000000-ffffff)
    -    val('rg'):    { r: (0-255), g: (0-255) }
    -    val('rgba'):  { r: (0-255), g: (0-255), b: (0-255), a: (0-255) }
    -    val('hvga'):  { h: (0-255), v: (0-100), g: (0-255), a: (0-255) }
    -    val('all'):   { r: (0-255), g: (0-255), b: (0-255), a: (0-255), h: (0-360) --
    -                    s: (0-100), v: (0-100), hex: (000000-ffffff), --
    -                    ahex: (00000000-ffffffff) }
    -
    -val(name, value, [context]) : set value
    -
    -  'r':     red         (0-255)
    -  'g':     green       (0-255)
    -  'b':     blue        (0-255)
    -  'a':     alpha       (0-255)
    -  'h':     hue         (0-360)
    -  's':     saturation  (0-100)
    -  'v':     value       (0-100)
    -  'hex':   hex         (000000-ffffff)
    -  'ahex':  ahex        (00000000-ffffffff)
    -  
    -  ex. Usage
    -
    -    val('r', (0-255)) || val('r', { r: (0-255) })
    -    val('h', (0-360)) || val('h', { h: (0-360) })
    -    val('hex', (000000-ffffff)) || val('hex', { hex: (000000-ffffff) })
    -    val('rg', { r: (0-255), g: (0-255) })
    -    val('rgba', { r: (-255), g: (0-255), b: (0-255), a: (0-255) })
    -    val(null, { r: (0-255), g: (0-255) })
    -    val('hvga'):  incorrect usage - cannot set hsv AND rgb as they will conflict
    -



    -

    jPicker ColorMethod Utility Class

    -

    - Static methods for altering and retrieving different color spaces.
    -

    -(jQuery).jPicker.ColorMethods.hexToRgba:
    -    function(hex)
    -    returns { r: (0-255), g: (0-255), b: (0-255), a: (0-255) }
    -    
    -(jQuery).jPicker.ColorMethods.validateHex:
    -    function(hex)
    -    returns new hex string
    -    
    -(jQuery).jPicker.ColorMethods.rgbaToHex:
    -    function({ r: (0-255), g: (0-255), b: (0-255), a: (0-255) })
    -    returns hex string
    -    
    -(jQuery).jPicker.ColorMethods.intToHex:
    -    function(number)
    -    returns hex string
    -    
    -(jQuery).jPicker.ColorMethods.hexToInt:
    -    function(hex)
    -    return integer
    -
    -(jQuery).jPicker.ColorMethods.rgbToHsv:
    -    function({ r: (0-255), g: (0-255), b: (0-255) })
    -    returns { h: (0-360), s: (0-100), v: (0-100) }
    -
    -(jQuery).jPicker.ColorMethods.hsvToRgb:
    -    function({ h: (0-360), s: (0-100), v: (0-100) })
    -    returns { r: (0-255), g: (0-255), b: (0-255) }
    -
    -



    + } +}
    +



    +

    Callback Pattern

    +

    + function(jPicker.Color color, object context){...} +



    +

    jPicker List

    +

    + The list of active jPicker objects.

    + (jQuery).jPicker.List[] +



    +

    jPicker Color Class

    +

    + Definition of the jPicker.Color class.
    +

    +(jQuery).jPicker.Color()
    +(jQuery).jPicker.Color({ ahex: 'ffffffff' })
    +(jQuery).jPicker.Color({ hex: 'ffffff', [a: (0-255)] })
    +(jQuery).jPicker.Color({ r: (0-255), g: (0-255), b: (0-255), [a: (0-255)] })
    +(jQuery).jPicker.Color({ h: (0-360), s: (0-100), v: (0-100), [a: (0-255)] })
    +{
    +  val: function(name, value, context),
    +  bind: function(callback) where callback is function(color, [context]),
    +  unbind: function(callback)
    +}
    +
    +method "val" usage
    +
    +val(name) : get value
    +
    +  'r':     red         (0-255)
    +  'g':     green       (0-255)
    +  'b':     blue        (0-255)
    +  'a':     alpha       (0-255)
    +  'h':     hue         (0-360)
    +  's':     saturation  (0-100)
    +  'v':     value       (0-100)
    +  'hex':   hex         (000000-ffffff)
    +  'ahex':  ahex        (00000000-ffffffff)
    +  'all':   all         all
    +  
    +  ex. Usage
    +
    +    val('r'):     (0-255)
    +    val('h'):     (0-360)
    +    val('hex'):   (000000-ffffff)
    +    val('rg'):    { r: (0-255), g: (0-255) }
    +    val('rgba'):  { r: (0-255), g: (0-255), b: (0-255), a: (0-255) }
    +    val('hvga'):  { h: (0-255), v: (0-100), g: (0-255), a: (0-255) }
    +    val('all'):   { r: (0-255), g: (0-255), b: (0-255), a: (0-255), h: (0-360) --
    +                    s: (0-100), v: (0-100), hex: (000000-ffffff), --
    +                    ahex: (00000000-ffffffff) }
    +
    +val(name, value, [context]) : set value
    +
    +  'r':     red         (0-255)
    +  'g':     green       (0-255)
    +  'b':     blue        (0-255)
    +  'a':     alpha       (0-255)
    +  'h':     hue         (0-360)
    +  's':     saturation  (0-100)
    +  'v':     value       (0-100)
    +  'hex':   hex         (000000-ffffff)
    +  'ahex':  ahex        (00000000-ffffffff)
    +  
    +  ex. Usage
    +
    +    val('r', (0-255)) || val('r', { r: (0-255) })
    +    val('h', (0-360)) || val('h', { h: (0-360) })
    +    val('hex', (000000-ffffff)) || val('hex', { hex: (000000-ffffff) })
    +    val('rg', { r: (0-255), g: (0-255) })
    +    val('rgba', { r: (-255), g: (0-255), b: (0-255), a: (0-255) })
    +    val(null, { r: (0-255), g: (0-255) })
    +    val('hvga'):  incorrect usage - cannot set hsv AND rgb as they will conflict
    +



    +

    jPicker ColorMethod Utility Class

    +

    + Static methods for altering and retrieving different color spaces.
    +

    +(jQuery).jPicker.ColorMethods.hexToRgba:
    +    function(hex)
    +    returns { r: (0-255), g: (0-255), b: (0-255), a: (0-255) }
    +    
    +(jQuery).jPicker.ColorMethods.validateHex:
    +    function(hex)
    +    returns new hex string
    +    
    +(jQuery).jPicker.ColorMethods.rgbaToHex:
    +    function({ r: (0-255), g: (0-255), b: (0-255), a: (0-255) })
    +    returns hex string
    +    
    +(jQuery).jPicker.ColorMethods.intToHex:
    +    function(number)
    +    returns hex string
    +    
    +(jQuery).jPicker.ColorMethods.hexToInt:
    +    function(hex)
    +    return integer
    +
    +(jQuery).jPicker.ColorMethods.rgbToHsv:
    +    function({ r: (0-255), g: (0-255), b: (0-255) })
    +    returns { h: (0-360), s: (0-100), v: (0-100) }
    +
    +(jQuery).jPicker.ColorMethods.hsvToRgb:
    +    function({ h: (0-360), s: (0-100), v: (0-100) })
    +    returns { r: (0-255), g: (0-255), b: (0-255) }
    +
    +



    Known Issues

    • @@ -549,10 +549,10 @@ val(name, value, [context]) : set value
      • jPicker creates a new instance of the picker for every element. Performance will suffer when binding dozens of instances.
      -
    • -

    -

    Coming Soon

    -
      + +

    +

    Coming Soon

    +
      • Will consider supporting jQuery ThemeRoller CSS API for theming the UI if demand exists.
      • @@ -567,8 +567,8 @@ val(name, value, [context]) : set value
      • This will result in much faster operation and initialization for pages with multiple pickers.
    • -
    • Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element.
    • -

    +
  • Add activateCallback option for calling a callback function when the jPicker is activated or its binding is switched to a different picker element.
  • +

    Change Log

    • @@ -677,28 +677,28 @@ val(name, value, [context]) : set value
      • Added ability for NULL colors (delete the hex value). Color will be returned as color.hex == ''. Can set the default color to an empty hex string as well.
      • cancelCallback now returns the original color for use in programming responses.
      • -
      +

  • V1.0.10:

    • Corrected table layout and tweaked display for more consisent presentation. Nice catch from Jonathan Pasquier.
    • -
    +
  • V1.0.9:

    • Added optional title variable for each jPicker window.
    • -
    +
  • V1.0.8:

    • Moved all images into a few sprites - now using backgroundPosition to change color maps and bars instead of changing the image - this should be faster to download and run.
    • -
    +
  • @@ -708,7 +708,7 @@ val(name, value, [context]) : set value
  • Added opacity feedback to color preview boxes.
  • Removed reliance on "id" value of containing object. Subobjects are now found by class and container instead of id's. This drastically reduces injected code.
  • Removed (jQuery).jPicker.getListElementById(id) function since "id" is no longer incorporated or required.
  • - +
  • @@ -717,58 +717,58 @@ val(name, value, [context]) : set value
  • Corrected picker bugs introduced with 1.0.5.
  • Removed alpha slider bar until activated - default behavior for alpha is now OFF.
  • Corrected Color constructor bug not allowing values of 0 for initial value (it was evaluating false and missing the init code - Thanks Pavol).
  • -
  • Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip).
  • -
  • THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
  • - -
    - +
  • Removed title tags (tooltips) from color maps and bars - They get in the way in some browsers (e.g. IE - dragging marker does NOT prevent or hide the tooltip).
  • +
  • THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
  • + +
    +
  • V1.0.5:

    • Added opacity support to picker and color/callback methods. New property "a" (alpha - range from 0-100) in all color objects now - defaults to 100% opaque. (Thank you Pavol)
    • Added title attributes to input elements - gives short tooltip directions on what button or field does.
    • Commit callback used to fire on control initialization (twice actually) - This has been corrected, it does not fire on initialization.
    • -
    • THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
    • -
    -
    -
  • -
  • +
  • THERE WERE CSS FILE CHANGES WITH THIS UPDATE!!! IF YOU USE NEVER-EXPIRE HEADERS, YOU WILL NEED TO INCREMENT YOUR CSS FILE VERSION NUMBER!!!
  • + +
    + +
  • V1.0.4:

      -
    • Added ability for smaller picker icon with expandable window on any DOM element (not just input).
    • -
    • "draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker.
    • -
    -
    -
  • -
  • -

    V1.0.3

    -
      -
    • Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol)
    • -
    -
    -
  • -
  • -

    V1.0.2

    -
      -
    • Random bug fixes - speed concerns.
    • -
    -
    -
  • -
  • -

    V1.0.1

    -
      -
    • Corrected closure based memeory leak - there may be others?
    • -
    -
    -
  • -
  • -

    V1.0.0

    -
      -
    • First Release.
    • -
    -
    -
  • - -
    - +
  • Added ability for smaller picker icon with expandable window on any DOM element (not just input).
  • +
  • "draggable" property renamed to "expandable" and its scope increased to create small picker icon or large static picker.
  • + +
    + +
  • +

    V1.0.3

    +
      +
    • Added cancelCallback function for registering an external function when user clicks cancel button. (Thank you Jeff and Pavol)
    • +
    +
    +
  • +
  • +

    V1.0.2

    +
      +
    • Random bug fixes - speed concerns.
    • +
    +
    +
  • +
  • +

    V1.0.1

    +
      +
    • Corrected closure based memeory leak - there may be others?
    • +
    +
    +
  • +
  • +

    V1.0.0

    +
      +
    • First Release.
    • +
    +
    +
  • + +
    + \ No newline at end of file diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.async.js b/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.async.js index 36e368a0737..0898e8c6510 100644 --- a/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.async.js +++ b/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.async.js @@ -1,108 +1,108 @@ -/* - * Async Treeview 0.1 - Lazy-loading extension for Treeview - * - * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ - * - * Copyright 2010 Jörn Zaefferer - * Released under the MIT license: - * http://www.opensource.org/licenses/mit-license.php - */ - -;(function($) { - -function load(settings, root, child, container) { - function createNode(parent) { - var current = $("
  • ").attr("id", this.id || "").html("" + this.text + "").appendTo(parent); - if (this.classes) { - current.children("span").addClass(this.classes); - } - if (this.expanded) { - current.addClass("open"); - } - if (this.hasChildren || this.children && this.children.length) { - var branch = $("
      ").appendTo(current); - if (this.hasChildren) { - current.addClass("hasChildren"); - createNode.call({ - classes: "placeholder", - text: " ", - children:[] - }, branch); - } - if (this.children && this.children.length) { - $.each(this.children, createNode, [branch]) - } - } - } - $.ajax($.extend(true, { - url: settings.url, - dataType: "json", - data: { - root: root - }, - success: function(response) { - child.empty(); - $.each(response, createNode, [child]); - $(container).treeview({add: child}); - } - }, settings.ajax)); - /* - $.getJSON(settings.url, {root: root}, function(response) { - function createNode(parent) { - var current = $("
    • ").attr("id", this.id || "").html("" + this.text + "").appendTo(parent); - if (this.classes) { - current.children("span").addClass(this.classes); - } - if (this.expanded) { - current.addClass("open"); - } - if (this.hasChildren || this.children && this.children.length) { - var branch = $("
        ").appendTo(current); - if (this.hasChildren) { - current.addClass("hasChildren"); - createNode.call({ - classes: "placeholder", - text: " ", - children:[] - }, branch); - } - if (this.children && this.children.length) { - $.each(this.children, createNode, [branch]) - } - } - } - child.empty(); - $.each(response, createNode, [child]); - $(container).treeview({add: child}); - }); - */ -} - -var proxied = $.fn.treeview; -$.fn.treeview = function(settings) { - if (!settings.url) { - return proxied.apply(this, arguments); - } - if (!settings.root) { - settings.root = "source"; - } - var container = this; - if (!container.children().size()) - load(settings, settings.root, this, container); - var userToggle = settings.toggle; - return proxied.call(this, $.extend({}, settings, { - collapsed: true, - toggle: function() { - var $this = $(this); - if ($this.hasClass("hasChildren")) { - var childList = $this.removeClass("hasChildren").find("ul"); - load(settings, this.id, childList, container); - } - if (userToggle) { - userToggle.apply(this, arguments); - } - } - })); -}; - -})(jQuery); +/* + * Async Treeview 0.1 - Lazy-loading extension for Treeview + * + * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ + * + * Copyright 2010 Jörn Zaefferer + * Released under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + */ + +;(function($) { + +function load(settings, root, child, container) { + function createNode(parent) { + var current = $("
      • ").attr("id", this.id || "").html("" + this.text + "").appendTo(parent); + if (this.classes) { + current.children("span").addClass(this.classes); + } + if (this.expanded) { + current.addClass("open"); + } + if (this.hasChildren || this.children && this.children.length) { + var branch = $("
          ").appendTo(current); + if (this.hasChildren) { + current.addClass("hasChildren"); + createNode.call({ + classes: "placeholder", + text: " ", + children:[] + }, branch); + } + if (this.children && this.children.length) { + $.each(this.children, createNode, [branch]) + } + } + } + $.ajax($.extend(true, { + url: settings.url, + dataType: "json", + data: { + root: root + }, + success: function(response) { + child.empty(); + $.each(response, createNode, [child]); + $(container).treeview({add: child}); + } + }, settings.ajax)); + /* + $.getJSON(settings.url, {root: root}, function(response) { + function createNode(parent) { + var current = $("
        • ").attr("id", this.id || "").html("" + this.text + "").appendTo(parent); + if (this.classes) { + current.children("span").addClass(this.classes); + } + if (this.expanded) { + current.addClass("open"); + } + if (this.hasChildren || this.children && this.children.length) { + var branch = $("
            ").appendTo(current); + if (this.hasChildren) { + current.addClass("hasChildren"); + createNode.call({ + classes: "placeholder", + text: " ", + children:[] + }, branch); + } + if (this.children && this.children.length) { + $.each(this.children, createNode, [branch]) + } + } + } + child.empty(); + $.each(response, createNode, [child]); + $(container).treeview({add: child}); + }); + */ +} + +var proxied = $.fn.treeview; +$.fn.treeview = function(settings) { + if (!settings.url) { + return proxied.apply(this, arguments); + } + if (!settings.root) { + settings.root = "source"; + } + var container = this; + if (!container.children().size()) + load(settings, settings.root, this, container); + var userToggle = settings.toggle; + return proxied.call(this, $.extend({}, settings, { + collapsed: true, + toggle: function() { + var $this = $(this); + if ($this.hasClass("hasChildren")) { + var childList = $this.removeClass("hasChildren").find("ul"); + load(settings, this.id, childList, container); + } + if (userToggle) { + userToggle.apply(this, arguments); + } + } + })); +}; + +})(jQuery); diff --git a/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.sortable.js b/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.sortable.js index 40dab0dc454..ebe5e6bfe05 100644 --- a/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.sortable.js +++ b/htdocs/includes/jquery/plugins/jquerytreeview/jquery.treeview.sortable.js @@ -1,378 +1,378 @@ -/* - * jQuery UI Sortable - * - * Copyright (c) 2008 Paul Bakaus - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Sortables - * - * Depends: - * ui.base.js - * - * Revision: $Id: ui.sortable.js 5262 2008-04-17 13:13:51Z paul.bakaus $ - */ -;(function($) { - - if (window.Node && Node.prototype && !Node.prototype.contains) { - Node.prototype.contains = function (arg) { - return !!(this.compareDocumentPosition(arg) & 16); - }; - } - - - $.widget("ui.sortableTree", $.extend($.ui.mouse, { - init: function() { - - //Initialize needed constants - var self = this, o = this.options; - this.containerCache = {}; - this.element.addClass("ui-sortableTree"); - - //Get the items - this.refresh(); - - //Let's determine the parent's offset - if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative'); - this.offset = this.element.offset(); - - //Initialize mouse events for interaction - this.mouseInit(); - - //Prepare cursorAt - if(o.cursorAt && o.cursorAt.constructor == Array) - o.cursorAt = { left: o.cursorAt[0], top: o.cursorAt[1] }; - - }, - plugins: {}, - ui: function(inst) { - return { - helper: (inst || this)["helper"], - position: (inst || this)["position"].current, - absolutePosition: (inst || this)["position"].absolute, - instance: this, - options: this.options, - element: this.element, - item: (inst || this)["currentItem"], - sender: inst ? inst.element : null - }; - }, - propagate: function(n,e,inst) { - $.ui.plugin.call(this, n, [e, this.ui(inst)]); - this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]); - }, - serialize: function(o) { - - var items = $(this.options.items, this.element).not('.ui-sortableTree-helper'); //Only the items of the sortable itself - var str = []; o = o || {}; - - items.each(function() { - var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); - if(res) str.push((o.key || res[1])+'[]='+(o.key ? res[1] : res[2])); - }); - - return str.join('&'); - - }, - toArray: function(attr) { - var items = $(this.options.items, this.element).not('.ui-sortableTree-helper'); //Only the items of the sortable itself - var ret = []; - - items.each(function() { ret.push($(this).attr(attr || 'id')); }); - return ret; - }, - enable: function() { - this.element.removeClass("ui-sortableTree-disabled"); - this.options.disabled = false; - }, - disable: function() { - this.element.addClass("ui-sortableTree-disabled"); - this.options.disabled = true; - }, - /* Be careful with the following core functions */ - intersectsWith: function(item) { - - var x1 = this.position.absolute.left - 10, x2 = x1 + 10, - y1 = this.position.absolute.top - 10, y2 = y1 + 10; - var l = item.left, r = l + item.width, - t = item.top, b = t + item.height; - - return ( l < x1 + (this.helperProportions.width / 2) // Right Half - && x2 - (this.helperProportions.width / 2) < r // Left Half - && t < y1 + (this.helperProportions.height / 2) // Bottom Half - && y2 - (this.helperProportions.height / 2) < b ); // Top Half - - }, - intersectsWithEdge: function(item) { - var y1 = this.position.absolute.top - 10, y2 = y1 + 10; - var t = item.top, b = t + item.height; - - if(!this.intersectsWith(item.item.parents(".ui-sortableTree").data("sortableTree").containerCache)) return false; - - if (!( t < y1 + (this.helperProportions.height / 2) // Bottom Half - && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half - - if(y2 > t && y1 < t) return 1; //Crosses top edge - if(y1 < b && y2 > b) return 2; //Crosses bottom edge - - return false; - - }, - refresh: function() { - this.refreshItems(); - this.refreshPositions(); - }, - refreshItems: function() { - - this.items = []; - this.containers = [this]; - var items = this.items; - var queries = [$(this.options.items, this.element)]; - - if(this.options.connectWith) { - for (var i = this.options.connectWith.length - 1; i >= 0; i--){ - var cur = $(this.options.connectWith[i]); - for (var j = cur.length - 1; j >= 0; j--){ - var inst = $.data(cur[j], 'sortableTree'); - if(inst && !inst.options.disabled) { - queries.push($(inst.options.items, inst.element)); - this.containers.push(inst); - } - }; - }; - } - - for (var i = queries.length - 1; i >= 0; i--){ - queries[i].each(function() { - $.data(this, 'sortableTree-item', true); // Data for target checking (mouse manager) - items.push({ - item: $(this), - width: 0, height: 0, - left: 0, top: 0 - }); - }); - }; - - }, - refreshPositions: function(fast) { - for (var i = this.items.length - 1; i >= 0; i--){ - if(!fast) this.items[i].height = this.items[i].item.outerHeight(); - this.items[i].top = this.items[i].item.offset().top; - }; - for (var i = this.containers.length - 1; i >= 0; i--){ - var p =this.containers[i].element.offset(); - this.containers[i].containerCache.left = p.left; - this.containers[i].containerCache.top = p.top; - this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); - this.containers[i].containerCache.height= this.containers[i].element.outerHeight(); - }; - }, - destroy: function() { - - this.element - .removeClass("ui-sortableTree ui-sortableTree-disabled") - .removeData("sortableTree") - .unbind(".sortableTree"); - this.mouseDestroy(); - - for ( var i = this.items.length - 1; i >= 0; i-- ) - this.items[i].item.removeData("sortableTree-item"); - - }, - contactContainers: function(e) { - for (var i = this.containers.length - 1; i >= 0; i--){ - - if(this.intersectsWith(this.containers[i].containerCache)) { - if(!this.containers[i].containerCache.over) { - - if(this.currentContainer != this.containers[i]) { - - //When entering a new container, we will find the item with the least distance and append our item near it - var dist = 10000; var itemWithLeastDistance = null; var base = this.position.absolute.top; - for (var j = this.items.length - 1; j >= 0; j--) { - if(!this.containers[i].element[0].contains(this.items[j].item[0])) continue; - var cur = this.items[j].top; - if(Math.abs(cur - base) < dist) { - dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; - } - } - - itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance) : this.rearrange(e, null, this.containers[i].element); - this.propagate("change", e); //Call plugins and callbacks - this.containers[i].propagate("change", e, this); //Call plugins and callbacks - this.currentContainer = this.containers[i]; - - } - - this.containers[i].propagate("over", e, this); - this.containers[i].containerCache.over = 1; - } - } else { - if(this.containers[i].containerCache.over) { - this.containers[i].propagate("out", e, this); - this.containers[i].containerCache.over = 0; - } - } - - }; - }, - mouseStart: function(e,el) { - - if(this.options.disabled || this.options.type == 'static') return false; - - //Find out if the clicked node (or one of its parents) is a actual item in this.items - var currentItem = null, nodes = $(e.target).parents().each(function() { - if($.data(this, 'sortableTree-item')) { - currentItem = $(this); - return false; - } - }); - if($.data(e.target, 'sortableTree-item')) currentItem = $(e.target); - - if(!currentItem) return false; - if(this.options.handle) { - var validHandle = false; - $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; }); - if(!validHandle) return false; - } - - this.currentItem = currentItem; - - var o = this.options; - this.currentContainer = this; - this.refresh(); - - //Create and append the visible helper - this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone(); - if(!this.helper.parents('body').length) this.helper.appendTo("body"); //Add the helper to the DOM if that didn't happen already - this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortableTree-helper'); //Position it absolutely and add a helper class - - //Prepare variables for position generation - $.extend(this, { - offsetParent: this.helper.offsetParent(), - offsets: { absolute: this.currentItem.offset() } - }); - - //Save the first time position - $.extend(this, { - position: { - current: { left: e.pageX, top: e.pageY }, - absolute: { left: e.pageX, top: e.pageY }, - dom: this.currentItem.prev()[0] - }, - clickOffset: { left: -5, top: -5 } - }); - - this.propagate("start", e); //Call plugins and callbacks - this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; //Save and store the helper proportions - - for (var i = this.containers.length - 1; i >= 0; i--) { - this.containers[i].propagate("activate", e, this); - } //Post 'activate' events to possible containers - - //Prepare possible droppables - if($.ui.ddmanager) $.ui.ddmanager.current = this; - if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e); - - this.dragging = true; - return true; - - }, - mouseStop: function(e) { - - if(this.newPositionAt) this.options.sortIndication.remove.call(this.currentItem, this.newPositionAt); //remove sort indicator - this.propagate("stop", e); //Call plugins and trigger callbacks - - //If we are using droppables, inform the manager about the drop - var dropped = ($.ui.ddmanager && !this.options.dropBehaviour) ? $.ui.ddmanager.drop(this, e) : false; - if(!dropped && this.newPositionAt) this.newPositionAt[this.direction == 'down' ? 'before' : 'after'](this.currentItem); //Append to element to its new position - - if(this.position.dom != this.currentItem.prev()[0]) this.propagate("update", e); //Trigger update callback if the DOM position has changed - if(!this.element[0].contains(this.currentItem[0])) { //Node was moved out of the current element - this.propagate("remove", e); - for (var i = this.containers.length - 1; i >= 0; i--){ - if(this.containers[i].element[0].contains(this.currentItem[0])) { - this.containers[i].propagate("update", e, this); - this.containers[i].propagate("receive", e, this); - } - }; - }; - - //Post events to containers - for (var i = this.containers.length - 1; i >= 0; i--){ - this.containers[i].propagate("deactivate", e, this); - if(this.containers[i].containerCache.over) { - this.containers[i].propagate("out", e, this); - this.containers[i].containerCache.over = 0; - } - } - - this.dragging = false; - if(this.cancelHelperRemoval) return false; - this.helper.remove(); - - return false; - - }, - mouseDrag: function(e) { - - //Compute the helpers position - this.position.current = { top: e.pageY + 5, left: e.pageX + 5 }; - this.position.absolute = { left: e.pageX + 5, top: e.pageY + 5 }; - - //Interconnect with droppables - if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); - var intersectsWithDroppable = false; - $.each($.ui.ddmanager.droppables, function() { - if(this.isover) intersectsWithDroppable = true; - }); - - //Rearrange - if(intersectsWithDroppable) { - if(this.newPositionAt) this.options.sortIndication.remove.call(this.currentItem, this.newPositionAt); - } else { - for (var i = this.items.length - 1; i >= 0; i--) { - - if(this.currentItem[0].contains(this.items[i].item[0])) continue; - - var intersection = this.intersectsWithEdge(this.items[i]); - if(!intersection) continue; - - this.direction = intersection == 1 ? "down" : "up"; - this.rearrange(e, this.items[i]); - this.propagate("change", e); //Call plugins and callbacks - break; - } - } - - //Post events to containers - this.contactContainers(e); - - this.propagate("sort", e); //Call plugins and callbacks - this.helper.css({ left: this.position.current.left+'px', top: this.position.current.top+'px' }); // Stick the helper to the cursor - return false; - - }, - rearrange: function(e, i, a) { - if(i) { - if(this.newPositionAt) this.options.sortIndication.remove.call(this.currentItem, this.newPositionAt); - this.newPositionAt = i.item; - this.options.sortIndication[this.direction].call(this.currentItem, this.newPositionAt); - } else { - //Append - } - } - })); - - $.extend($.ui.sortableTree, { - defaults: { - items: '> *', - zIndex: 1000, - distance: 1 - }, - getter: "serialize toArray" - }); - - - -})(jQuery); +/* + * jQuery UI Sortable + * + * Copyright (c) 2008 Paul Bakaus + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * ui.base.js + * + * Revision: $Id: ui.sortable.js 5262 2008-04-17 13:13:51Z paul.bakaus $ + */ +;(function($) { + + if (window.Node && Node.prototype && !Node.prototype.contains) { + Node.prototype.contains = function (arg) { + return !!(this.compareDocumentPosition(arg) & 16); + }; + } + + + $.widget("ui.sortableTree", $.extend($.ui.mouse, { + init: function() { + + //Initialize needed constants + var self = this, o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortableTree"); + + //Get the items + this.refresh(); + + //Let's determine the parent's offset + if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative'); + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this.mouseInit(); + + //Prepare cursorAt + if(o.cursorAt && o.cursorAt.constructor == Array) + o.cursorAt = { left: o.cursorAt[0], top: o.cursorAt[1] }; + + }, + plugins: {}, + ui: function(inst) { + return { + helper: (inst || this)["helper"], + position: (inst || this)["position"].current, + absolutePosition: (inst || this)["position"].absolute, + instance: this, + options: this.options, + element: this.element, + item: (inst || this)["currentItem"], + sender: inst ? inst.element : null + }; + }, + propagate: function(n,e,inst) { + $.ui.plugin.call(this, n, [e, this.ui(inst)]); + this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]); + }, + serialize: function(o) { + + var items = $(this.options.items, this.element).not('.ui-sortableTree-helper'); //Only the items of the sortable itself + var str = []; o = o || {}; + + items.each(function() { + var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1])+'[]='+(o.key ? res[1] : res[2])); + }); + + return str.join('&'); + + }, + toArray: function(attr) { + var items = $(this.options.items, this.element).not('.ui-sortableTree-helper'); //Only the items of the sortable itself + var ret = []; + + items.each(function() { ret.push($(this).attr(attr || 'id')); }); + return ret; + }, + enable: function() { + this.element.removeClass("ui-sortableTree-disabled"); + this.options.disabled = false; + }, + disable: function() { + this.element.addClass("ui-sortableTree-disabled"); + this.options.disabled = true; + }, + /* Be careful with the following core functions */ + intersectsWith: function(item) { + + var x1 = this.position.absolute.left - 10, x2 = x1 + 10, + y1 = this.position.absolute.top - 10, y2 = y1 + 10; + var l = item.left, r = l + item.width, + t = item.top, b = t + item.height; + + return ( l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + }, + intersectsWithEdge: function(item) { + var y1 = this.position.absolute.top - 10, y2 = y1 + 10; + var t = item.top, b = t + item.height; + + if(!this.intersectsWith(item.item.parents(".ui-sortableTree").data("sortableTree").containerCache)) return false; + + if (!( t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half + + if(y2 > t && y1 < t) return 1; //Crosses top edge + if(y1 < b && y2 > b) return 2; //Crosses bottom edge + + return false; + + }, + refresh: function() { + this.refreshItems(); + this.refreshPositions(); + }, + refreshItems: function() { + + this.items = []; + this.containers = [this]; + var items = this.items; + var queries = [$(this.options.items, this.element)]; + + if(this.options.connectWith) { + for (var i = this.options.connectWith.length - 1; i >= 0; i--){ + var cur = $(this.options.connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], 'sortableTree'); + if(inst && !inst.options.disabled) { + queries.push($(inst.options.items, inst.element)); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i].each(function() { + $.data(this, 'sortableTree-item', true); // Data for target checking (mouse manager) + items.push({ + item: $(this), + width: 0, height: 0, + left: 0, top: 0 + }); + }); + }; + + }, + refreshPositions: function(fast) { + for (var i = this.items.length - 1; i >= 0; i--){ + if(!fast) this.items[i].height = this.items[i].item.outerHeight(); + this.items[i].top = this.items[i].item.offset().top; + }; + for (var i = this.containers.length - 1; i >= 0; i--){ + var p =this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height= this.containers[i].element.outerHeight(); + }; + }, + destroy: function() { + + this.element + .removeClass("ui-sortableTree ui-sortableTree-disabled") + .removeData("sortableTree") + .unbind(".sortableTree"); + this.mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData("sortableTree-item"); + + }, + contactContainers: function(e) { + for (var i = this.containers.length - 1; i >= 0; i--){ + + if(this.intersectsWith(this.containers[i].containerCache)) { + if(!this.containers[i].containerCache.over) { + + if(this.currentContainer != this.containers[i]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.position.absolute.top; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!this.containers[i].element[0].contains(this.items[j].item[0])) continue; + var cur = this.items[j].top; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + } + } + + itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance) : this.rearrange(e, null, this.containers[i].element); + this.propagate("change", e); //Call plugins and callbacks + this.containers[i].propagate("change", e, this); //Call plugins and callbacks + this.currentContainer = this.containers[i]; + + } + + this.containers[i].propagate("over", e, this); + this.containers[i].containerCache.over = 1; + } + } else { + if(this.containers[i].containerCache.over) { + this.containers[i].propagate("out", e, this); + this.containers[i].containerCache.over = 0; + } + } + + }; + }, + mouseStart: function(e,el) { + + if(this.options.disabled || this.options.type == 'static') return false; + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, nodes = $(e.target).parents().each(function() { + if($.data(this, 'sortableTree-item')) { + currentItem = $(this); + return false; + } + }); + if($.data(e.target, 'sortableTree-item')) currentItem = $(e.target); + + if(!currentItem) return false; + if(this.options.handle) { + var validHandle = false; + $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + + var o = this.options; + this.currentContainer = this; + this.refresh(); + + //Create and append the visible helper + this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone(); + if(!this.helper.parents('body').length) this.helper.appendTo("body"); //Add the helper to the DOM if that didn't happen already + this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortableTree-helper'); //Position it absolutely and add a helper class + + //Prepare variables for position generation + $.extend(this, { + offsetParent: this.helper.offsetParent(), + offsets: { absolute: this.currentItem.offset() } + }); + + //Save the first time position + $.extend(this, { + position: { + current: { left: e.pageX, top: e.pageY }, + absolute: { left: e.pageX, top: e.pageY }, + dom: this.currentItem.prev()[0] + }, + clickOffset: { left: -5, top: -5 } + }); + + this.propagate("start", e); //Call plugins and callbacks + this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; //Save and store the helper proportions + + for (var i = this.containers.length - 1; i >= 0; i--) { + this.containers[i].propagate("activate", e, this); + } //Post 'activate' events to possible containers + + //Prepare possible droppables + if($.ui.ddmanager) $.ui.ddmanager.current = this; + if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e); + + this.dragging = true; + return true; + + }, + mouseStop: function(e) { + + if(this.newPositionAt) this.options.sortIndication.remove.call(this.currentItem, this.newPositionAt); //remove sort indicator + this.propagate("stop", e); //Call plugins and trigger callbacks + + //If we are using droppables, inform the manager about the drop + var dropped = ($.ui.ddmanager && !this.options.dropBehaviour) ? $.ui.ddmanager.drop(this, e) : false; + if(!dropped && this.newPositionAt) this.newPositionAt[this.direction == 'down' ? 'before' : 'after'](this.currentItem); //Append to element to its new position + + if(this.position.dom != this.currentItem.prev()[0]) this.propagate("update", e); //Trigger update callback if the DOM position has changed + if(!this.element[0].contains(this.currentItem[0])) { //Node was moved out of the current element + this.propagate("remove", e); + for (var i = this.containers.length - 1; i >= 0; i--){ + if(this.containers[i].element[0].contains(this.currentItem[0])) { + this.containers[i].propagate("update", e, this); + this.containers[i].propagate("receive", e, this); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i].propagate("deactivate", e, this); + if(this.containers[i].containerCache.over) { + this.containers[i].propagate("out", e, this); + this.containers[i].containerCache.over = 0; + } + } + + this.dragging = false; + if(this.cancelHelperRemoval) return false; + this.helper.remove(); + + return false; + + }, + mouseDrag: function(e) { + + //Compute the helpers position + this.position.current = { top: e.pageY + 5, left: e.pageX + 5 }; + this.position.absolute = { left: e.pageX + 5, top: e.pageY + 5 }; + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); + var intersectsWithDroppable = false; + $.each($.ui.ddmanager.droppables, function() { + if(this.isover) intersectsWithDroppable = true; + }); + + //Rearrange + if(intersectsWithDroppable) { + if(this.newPositionAt) this.options.sortIndication.remove.call(this.currentItem, this.newPositionAt); + } else { + for (var i = this.items.length - 1; i >= 0; i--) { + + if(this.currentItem[0].contains(this.items[i].item[0])) continue; + + var intersection = this.intersectsWithEdge(this.items[i]); + if(!intersection) continue; + + this.direction = intersection == 1 ? "down" : "up"; + this.rearrange(e, this.items[i]); + this.propagate("change", e); //Call plugins and callbacks + break; + } + } + + //Post events to containers + this.contactContainers(e); + + this.propagate("sort", e); //Call plugins and callbacks + this.helper.css({ left: this.position.current.left+'px', top: this.position.current.top+'px' }); // Stick the helper to the cursor + return false; + + }, + rearrange: function(e, i, a) { + if(i) { + if(this.newPositionAt) this.options.sortIndication.remove.call(this.currentItem, this.newPositionAt); + this.newPositionAt = i.item; + this.options.sortIndication[this.direction].call(this.currentItem, this.newPositionAt); + } else { + //Append + } + } + })); + + $.extend($.ui.sortableTree, { + defaults: { + items: '> *', + zIndex: 1000, + distance: 1 + }, + getter: "serialize toArray" + }); + + + +})(jQuery); diff --git a/htdocs/includes/jquery/plugins/layout/jquery.layout-latest.js b/htdocs/includes/jquery/plugins/layout/jquery.layout-latest.js index 270ddb1d08e..3e5d8d8f893 100644 --- a/htdocs/includes/jquery/plugins/layout/jquery.layout-latest.js +++ b/htdocs/includes/jquery/plugins/layout/jquery.layout-latest.js @@ -1,5919 +1,5919 @@ -/** - * @preserve - * jquery.layout 1.3.0 - Release Candidate 30.74 - * $Date: 2012-10-28 08:00:00 (Sun, 28 Oct 2012) $ - * $Rev: 303007 $ - * - * Copyright (c) 2012 - * Fabrizio Balliano (http://www.fabrizioballiano.net) - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.74 - * - * Docs: http://layout.jquery-dev.net/documentation.html - * Tips: http://layout.jquery-dev.net/tips.html - * Help: http://groups.google.com/group/jquery-ui-layout - */ - -/* JavaDoc Info: http://code.google.com/closure/compiler/docs/js-for-compiler.html - * {!Object} non-nullable type (never NULL) - * {?string} nullable type (sometimes NULL) - default for {Object} - * {number=} optional parameter - * {*} ALL types - */ - -// NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars - -;(function ($) { - -// alias Math methods - used a lot! -var min = Math.min -, max = Math.max -, round = Math.floor - -, isStr = function (v) { return $.type(v) === "string"; } - - /** - * @param {!Object} Instance - * @param {Array.} a_fn - */ -, runPluginCallbacks = function (Instance, a_fn) { - if ($.isArray(a_fn)) - for (var i=0, c=a_fn.length; i').appendTo("body"); - var d = { width: $c.css("width") - $c[0].clientWidth, height: $c.height() - $c[0].clientHeight }; - $c.remove(); - window.scrollbarWidth = d.width; - window.scrollbarHeight = d.height; - return dim.match(/^(width|height)$/) ? d[dim] : d; - } - - - /** - * Returns hash container 'display' and 'visibility' - * - * @see $.swap() - swaps CSS, runs callback, resets CSS - * @param {!Object} $E jQuery element - * @param {boolean=} [force=false] Run even if display != none - * @return {!Object} Returns current style props, if applicable - */ -, showInvisibly: function ($E, force) { - if ($E && $E.length && (force || $E.css("display") === "none")) { // only if not *already hidden* - var s = $E[0].style - // save ONLY the 'style' props because that is what we must restore - , CSS = { display: s.display || '', visibility: s.visibility || '' }; - // show element 'invisibly' so can be measured - $E.css({ display: "block", visibility: "hidden" }); - return CSS; - } - return {}; - } - - /** - * Returns data for setting size of an element (container or a pane). - * - * @see _create(), onWindowResize() for container, plus others for pane - * @return JSON Returns a hash of all dimensions: top, bottom, left, right, outerWidth, innerHeight, etc - */ -, getElementDimensions: function ($E, inset) { - var - // dimensions hash - start with current data IF passed - d = { css: {}, inset: {} } - , x = d.css // CSS hash - , i = { bottom: 0 } // TEMP insets (bottom = complier hack) - , N = $.layout.cssNum - , off = $E.offset() - , b, p, ei // TEMP border, padding - ; - d.offsetLeft = off.left; - d.offsetTop = off.top; - - if (!inset) inset = {}; // simplify logic below - - $.each("Left,Right,Top,Bottom".split(","), function (idx, e) { // e = edge - b = x["border" + e] = $.layout.borderWidth($E, e); - p = x["padding"+ e] = $.layout.cssNum($E, "padding"+e); - ei = e.toLowerCase(); - d.inset[ei] = inset[ei] >= 0 ? inset[ei] : p; // any missing insetX value = paddingX - i[ei] = d.inset[ei] + b; // total offset of content from outer side - }); - - x.width = $E.css("width"); - x.height = $E.height(); - x.top = N($E,"top",true); - x.bottom = N($E,"bottom",true); - x.left = N($E,"left",true); - x.right = N($E,"right",true); - - d.outerWidth = $E.outerWidth(); - d.outerHeight = $E.outerHeight(); - // calc the TRUE inner-dimensions, even in quirks-mode! - d.innerWidth = max(0, d.outerWidth - i.left - i.right); - d.innerHeight = max(0, d.outerHeight - i.top - i.bottom); - // layoutWidth/Height is used in calcs for manual resizing - // layoutW/H only differs from innerW/H when in quirks-mode - then is like outerW/H - d.layoutWidth = $E.innerWidth(); - d.layoutHeight = $E.innerHeight(); - - //if ($E.prop('tagName') === 'BODY') { debugData( d, $E.prop('tagName') ); } // DEBUG - - //d.visible = $E.is(":visible");// && x.width > 0 && x.height > 0; - - return d; - } - -, getElementStyles: function ($E, list) { - var - CSS = {} - , style = $E[0].style - , props = list.split(",") - , sides = "Top,Bottom,Left,Right".split(",") - , attrs = "Color,Style,Width".split(",") - , p, s, a, i, j, k - ; - for (i=0; i < props.length; i++) { - p = props[i]; - if (p.match(/(border|padding|margin)$/)) - for (j=0; j < 4; j++) { - s = sides[j]; - if (p === "border") - for (k=0; k < 3; k++) { - a = attrs[k]; - CSS[p+s+a] = style[p+s+a]; - } - else - CSS[p+s] = style[p+s]; - } - else - CSS[p] = style[p]; - }; - return CSS - } - - /** - * Return the innerWidth for the current browser/doctype - * - * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() - * @param {Array.} $E Must pass a jQuery object - first element is processed - * @param {number=} outerWidth (optional) Can pass a width, allowing calculations BEFORE element is resized - * @return {number} Returns the innerWidth of the elem by subtracting padding and borders - */ -, cssWidth: function ($E, outerWidth) { - // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed - if (outerWidth <= 0) return 0; - - if (!$.layout.browser.boxModel) return outerWidth; - - // strip border and padding from outerWidth to get CSS Width - var b = $.layout.borderWidth - , n = $.layout.cssNum - , W = outerWidth - - b($E, "Left") - - b($E, "Right") - - n($E, "paddingLeft") - - n($E, "paddingRight"); - - return max(0,W); - } - - /** - * Return the innerHeight for the current browser/doctype - * - * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() - * @param {Array.} $E Must pass a jQuery object - first element is processed - * @param {number=} outerHeight (optional) Can pass a width, allowing calculations BEFORE element is resized - * @return {number} Returns the innerHeight of the elem by subtracting padding and borders - */ -, cssHeight: function ($E, outerHeight) { - // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed - if (outerHeight <= 0) return 0; - - if (!$.layout.browser.boxModel) return outerHeight; - - // strip border and padding from outerHeight to get CSS Height - var b = $.layout.borderWidth - , n = $.layout.cssNum - , H = outerHeight - - b($E, "Top") - - b($E, "Bottom") - - n($E, "paddingTop") - - n($E, "paddingBottom"); - - return max(0,H); - } - - /** - * Returns the 'current CSS numeric value' for a CSS property - 0 if property does not exist - * - * @see Called by many methods - * @param {Array.} $E Must pass a jQuery object - first element is processed - * @param {string} prop The name of the CSS property, eg: top, width, etc. - * @param {boolean=} [allowAuto=false] true = return 'auto' if that is value; false = return 0 - * @return {(string|number)} Usually used to get an integer value for position (top, left) or size (height, width) - */ -, cssNum: function ($E, prop, allowAuto) { - if (!$E.jquery) $E = $($E); - var CSS = $.layout.showInvisibly($E) - , p = $.css($E[0], prop, true) - , v = allowAuto && p=="auto" ? p : Math.round(parseFloat(p) || 0); - $E.css( CSS ); // RESET - return v; - } - -, borderWidth: function (el, side) { - if (el.jquery) el = el[0]; - var b = "border"+ side.substr(0,1).toUpperCase() + side.substr(1); // left => Left - return $.css(el, b+"Style", true) === "none" ? 0 : Math.round(parseFloat($.css(el, b+"Width", true)) || 0); - } - - /** - * Mouse-tracking utility - FUTURE REFERENCE - * - * init: if (!window.mouse) { - * window.mouse = { x: 0, y: 0 }; - * $(document).mousemove( $.layout.trackMouse ); - * } - * - * @param {Object} evt - * -, trackMouse: function (evt) { - window.mouse = { x: evt.clientX, y: evt.clientY }; - } - */ - - /** - * SUBROUTINE for preventPrematureSlideClose option - * - * @param {Object} evt - * @param {Object=} el - */ -, isMouseOverElem: function (evt, el) { - var - $E = $(el || this) - , d = $E.offset() - , T = d.top - , L = d.left - , R = L + $E.outerWidth() - , B = T + $E.outerHeight() - , x = evt.pageX // evt.clientX ? - , y = evt.pageY // evt.clientY ? - ; - // if X & Y are < 0, probably means is over an open SELECT - return ($.layout.browser.msie && x < 0 && y < 0) || ((x >= L && x <= R) && (y >= T && y <= B)); - } - - /** - * Message/Logging Utility - * - * @example $.layout.msg("My message"); // log text - * @example $.layout.msg("My message", true); // alert text - * @example $.layout.msg({ foo: "bar" }, "Title"); // log hash-data, with custom title - * @example $.layout.msg({ foo: "bar" }, true, "Title", { sort: false }); -OR- - * @example $.layout.msg({ foo: "bar" }, "Title", { sort: false, display: true }); // alert hash-data - * - * @param {(Object|string)} info String message OR Hash/Array - * @param {(Boolean|string|Object)=} [popup=false] True means alert-box - can be skipped - * @param {(Object|string)=} [debugTitle=""] Title for Hash data - can be skipped - * @param {Object=} [debugOpts] Extra options for debug output - */ -, msg: function (info, popup, debugTitle, debugOpts) { - if ($.isPlainObject(info) && window.debugData) { - if (typeof popup === "string") { - debugOpts = debugTitle; - debugTitle = popup; - } - else if (typeof debugTitle === "object") { - debugOpts = debugTitle; - debugTitle = null; - } - var t = debugTitle || "log( )" - , o = $.extend({ sort: false, returnHTML: false, display: false }, debugOpts); - if (popup === true || o.display) - debugData( info, t, o ); - else if (window.console) - console.log(debugData( info, t, o )); - } - else if (popup) - alert(info); - else if (window.console) - console.log(info); - else { - var id = "#layoutLogger" - , $l = $(id); - if (!$l.length) - $l = createLog(); - $l.children("ul").append('
          • '+ info.replace(/\/g,">") +'
          • '); - } - - function createLog () { - var pos = $.support.fixedPosition ? 'fixed' : 'absolute' - , $e = $('
            ' - + '
            ' - + 'XLayout console.log
            ' - + '
              ' - + '
              ' - ).appendTo("body"); - $e.css('left', $(window).width() - $e.outerWidth() - 5) - if ($.ui.draggable) $e.draggable({ handle: ':first-child' }); - return $e; - }; - } - -}; - -// DEFAULT OPTIONS -$.layout.defaults = { -/* - * LAYOUT & LAYOUT-CONTAINER OPTIONS - * - none of these options are applicable to individual panes - */ - name: "" // Not required, but useful for buttons and used for the state-cookie -, containerClass: "ui-layout-container" // layout-container element -, inset: null // custom container-inset values (override padding) -, scrollToBookmarkOnLoad: true // after creating a layout, scroll to bookmark in URL (.../page.htm#myBookmark) -, resizeWithWindow: true // bind thisLayout.resizeAll() to the window.resize event -, resizeWithWindowDelay: 200 // delay calling resizeAll because makes window resizing very jerky -, resizeWithWindowMaxDelay: 0 // 0 = none - force resize every XX ms while window is being resized -, maskPanesEarly: false // true = create pane-masks on resizer.mouseDown instead of waiting for resizer.dragstart -, onresizeall_start: null // CALLBACK when resizeAll() STARTS - NOT pane-specific -, onresizeall_end: null // CALLBACK when resizeAll() ENDS - NOT pane-specific -, onload_start: null // CALLBACK when Layout inits - after options initialized, but before elements -, onload_end: null // CALLBACK when Layout inits - after EVERYTHING has been initialized -, onunload_start: null // CALLBACK when Layout is destroyed OR onWindowUnload -, onunload_end: null // CALLBACK when Layout is destroyed OR onWindowUnload -, initPanes: true // false = DO NOT initialize the panes onLoad - will init later -, showErrorMessages: true // enables fatal error messages to warn developers of common errors -, showDebugMessages: false // display console-and-alert debug msgs - IF this Layout version _has_ debugging code! -// Changing this zIndex value will cause other zIndex values to automatically change -, zIndex: null // the PANE zIndex - resizers and masks will be +1 -// DO NOT CHANGE the zIndex values below unless you clearly understand their relationships -, zIndexes: { // set _default_ z-index values here... - pane_normal: 0 // normal z-index for panes - , content_mask: 1 // applied to overlays used to mask content INSIDE panes during resizing - , resizer_normal: 2 // normal z-index for resizer-bars - , pane_sliding: 100 // applied to *BOTH* the pane and its resizer when a pane is 'slid open' - , pane_animate: 1000 // applied to the pane when being animated - not applied to the resizer - , resizer_drag: 10000 // applied to the CLONED resizer-bar when being 'dragged' - } -, errors: { - pane: "pane" // description of "layout pane element" - used only in error messages - , selector: "selector" // description of "jQuery-selector" - used only in error messages - , addButtonError: "Error Adding Button \n\nInvalid " - , containerMissing: "UI Layout Initialization Error\n\nThe specified layout-container does not exist." - , centerPaneMissing: "UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element." - , noContainerHeight: "UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!" - , callbackError: "UI Layout Callback Error\n\nThe EVENT callback is not a valid function." - } -/* - * PANE DEFAULT SETTINGS - * - settings under the 'panes' key become the default settings for *all panes* - * - ALL pane-options can also be set specifically for each panes, which will override these 'default values' - */ -, panes: { // default options for 'all panes' - will be overridden by 'per-pane settings' - applyDemoStyles: false // NOTE: renamed from applyDefaultStyles for clarity - , closable: true // pane can open & close - , resizable: true // when open, pane can be resized - , slidable: true // when closed, pane can 'slide open' over other panes - closes on mouse-out - , initClosed: false // true = init pane as 'closed' - , initHidden: false // true = init pane as 'hidden' - no resizer-bar/spacing - // SELECTORS - //, paneSelector: "" // MUST be pane-specific - jQuery selector for pane - , contentSelector: ".ui-layout-content" // INNER div/element to auto-size so only it scrolls, not the entire pane! - , contentIgnoreSelector: ".ui-layout-ignore" // element(s) to 'ignore' when measuring 'content' - , findNestedContent: false // true = $P.find(contentSelector), false = $P.children(contentSelector) - // GENERIC ROOT-CLASSES - for auto-generated classNames - , paneClass: "ui-layout-pane" // Layout Pane - , resizerClass: "ui-layout-resizer" // Resizer Bar - , togglerClass: "ui-layout-toggler" // Toggler Button - , buttonClass: "ui-layout-button" // CUSTOM Buttons - eg: '[ui-layout-button]-toggle/-open/-close/-pin' - // ELEMENT SIZE & SPACING - //, size: 100 // MUST be pane-specific -initial size of pane - , minSize: 0 // when manually resizing a pane - , maxSize: 0 // ditto, 0 = no limit - , spacing_open: 6 // space between pane and adjacent panes - when pane is 'open' - , spacing_closed: 6 // ditto - when pane is 'closed' - , togglerLength_open: 50 // Length = WIDTH of toggler button on north/south sides - HEIGHT on east/west sides - , togglerLength_closed: 50 // 100% OR -1 means 'full height/width of resizer bar' - 0 means 'hidden' - , togglerAlign_open: "center" // top/left, bottom/right, center, OR... - , togglerAlign_closed: "center" // 1 => nn = offset from top/left, -1 => -nn == offset from bottom/right - , togglerContent_open: "" // text or HTML to put INSIDE the toggler - , togglerContent_closed: "" // ditto - // RESIZING OPTIONS - , resizerDblClickToggle: true // - , autoResize: true // IF size is 'auto' or a percentage, then recalc 'pixel size' whenever the layout resizes - , autoReopen: true // IF a pane was auto-closed due to noRoom, reopen it when there is room? False = leave it closed - , resizerDragOpacity: 1 // option for ui.draggable - //, resizerCursor: "" // MUST be pane-specific - cursor when over resizer-bar - , maskContents: false // true = add DIV-mask over-or-inside this pane so can 'drag' over IFRAMES - , maskObjects: false // true = add IFRAME-mask over-or-inside this pane to cover objects/applets - content-mask will overlay this mask - , maskZindex: null // will override zIndexes.content_mask if specified - not applicable to iframe-panes - , resizingGrid: false // grid size that the resizers will snap-to during resizing, eg: [20,20] - , livePaneResizing: false // true = LIVE Resizing as resizer is dragged - , liveContentResizing: false // true = re-measure header/footer heights as resizer is dragged - , liveResizingTolerance: 1 // how many px change before pane resizes, to control performance - // SLIDING OPTIONS - , sliderCursor: "pointer" // cursor when resizer-bar will trigger 'sliding' - , slideTrigger_open: "click" // click, dblclick, mouseenter - , slideTrigger_close: "mouseleave"// click, mouseleave - , slideDelay_open: 300 // applies only for mouseenter event - 0 = instant open - , slideDelay_close: 300 // applies only for mouseleave event (300ms is the minimum!) - , hideTogglerOnSlide: false // when pane is slid-open, should the toggler show? - , preventQuickSlideClose: $.layout.browser.webkit // Chrome triggers slideClosed as it is opening - , preventPrematureSlideClose: false // handle incorrect mouseleave trigger, like when over a SELECT-list in IE - // PANE-SPECIFIC TIPS & MESSAGES - , tips: { - Open: "Open" // eg: "Open Pane" - , Close: "Close" - , Resize: "Resize" - , Slide: "Slide Open" - , Pin: "Pin" - , Unpin: "Un-Pin" - , noRoomToOpen: "Not enough room to show this panel." // alert if user tries to open a pane that cannot - , minSizeWarning: "Panel has reached its minimum size" // displays in browser statusbar - , maxSizeWarning: "Panel has reached its maximum size" // ditto - } - // HOT-KEYS & MISC - , showOverflowOnHover: false // will bind allowOverflow() utility to pane.onMouseOver - , enableCursorHotkey: true // enabled 'cursor' hotkeys - //, customHotkey: "" // MUST be pane-specific - EITHER a charCode OR a character - , customHotkeyModifier: "SHIFT" // either 'SHIFT', 'CTRL' or 'CTRL+SHIFT' - NOT 'ALT' - // PANE ANIMATION - // NOTE: fxSss_open, fxSss_close & fxSss_size options (eg: fxName_open) are auto-generated if not passed - , fxName: "slide" // ('none' or blank), slide, drop, scale -- only relevant to 'open' & 'close', NOT 'size' - , fxSpeed: null // slow, normal, fast, 200, nnn - if passed, will OVERRIDE fxSettings.duration - , fxSettings: {} // can be passed, eg: { easing: "easeOutBounce", duration: 1500 } - , fxOpacityFix: true // tries to fix opacity in IE to restore anti-aliasing after animation - , animatePaneSizing: false // true = animate resizing after dragging resizer-bar OR sizePane() is called - /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set: - fxName_open: "slide" // 'Open' pane animation - fnName_close: "slide" // 'Close' pane animation - fxName_size: "slide" // 'Size' pane animation - when animatePaneSizing = true - fxSpeed_open: null - fxSpeed_close: null - fxSpeed_size: null - fxSettings_open: {} - fxSettings_close: {} - fxSettings_size: {} - */ - // CHILD/NESTED LAYOUTS - , children: null // Layout-options for nested/child layout - even {} is valid as options - , containerSelector: '' // if child is NOT 'directly nested', a selector to find it/them (can have more than one child layout!) - , initChildren: true // true = child layout will be created as soon as _this_ layout completes initialization - , destroyChildren: true // true = destroy child-layout if this pane is destroyed - , resizeChildren: true // true = trigger child-layout.resizeAll() when this pane is resized - // EVENT TRIGGERING - , triggerEventsOnLoad: false // true = trigger onopen OR onclose callbacks when layout initializes - , triggerEventsDuringLiveResize: true // true = trigger onresize callback REPEATEDLY if livePaneResizing==true - // PANE CALLBACKS - , onshow_start: null // CALLBACK when pane STARTS to Show - BEFORE onopen/onhide_start - , onshow_end: null // CALLBACK when pane ENDS being Shown - AFTER onopen/onhide_end - , onhide_start: null // CALLBACK when pane STARTS to Close - BEFORE onclose_start - , onhide_end: null // CALLBACK when pane ENDS being Closed - AFTER onclose_end - , onopen_start: null // CALLBACK when pane STARTS to Open - , onopen_end: null // CALLBACK when pane ENDS being Opened - , onclose_start: null // CALLBACK when pane STARTS to Close - , onclose_end: null // CALLBACK when pane ENDS being Closed - , onresize_start: null // CALLBACK when pane STARTS being Resized ***FOR ANY REASON*** - , onresize_end: null // CALLBACK when pane ENDS being Resized ***FOR ANY REASON*** - , onsizecontent_start: null // CALLBACK when sizing of content-element STARTS - , onsizecontent_end: null // CALLBACK when sizing of content-element ENDS - , onswap_start: null // CALLBACK when pane STARTS to Swap - , onswap_end: null // CALLBACK when pane ENDS being Swapped - , ondrag_start: null // CALLBACK when pane STARTS being ***MANUALLY*** Resized - , ondrag_end: null // CALLBACK when pane ENDS being ***MANUALLY*** Resized - } -/* - * PANE-SPECIFIC SETTINGS - * - options listed below MUST be specified per-pane - they CANNOT be set under 'panes' - * - all options under the 'panes' key can also be set specifically for any pane - * - most options under the 'panes' key apply only to 'border-panes' - NOT the the center-pane - */ -, north: { - paneSelector: ".ui-layout-north" - , size: "auto" // eg: "auto", "30%", .30, 200 - , resizerCursor: "n-resize" // custom = url(myCursor.cur) - , customHotkey: "" // EITHER a charCode (43) OR a character ("o") - } -, south: { - paneSelector: ".ui-layout-south" - , size: "auto" - , resizerCursor: "s-resize" - , customHotkey: "" - } -, east: { - paneSelector: ".ui-layout-east" - , size: 200 - , resizerCursor: "e-resize" - , customHotkey: "" - } -, west: { - paneSelector: ".ui-layout-west" - , size: 200 - , resizerCursor: "w-resize" - , customHotkey: "" - } -, center: { - paneSelector: ".ui-layout-center" - , minWidth: 0 - , minHeight: 0 - } -}; - -$.layout.optionsMap = { - // layout/global options - NOT pane-options - layout: ("name,instanceKey,stateManagement,effects,inset,zIndexes,errors," - + "zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly," - + "outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay," - + "onresizeall,onresizeall_start,onresizeall_end,onload,onunload").split(",") -// borderPanes: [ ALL options that are NOT specified as 'layout' ] - // default.panes options that apply to the center-pane (most options apply _only_ to border-panes) -, center: ("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad," - + "showOverflowOnHover,maskContents,maskObjects,liveContentResizing," - + "containerSelector,children,initChildren,resizeChildren,destroyChildren," - + "onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(",") - // options that MUST be specifically set 'per-pane' - CANNOT set in the panes (defaults) key -, noDefault: ("paneSelector,resizerCursor,customHotkey").split(",") -}; - -/** - * Processes options passed in converts flat-format data into subkey (JSON) format - * In flat-format, subkeys are _currently_ separated with 2 underscores, like north__optName - * Plugins may also call this method so they can transform their own data - * - * @param {!Object} hash Data/options passed by user - may be a single level or nested levels - * @param {boolean=} [addKeys=false] Should the primary layout.options keys be added if they do not exist? - * @return {Object} Returns hash of minWidth & minHeight - */ -$.layout.transformData = function (hash, addKeys) { - var json = addKeys ? { panes: {}, center: {} } : {} // init return object - , branch, optKey, keys, key, val, i, c; - - if (typeof hash !== "object") return json; // no options passed - - // convert all 'flat-keys' to 'sub-key' format - for (optKey in hash) { - branch = json; - val = hash[ optKey ]; - keys = optKey.split("__"); // eg: west__size or north__fxSettings__duration - c = keys.length - 1; - // convert underscore-delimited to subkeys - for (i=0; i <= c; i++) { - key = keys[i]; - if (i === c) { // last key = value - if ($.isPlainObject( val )) - branch[key] = $.layout.transformData( val ); // RECURSE - else - branch[key] = val; - } - else { - if (!branch[key]) - branch[key] = {}; // create the subkey - // recurse to sub-key for next loop - if not done - branch = branch[key]; - } - } - } - return json; -}; - -// INTERNAL CONFIG DATA - DO NOT CHANGE THIS! -$.layout.backwardCompatibility = { - // data used by renameOldOptions() - map: { - // OLD Option Name: NEW Option Name - applyDefaultStyles: "applyDemoStyles" - // CHILD/NESTED LAYOUTS - , childOptions: "children" - , initChildLayout: "initChildren" - , destroyChildLayout: "destroyChildren" - , resizeChildLayout: "resizeChildren" - , resizeNestedLayout: "resizeChildren" - // MISC Options - , resizeWhileDragging: "livePaneResizing" - , resizeContentWhileDragging: "liveContentResizing" - , triggerEventsWhileDragging: "triggerEventsDuringLiveResize" - , maskIframesOnResize: "maskContents" - // STATE MANAGEMENT - , useStateCookie: "stateManagement.enabled" - , "cookie.autoLoad": "stateManagement.autoLoad" - , "cookie.autoSave": "stateManagement.autoSave" - , "cookie.keys": "stateManagement.stateKeys" - , "cookie.name": "stateManagement.cookie.name" - , "cookie.domain": "stateManagement.cookie.domain" - , "cookie.path": "stateManagement.cookie.path" - , "cookie.expires": "stateManagement.cookie.expires" - , "cookie.secure": "stateManagement.cookie.secure" - // OLD Language options - , noRoomToOpenTip: "tips.noRoomToOpen" - , togglerTip_open: "tips.Close" // open = Close - , togglerTip_closed: "tips.Open" // closed = Open - , resizerTip: "tips.Resize" - , sliderTip: "tips.Slide" - } - -/** -* @param {Object} opts -*/ -, renameOptions: function (opts) { - var map = $.layout.backwardCompatibility.map - , oldData, newData, value - ; - for (var itemPath in map) { - oldData = getBranch( itemPath ); - value = oldData.branch[ oldData.key ]; - if (value !== undefined) { - newData = getBranch( map[itemPath], true ); - newData.branch[ newData.key ] = value; - delete oldData.branch[ oldData.key ]; - } - } - - /** - * @param {string} path - * @param {boolean=} [create=false] Create path if does not exist - */ - function getBranch (path, create) { - var a = path.split(".") // split keys into array - , c = a.length - 1 - , D = { branch: opts, key: a[c] } // init branch at top & set key (last item) - , i = 0, k, undef; - for (; i 0) { - if (autoHide && $E.data('autoHidden') && $E.innerHeight() > 0) { - $E.show().data('autoHidden', false); - if (!browser.mozilla) // FireFox refreshes iframes - IE does not - // make hidden, then visible to 'refresh' display after animation - $E.css(_c.hidden).css(_c.visible); - } - } - else if (autoHide && !$E.data('autoHidden')) - $E.hide().data('autoHidden', true); - } - - /** - * @param {(string|!Object)} el - * @param {number=} outerHeight - * @param {boolean=} [autoHide=false] - */ -, setOuterHeight = function (el, outerHeight, autoHide) { - var $E = el, h; - if (isStr(el)) $E = $Ps[el]; // west - else if (!el.jquery) $E = $(el); - h = cssH($E, outerHeight); - $E.css({ height: h, visibility: "visible" }); // may have been 'hidden' by sizeContent - if (h > 0 && $E.innerWidth() > 0) { - if (autoHide && $E.data('autoHidden')) { - $E.show().data('autoHidden', false); - if (!browser.mozilla) // FireFox refreshes iframes - IE does not - $E.css(_c.hidden).css(_c.visible); - } - } - else if (autoHide && !$E.data('autoHidden')) - $E.hide().data('autoHidden', true); - } - - - /** - * Converts any 'size' params to a pixel/integer size, if not already - * If 'auto' or a decimal/percentage is passed as 'size', a pixel-size is calculated - * - /** - * @param {string} pane - * @param {(string|number)=} size - * @param {string=} [dir] - * @return {number} - */ -, _parseSize = function (pane, size, dir) { - if (!dir) dir = _c[pane].dir; - - if (isStr(size) && size.match(/%/)) - size = (size === '100%') ? -1 : parseInt(size, 10) / 100; // convert % to decimal - - if (size === 0) - return 0; - else if (size >= 1) - return parseInt(size, 10); - - var o = options, avail = 0; - if (dir=="horz") // north or south or center.minHeight - avail = sC.innerHeight - ($Ps.north ? o.north.spacing_open : 0) - ($Ps.south ? o.south.spacing_open : 0); - else if (dir=="vert") // east or west or center.minWidth - avail = sC.innerWidth - ($Ps.west ? o.west.spacing_open : 0) - ($Ps.east ? o.east.spacing_open : 0); - - if (size === -1) // -1 == 100% - return avail; - else if (size > 0) // percentage, eg: .25 - return round(avail * size); - else if (pane=="center") - return 0; - else { // size < 0 || size=='auto' || size==Missing || size==Invalid - // auto-size the pane - var dim = (dir === "horz" ? "height" : "width") - , $P = $Ps[pane] - , $C = dim === 'height' ? $Cs[pane] : false - , vis = $.layout.showInvisibly($P) // show pane invisibly if hidden - , szP = $P.css(dim) // SAVE current pane size - , szC = $C ? $C.css(dim) : 0 // SAVE current content size - ; - $P.css(dim, "auto"); - if ($C) $C.css(dim, "auto"); - size = (dim === "height") ? $P.outerHeight() : $P.outerWidth(); // MEASURE - $P.css(dim, szP).css(vis); // RESET size & visibility - if ($C) $C.css(dim, szC); - return size; - } - } - - /** - * Calculates current 'size' (outer-width or outer-height) of a border-pane - optionally with 'pane-spacing' added - * - * @param {(string|!Object)} pane - * @param {boolean=} [inclSpace=false] - * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes - */ -, getPaneSize = function (pane, inclSpace) { - var - $P = $Ps[pane] - , o = options[pane] - , s = state[pane] - , oSp = (inclSpace ? o.spacing_open : 0) - , cSp = (inclSpace ? o.spacing_closed : 0) - ; - if (!$P || s.isHidden) - return 0; - else if (s.isClosed || (s.isSliding && inclSpace)) - return cSp; - else if (_c[pane].dir === "horz") - return $P.outerHeight() + oSp; - else // dir === "vert" - return $P.outerWidth() + oSp; - } - - /** - * Calculate min/max pane dimensions and limits for resizing - * - * @param {string} pane - * @param {boolean=} [slide=false] - */ -, setSizeLimits = function (pane, slide) { - if (!isInitialized()) return; - var - o = options[pane] - , s = state[pane] - , c = _c[pane] - , dir = c.dir - , type = c.sizeType.toLowerCase() - , isSliding = (slide != undefined ? slide : s.isSliding) // only open() passes 'slide' param - , $P = $Ps[pane] - , paneSpacing = o.spacing_open - // measure the pane on the *opposite side* from this pane - , altPane = _c.oppositeEdge[pane] - , altS = state[altPane] - , $altP = $Ps[altPane] - , altPaneSize = (!$altP || altS.isVisible===false || altS.isSliding ? 0 : (dir=="horz" ? $altP.outerHeight() : $altP.outerWidth())) - , altPaneSpacing = ((!$altP || altS.isHidden ? 0 : options[altPane][ altS.isClosed !== false ? "spacing_closed" : "spacing_open" ]) || 0) - // limitSize prevents this pane from 'overlapping' opposite pane - , containerSize = (dir=="horz" ? sC.innerHeight : sC.innerWidth) - , minCenterDims = cssMinDims("center") - , minCenterSize = dir=="horz" ? max(options.center.minHeight, minCenterDims.minHeight) : max(options.center.minWidth, minCenterDims.minWidth) - // if pane is 'sliding', then ignore center and alt-pane sizes - because 'overlays' them - , limitSize = (containerSize - paneSpacing - (isSliding ? 0 : (_parseSize("center", minCenterSize, dir) + altPaneSize + altPaneSpacing))) - , minSize = s.minSize = max( _parseSize(pane, o.minSize), cssMinDims(pane).minSize ) - , maxSize = s.maxSize = min( (o.maxSize ? _parseSize(pane, o.maxSize) : 100000), limitSize ) - , r = s.resizerPosition = {} // used to set resizing limits - , top = sC.inset.top - , left = sC.inset.left - , W = sC.innerWidth - , H = sC.innerHeight - , rW = o.spacing_open // subtract resizer-width to get top/left position for south/east - ; - switch (pane) { - case "north": r.min = top + minSize; - r.max = top + maxSize; - break; - case "west": r.min = left + minSize; - r.max = left + maxSize; - break; - case "south": r.min = top + H - maxSize - rW; - r.max = top + H - minSize - rW; - break; - case "east": r.min = left + W - maxSize - rW; - r.max = left + W - minSize - rW; - break; - }; - } - - /** - * Returns data for setting the size/position of center pane. Also used to set Height for east/west panes - * - * @return JSON Returns a hash of all dimensions: top, bottom, left, right, (outer) width and (outer) height - */ -, calcNewCenterPaneDims = function () { - var d = { - top: getPaneSize("north", true) // true = include 'spacing' value for pane - , bottom: getPaneSize("south", true) - , left: getPaneSize("west", true) - , right: getPaneSize("east", true) - , width: 0 - , height: 0 - }; - - // NOTE: sC = state.container - // calc center-pane outer dimensions - d.width = sC.innerWidth - d.left - d.right; // outerWidth - d.height = sC.innerHeight - d.bottom - d.top; // outerHeight - // add the 'container border/padding' to get final positions relative to the container - d.top += sC.inset.top; - d.bottom += sC.inset.bottom; - d.left += sC.inset.left; - d.right += sC.inset.right; - - return d; - } - - - /** - * @param {!Object} el - * @param {boolean=} [allStates=false] - */ -, getHoverClasses = function (el, allStates) { - var - $El = $(el) - , type = $El.data("layoutRole") - , pane = $El.data("layoutEdge") - , o = options[pane] - , root = o[type +"Class"] - , _pane = "-"+ pane // eg: "-west" - , _open = "-open" - , _closed = "-closed" - , _slide = "-sliding" - , _hover = "-hover " // NOTE the trailing space - , _state = $El.hasClass(root+_closed) ? _closed : _open - , _alt = _state === _closed ? _open : _closed - , classes = (root+_hover) + (root+_pane+_hover) + (root+_state+_hover) + (root+_pane+_state+_hover) - ; - if (allStates) // when 'removing' classes, also remove alternate-state classes - classes += (root+_alt+_hover) + (root+_pane+_alt+_hover); - - if (type=="resizer" && $El.hasClass(root+_slide)) - classes += (root+_slide+_hover) + (root+_pane+_slide+_hover); - - return $.trim(classes); - } -, addHover = function (evt, el) { - var $E = $(el || this); - if (evt && $E.data("layoutRole") === "toggler") - evt.stopPropagation(); // prevent triggering 'slide' on Resizer-bar - $E.addClass( getHoverClasses($E) ); - } -, removeHover = function (evt, el) { - var $E = $(el || this); - $E.removeClass( getHoverClasses($E, true) ); - } - -, onResizerEnter = function (evt) { // ALSO called by toggler.mouseenter - var pane = $(this).data("layoutEdge") - , s = state[pane] - ; - // ignore closed-panes and mouse moving back & forth over resizer! - // also ignore if ANY pane is currently resizing - if ( s.isClosed || s.isResizing || state.paneResizing ) return; - - if ($.fn.disableSelection) - $("body").disableSelection(); - if (options.maskPanesEarly) - showMasks( pane, { resizing: true }); - } -, onResizerLeave = function (evt, el) { - var e = el || this // el is only passed when called by the timer - , pane = $(e).data("layoutEdge") - , name = pane +"ResizerLeave" - ; - timer.clear(pane+"_openSlider"); // cancel slideOpen timer, if set - timer.clear(name); // cancel enableSelection timer - may re/set below - // this method calls itself on a timer because it needs to allow - // enough time for dragging to kick-in and set the isResizing flag - // dragging has a 100ms delay set, so this delay must be >100 - if (!el) // 1st call - mouseleave event - timer.set(name, function(){ onResizerLeave(evt, e); }, 200); - // if user is resizing, then dragStop will enableSelection(), so can skip it here - else if ( !state.paneResizing ) { // 2nd call - by timer - if ($.fn.enableSelection) - $("body").enableSelection(); - if (options.maskPanesEarly) - hideMasks(); - } - } - -/* - * ########################### - * INITIALIZATION METHODS - * ########################### - */ - - /** - * Initialize the layout - called automatically whenever an instance of layout is created - * - * @see none - triggered onInit - * @return mixed true = fully initialized | false = panes not initialized (yet) | 'cancel' = abort - */ -, _create = function () { - // initialize config/options - initOptions(); - var o = options - , s = state; - - // TEMP state so isInitialized returns true during init process - s.creatingLayout = true; - - // init plugins for this layout, if there are any (eg: stateManagement) - runPluginCallbacks( Instance, $.layout.onCreate ); - - // options & state have been initialized, so now run beforeLoad callback - // onload will CANCEL layout creation if it returns false - if (false === _runCallbacks("onload_start")) - return 'cancel'; - - // initialize the container element - _initContainer(); - - // bind hotkey function - keyDown - if required - initHotkeys(); - - // bind window.onunload - $(window).bind("unload."+ sID, unload); - - // init plugins for this layout, if there are any (eg: customButtons) - runPluginCallbacks( Instance, $.layout.onLoad ); - - // if layout elements are hidden, then layout WILL NOT complete initialization! - // initLayoutElements will set initialized=true and run the onload callback IF successful - if (o.initPanes) _initLayoutElements(); - - delete s.creatingLayout; - - return state.initialized; - } - - /** - * Initialize the layout IF not already - * - * @see All methods in Instance run this test - * @return boolean true = layoutElements have been initialized | false = panes are not initialized (yet) - */ -, isInitialized = function () { - if (state.initialized || state.creatingLayout) return true; // already initialized - else return _initLayoutElements(); // try to init panes NOW - } - - /** - * Initialize the layout - called automatically whenever an instance of layout is created - * - * @see _create() & isInitialized - * @param {boolean=} [retry=false] // indicates this is a 2nd try - * @return An object pointer to the instance created - */ -, _initLayoutElements = function (retry) { - // initialize config/options - var o = options; - // CANNOT init panes inside a hidden container! - if (!$N.is(":visible")) { - // handle Chrome bug where popup window 'has no height' - // if layout is BODY element, try again in 50ms - // SEE: http://layout.jquery-dev.net/samples/test_popup_window.html - if ( !retry && browser.webkit && $N[0].tagName === "BODY" ) - setTimeout(function(){ _initLayoutElements(true); }, 50); - return false; - } - - // a center pane is required, so make sure it exists - if (!getPane("center").length) { - return _log( o.errors.centerPaneMissing ); - } - - // TEMP state so isInitialized returns true during init process - state.creatingLayout = true; - - // update Container dims - $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values - - // initialize all layout elements - initPanes(); // size & position panes - calls initHandles() - which calls initResizable() - - if (o.scrollToBookmarkOnLoad) { - var l = self.location; - if (l.hash) l.replace( l.hash ); // scrollTo Bookmark - } - - // check to see if this layout 'nested' inside a pane - if (Instance.hasParentLayout) - o.resizeWithWindow = false; - // bind resizeAll() for 'this layout instance' to window.resize event - else if (o.resizeWithWindow) - $(window).bind("resize."+ sID, windowResize); - - delete state.creatingLayout; - state.initialized = true; - - // init plugins for this layout, if there are any - runPluginCallbacks( Instance, $.layout.onReady ); - - // now run the onload callback, if exists - _runCallbacks("onload_end"); - - return true; // elements initialized successfully - } - - /** - * Initialize nested layouts for a specific pane - can optionally pass layout-options - * - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].children - * @return An object pointer to the layout instance created - or null - */ -, createChildren = function (evt_or_pane, opts) { - var pane = evtPane.call(this, evt_or_pane) - , $P = $Ps[pane] - ; - if (!$P) return; - var $C = $Cs[pane] - , s = state[pane] - , o = options[pane] - , sm = options.stateManagement || {} - , cos = opts ? (o.children = opts) : o.children - ; - if ( $.isPlainObject( cos ) ) - cos = [ cos ]; // convert a hash to a 1-elem array - else if (!cos || !$.isArray( cos )) - return; - - $.each( cos, function (idx, co) { - if ( !$.isPlainObject( co ) ) return; - - // determine which element is supposed to be the 'child container' - // if pane has a 'containerSelector' OR a 'content-div', use those instead of the pane - var $containers = co.containerSelector ? $P.find( co.containerSelector ) : ($C || $P); - - $containers.each(function(){ - var $cont = $(this) - , child = $cont.data("layout") // see if a child-layout ALREADY exists on this element - ; - // if no layout exists, but children are set, try to create the layout now - if (!child) { - // TODO: see about moving this to the stateManagement plugin, as a method - // set a unique child-instance key for this layout, if not already set - setInstanceKey({ container: $cont, options: co }, s ); - // If THIS layout has a hash in stateManagement.autoLoad, - // then see if it also contains state-data for this child-layout - // If so, copy the stateData to child.options.stateManagement.autoLoad - if ( sm.includeChildren && state.stateData[pane] ) { - // THIS layout's state was cached when its state was loaded - var paneChildren = state.stateData[pane].children || {} - , childState = paneChildren[ co.instanceKey ] - , co_sm = co.stateManagement || (co.stateManagement = { autoLoad: true }) - ; - // COPY the stateData into the autoLoad key - if ( co_sm.autoLoad === true && childState ) { - co_sm.autoSave = false; // disable autoSave because saving handled by parent-layout - co_sm.includeChildren = true; // cascade option - FOR NOW - co_sm.autoLoad = $.extend(true, {}, childState); // COPY the state-hash - } - } - - // create the layout - child = $cont.layout( co ); - - // if successful, update data - if (child) { - // add the child and update all layout-pointers - // MAY have already been done by child-layout calling parent.refreshChildren() - refreshChildren( pane, child ); - } - } - }); - }); - } - -, setInstanceKey = function (child, parentPaneState) { - // create a named key for use in state and instance branches - var $c = child.container - , o = child.options - , sm = o.stateManagement - , key = o.instanceKey || $c.data("layoutInstanceKey") - ; - if (!key) key = (sm && sm.cookie ? sm.cookie.name : '') || o.name; // look for a name/key - if (!key) key = "layout"+ (++parentPaneState.childIdx); // if no name/key found, generate one - else key = key.replace(/[^\w-]/gi, '_').replace(/_{2,}/g, '_'); // ensure is valid as a hash key - o.instanceKey = key; - $c.data("layoutInstanceKey", key); // useful if layout is destroyed and then recreated - return key; - } - - /** - * @param {string} pane The pane being opened, ie: north, south, east, or west - * @param {Object=} newChild New child-layout Instance to add to this pane - */ -, refreshChildren = function (pane, newChild) { - var $P = $Ps[pane] - , pC = children[pane] - , s = state[pane] - , o - ; - // check for destroy()ed layouts and update the child pointers & arrays - if ($.isPlainObject( pC )) { - $.each( pC, function (key, child) { - if (child.destroyed) delete pC[key] - }); - // if no more children, remove the children hash - if ($.isEmptyObject( pC )) - pC = children[pane] = null; // clear children hash - } - - // see if there is a directly-nested layout inside this pane - // if there is, then there can be only ONE child-layout, so check that... - if (!newChild && !pC) { - newChild = $P.data("layout"); - } - - // if a newChild instance was passed, add it to children[pane] - if (newChild) { - // update child.state - newChild.hasParentLayout = true; // set parent-flag in child - // instanceKey is a key-name used in both state and children - o = newChild.options; - // set a unique child-instance key for this layout, if not already set - setInstanceKey( newChild, s ); - // add pointer to pane.children hash - if (!pC) pC = children[pane] = {}; // create an empty children hash - pC[ o.instanceKey ] = newChild.container.data("layout"); // add childLayout instance - } - - // ALWAYS refresh the pane.children alias, even if null - Instance[pane].children = children[pane]; - - // if newChild was NOT passed - see if there is a child layout NOW - if (!newChild) { - createChildren(pane); // MAY create a child and re-call this method - } - } - -, windowResize = function () { - var o = options - , delay = Number(o.resizeWithWindowDelay); - if (delay < 10) delay = 100; // MUST have a delay! - // resizing uses a delay-loop because the resize event fires repeatly - except in FF, but delay anyway - timer.clear("winResize"); // if already running - timer.set("winResize", function(){ - timer.clear("winResize"); - timer.clear("winResizeRepeater"); - var dims = elDims( $N, o.inset ); - // only trigger resizeAll() if container has changed size - if (dims.innerWidth !== sC.innerWidth || dims.innerHeight !== sC.innerHeight) - resizeAll(); - }, delay); - // ALSO set fixed-delay timer, if not already running - if (!timer.data["winResizeRepeater"]) setWindowResizeRepeater(); - } - -, setWindowResizeRepeater = function () { - var delay = Number(options.resizeWithWindowMaxDelay); - if (delay > 0) - timer.set("winResizeRepeater", function(){ setWindowResizeRepeater(); resizeAll(); }, delay); - } - -, unload = function () { - var o = options; - - _runCallbacks("onunload_start"); - - // trigger plugin callabacks for this layout (eg: stateManagement) - runPluginCallbacks( Instance, $.layout.onUnload ); - - _runCallbacks("onunload_end"); - } - - /** - * Validate and initialize container CSS and events - * - * @see _create() - */ -, _initContainer = function () { - var - N = $N[0] - , $H = $("html") - , tag = sC.tagName = N.tagName - , id = sC.id = N.id - , cls = sC.className = N.className - , o = options - , name = o.name - , props = "position,margin,padding,border" - , css = "layoutCSS" - , CSS = {} - , hid = "hidden" // used A LOT! - // see if this container is a 'pane' inside an outer-layout - , parent = $N.data("parentLayout") // parent-layout Instance - , pane = $N.data("layoutEdge") // pane-name in parent-layout - , isChild = parent && pane - , num = $.layout.cssNum - , $parent, n - ; - // sC = state.container - sC.selector = $N.selector.split(".slice")[0]; - sC.ref = (o.name ? o.name +' layout / ' : '') + tag + (id ? "#"+id : cls ? '.['+cls+']' : ''); // used in messages - sC.isBody = (tag === "BODY"); - - // try to find a parent-layout - if (!isChild && !sC.isBody) { - $parent = $N.closest("."+ $.layout.defaults.panes.paneClass); - parent = $parent.data("parentLayout"); - pane = $parent.data("layoutEdge"); - isChild = parent && pane; - } - - $N .data({ - layout: Instance - , layoutContainer: sID // FLAG to indicate this is a layout-container - contains unique internal ID - }) - .addClass(o.containerClass) - ; - var layoutMethods = { - destroy: '' - , initPanes: '' - , resizeAll: 'resizeAll' - , resize: 'resizeAll' - }; - // loop hash and bind all methods - include layoutID namespacing - for (name in layoutMethods) { - $N.bind("layout"+ name.toLowerCase() +"."+ sID, Instance[ layoutMethods[name] || name ]); - } - - // if this container is another layout's 'pane', then set child/parent pointers - if (isChild) { - // update parent flag - Instance.hasParentLayout = true; - // set pointers to THIS child-layout (Instance) in parent-layout - parent.refreshChildren( pane, Instance ); - } - - // SAVE original container CSS for use in destroy() - if (!$N.data(css)) { - // handle props like overflow different for BODY & HTML - has 'system default' values - if (sC.isBody) { - // SAVE CSS - $N.data(css, $.extend( styles($N, props), { - height: $N.css("height") - , overflow: $N.css("overflow") - , overflowX: $N.css("overflowX") - , overflowY: $N.css("overflowY") - })); - // ALSO SAVE CSS - $H.data(css, $.extend( styles($H, 'padding'), { - height: "auto" // FF would return a fixed px-size! - , overflow: $H.css("overflow") - , overflowX: $H.css("overflowX") - , overflowY: $H.css("overflowY") - })); - } - else // handle props normally for non-body elements - $N.data(css, styles($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY") ); - } - - try { - // common container CSS - CSS = { - overflow: hid - , overflowX: hid - , overflowY: hid - }; - $N.css( CSS ); - - if (o.inset && !$.isPlainObject(o.inset)) { - // can specify a single number for equal outset all-around - n = parseInt(o.inset, 10) || 0 - o.inset = { - top: n - , bottom: n - , left: n - , right: n - }; - } - - // format html & body if this is a full page layout - if (sC.isBody) { - // if HTML has padding, use this as an outer-spacing around BODY - if (!o.outset) { - // use padding from parent-elem (HTML) as outset - o.outset = { - top: num($H, "paddingTop") - , bottom: num($H, "paddingBottom") - , left: num($H, "paddingLeft") - , right: num($H, "paddingRight") - }; - } - else if (!$.isPlainObject(o.outset)) { - // can specify a single number for equal outset all-around - n = parseInt(o.outset, 10) || 0 - o.outset = { - top: n - , bottom: n - , left: n - , right: n - }; - } - // HTML - $H.css( CSS ).css({ - height: "100%" - , border: "none" // no border or padding allowed when using height = 100% - , padding: 0 // ditto - , margin: 0 - }); - // BODY - if (browser.isIE6) { - // IE6 CANNOT use the trick of setting absolute positioning on all 4 sides - must have 'height' - $N.css({ - width: "100%" - , height: "100%" - , border: "none" // no border or padding allowed when using height = 100% - , padding: 0 // ditto - , margin: 0 - , position: "relative" - }); - // convert body padding to an inset option - the border cannot be measured in IE6! - if (!o.inset) o.inset = elDims( $N ).inset; - } - else { // use absolute positioning for BODY to allow borders & padding without overflow - $N.css({ - width: "auto" - , height: "auto" - , margin: 0 - , position: "absolute" // allows for border and padding on BODY - }); - // apply edge-positioning created above - $N.css( o.outset ); - } - // set current layout-container dimensions - $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values - } - else { - // container MUST have 'position' - var p = $N.css("position"); - if (!p || !p.match(/(fixed|absolute|relative)/)) - $N.css("position","relative"); - - // set current layout-container dimensions - if ( $N.is(":visible") ) { - $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT change insetX (padding) values - if (sC.innerHeight < 1) // container has no 'height' - warn developer - _log( o.errors.noContainerHeight.replace(/CONTAINER/, sC.ref) ); - } - } - - // if container has min-width/height, then enable scrollbar(s) - if ( num($N, "minWidth") ) $N.parent().css("overflowX","auto"); - if ( num($N, "minHeight") ) $N.parent().css("overflowY","auto"); - - } catch (ex) {} - } - - /** - * Bind layout hotkeys - if options enabled - * - * @see _create() and addPane() - * @param {string=} [panes=""] The edge(s) to process - */ -, initHotkeys = function (panes) { - panes = panes ? panes.split(",") : _c.borderPanes; - // bind keyDown to capture hotkeys, if option enabled for ANY pane - $.each(panes, function (i, pane) { - var o = options[pane]; - if (o.enableCursorHotkey || o.customHotkey) { - $(document).bind("keydown."+ sID, keyDown); // only need to bind this ONCE - return false; // BREAK - binding was done - } - }); - } - - /** - * Build final OPTIONS data - * - * @see _create() - */ -, initOptions = function () { - var data, d, pane, key, val, i, c, o; - - // reprocess user's layout-options to have correct options sub-key structure - opts = $.layout.transformData( opts, true ); // panes = default subkey - - // auto-rename old options for backward compatibility - opts = $.layout.backwardCompatibility.renameAllOptions( opts ); - - // if user-options has 'panes' key (pane-defaults), clean it... - if (!$.isEmptyObject(opts.panes)) { - // REMOVE any pane-defaults that MUST be set per-pane - data = $.layout.optionsMap.noDefault; - for (i=0, c=data.length; i 0) { - z.pane_normal = zo; - z.content_mask = max(zo+1, z.content_mask); // MIN = +1 - z.resizer_normal = max(zo+2, z.resizer_normal); // MIN = +2 - } - - // DELETE 'panes' key now that we are done - values were copied to EACH pane - delete options.panes; - - - function createFxOptions ( pane ) { - var o = options[pane] - , d = options.panes; - // ensure fxSettings key to avoid errors - if (!o.fxSettings) o.fxSettings = {}; - if (!d.fxSettings) d.fxSettings = {}; - - $.each(["_open","_close","_size"], function (i,n) { - var - sName = "fxName"+ n - , sSpeed = "fxSpeed"+ n - , sSettings = "fxSettings"+ n - // recalculate fxName according to specificity rules - , fxName = o[sName] = - o[sName] // options.west.fxName_open - || d[sName] // options.panes.fxName_open - || o.fxName // options.west.fxName - || d.fxName // options.panes.fxName - || "none" // MEANS $.layout.defaults.panes.fxName == "" || false || null || 0 - , fxExists = $.effects && ($.effects[fxName] || ($.effects.effect && $.effects.effect[fxName])) - ; - // validate fxName to ensure is valid effect - MUST have effect-config data in options.effects - if (fxName === "none" || !options.effects[fxName] || !fxExists) - fxName = o[sName] = "none"; // effect not loaded OR unrecognized fxName - - // set vars for effects subkeys to simplify logic - var fx = options.effects[fxName] || {} // effects.slide - , fx_all = fx.all || null // effects.slide.all - , fx_pane = fx[pane] || null // effects.slide.west - ; - // create fxSpeed[_open|_close|_size] - o[sSpeed] = - o[sSpeed] // options.west.fxSpeed_open - || d[sSpeed] // options.west.fxSpeed_open - || o.fxSpeed // options.west.fxSpeed - || d.fxSpeed // options.panes.fxSpeed - || null // DEFAULT - let fxSetting.duration control speed - ; - // create fxSettings[_open|_close|_size] - o[sSettings] = $.extend( - true - , {} - , fx_all // effects.slide.all - , fx_pane // effects.slide.west - , d.fxSettings // options.panes.fxSettings - , o.fxSettings // options.west.fxSettings - , d[sSettings] // options.panes.fxSettings_open - , o[sSettings] // options.west.fxSettings_open - ); - }); - - // DONE creating action-specific-settings for this pane, - // so DELETE generic options - are no longer meaningful - delete o.fxName; - delete o.fxSpeed; - delete o.fxSettings; - } - } - - /** - * Initialize module objects, styling, size and position for all panes - * - * @see _initElements() - * @param {string} pane The pane to process - */ -, getPane = function (pane) { - var sel = options[pane].paneSelector - if (sel.substr(0,1)==="#") // ID selector - // NOTE: elements selected 'by ID' DO NOT have to be 'children' - return $N.find(sel).eq(0); - else { // class or other selector - var $P = $N.children(sel).eq(0); - // look for the pane nested inside a 'form' element - return $P.length ? $P : $N.children("form:first").children(sel).eq(0); - } - } - - /** - * @param {Object=} evt - */ -, initPanes = function (evt) { - // stopPropagation if called by trigger("layoutinitpanes") - use evtPane utility - evtPane(evt); - - // NOTE: do north & south FIRST so we can measure their height - do center LAST - $.each(_c.allPanes, function (idx, pane) { - addPane( pane, true ); - }); - - // init the pane-handles NOW in case we have to hide or close the pane below - initHandles(); - - // now that all panes have been initialized and initially-sized, - // make sure there is really enough space available for each pane - $.each(_c.borderPanes, function (i, pane) { - if ($Ps[pane] && state[pane].isVisible) { // pane is OPEN - setSizeLimits(pane); - makePaneFit(pane); // pane may be Closed, Hidden or Resized by makePaneFit() - } - }); - // size center-pane AGAIN in case we 'closed' a border-pane in loop above - sizeMidPanes("center"); - - // Chrome/Webkit sometimes fires callbacks BEFORE it completes resizing! - // Before RC30.3, there was a 10ms delay here, but that caused layout - // to load asynchrously, which is BAD, so try skipping delay for now - - // process pane contents and callbacks, and init/resize child-layout if exists - $.each(_c.allPanes, function (idx, pane) { - afterInitPane(pane); - }); - } - - /** - * Add a pane to the layout - subroutine of initPanes() - * - * @see initPanes() - * @param {string} pane The pane to process - * @param {boolean=} [force=false] Size content after init - */ -, addPane = function (pane, force) { - if (!force && !isInitialized()) return; - var - o = options[pane] - , s = state[pane] - , c = _c[pane] - , dir = c.dir - , fx = s.fx - , spacing = o.spacing_open || 0 - , isCenter = (pane === "center") - , CSS = {} - , $P = $Ps[pane] - , size, minSize, maxSize, child - ; - // if pane-pointer already exists, remove the old one first - if ($P) - removePane( pane, false, true, false ); - else - $Cs[pane] = false; // init - - $P = $Ps[pane] = getPane(pane); - if (!$P.length) { - $Ps[pane] = false; // logic - return; - } - - // SAVE original Pane CSS - if (!$P.data("layoutCSS")) { - var props = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"; - $P.data("layoutCSS", styles($P, props)); - } - - // create alias for pane data in Instance - initHandles will add more - Instance[pane] = { - name: pane - , pane: $Ps[pane] - , content: $Cs[pane] - , options: options[pane] - , state: state[pane] - , children: children[pane] - }; - - // add classes, attributes & events - $P .data({ - parentLayout: Instance // pointer to Layout Instance - , layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - , layoutRole: "pane" - }) - .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal) - .css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles - .addClass( o.paneClass +" "+ o.paneClass+"-"+pane ) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector' - .bind("mouseenter."+ sID, addHover ) - .bind("mouseleave."+ sID, removeHover ) - ; - var paneMethods = { - hide: '' - , show: '' - , toggle: '' - , close: '' - , open: '' - , slideOpen: '' - , slideClose: '' - , slideToggle: '' - , size: 'sizePane' - , sizePane: 'sizePane' - , sizeContent: '' - , sizeHandles: '' - , enableClosable: '' - , disableClosable: '' - , enableSlideable: '' - , disableSlideable: '' - , enableResizable: '' - , disableResizable: '' - , swapPanes: 'swapPanes' - , swap: 'swapPanes' - , move: 'swapPanes' - , removePane: 'removePane' - , remove: 'removePane' - , createChildren: '' - , resizeChildren: '' - , resizeAll: 'resizeAll' - , resizeLayout: 'resizeAll' - } - , name; - // loop hash and bind all methods - include layoutID namespacing - for (name in paneMethods) { - $P.bind("layoutpane"+ name.toLowerCase() +"."+ sID, Instance[ paneMethods[name] || name ]); - } - - // see if this pane has a 'scrolling-content element' - initContent(pane, false); // false = do NOT sizeContent() - called later - - if (!isCenter) { - // call _parseSize AFTER applying pane classes & styles - but before making visible (if hidden) - // if o.size is auto or not valid, then MEASURE the pane and use that as its 'size' - size = s.size = _parseSize(pane, o.size); - minSize = _parseSize(pane,o.minSize) || 1; - maxSize = _parseSize(pane,o.maxSize) || 100000; - if (size > 0) size = max(min(size, maxSize), minSize); - s.autoResize = o.autoResize; // used with percentage sizes - - // state for border-panes - s.isClosed = false; // true = pane is closed - s.isSliding = false; // true = pane is currently open by 'sliding' over adjacent panes - s.isResizing= false; // true = pane is in process of being resized - s.isHidden = false; // true = pane is hidden - no spacing, resizer or toggler is visible! - - // array for 'pin buttons' whose classNames are auto-updated on pane-open/-close - if (!s.pins) s.pins = []; - } - // states common to ALL panes - s.tagName = $P[0].tagName; - s.edge = pane; // useful if pane is (or about to be) 'swapped' - easy find out where it is (or is going) - s.noRoom = false; // true = pane 'automatically' hidden due to insufficient room - will unhide automatically - s.isVisible = true; // false = pane is invisible - closed OR hidden - simplify logic - - // init pane positioning - setPanePosition( pane ); - - // if pane is not visible, - if (dir === "horz") // north or south pane - CSS.height = cssH($P, size); - else if (dir === "vert") // east or west pane - CSS.width = cssW($P, size); - //else if (isCenter) {} - - $P.css(CSS); // apply size -- top, bottom & height will be set by sizeMidPanes - if (dir != "horz") sizeMidPanes(pane, true); // true = skipCallback - - // if manually adding a pane AFTER layout initialization, then... - if (state.initialized) { - initHandles( pane ); - initHotkeys( pane ); - } - - // close or hide the pane if specified in settings - if (o.initClosed && o.closable && !o.initHidden) - close(pane, true, true); // true, true = force, noAnimation - else if (o.initHidden || o.initClosed) - hide(pane); // will be completely invisible - no resizer or spacing - else if (!s.noRoom) - // make the pane visible - in case was initially hidden - $P.css("display","block"); - // ELSE setAsOpen() - called later by initHandles() - - // RESET visibility now - pane will appear IF display:block - $P.css("visibility","visible"); - - // check option for auto-handling of pop-ups & drop-downs - if (o.showOverflowOnHover) - $P.hover( allowOverflow, resetOverflow ); - - // if manually adding a pane AFTER layout initialization, then... - if (state.initialized) { - afterInitPane( pane ); - } - } - -, afterInitPane = function (pane) { - var $P = $Ps[pane] - , s = state[pane] - , o = options[pane] - ; - if (!$P) return; - - // see if there is a directly-nested layout inside this pane - if ($P.data("layout")) - refreshChildren( pane, $P.data("layout") ); - - // process pane contents and callbacks, and init/resize child-layout if exists - if (s.isVisible) { // pane is OPEN - if (state.initialized) // this pane was added AFTER layout was created - resizeAll(); // will also sizeContent - else - sizeContent(pane); - - if (o.triggerEventsOnLoad) - _runCallbacks("onresize_end", pane); - else // automatic if onresize called, otherwise call it specifically - // resize child - IF inner-layout already exists (created before this layout) - resizeChildren(pane, true); // a previously existing childLayout - } - - // init childLayouts - even if pane is not visible - if (o.initChildren && o.children) - createChildren(pane); - } - - /** - * @param {string=} panes The pane(s) to process - */ -, setPanePosition = function (panes) { - panes = panes ? panes.split(",") : _c.borderPanes; - - // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV - $.each(panes, function (i, pane) { - var $P = $Ps[pane] - , $R = $Rs[pane] - , o = options[pane] - , s = state[pane] - , side = _c[pane].side - , CSS = {} - ; - if (!$P) return; // pane does not exist - skip - - // set css-position to account for container borders & padding - switch (pane) { - case "north": CSS.top = sC.inset.top; - CSS.left = sC.inset.left; - CSS.right = sC.inset.right; - break; - case "south": CSS.bottom = sC.inset.bottom; - CSS.left = sC.inset.left; - CSS.right = sC.inset.right; - break; - case "west": CSS.left = sC.inset.left; // top, bottom & height set by sizeMidPanes() - break; - case "east": CSS.right = sC.inset.right; // ditto - break; - case "center": // top, left, width & height set by sizeMidPanes() - } - // apply position - $P.css(CSS); - - // update resizer position - if ($R && s.isClosed) - $R.css(side, sC.inset[side]); - else if ($R && !s.isHidden) - $R.css(side, sC.inset[side] + getPaneSize(pane)); - }); - } - - /** - * Initialize module objects, styling, size and position for all resize bars and toggler buttons - * - * @see _create() - * @param {string=} [panes=""] The edge(s) to process - */ -, initHandles = function (panes) { - panes = panes ? panes.split(",") : _c.borderPanes; - - // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV - $.each(panes, function (i, pane) { - var $P = $Ps[pane]; - $Rs[pane] = false; // INIT - $Ts[pane] = false; - if (!$P) return; // pane does not exist - skip - - var - o = options[pane] - , s = state[pane] - , c = _c[pane] - , paneId = o.paneSelector.substr(0,1) === "#" ? o.paneSelector.substr(1) : "" - , rClass = o.resizerClass - , tClass = o.togglerClass - , spacing = (s.isVisible ? o.spacing_open : o.spacing_closed) - , _pane = "-"+ pane // used for classNames - , _state = (s.isVisible ? "-open" : "-closed") // used for classNames - , I = Instance[pane] - // INIT RESIZER BAR - , $R = I.resizer = $Rs[pane] = $("
              ") - // INIT TOGGLER BUTTON - , $T = I.toggler = (o.closable ? $Ts[pane] = $("
              ") : false) - ; - - //if (s.isVisible && o.resizable) ... handled by initResizable - if (!s.isVisible && o.slidable) - $R.attr("title", o.tips.Slide).css("cursor", o.sliderCursor); - - $R // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "paneLeft-resizer" - .attr("id", paneId ? paneId +"-resizer" : "" ) - .data({ - parentLayout: Instance - , layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - , layoutRole: "resizer" - }) - .css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal) - .css(o.applyDemoStyles ? _c.resizers.cssDemo : {}) // add demo styles - .addClass(rClass +" "+ rClass+_pane) - .hover(addHover, removeHover) // ALWAYS add hover-classes, even if resizing is not enabled - handle with CSS instead - .hover(onResizerEnter, onResizerLeave) // ALWAYS NEED resizer.mouseleave to balance toggler.mouseenter - .appendTo($N) // append DIV to container - ; - if (o.resizerDblClickToggle) - $R.bind("dblclick."+ sID, toggle ); - - if ($T) { - $T // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "#paneLeft-toggler" - .attr("id", paneId ? paneId +"-toggler" : "" ) - .data({ - parentLayout: Instance - , layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - , layoutRole: "toggler" - }) - .css(_c.togglers.cssReq) // add base/required styles - .css(o.applyDemoStyles ? _c.togglers.cssDemo : {}) // add demo styles - .addClass(tClass +" "+ tClass+_pane) - .hover(addHover, removeHover) // ALWAYS add hover-classes, even if toggling is not enabled - handle with CSS instead - .bind("mouseenter", onResizerEnter) // NEED toggler.mouseenter because mouseenter MAY NOT fire on resizer - .appendTo($R) // append SPAN to resizer DIV - ; - // ADD INNER-SPANS TO TOGGLER - if (o.togglerContent_open) // ui-layout-open - $(""+ o.togglerContent_open +"") - .data({ - layoutEdge: pane - , layoutRole: "togglerContent" - }) - .data("layoutRole", "togglerContent") - .data("layoutEdge", pane) - .addClass("content content-open") - .css("display","none") - .appendTo( $T ) - //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-open instead! - ; - if (o.togglerContent_closed) // ui-layout-closed - $(""+ o.togglerContent_closed +"") - .data({ - layoutEdge: pane - , layoutRole: "togglerContent" - }) - .addClass("content content-closed") - .css("display","none") - .appendTo( $T ) - //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-closed instead! - ; - // ADD TOGGLER.click/.hover - enableClosable(pane); - } - - // add Draggable events - initResizable(pane); - - // ADD CLASSNAMES & SLIDE-BINDINGS - eg: class="resizer resizer-west resizer-open" - if (s.isVisible) - setAsOpen(pane); // onOpen will be called, but NOT onResize - else { - setAsClosed(pane); // onClose will be called - bindStartSlidingEvents(pane, true); // will enable events IF option is set - } - - }); - - // SET ALL HANDLE DIMENSIONS - sizeHandles(); - } - - - /** - * Initialize scrolling ui-layout-content div - if exists - * - * @see initPane() - or externally after an Ajax injection - * @param {string} pane The pane to process - * @param {boolean=} [resize=true] Size content after init - */ -, initContent = function (pane, resize) { - if (!isInitialized()) return; - var - o = options[pane] - , sel = o.contentSelector - , I = Instance[pane] - , $P = $Ps[pane] - , $C - ; - if (sel) $C = I.content = $Cs[pane] = (o.findNestedContent) - ? $P.find(sel).eq(0) // match 1-element only - : $P.children(sel).eq(0) - ; - if ($C && $C.length) { - $C.data("layoutRole", "content"); - // SAVE original Content CSS - if (!$C.data("layoutCSS")) - $C.data("layoutCSS", styles($C, "height")); - $C.css( _c.content.cssReq ); - if (o.applyDemoStyles) { - $C.css( _c.content.cssDemo ); // add padding & overflow: auto to content-div - $P.css( _c.content.cssDemoPane ); // REMOVE padding/scrolling from pane - } - // ensure no vertical scrollbar on pane - will mess up measurements - if ($P.css("overflowX").match(/(scroll|auto)/)) { - $P.css("overflow", "hidden"); - } - state[pane].content = {}; // init content state - if (resize !== false) sizeContent(pane); - // sizeContent() is called AFTER init of all elements - } - else - I.content = $Cs[pane] = false; - } - - - /** - * Add resize-bars to all panes that specify it in options - * -dependancy: $.fn.resizable - will skip if not found - * - * @see _create() - * @param {string=} [panes=""] The edge(s) to process - */ -, initResizable = function (panes) { - var draggingAvailable = $.layout.plugins.draggable - , side // set in start() - ; - panes = panes ? panes.split(",") : _c.borderPanes; - - $.each(panes, function (idx, pane) { - var o = options[pane]; - if (!draggingAvailable || !$Ps[pane] || !o.resizable) { - o.resizable = false; - return true; // skip to next - } - - var s = state[pane] - , z = options.zIndexes - , c = _c[pane] - , side = c.dir=="horz" ? "top" : "left" - , $P = $Ps[pane] - , $R = $Rs[pane] - , base = o.resizerClass - , lastPos = 0 // used when live-resizing - , r, live // set in start because may change - // 'drag' classes are applied to the ORIGINAL resizer-bar while dragging is in process - , resizerClass = base+"-drag" // resizer-drag - , resizerPaneClass = base+"-"+pane+"-drag" // resizer-north-drag - // 'helper' class is applied to the CLONED resizer-bar while it is being dragged - , helperClass = base+"-dragging" // resizer-dragging - , helperPaneClass = base+"-"+pane+"-dragging" // resizer-north-dragging - , helperLimitClass = base+"-dragging-limit" // resizer-drag - , helperPaneLimitClass = base+"-"+pane+"-dragging-limit" // resizer-north-drag - , helperClassesSet = false // logic var - ; - - if (!s.isClosed) - $R.attr("title", o.tips.Resize) - .css("cursor", o.resizerCursor); // n-resize, s-resize, etc - - $R.draggable({ - containment: $N[0] // limit resizing to layout container - , axis: (c.dir=="horz" ? "y" : "x") // limit resizing to horz or vert axis - , delay: 0 - , distance: 1 - , grid: o.resizingGrid - // basic format for helper - style it using class: .ui-draggable-dragging - , helper: "clone" - , opacity: o.resizerDragOpacity - , addClasses: false // avoid ui-state-disabled class when disabled - //, iframeFix: o.draggableIframeFix // TODO: consider using when bug is fixed - , zIndex: z.resizer_drag - - , start: function (e, ui) { - // REFRESH options & state pointers in case we used swapPanes - o = options[pane]; - s = state[pane]; - // re-read options - live = o.livePaneResizing; - - // ondrag_start callback - will CANCEL hide if returns false - // TODO: dragging CANNOT be cancelled like this, so see if there is a way? - if (false === _runCallbacks("ondrag_start", pane)) return false; - - s.isResizing = true; // prevent pane from closing while resizing - state.paneResizing = pane; // easy to see if ANY pane is resizing - timer.clear(pane+"_closeSlider"); // just in case already triggered - - // SET RESIZER LIMITS - used in drag() - setSizeLimits(pane); // update pane/resizer state - r = s.resizerPosition; - lastPos = ui.position[ side ] - - $R.addClass( resizerClass +" "+ resizerPaneClass ); // add drag classes - helperClassesSet = false; // reset logic var - see drag() - - // DISABLE TEXT SELECTION (probably already done by resizer.mouseOver) - $('body').disableSelection(); - - // MASK PANES CONTAINING IFRAMES, APPLETS OR OTHER TROUBLESOME ELEMENTS - showMasks( pane, { resizing: true }); - } - - , drag: function (e, ui) { - if (!helperClassesSet) { // can only add classes after clone has been added to the DOM - //$(".ui-draggable-dragging") - ui.helper - .addClass( helperClass +" "+ helperPaneClass ) // add helper classes - .css({ right: "auto", bottom: "auto" }) // fix dir="rtl" issue - .children().css("visibility","hidden") // hide toggler inside dragged resizer-bar - ; - helperClassesSet = true; - // draggable bug!? RE-SET zIndex to prevent E/W resize-bar showing through N/S pane! - if (s.isSliding) $Ps[pane].css("zIndex", z.pane_sliding); - } - // CONTAIN RESIZER-BAR TO RESIZING LIMITS - var limit = 0; - if (ui.position[side] < r.min) { - ui.position[side] = r.min; - limit = -1; - } - else if (ui.position[side] > r.max) { - ui.position[side] = r.max; - limit = 1; - } - // ADD/REMOVE dragging-limit CLASS - if (limit) { - ui.helper.addClass( helperLimitClass +" "+ helperPaneLimitClass ); // at dragging-limit - window.defaultStatus = (limit>0 && pane.match(/(north|west)/)) || (limit<0 && pane.match(/(south|east)/)) ? o.tips.maxSizeWarning : o.tips.minSizeWarning; - } - else { - ui.helper.removeClass( helperLimitClass +" "+ helperPaneLimitClass ); // not at dragging-limit - window.defaultStatus = ""; - } - // DYNAMICALLY RESIZE PANES IF OPTION ENABLED - // won't trigger unless resizer has actually moved! - if (live && Math.abs(ui.position[side] - lastPos) >= o.liveResizingTolerance) { - lastPos = ui.position[side]; - resizePanes(e, ui, pane) - } - } - - , stop: function (e, ui) { - $('body').enableSelection(); // RE-ENABLE TEXT SELECTION - window.defaultStatus = ""; // clear 'resizing limit' message from statusbar - $R.removeClass( resizerClass +" "+ resizerPaneClass ); // remove drag classes from Resizer - s.isResizing = false; - state.paneResizing = false; // easy to see if ANY pane is resizing - resizePanes(e, ui, pane, true); // true = resizingDone - } - - }); - }); - - /** - * resizePanes - * - * Sub-routine called from stop() - and drag() if livePaneResizing - * - * @param {!Object} evt - * @param {!Object} ui - * @param {string} pane - * @param {boolean=} [resizingDone=false] - */ - var resizePanes = function (evt, ui, pane, resizingDone) { - var dragPos = ui.position - , c = _c[pane] - , o = options[pane] - , s = state[pane] - , resizerPos - ; - switch (pane) { - case "north": resizerPos = dragPos.top; break; - case "west": resizerPos = dragPos.left; break; - case "south": resizerPos = sC.layoutHeight - dragPos.top - o.spacing_open; break; - case "east": resizerPos = sC.layoutWidth - dragPos.left - o.spacing_open; break; - }; - // remove container margin from resizer position to get the pane size - var newSize = resizerPos - sC.inset[c.side]; - - // Disable OR Resize Mask(s) created in drag.start - if (!resizingDone) { - // ensure we meet liveResizingTolerance criteria - if (Math.abs(newSize - s.size) < o.liveResizingTolerance) - return; // SKIP resize this time - // resize the pane - manualSizePane(pane, newSize, false, true); // true = noAnimation - sizeMasks(); // resize all visible masks - } - else { // resizingDone - // ondrag_end callback - if (false !== _runCallbacks("ondrag_end", pane)) - manualSizePane(pane, newSize, false, true); // true = noAnimation - hideMasks(true); // true = force hiding all masks even if one is 'sliding' - if (s.isSliding) // RE-SHOW 'object-masks' so objects won't show through sliding pane - showMasks( pane, { resizing: true }); - } - }; - } - - /** - * sizeMask - * - * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane - * Called when mask created, and during livePaneResizing - */ -, sizeMask = function () { - var $M = $(this) - , pane = $M.data("layoutMask") // eg: "west" - , s = state[pane] - ; - // only masks over an IFRAME-pane need manual resizing - if (s.tagName == "IFRAME" && s.isVisible) // no need to mask closed/hidden panes - $M.css({ - top: s.offsetTop - , left: s.offsetLeft - , width: s.outerWidth - , height: s.outerHeight - }); - /* ALT Method... - var $P = $Ps[pane]; - $M.css( $P.position() ).css({ width: $P[0].offsetWidth, height: $P[0].offsetHeight }); - */ - } -, sizeMasks = function () { - $Ms.each( sizeMask ); // resize all 'visible' masks - } - - /** - * @param {string} pane The pane being resized, animated or isSliding - * @param {Object=} [args] (optional) Options: which masks to apply, and to which panes - */ -, showMasks = function (pane, args) { - var c = _c[pane] - , panes = ["center"] - , z = options.zIndexes - , a = $.extend({ - objectsOnly: false - , animation: false - , resizing: true - , sliding: state[pane].isSliding - }, args ) - , o, s - ; - if (a.resizing) - panes.push( pane ); - if (a.sliding) - panes.push( _c.oppositeEdge[pane] ); // ADD the oppositeEdge-pane - - if (c.dir === "horz") { - panes.push("west"); - panes.push("east"); - } - - $.each(panes, function(i,p){ - s = state[p]; - o = options[p]; - if (s.isVisible && ( o.maskObjects || (!a.objectsOnly && o.maskContents) )) { - getMasks(p).each(function(){ - sizeMask.call(this); - this.style.zIndex = s.isSliding ? z.pane_sliding+1 : z.pane_normal+1 - this.style.display = "block"; - }); - } - }); - } - - /** - * @param {boolean=} force Hide masks even if a pane is sliding - */ -, hideMasks = function (force) { - // ensure no pane is resizing - could be a timing issue - if (force || !state.paneResizing) { - $Ms.hide(); // hide ALL masks - } - // if ANY pane is sliding, then DO NOT remove masks from panes with maskObjects enabled - else if (!force && !$.isEmptyObject( state.panesSliding )) { - var i = $Ms.length - 1 - , p, $M; - for (; i >= 0; i--) { - $M = $Ms.eq(i); - p = $M.data("layoutMask"); - if (!options[p].maskObjects) { - $M.hide(); - } - } - } - } - - /** - * @param {string} pane - */ -, getMasks = function (pane) { - var $Masks = $([]) - , $M, i = 0, c = $Ms.length - ; - for (; i CSS - if (sC.tagName === "BODY" && ($N = $("html")).data(css)) // RESET CSS - $N.css( $N.data(css) ).removeData(css); - - // trigger plugins for this layout, if there are any - runPluginCallbacks( Instance, $.layout.onDestroy ); - - // trigger state-management and onunload callback - unload(); - - // clear the Instance of everything except for container & options (so could recreate) - // RE-CREATE: myLayout = myLayout.container.layout( myLayout.options ); - for (var n in Instance) - if (!n.match(/^(container|options)$/)) delete Instance[ n ]; - // add a 'destroyed' flag to make it easy to check - Instance.destroyed = true; - - // if this is a child layout, CLEAR the child-pointer in the parent - /* for now the pointer REMAINS, but with only container, options and destroyed keys - if (parentPane) { - var layout = parentPane.pane.data("parentLayout") - , key = layout.options.instanceKey || 'error'; - // THIS SYNTAX MAY BE WRONG! - parentPane.children[key] = layout.children[ parentPane.name ].children[key] = null; - } - */ - - return Instance; // for coding convenience - } - - /** - * Remove a pane from the layout - subroutine of destroy() - * - * @see destroy() - * @param {(string|Object)} evt_or_pane The pane to process - * @param {boolean=} [remove=false] Remove the DOM element? - * @param {boolean=} [skipResize=false] Skip calling resizeAll()? - * @param {boolean=} [destroyChild=true] Destroy Child-layouts? If not passed, obeys options setting - */ -, removePane = function (evt_or_pane, remove, skipResize, destroyChild) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $P = $Ps[pane] - , $C = $Cs[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - ; - // NOTE: elements can still exist even after remove() - // so check for missing data(), which is cleared by removed() - if ($P && $.isEmptyObject( $P.data() )) $P = false; - if ($C && $.isEmptyObject( $C.data() )) $C = false; - if ($R && $.isEmptyObject( $R.data() )) $R = false; - if ($T && $.isEmptyObject( $T.data() )) $T = false; - - if ($P) $P.stop(true, true); - - var o = options[pane] - , s = state[pane] - , d = "layout" - , css = "layoutCSS" - , pC = children[pane] - , hasChildren = $.isPlainObject( pC ) && !$.isEmptyObject( pC ) - , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildren - ; - // FIRST destroy the child-layout(s) - if (hasChildren && destroy) { - $.each( pC, function (key, child) { - if (!child.destroyed) - child.destroy(true);// tell child-layout to destroy ALL its child-layouts too - if (child.destroyed) // destroy was successful - delete pC[key]; - }); - // if no more children, remove the children hash - if ($.isEmptyObject( pC )) { - pC = children[pane] = null; // clear children hash - hasChildren = false; - } - } - - // Note: can't 'remove' a pane element with non-destroyed children - if ($P && remove && !hasChildren) - $P.remove(); // remove the pane-element and everything inside it - else if ($P && $P[0]) { - // create list of ALL pane-classes that need to be removed - var root = o.paneClass // default="ui-layout-pane" - , pRoot = root +"-"+ pane // eg: "ui-layout-pane-west" - , _open = "-open" - , _sliding= "-sliding" - , _closed = "-closed" - , classes = [ root, root+_open, root+_closed, root+_sliding, // generic classes - pRoot, pRoot+_open, pRoot+_closed, pRoot+_sliding ] // pane-specific classes - ; - $.merge(classes, getHoverClasses($P, true)); // ADD hover-classes - // remove all Layout classes from pane-element - $P .removeClass( classes.join(" ") ) // remove ALL pane-classes - .removeData("parentLayout") - .removeData("layoutPane") - .removeData("layoutRole") - .removeData("layoutEdge") - .removeData("autoHidden") // in case set - .unbind("."+ sID) // remove ALL Layout events - // TODO: remove these extra unbind commands when jQuery is fixed - //.unbind("mouseenter"+ sID) - //.unbind("mouseleave"+ sID) - ; - // do NOT reset CSS if this pane/content is STILL the container of a nested layout! - // the nested layout will reset its 'container' CSS when/if it is destroyed - if (hasChildren && $C) { - // a content-div may not have a specific width, so give it one to contain the Layout - $C.width( $C.width() ); - $.each( pC, function (key, child) { - child.resizeAll(); // resize the Layout - }); - } - else if ($C) - $C.css( $C.data(css) ).removeData(css).removeData("layoutRole"); - // remove pane AFTER content in case there was a nested layout - if (!$P.data(d)) - $P.css( $P.data(css) ).removeData(css); - } - - // REMOVE pane resizer and toggler elements - if ($T) $T.remove(); - if ($R) $R.remove(); - - // CLEAR all pointers and state data - Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = false; - s = { removed: true }; - - if (!skipResize) - resizeAll(); - } - - -/* - * ########################### - * ACTION METHODS - * ########################### - */ - - /** - * @param {string} pane - */ -, _hidePane = function (pane) { - var $P = $Ps[pane] - , o = options[pane] - , s = $P[0].style - ; - if (o.useOffscreenClose) { - if (!$P.data(_c.offscreenReset)) - $P.data(_c.offscreenReset, { left: s.left, right: s.right }); - $P.css( _c.offscreenCSS ); - } - else - $P.hide().removeData(_c.offscreenReset); - } - - /** - * @param {string} pane - */ -, _showPane = function (pane) { - var $P = $Ps[pane] - , o = options[pane] - , off = _c.offscreenCSS - , old = $P.data(_c.offscreenReset) - , s = $P[0].style - ; - $P .show() // ALWAYS show, just in case - .removeData(_c.offscreenReset); - if (o.useOffscreenClose && old) { - if (s.left == off.left) - s.left = old.left; - if (s.right == off.right) - s.right = old.right; - } - } - - - /** - * Completely 'hides' a pane, including its spacing - as if it does not exist - * The pane is not actually 'removed' from the source, so can use 'show' to un-hide it - * - * @param {(string|Object)} evt_or_pane The pane being hidden, ie: north, south, east, or west - * @param {boolean=} [noAnimation=false] - */ -, hide = function (evt_or_pane, noAnimation) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - ; - if (!$P || s.isHidden) return; // pane does not exist OR is already hidden - - // onhide_start callback - will CANCEL hide if returns false - if (state.initialized && false === _runCallbacks("onhide_start", pane)) return; - - s.isSliding = false; // just in case - delete state.panesSliding[pane]; - - // now hide the elements - if ($R) $R.hide(); // hide resizer-bar - if (!state.initialized || s.isClosed) { - s.isClosed = true; // to trigger open-animation on show() - s.isHidden = true; - s.isVisible = false; - if (!state.initialized) - _hidePane(pane); // no animation when loading page - sizeMidPanes(_c[pane].dir === "horz" ? "" : "center"); - if (state.initialized || o.triggerEventsOnLoad) - _runCallbacks("onhide_end", pane); - } - else { - s.isHiding = true; // used by onclose - close(pane, false, noAnimation); // adjust all panes to fit - } - } - - /** - * Show a hidden pane - show as 'closed' by default unless openPane = true - * - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - * @param {boolean=} [openPane=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [noAlert=false] - */ -, show = function (evt_or_pane, openPane, noAnimation, noAlert) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - ; - if (!$P || !s.isHidden) return; // pane does not exist OR is not hidden - - // onshow_start callback - will CANCEL show if returns false - if (false === _runCallbacks("onshow_start", pane)) return; - - s.isShowing = true; // used by onopen/onclose - //s.isHidden = false; - will be set by open/close - if not cancelled - s.isSliding = false; // just in case - delete state.panesSliding[pane]; - - // now show the elements - //if ($R) $R.show(); - will be shown by open/close - if (openPane === false) - close(pane, true); // true = force - else - open(pane, false, noAnimation, noAlert); // adjust all panes to fit - } - - - /** - * Toggles a pane open/closed by calling either open or close - * - * @param {(string|Object)} evt_or_pane The pane being toggled, ie: north, south, east, or west - * @param {boolean=} [slide=false] - */ -, toggle = function (evt_or_pane, slide) { - if (!isInitialized()) return; - var evt = evtObj(evt_or_pane) - , pane = evtPane.call(this, evt_or_pane) - , s = state[pane] - ; - if (evt) // called from to $R.dblclick OR triggerPaneEvent - evt.stopImmediatePropagation(); - if (s.isHidden) - show(pane); // will call 'open' after unhiding it - else if (s.isClosed) - open(pane, !!slide); - else - close(pane); - } - - - /** - * Utility method used during init or other auto-processes - * - * @param {string} pane The pane being closed - * @param {boolean=} [setHandles=false] - */ -, _closePane = function (pane, setHandles) { - var - $P = $Ps[pane] - , s = state[pane] - ; - _hidePane(pane); - s.isClosed = true; - s.isVisible = false; - // UNUSED: if (setHandles) setAsClosed(pane, true); // true = force - } - - /** - * Close the specified pane (animation optional), and resize all other panes as needed - * - * @param {(string|Object)} evt_or_pane The pane being closed, ie: north, south, east, or west - * @param {boolean=} [force=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [skipCallback=false] - */ -, close = function (evt_or_pane, force, noAnimation, skipCallback) { - var pane = evtPane.call(this, evt_or_pane); - // if pane has been initialized, but NOT the complete layout, close pane instantly - if (!state.initialized && $Ps[pane]) { - _closePane(pane); // INIT pane as closed - return; - } - if (!isInitialized()) return; - - var - $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , c = _c[pane] - , doFX, isShowing, isHiding, wasSliding; - - // QUEUE in case another action/animation is in progress - $N.queue(function( queueNext ){ - - if ( !$P - || (!o.closable && !s.isShowing && !s.isHiding) // invalid request // (!o.resizable && !o.closable) ??? - || (!force && s.isClosed && !s.isShowing) // already closed - ) return queueNext(); - - // onclose_start callback - will CANCEL hide if returns false - // SKIP if just 'showing' a hidden pane as 'closed' - var abort = !s.isShowing && false === _runCallbacks("onclose_start", pane); - - // transfer logic vars to temp vars - isShowing = s.isShowing; - isHiding = s.isHiding; - wasSliding = s.isSliding; - // now clear the logic vars (REQUIRED before aborting) - delete s.isShowing; - delete s.isHiding; - - if (abort) return queueNext(); - - doFX = !noAnimation && !s.isClosed && (o.fxName_close != "none"); - s.isMoving = true; - s.isClosed = true; - s.isVisible = false; - // update isHidden BEFORE sizing panes - if (isHiding) s.isHidden = true; - else if (isShowing) s.isHidden = false; - - if (s.isSliding) // pane is being closed, so UNBIND trigger events - bindStopSlidingEvents(pane, false); // will set isSliding=false - else // resize panes adjacent to this one - sizeMidPanes(_c[pane].dir === "horz" ? "" : "center", false); // false = NOT skipCallback - - // if this pane has a resizer bar, move it NOW - before animation - setAsClosed(pane); - - // CLOSE THE PANE - if (doFX) { // animate the close - lockPaneForFX(pane, true); // need to set left/top so animation will work - $P.hide( o.fxName_close, o.fxSettings_close, o.fxSpeed_close, function () { - lockPaneForFX(pane, false); // undo - if (s.isClosed) close_2(); - queueNext(); - }); - } - else { // hide the pane without animation - _hidePane(pane); - close_2(); - queueNext(); - }; - }); - - // SUBROUTINE - function close_2 () { - s.isMoving = false; - bindStartSlidingEvents(pane, true); // will enable if o.slidable = true - - // if opposite-pane was autoClosed, see if it can be autoOpened now - var altPane = _c.oppositeEdge[pane]; - if (state[ altPane ].noRoom) { - setSizeLimits( altPane ); - makePaneFit( altPane ); - } - - if (!skipCallback && (state.initialized || o.triggerEventsOnLoad)) { - // onclose callback - UNLESS just 'showing' a hidden pane as 'closed' - if (!isShowing) _runCallbacks("onclose_end", pane); - // onhide OR onshow callback - if (isShowing) _runCallbacks("onshow_end", pane); - if (isHiding) _runCallbacks("onhide_end", pane); - } - } - } - - /** - * @param {string} pane The pane just closed, ie: north, south, east, or west - */ -, setAsClosed = function (pane) { - var - $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , side = _c[pane].side - , rClass = o.resizerClass - , tClass = o.togglerClass - , _pane = "-"+ pane // used for classNames - , _open = "-open" - , _sliding= "-sliding" - , _closed = "-closed" - ; - $R - .css(side, sC.inset[side]) // move the resizer - .removeClass( rClass+_open +" "+ rClass+_pane+_open ) - .removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - .addClass( rClass+_closed +" "+ rClass+_pane+_closed ) - ; - // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvents? - if (o.resizable && $.layout.plugins.draggable) - $R - .draggable("disable") - .removeClass("ui-state-disabled") // do NOT apply disabled styling - not suitable here - .css("cursor", "default") - .attr("title","") - ; - - // if pane has a toggler button, adjust that too - if ($T) { - $T - .removeClass( tClass+_open +" "+ tClass+_pane+_open ) - .addClass( tClass+_closed +" "+ tClass+_pane+_closed ) - .attr("title", o.tips.Open) // may be blank - ; - // toggler-content - if exists - $T.children(".content-open").hide(); - $T.children(".content-closed").css("display","block"); - } - - // sync any 'pin buttons' - syncPinBtns(pane, false); - - if (state.initialized) { - // resize 'length' and position togglers for adjacent panes - sizeHandles(); - } - } - - /** - * Open the specified pane (animation optional), and resize all other panes as needed - * - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - * @param {boolean=} [slide=false] - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [noAlert=false] - */ -, open = function (evt_or_pane, slide, noAnimation, noAlert) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , c = _c[pane] - , doFX, isShowing - ; - // QUEUE in case another action/animation is in progress - $N.queue(function( queueNext ){ - - if ( !$P - || (!o.resizable && !o.closable && !s.isShowing) // invalid request - || (s.isVisible && !s.isSliding) // already open - ) return queueNext(); - - // pane can ALSO be unhidden by just calling show(), so handle this scenario - if (s.isHidden && !s.isShowing) { - queueNext(); // call before show() because it needs the queue free - show(pane, true); - return; - } - - if (s.autoResize && s.size != o.size) // resize pane to original size set in options - sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize - else - // make sure there is enough space available to open the pane - setSizeLimits(pane, slide); - - // onopen_start callback - will CANCEL open if returns false - var cbReturn = _runCallbacks("onopen_start", pane); - - if (cbReturn === "abort") - return queueNext(); - - // update pane-state again in case options were changed in onopen_start - if (cbReturn !== "NC") // NC = "No Callback" - setSizeLimits(pane, slide); - - if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN! - syncPinBtns(pane, false); // make sure pin-buttons are reset - if (!noAlert && o.tips.noRoomToOpen) - alert(o.tips.noRoomToOpen); - return queueNext(); // ABORT - } - - if (slide) // START Sliding - will set isSliding=true - bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane - else if (s.isSliding) // PIN PANE (stop sliding) - open pane 'normally' instead - bindStopSlidingEvents(pane, false); // UNBIND trigger events - will set isSliding=false - else if (o.slidable) - bindStartSlidingEvents(pane, false); // UNBIND trigger events - - s.noRoom = false; // will be reset by makePaneFit if 'noRoom' - makePaneFit(pane); - - // transfer logic var to temp var - isShowing = s.isShowing; - // now clear the logic var - delete s.isShowing; - - doFX = !noAnimation && s.isClosed && (o.fxName_open != "none"); - s.isMoving = true; - s.isVisible = true; - s.isClosed = false; - // update isHidden BEFORE sizing panes - WHY??? Old? - if (isShowing) s.isHidden = false; - - if (doFX) { // ANIMATE - // mask adjacent panes with objects - lockPaneForFX(pane, true); // need to set left/top so animation will work - $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() { - lockPaneForFX(pane, false); // undo - if (s.isVisible) open_2(); // continue - queueNext(); - }); - } - else { // no animation - _showPane(pane);// just show pane and... - open_2(); // continue - queueNext(); - }; - }); - - // SUBROUTINE - function open_2 () { - s.isMoving = false; - - // cure iframe display issues - _fixIframe(pane); - - // NOTE: if isSliding, then other panes are NOT 'resized' - if (!s.isSliding) { // resize all panes adjacent to this one - sizeMidPanes(_c[pane].dir=="vert" ? "center" : "", false); // false = NOT skipCallback - } - - // set classes, position handles and execute callbacks... - setAsOpen(pane); - }; - - } - - /** - * @param {string} pane The pane just opened, ie: north, south, east, or west - * @param {boolean=} [skipCallback=false] - */ -, setAsOpen = function (pane, skipCallback) { - var - $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , o = options[pane] - , s = state[pane] - , side = _c[pane].side - , rClass = o.resizerClass - , tClass = o.togglerClass - , _pane = "-"+ pane // used for classNames - , _open = "-open" - , _closed = "-closed" - , _sliding= "-sliding" - ; - $R - .css(side, sC.inset[side] + getPaneSize(pane)) // move the resizer - .removeClass( rClass+_closed +" "+ rClass+_pane+_closed ) - .addClass( rClass+_open +" "+ rClass+_pane+_open ) - ; - if (s.isSliding) - $R.addClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - else // in case 'was sliding' - $R.removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) - - removeHover( 0, $R ); // remove hover classes - if (o.resizable && $.layout.plugins.draggable) - $R .draggable("enable") - .css("cursor", o.resizerCursor) - .attr("title", o.tips.Resize); - else if (!s.isSliding) - $R.css("cursor", "default"); // n-resize, s-resize, etc - - // if pane also has a toggler button, adjust that too - if ($T) { - $T .removeClass( tClass+_closed +" "+ tClass+_pane+_closed ) - .addClass( tClass+_open +" "+ tClass+_pane+_open ) - .attr("title", o.tips.Close); // may be blank - removeHover( 0, $T ); // remove hover classes - // toggler-content - if exists - $T.children(".content-closed").hide(); - $T.children(".content-open").css("display","block"); - } - - // sync any 'pin buttons' - syncPinBtns(pane, !s.isSliding); - - // update pane-state dimensions - BEFORE resizing content - $.extend(s, elDims($P)); - - if (state.initialized) { - // resize resizer & toggler sizes for all panes - sizeHandles(); - // resize content every time pane opens - to be sure - sizeContent(pane, true); // true = remeasure headers/footers, even if 'pane.isMoving' - } - - if (!skipCallback && (state.initialized || o.triggerEventsOnLoad) && $P.is(":visible")) { - // onopen callback - _runCallbacks("onopen_end", pane); - // onshow callback - TODO: should this be here? - if (s.isShowing) _runCallbacks("onshow_end", pane); - - // ALSO call onresize because layout-size *may* have changed while pane was closed - if (state.initialized) - _runCallbacks("onresize_end", pane); - } - - // TODO: Somehow sizePane("north") is being called after this point??? - } - - - /** - * slideOpen / slideClose / slideToggle - * - * Pass-though methods for sliding - */ -, slideOpen = function (evt_or_pane) { - if (!isInitialized()) return; - var evt = evtObj(evt_or_pane) - , pane = evtPane.call(this, evt_or_pane) - , s = state[pane] - , delay = options[pane].slideDelay_open - ; - // prevent event from triggering on NEW resizer binding created below - if (evt) evt.stopImmediatePropagation(); - - if (s.isClosed && evt && evt.type === "mouseenter" && delay > 0) - // trigger = mouseenter - use a delay - timer.set(pane+"_openSlider", open_NOW, delay); - else - open_NOW(); // will unbind events if is already open - - /** - * SUBROUTINE for timed open - */ - function open_NOW () { - if (!s.isClosed) // skip if no longer closed! - bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane - else if (!s.isMoving) - open(pane, true); // true = slide - open() will handle binding - }; - } - -, slideClose = function (evt_or_pane) { - if (!isInitialized()) return; - var evt = evtObj(evt_or_pane) - , pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - , delay = s.isMoving ? 1000 : 300 // MINIMUM delay - option may override - ; - if (s.isClosed || s.isResizing) - return; // skip if already closed OR in process of resizing - else if (o.slideTrigger_close === "click") - close_NOW(); // close immediately onClick - else if (o.preventQuickSlideClose && s.isMoving) - return; // handle Chrome quick-close on slide-open - else if (o.preventPrematureSlideClose && evt && $.layout.isMouseOverElem(evt, $Ps[pane])) - return; // handle incorrect mouseleave trigger, like when over a SELECT-list in IE - else if (evt) // trigger = mouseleave - use a delay - // 1 sec delay if 'opening', else .3 sec - timer.set(pane+"_closeSlider", close_NOW, max(o.slideDelay_close, delay)); - else // called programically - close_NOW(); - - /** - * SUBROUTINE for timed close - */ - function close_NOW () { - if (s.isClosed) // skip 'close' if already closed! - bindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here? - else if (!s.isMoving) - close(pane); // close will handle unbinding - }; - } - - /** - * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west - */ -, slideToggle = function (evt_or_pane) { - var pane = evtPane.call(this, evt_or_pane); - toggle(pane, true); - } - - - /** - * Must set left/top on East/South panes so animation will work properly - * - * @param {string} pane The pane to lock, 'east' or 'south' - any other is ignored! - * @param {boolean} doLock true = set left/top, false = remove - */ -, lockPaneForFX = function (pane, doLock) { - var $P = $Ps[pane] - , s = state[pane] - , o = options[pane] - , z = options.zIndexes - ; - if (doLock) { - showMasks( pane, { animation: true, objectsOnly: true }); - $P.css({ zIndex: z.pane_animate }); // overlay all elements during animation - if (pane=="south") - $P.css({ top: sC.inset.top + sC.innerHeight - $P.outerHeight() }); - else if (pane=="east") - $P.css({ left: sC.inset.left + sC.innerWidth - $P.outerWidth() }); - } - else { // animation DONE - RESET CSS - hideMasks(); - $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); - if (pane=="south") - $P.css({ top: "auto" }); - // if pane is positioned 'off-screen', then DO NOT screw with it! - else if (pane=="east" && !$P.css("left").match(/\-99999/)) - $P.css({ left: "auto" }); - // fix anti-aliasing in IE - only needed for animations that change opacity - if (browser.msie && o.fxOpacityFix && o.fxName_open != "slide" && $P.css("filter") && $P.css("opacity") == 1) - $P[0].style.removeAttribute('filter'); - } - } - - - /** - * Toggle sliding functionality of a specific pane on/off by adding removing 'slide open' trigger - * - * @see open(), close() - * @param {string} pane The pane to enable/disable, 'north', 'south', etc. - * @param {boolean} enable Enable or Disable sliding? - */ -, bindStartSlidingEvents = function (pane, enable) { - var o = options[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , evtName = o.slideTrigger_open.toLowerCase() - ; - if (!$R || (enable && !o.slidable)) return; - - // make sure we have a valid event - if (evtName.match(/mouseover/)) - evtName = o.slideTrigger_open = "mouseenter"; - else if (!evtName.match(/(click|dblclick|mouseenter)/)) - evtName = o.slideTrigger_open = "click"; - - // must remove double-click-toggle when using dblclick-slide - if (o.resizerDblClickToggle && evtName.match(/click/)) { - $R[enable ? "unbind" : "bind"]('dblclick.'+ sID, toggle) - } - - $R - // add or remove event - [enable ? "bind" : "unbind"](evtName +'.'+ sID, slideOpen) - // set the appropriate cursor & title/tip - .css("cursor", enable ? o.sliderCursor : "default") - .attr("title", enable ? o.tips.Slide : "") - ; - } - - /** - * Add or remove 'mouseleave' events to 'slide close' when pane is 'sliding' open or closed - * Also increases zIndex when pane is sliding open - * See bindStartSlidingEvents for code to control 'slide open' - * - * @see slideOpen(), slideClose() - * @param {string} pane The pane to process, 'north', 'south', etc. - * @param {boolean} enable Enable or Disable events? - */ -, bindStopSlidingEvents = function (pane, enable) { - var o = options[pane] - , s = state[pane] - , c = _c[pane] - , z = options.zIndexes - , evtName = o.slideTrigger_close.toLowerCase() - , action = (enable ? "bind" : "unbind") - , $P = $Ps[pane] - , $R = $Rs[pane] - ; - timer.clear(pane+"_closeSlider"); // just in case - - if (enable) { - s.isSliding = true; - state.panesSliding[pane] = true; - // remove 'slideOpen' event from resizer - // ALSO will raise the zIndex of the pane & resizer - bindStartSlidingEvents(pane, false); - } - else { - s.isSliding = false; - delete state.panesSliding[pane]; - } - - // RE/SET zIndex - increases when pane is sliding-open, resets to normal when not - $P.css("zIndex", enable ? z.pane_sliding : z.pane_normal); - $R.css("zIndex", enable ? z.pane_sliding+2 : z.resizer_normal); // NOTE: mask = pane_sliding+1 - - // make sure we have a valid event - if (!evtName.match(/(click|mouseleave)/)) - evtName = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout' - - // add/remove slide triggers - $R[action](evtName, slideClose); // base event on resize - // need extra events for mouseleave - if (evtName === "mouseleave") { - // also close on pane.mouseleave - $P[action]("mouseleave."+ sID, slideClose); - // cancel timer when mouse moves between 'pane' and 'resizer' - $R[action]("mouseenter."+ sID, cancelMouseOut); - $P[action]("mouseenter."+ sID, cancelMouseOut); - } - - if (!enable) - timer.clear(pane+"_closeSlider"); - else if (evtName === "click" && !o.resizable) { - // IF pane is not resizable (which already has a cursor and tip) - // then set the a cursor & title/tip on resizer when sliding - $R.css("cursor", enable ? o.sliderCursor : "default"); - $R.attr("title", enable ? o.tips.Close : ""); // use Toggler-tip, eg: "Close Pane" - } - - // SUBROUTINE for mouseleave timer clearing - function cancelMouseOut (evt) { - timer.clear(pane+"_closeSlider"); - evt.stopPropagation(); - } - } - - - /** - * Hides/closes a pane if there is insufficient room - reverses this when there is room again - * MUST have already called setSizeLimits() before calling this method - * - * @param {string} pane The pane being resized - * @param {boolean=} [isOpening=false] Called from onOpen? - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [force=false] - */ -, makePaneFit = function (pane, isOpening, skipCallback, force) { - var - o = options[pane] - , s = state[pane] - , c = _c[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , isSidePane = c.dir==="vert" - , hasRoom = false - ; - // special handling for center & east/west panes - if (pane === "center" || (isSidePane && s.noVerticalRoom)) { - // see if there is enough room to display the pane - // ERROR: hasRoom = s.minHeight <= s.maxHeight && (isSidePane || s.minWidth <= s.maxWidth); - hasRoom = (s.maxHeight >= 0); - if (hasRoom && s.noRoom) { // previously hidden due to noRoom, so show now - _showPane(pane); - if ($R) $R.show(); - s.isVisible = true; - s.noRoom = false; - if (isSidePane) s.noVerticalRoom = false; - _fixIframe(pane); - } - else if (!hasRoom && !s.noRoom) { // not currently hidden, so hide now - _hidePane(pane); - if ($R) $R.hide(); - s.isVisible = false; - s.noRoom = true; - } - } - - // see if there is enough room to fit the border-pane - if (pane === "center") { - // ignore center in this block - } - else if (s.minSize <= s.maxSize) { // pane CAN fit - hasRoom = true; - if (s.size > s.maxSize) // pane is too big - shrink it - sizePane(pane, s.maxSize, skipCallback, true, force); // true = noAnimation - else if (s.size < s.minSize) // pane is too small - enlarge it - sizePane(pane, s.minSize, skipCallback, true, force); // true = noAnimation - // need s.isVisible because new pseudoClose method keeps pane visible, but off-screen - else if ($R && s.isVisible && $P.is(":visible")) { - // make sure resizer-bar is positioned correctly - // handles situation where nested layout was 'hidden' when initialized - var pos = s.size + sC.inset[c.side]; - if ($.layout.cssNum( $R, c.side ) != pos) $R.css( c.side, pos ); - } - - // if was previously hidden due to noRoom, then RESET because NOW there is room - if (s.noRoom) { - // s.noRoom state will be set by open or show - if (s.wasOpen && o.closable) { - if (o.autoReopen) - open(pane, false, true, true); // true = noAnimation, true = noAlert - else // leave the pane closed, so just update state - s.noRoom = false; - } - else - show(pane, s.wasOpen, true, true); // true = noAnimation, true = noAlert - } - } - else { // !hasRoom - pane CANNOT fit - if (!s.noRoom) { // pane not set as noRoom yet, so hide or close it now... - s.noRoom = true; // update state - s.wasOpen = !s.isClosed && !s.isSliding; - if (s.isClosed){} // SKIP - else if (o.closable) // 'close' if possible - close(pane, true, true); // true = force, true = noAnimation - else // 'hide' pane if cannot just be closed - hide(pane, true); // true = noAnimation - } - } - } - - - /** - * sizePane / manualSizePane - * sizePane is called only by internal methods whenever a pane needs to be resized - * manualSizePane is an exposed flow-through method allowing extra code when pane is 'manually resized' - * - * @param {(string|Object)} evt_or_pane The pane being resized - * @param {number} size The *desired* new size for this pane - will be validated - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [force=false] Force resizing even if does not seem necessary - */ -, manualSizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , o = options[pane] - , s = state[pane] - // if resizing callbacks have been delayed and resizing is now DONE, force resizing to complete... - , forceResize = force || (o.livePaneResizing && !s.isResizing) - ; - // ANY call to manualSizePane disables autoResize - ie, percentage sizing - s.autoResize = false; - // flow-through... - sizePane(pane, size, skipCallback, noAnimation, forceResize); // will animate resize if option enabled - } - - /** - * @param {(string|Object)} evt_or_pane The pane being resized - * @param {number} size The *desired* new size for this pane - will be validated - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [noAnimation=false] - * @param {boolean=} [force=false] Force resizing even if does not seem necessary - */ -, sizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) // probably NEVER called from event? - , o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , side = _c[pane].side - , dimName = _c[pane].sizeType.toLowerCase() - , skipResizeWhileDragging = s.isResizing && !o.triggerEventsDuringLiveResize - , doFX = noAnimation !== true && o.animatePaneSizing - , oldSize, newSize - ; - // QUEUE in case another action/animation is in progress - $N.queue(function( queueNext ){ - // calculate 'current' min/max sizes - setSizeLimits(pane); // update pane-state - oldSize = s.size; - size = _parseSize(pane, size); // handle percentages & auto - size = max(size, _parseSize(pane, o.minSize)); - size = min(size, s.maxSize); - if (size < s.minSize) { // not enough room for pane! - queueNext(); // call before makePaneFit() because it needs the queue free - makePaneFit(pane, false, skipCallback); // will hide or close pane - return; - } - - // IF newSize is same as oldSize, then nothing to do - abort - if (!force && size === oldSize) - return queueNext(); - - s.newSize = size; - - // onresize_start callback CANNOT cancel resizing because this would break the layout! - if (!skipCallback && state.initialized && s.isVisible) - _runCallbacks("onresize_start", pane); - - // resize the pane, and make sure its visible - newSize = cssSize(pane, size); - - if (doFX && $P.is(":visible")) { // ANIMATE - var fx = $.layout.effects.size[pane] || $.layout.effects.size.all - , easing = o.fxSettings_size.easing || fx.easing - , z = options.zIndexes - , props = {}; - props[ dimName ] = newSize +'px'; - s.isMoving = true; - // overlay all elements during animation - $P.css({ zIndex: z.pane_animate }) - .show().animate( props, o.fxSpeed_size, easing, function(){ - // reset zIndex after animation - $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); - s.isMoving = false; - delete s.newSize; - sizePane_2(); // continue - queueNext(); - }); - } - else { // no animation - $P.css( dimName, newSize ); // resize pane - delete s.newSize; - // if pane is visible, then - if ($P.is(":visible")) - sizePane_2(); // continue - else { - // pane is NOT VISIBLE, so just update state data... - // when pane is *next opened*, it will have the new size - s.size = size; // update state.size - $.extend(s, elDims($P)); // update state dimensions - } - queueNext(); - }; - - }); - - // SUBROUTINE - function sizePane_2 () { - /* Panes are sometimes not sized precisely in some browsers!? - * This code will resize the pane up to 3 times to nudge the pane to the correct size - */ - var actual = dimName==='width' ? $P.outerWidth() : $P.outerHeight() - , tries = [{ - pane: pane - , count: 1 - , target: size - , actual: actual - , correct: (size === actual) - , attempt: size - , cssSize: newSize - }] - , lastTry = tries[0] - , thisTry = {} - , msg = 'Inaccurate size after resizing the '+ pane +'-pane.' - ; - while ( !lastTry.correct ) { - thisTry = { pane: pane, count: lastTry.count+1, target: size }; - - if (lastTry.actual > size) - thisTry.attempt = max(0, lastTry.attempt - (lastTry.actual - size)); - else // lastTry.actual < size - thisTry.attempt = max(0, lastTry.attempt + (size - lastTry.actual)); - - thisTry.cssSize = cssSize(pane, thisTry.attempt); - $P.css( dimName, thisTry.cssSize ); - - thisTry.actual = dimName=='width' ? $P.outerWidth() : $P.outerHeight(); - thisTry.correct = (size === thisTry.actual); - - // log attempts and alert the user of this *non-fatal error* (if showDebugMessages) - if ( tries.length === 1) { - _log(msg, false, true); - _log(lastTry, false, true); - } - _log(thisTry, false, true); - // after 4 tries, is as close as its gonna get! - if (tries.length > 3) break; - - tries.push( thisTry ); - lastTry = tries[ tries.length - 1 ]; - } - // END TESTING CODE - - // update pane-state dimensions - s.size = size; - $.extend(s, elDims($P)); - - if (s.isVisible && $P.is(":visible")) { - // reposition the resizer-bar - if ($R) $R.css( side, size + sC.inset[side] ); - // resize the content-div - sizeContent(pane); - } - - if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible) - _runCallbacks("onresize_end", pane); - - // resize all the adjacent panes, and adjust their toggler buttons - // when skipCallback passed, it means the controlling method will handle 'other panes' - if (!skipCallback) { - // also no callback if live-resize is in progress and NOT triggerEventsDuringLiveResize - if (!s.isSliding) sizeMidPanes(_c[pane].dir=="horz" ? "" : "center", skipResizeWhileDragging, force); - sizeHandles(); - } - - // if opposite-pane was autoClosed, see if it can be autoOpened now - var altPane = _c.oppositeEdge[pane]; - if (size < oldSize && state[ altPane ].noRoom) { - setSizeLimits( altPane ); - makePaneFit( altPane, false, skipCallback ); - } - - // DEBUG - ALERT user/developer so they know there was a sizing problem - if (tries.length > 1) - _log(msg +'\nSee the Error Console for details.', true, true); - } - } - - /** - * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide() - * @param {(Array.|string)} panes The pane(s) being resized, comma-delmited string - * @param {boolean=} [skipCallback=false] Should the onresize callback be run? - * @param {boolean=} [force=false] - */ -, sizeMidPanes = function (panes, skipCallback, force) { - panes = (panes ? panes : "east,west,center").split(","); - - $.each(panes, function (i, pane) { - if (!$Ps[pane]) return; // NO PANE - skip - var - o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , isCenter= (pane=="center") - , hasRoom = true - , CSS = {} - // if pane is not visible, show it invisibly NOW rather than for *each call* in this script - , visCSS = $.layout.showInvisibly($P) - - , newCenter = calcNewCenterPaneDims() - ; - - // update pane-state dimensions - $.extend(s, elDims($P)); - - if (pane === "center") { - if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) { - $P.css(visCSS); - return true; // SKIP - pane already the correct size - } - // set state for makePaneFit() logic - $.extend(s, cssMinDims(pane), { - maxWidth: newCenter.width - , maxHeight: newCenter.height - }); - CSS = newCenter; - s.newWidth = CSS.width; - s.newHeight = CSS.height; - // convert OUTER width/height to CSS width/height - CSS.width = cssW($P, CSS.width); - // NEW - allow pane to extend 'below' visible area rather than hide it - CSS.height = cssH($P, CSS.height); - hasRoom = CSS.width >= 0 && CSS.height >= 0; // height >= 0 = ALWAYS TRUE NOW - - // during layout init, try to shrink east/west panes to make room for center - if (!state.initialized && o.minWidth > newCenter.width) { - var - reqPx = o.minWidth - s.outerWidth - , minE = options.east.minSize || 0 - , minW = options.west.minSize || 0 - , sizeE = state.east.size - , sizeW = state.west.size - , newE = sizeE - , newW = sizeW - ; - if (reqPx > 0 && state.east.isVisible && sizeE > minE) { - newE = max( sizeE-minE, sizeE-reqPx ); - reqPx -= sizeE-newE; - } - if (reqPx > 0 && state.west.isVisible && sizeW > minW) { - newW = max( sizeW-minW, sizeW-reqPx ); - reqPx -= sizeW-newW; - } - // IF we found enough extra space, then resize the border panes as calculated - if (reqPx === 0) { - if (sizeE && sizeE != minE) - sizePane('east', newE, true, true, force); // true = skipCallback/noAnimation - initPanes will handle when done - if (sizeW && sizeW != minW) - sizePane('west', newW, true, true, force); // true = skipCallback/noAnimation - // now start over! - sizeMidPanes('center', skipCallback, force); - $P.css(visCSS); - return; // abort this loop - } - } - } - else { // for east and west, set only the height, which is same as center height - // set state.min/maxWidth/Height for makePaneFit() logic - if (s.isVisible && !s.noVerticalRoom) - $.extend(s, elDims($P), cssMinDims(pane)) - if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) { - $P.css(visCSS); - return true; // SKIP - pane already the correct size - } - // east/west have same top, bottom & height as center - CSS.top = newCenter.top; - CSS.bottom = newCenter.bottom; - s.newSize = newCenter.height - // NEW - allow pane to extend 'below' visible area rather than hide it - CSS.height = cssH($P, newCenter.height); - s.maxHeight = CSS.height; - hasRoom = (s.maxHeight >= 0); // ALWAYS TRUE NOW - if (!hasRoom) s.noVerticalRoom = true; // makePaneFit() logic - } - - if (hasRoom) { - // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized - if (!skipCallback && state.initialized) - _runCallbacks("onresize_start", pane); - - $P.css(CSS); // apply the CSS to pane - if (pane !== "center") - sizeHandles(pane); // also update resizer length - if (s.noRoom && !s.isClosed && !s.isHidden) - makePaneFit(pane); // will re-open/show auto-closed/hidden pane - if (s.isVisible) { - $.extend(s, elDims($P)); // update pane dimensions - if (state.initialized) sizeContent(pane); // also resize the contents, if exists - } - } - else if (!s.noRoom && s.isVisible) // no room for pane - makePaneFit(pane); // will hide or close pane - - // reset visibility, if necessary - $P.css(visCSS); - - delete s.newSize; - delete s.newWidth; - delete s.newHeight; - - if (!s.isVisible) - return true; // DONE - next pane - - /* - * Extra CSS for IE6 or IE7 in Quirks-mode - add 'width' to NORTH/SOUTH panes - * Normally these panes have only 'left' & 'right' positions so pane auto-sizes - * ALSO required when pane is an IFRAME because will NOT default to 'full width' - * TODO: Can I use width:100% for a north/south iframe? - * TODO: Sounds like a job for $P.outerWidth( sC.innerWidth ) SETTER METHOD - */ - if (pane === "center") { // finished processing midPanes - var fix = browser.isIE6 || !browser.boxModel; - if ($Ps.north && (fix || state.north.tagName=="IFRAME")) - $Ps.north.css("width", cssW($Ps.north, sC.innerWidth)); - if ($Ps.south && (fix || state.south.tagName=="IFRAME")) - $Ps.south.css("width", cssW($Ps.south, sC.innerWidth)); - } - - // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized - if (!skipCallback && state.initialized) - _runCallbacks("onresize_end", pane); - }); - } - - - /** - * @see window.onresize(), callbacks or custom code - * @param {(Object|boolean)=} evt_or_refresh If 'true', then also reset pane-positioning - */ -, resizeAll = function (evt_or_refresh) { - var oldW = sC.innerWidth - , oldH = sC.innerHeight - ; - // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility - evtPane(evt_or_refresh); - - // cannot size layout when 'container' is hidden or collapsed - if (!$N.is(":visible")) return; - - if (!state.initialized) { - _initLayoutElements(); - return; // no need to resize since we just initialized! - } - - if (evt_or_refresh === true && $.isPlainObject(options.outset)) { - // update container CSS in case outset option has changed - $N.css( options.outset ); - } - // UPDATE container dimensions - $.extend(sC, elDims( $N, options.inset )); - if (!sC.outerHeight) return; - - // if 'true' passed, refresh pane & handle positioning too - if (evt_or_refresh === true) { - setPanePosition(); - } - - // onresizeall_start will CANCEL resizing if returns false - // state.container has already been set, so user can access this info for calcuations - if (false === _runCallbacks("onresizeall_start")) return false; - - var // see if container is now 'smaller' than before - shrunkH = (sC.innerHeight < oldH) - , shrunkW = (sC.innerWidth < oldW) - , $P, o, s - ; - // NOTE special order for sizing: S-N-E-W - $.each(["south","north","east","west"], function (i, pane) { - if (!$Ps[pane]) return; // no pane - SKIP - o = options[pane]; - s = state[pane]; - if (s.autoResize && s.size != o.size) // resize pane to original size set in options - sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize - else { - setSizeLimits(pane); - makePaneFit(pane, false, true, true); // true=skipCallback/forceResize - } - }); - - sizeMidPanes("", true, true); // true=skipCallback/forceResize - sizeHandles(); // reposition the toggler elements - - // trigger all individual pane callbacks AFTER layout has finished resizing - $.each(_c.allPanes, function (i, pane) { - $P = $Ps[pane]; - if (!$P) return; // SKIP - if (state[pane].isVisible) // undefined for non-existent panes - _runCallbacks("onresize_end", pane); // callback - if exists - }); - - _runCallbacks("onresizeall_end"); - //_triggerLayoutEvent(pane, 'resizeall'); - } - - /** - * Whenever a pane resizes or opens that has a nested layout, trigger resizeAll - * - * @param {(string|Object)} evt_or_pane The pane just resized or opened - */ -, resizeChildren = function (evt_or_pane, skipRefresh) { - var pane = evtPane.call(this, evt_or_pane); - - if (!options[pane].resizeChildren) return; - - // ensure the pane-children are up-to-date - if (!skipRefresh) refreshChildren( pane ); - var pC = children[pane]; - if ($.isPlainObject( pC )) { - // resize one or more children - $.each( pC, function (key, child) { - child.resizeAll(); - }); - } - } - - /** - * IF pane has a content-div, then resize all elements inside pane to fit pane-height - * - * @param {(string|Object)} evt_or_panes The pane(s) being resized - * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured? - */ -, sizeContent = function (evt_or_panes, remeasure) { - if (!isInitialized()) return; - - var panes = evtPane.call(this, evt_or_panes); - panes = panes ? panes.split(",") : _c.allPanes; - - $.each(panes, function (idx, pane) { - var - $P = $Ps[pane] - , $C = $Cs[pane] - , o = options[pane] - , s = state[pane] - , m = s.content // m = measurements - ; - if (!$P || !$C || !$P.is(":visible")) return true; // NOT VISIBLE - skip - - // if content-element was REMOVED, update OR remove the pointer - if (!$C.length) { - initContent(pane, false); // false = do NOT sizeContent() - already there! - if (!$C) return; // no replacement element found - pointer have been removed - } - - // onsizecontent_start will CANCEL resizing if returns false - if (false === _runCallbacks("onsizecontent_start", pane)) return; - - // skip re-measuring offsets if live-resizing - if ((!s.isMoving && !s.isResizing) || o.liveContentResizing || remeasure || m.top == undefined) { - _measure(); - // if any footers are below pane-bottom, they may not measure correctly, - // so allow pane overflow and re-measure - if (m.hiddenFooters > 0 && $P.css("overflow") === "hidden") { - $P.css("overflow", "visible"); - _measure(); // remeasure while overflowing - $P.css("overflow", "hidden"); - } - } - // NOTE: spaceAbove/Below *includes* the pane paddingTop/Bottom, but not pane.borders - var newH = s.innerHeight - (m.spaceAbove - s.css.paddingTop) - (m.spaceBelow - s.css.paddingBottom); - - if (!$C.is(":visible") || m.height != newH) { - // size the Content element to fit new pane-size - will autoHide if not enough room - setOuterHeight($C, newH, true); // true=autoHide - m.height = newH; // save new height - }; - - if (state.initialized) - _runCallbacks("onsizecontent_end", pane); - - function _below ($E) { - return max(s.css.paddingBottom, (parseInt($E.css("marginBottom"), 10) || 0)); - }; - - function _measure () { - var - ignore = options[pane].contentIgnoreSelector - , $Fs = $C.nextAll().not(".ui-layout-mask").not(ignore || ":lt(0)") // not :lt(0) = ALL - , $Fs_vis = $Fs.filter(':visible') - , $F = $Fs_vis.filter(':last') - ; - m = { - top: $C[0].offsetTop - , height: $C.outerHeight() - , numFooters: $Fs.length - , hiddenFooters: $Fs.length - $Fs_vis.length - , spaceBelow: 0 // correct if no content footer ($E) - } - m.spaceAbove = m.top; // just for state - not used in calc - m.bottom = m.top + m.height; - if ($F.length) - //spaceBelow = (LastFooter.top + LastFooter.height) [footerBottom] - Content.bottom + max(LastFooter.marginBottom, pane.paddingBotom) - m.spaceBelow = ($F[0].offsetTop + $F.outerHeight()) - m.bottom + _below($F); - else // no footer - check marginBottom on Content element itself - m.spaceBelow = _below($C); - }; - }); - } - - - /** - * Called every time a pane is opened, closed, or resized to slide the togglers to 'center' and adjust their length if necessary - * - * @see initHandles(), open(), close(), resizeAll() - * @param {(string|Object)=} evt_or_panes The pane(s) being resized - */ -, sizeHandles = function (evt_or_panes) { - var panes = evtPane.call(this, evt_or_panes) - panes = panes ? panes.split(",") : _c.borderPanes; - - $.each(panes, function (i, pane) { - var - o = options[pane] - , s = state[pane] - , $P = $Ps[pane] - , $R = $Rs[pane] - , $T = $Ts[pane] - , $TC - ; - if (!$P || !$R) return; - - var - dir = _c[pane].dir - , _state = (s.isClosed ? "_closed" : "_open") - , spacing = o["spacing"+ _state] - , togAlign = o["togglerAlign"+ _state] - , togLen = o["togglerLength"+ _state] - , paneLen - , left - , offset - , CSS = {} - ; - - if (spacing === 0) { - $R.hide(); - return; - } - else if (!s.noRoom && !s.isHidden) // skip if resizer was hidden for any reason - $R.show(); // in case was previously hidden - - // Resizer Bar is ALWAYS same width/height of pane it is attached to - if (dir === "horz") { // north/south - //paneLen = $P.outerWidth(); // s.outerWidth || - paneLen = sC.innerWidth; // handle offscreen-panes - s.resizerLength = paneLen; - left = $.layout.cssNum($P, "left") - $R.css({ - width: cssW($R, paneLen) // account for borders & padding - , height: cssH($R, spacing) // ditto - , left: left > -9999 ? left : sC.inset.left // handle offscreen-panes - }); - } - else { // east/west - paneLen = $P.outerHeight(); // s.outerHeight || - s.resizerLength = paneLen; - $R.css({ - height: cssH($R, paneLen) // account for borders & padding - , width: cssW($R, spacing) // ditto - , top: sC.inset.top + getPaneSize("north", true) // TODO: what if no North pane? - //, top: $.layout.cssNum($Ps["center"], "top") - }); - } - - // remove hover classes - removeHover( o, $R ); - - if ($T) { - if (togLen === 0 || (s.isSliding && o.hideTogglerOnSlide)) { - $T.hide(); // always HIDE the toggler when 'sliding' - return; - } - else - $T.show(); // in case was previously hidden - - if (!(togLen > 0) || togLen === "100%" || togLen > paneLen) { - togLen = paneLen; - offset = 0; - } - else { // calculate 'offset' based on options.PANE.togglerAlign_open/closed - if (isStr(togAlign)) { - switch (togAlign) { - case "top": - case "left": offset = 0; - break; - case "bottom": - case "right": offset = paneLen - togLen; - break; - case "middle": - case "center": - default: offset = round((paneLen - togLen) / 2); // 'default' catches typos - } - } - else { // togAlign = number - var x = parseInt(togAlign, 10); // - if (togAlign >= 0) offset = x; - else offset = paneLen - togLen + x; // NOTE: x is negative! - } - } - - if (dir === "horz") { // north/south - var width = cssW($T, togLen); - $T.css({ - width: width // account for borders & padding - , height: cssH($T, spacing) // ditto - , left: offset // TODO: VERIFY that toggler positions correctly for ALL values - , top: 0 - }); - // CENTER the toggler content SPAN - $T.children(".content").each(function(){ - $TC = $(this); - $TC.css("marginLeft", round((width-$TC.outerWidth())/2)); // could be negative - }); - } - else { // east/west - var height = cssH($T, togLen); - $T.css({ - height: height // account for borders & padding - , width: cssW($T, spacing) // ditto - , top: offset // POSITION the toggler - , left: 0 - }); - // CENTER the toggler content SPAN - $T.children(".content").each(function(){ - $TC = $(this); - $TC.css("marginTop", round((height-$TC.outerHeight())/2)); // could be negative - }); - } - - // remove ALL hover classes - removeHover( 0, $T ); - } - - // DONE measuring and sizing this resizer/toggler, so can be 'hidden' now - if (!state.initialized && (o.initHidden || s.noRoom)) { - $R.hide(); - if ($T) $T.hide(); - } - }); - } - - - /** - * @param {(string|Object)} evt_or_pane - */ -, enableClosable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $T = $Ts[pane] - , o = options[pane] - ; - if (!$T) return; - o.closable = true; - $T .bind("click."+ sID, function(evt){ evt.stopPropagation(); toggle(pane); }) - .css("visibility", "visible") - .css("cursor", "pointer") - .attr("title", state[pane].isClosed ? o.tips.Open : o.tips.Close) // may be blank - .show(); - } - /** - * @param {(string|Object)} evt_or_pane - * @param {boolean=} [hide=false] - */ -, disableClosable = function (evt_or_pane, hide) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $T = $Ts[pane] - ; - if (!$T) return; - options[pane].closable = false; - // is closable is disable, then pane MUST be open! - if (state[pane].isClosed) open(pane, false, true); - $T .unbind("."+ sID) - .css("visibility", hide ? "hidden" : "visible") // instead of hide(), which creates logic issues - .css("cursor", "default") - .attr("title", ""); - } - - - /** - * @param {(string|Object)} evt_or_pane - */ -, enableSlidable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - ; - if (!$R || !$R.data('draggable')) return; - options[pane].slidable = true; - if (state[pane].isClosed) - bindStartSlidingEvents(pane, true); - } - /** - * @param {(string|Object)} evt_or_pane - */ -, disableSlidable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - ; - if (!$R) return; - options[pane].slidable = false; - if (state[pane].isSliding) - close(pane, false, true); - else { - bindStartSlidingEvents(pane, false); - $R .css("cursor", "default") - .attr("title", ""); - removeHover(null, $R[0]); // in case currently hovered - } - } - - - /** - * @param {(string|Object)} evt_or_pane - */ -, enableResizable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - , o = options[pane] - ; - if (!$R || !$R.data('draggable')) return; - o.resizable = true; - $R.draggable("enable"); - if (!state[pane].isClosed) - $R .css("cursor", o.resizerCursor) - .attr("title", o.tips.Resize); - } - /** - * @param {(string|Object)} evt_or_pane - */ -, disableResizable = function (evt_or_pane) { - if (!isInitialized()) return; - var pane = evtPane.call(this, evt_or_pane) - , $R = $Rs[pane] - ; - if (!$R || !$R.data('draggable')) return; - options[pane].resizable = false; - $R .draggable("disable") - .css("cursor", "default") - .attr("title", ""); - removeHover(null, $R[0]); // in case currently hovered - } - - - /** - * Move a pane from source-side (eg, west) to target-side (eg, east) - * If pane exists on target-side, move that to source-side, ie, 'swap' the panes - * - * @param {(string|Object)} evt_or_pane1 The pane/edge being swapped - * @param {string} pane2 ditto - */ -, swapPanes = function (evt_or_pane1, pane2) { - if (!isInitialized()) return; - var pane1 = evtPane.call(this, evt_or_pane1); - // change state.edge NOW so callbacks can know where pane is headed... - state[pane1].edge = pane2; - state[pane2].edge = pane1; - // run these even if NOT state.initialized - if (false === _runCallbacks("onswap_start", pane1) - || false === _runCallbacks("onswap_start", pane2) - ) { - state[pane1].edge = pane1; // reset - state[pane2].edge = pane2; - return; - } - - var - oPane1 = copy( pane1 ) - , oPane2 = copy( pane2 ) - , sizes = {} - ; - sizes[pane1] = oPane1 ? oPane1.state.size : 0; - sizes[pane2] = oPane2 ? oPane2.state.size : 0; - - // clear pointers & state - $Ps[pane1] = false; - $Ps[pane2] = false; - state[pane1] = {}; - state[pane2] = {}; - - // ALWAYS remove the resizer & toggler elements - if ($Ts[pane1]) $Ts[pane1].remove(); - if ($Ts[pane2]) $Ts[pane2].remove(); - if ($Rs[pane1]) $Rs[pane1].remove(); - if ($Rs[pane2]) $Rs[pane2].remove(); - $Rs[pane1] = $Rs[pane2] = $Ts[pane1] = $Ts[pane2] = false; - - // transfer element pointers and data to NEW Layout keys - move( oPane1, pane2 ); - move( oPane2, pane1 ); - - // cleanup objects - oPane1 = oPane2 = sizes = null; - - // make panes 'visible' again - if ($Ps[pane1]) $Ps[pane1].css(_c.visible); - if ($Ps[pane2]) $Ps[pane2].css(_c.visible); - - // fix any size discrepancies caused by swap - resizeAll(); - - // run these even if NOT state.initialized - _runCallbacks("onswap_end", pane1); - _runCallbacks("onswap_end", pane2); - - return; - - function copy (n) { // n = pane - var - $P = $Ps[n] - , $C = $Cs[n] - ; - return !$P ? false : { - pane: n - , P: $P ? $P[0] : false - , C: $C ? $C[0] : false - , state: $.extend(true, {}, state[n]) - , options: $.extend(true, {}, options[n]) - } - }; - - function move (oPane, pane) { - if (!oPane) return; - var - P = oPane.P - , C = oPane.C - , oldPane = oPane.pane - , c = _c[pane] - // save pane-options that should be retained - , s = $.extend(true, {}, state[pane]) - , o = options[pane] - // RETAIN side-specific FX Settings - more below - , fx = { resizerCursor: o.resizerCursor } - , re, size, pos - ; - $.each("fxName,fxSpeed,fxSettings".split(","), function (i, k) { - fx[k +"_open"] = o[k +"_open"]; - fx[k +"_close"] = o[k +"_close"]; - fx[k +"_size"] = o[k +"_size"]; - }); - - // update object pointers and attributes - $Ps[pane] = $(P) - .data({ - layoutPane: Instance[pane] // NEW pointer to pane-alias-object - , layoutEdge: pane - }) - .css(_c.hidden) - .css(c.cssReq) - ; - $Cs[pane] = C ? $(C) : false; - - // set options and state - options[pane] = $.extend(true, {}, oPane.options, fx); - state[pane] = $.extend(true, {}, oPane.state); - - // change classNames on the pane, eg: ui-layout-pane-east ==> ui-layout-pane-west - re = new RegExp(o.paneClass +"-"+ oldPane, "g"); - P.className = P.className.replace(re, o.paneClass +"-"+ pane); - - // ALWAYS regenerate the resizer & toggler elements - initHandles(pane); // create the required resizer & toggler - - // if moving to different orientation, then keep 'target' pane size - if (c.dir != _c[oldPane].dir) { - size = sizes[pane] || 0; - setSizeLimits(pane); // update pane-state - size = max(size, state[pane].minSize); - // use manualSizePane to disable autoResize - not useful after panes are swapped - manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation - } - else // move the resizer here - $Rs[pane].css(c.side, sC.inset[c.side] + (state[pane].isVisible ? getPaneSize(pane) : 0)); - - - // ADD CLASSNAMES & SLIDE-BINDINGS - if (oPane.state.isVisible && !s.isVisible) - setAsOpen(pane, true); // true = skipCallback - else { - setAsClosed(pane); - bindStartSlidingEvents(pane, true); // will enable events IF option is set - } - - // DESTROY the object - oPane = null; - }; - } - - - /** - * INTERNAL method to sync pin-buttons when pane is opened or closed - * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes - * - * @see open(), setAsOpen(), setAsClosed() - * @param {string} pane These are the params returned to callbacks by layout() - * @param {boolean} doPin True means set the pin 'down', False means 'up' - */ -, syncPinBtns = function (pane, doPin) { - if ($.layout.plugins.buttons) - $.each(state[pane].pins, function (i, selector) { - $.layout.buttons.setPinState(Instance, $(selector), pane, doPin); - }); - } - -; // END var DECLARATIONS - - /** - * Capture keys when enableCursorHotkey - toggle pane if hotkey pressed - * - * @see document.keydown() - */ - function keyDown (evt) { - if (!evt) return true; - var code = evt.keyCode; - if (code < 33) return true; // ignore special keys: ENTER, TAB, etc - - var - PANE = { - 38: "north" // Up Cursor - $.ui.keyCode.UP - , 40: "south" // Down Cursor - $.ui.keyCode.DOWN - , 37: "west" // Left Cursor - $.ui.keyCode.LEFT - , 39: "east" // Right Cursor - $.ui.keyCode.RIGHT - } - , ALT = evt.altKey // no worky! - , SHIFT = evt.shiftKey - , CTRL = evt.ctrlKey - , CURSOR = (CTRL && code >= 37 && code <= 40) - , o, k, m, pane - ; - - if (CURSOR && options[PANE[code]].enableCursorHotkey) // valid cursor-hotkey - pane = PANE[code]; - else if (CTRL || SHIFT) // check to see if this matches a custom-hotkey - $.each(_c.borderPanes, function (i, p) { // loop each pane to check its hotkey - o = options[p]; - k = o.customHotkey; - m = o.customHotkeyModifier; // if missing or invalid, treated as "CTRL+SHIFT" - if ((SHIFT && m=="SHIFT") || (CTRL && m=="CTRL") || (CTRL && SHIFT)) { // Modifier matches - if (k && code === (isNaN(k) || k <= 9 ? k.toUpperCase().charCodeAt(0) : k)) { // Key matches - pane = p; - return false; // BREAK - } - } - }); - - // validate pane - if (!pane || !$Ps[pane] || !options[pane].closable || state[pane].isHidden) - return true; - - toggle(pane); - - evt.stopPropagation(); - evt.returnValue = false; // CANCEL key - return false; - }; - - -/* - * ###################################### - * UTILITY METHODS - * called externally or by initButtons - * ###################################### - */ - - /** - * Change/reset a pane overflow setting & zIndex to allow popups/drop-downs to work - * - * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event - */ - function allowOverflow (el) { - if (!isInitialized()) return; - if (this && this.tagName) el = this; // BOUND to element - var $P; - if (isStr(el)) - $P = $Ps[el]; - else if ($(el).data("layoutRole")) - $P = $(el); - else - $(el).parents().each(function(){ - if ($(this).data("layoutRole")) { - $P = $(this); - return false; // BREAK - } - }); - if (!$P || !$P.length) return; // INVALID - - var - pane = $P.data("layoutEdge") - , s = state[pane] - ; - - // if pane is already raised, then reset it before doing it again! - // this would happen if allowOverflow is attached to BOTH the pane and an element - if (s.cssSaved) - resetOverflow(pane); // reset previous CSS before continuing - - // if pane is raised by sliding or resizing, or its closed, then abort - if (s.isSliding || s.isResizing || s.isClosed) { - s.cssSaved = false; - return; - } - - var - newCSS = { zIndex: (options.zIndexes.resizer_normal + 1) } - , curCSS = {} - , of = $P.css("overflow") - , ofX = $P.css("overflowX") - , ofY = $P.css("overflowY") - ; - // determine which, if any, overflow settings need to be changed - if (of != "visible") { - curCSS.overflow = of; - newCSS.overflow = "visible"; - } - if (ofX && !ofX.match(/(visible|auto)/)) { - curCSS.overflowX = ofX; - newCSS.overflowX = "visible"; - } - if (ofY && !ofY.match(/(visible|auto)/)) { - curCSS.overflowY = ofX; - newCSS.overflowY = "visible"; - } - - // save the current overflow settings - even if blank! - s.cssSaved = curCSS; - - // apply new CSS to raise zIndex and, if necessary, make overflow 'visible' - $P.css( newCSS ); - - // make sure the zIndex of all other panes is normal - $.each(_c.allPanes, function(i, p) { - if (p != pane) resetOverflow(p); - }); - - }; - /** - * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event - */ - function resetOverflow (el) { - if (!isInitialized()) return; - if (this && this.tagName) el = this; // BOUND to element - var $P; - if (isStr(el)) - $P = $Ps[el]; - else if ($(el).data("layoutRole")) - $P = $(el); - else - $(el).parents().each(function(){ - if ($(this).data("layoutRole")) { - $P = $(this); - return false; // BREAK - } - }); - if (!$P || !$P.length) return; // INVALID - - var - pane = $P.data("layoutEdge") - , s = state[pane] - , CSS = s.cssSaved || {} - ; - // reset the zIndex - if (!s.isSliding && !s.isResizing) - $P.css("zIndex", options.zIndexes.pane_normal); - - // reset Overflow - if necessary - $P.css( CSS ); - - // clear var - s.cssSaved = false; - }; - -/* - * ##################### - * CREATE/RETURN LAYOUT - * ##################### - */ - - // validate that container exists - var $N = $(this).eq(0); // FIRST matching Container element - if (!$N.length) { - return _log( options.errors.containerMissing ); - }; - - // Users retrieve Instance of a layout with: $N.layout() OR $N.data("layout") - // return the Instance-pointer if layout has already been initialized - if ($N.data("layoutContainer") && $N.data("layout")) - return $N.data("layout"); // cached pointer - - // init global vars - var - $Ps = {} // Panes x5 - set in initPanes() - , $Cs = {} // Content x5 - set in initPanes() - , $Rs = {} // Resizers x4 - set in initHandles() - , $Ts = {} // Togglers x4 - set in initHandles() - , $Ms = $([]) // Masks - up to 2 masks per pane (IFRAME + DIV) - // aliases for code brevity - , sC = state.container // alias for easy access to 'container dimensions' - , sID = state.id // alias for unique layout ID/namespace - eg: "layout435" - ; - - // create Instance object to expose data & option Properties, and primary action Methods - var Instance = { - // layout data - options: options // property - options hash - , state: state // property - dimensions hash - // object pointers - , container: $N // property - object pointers for layout container - , panes: $Ps // property - object pointers for ALL Panes: panes.north, panes.center - , contents: $Cs // property - object pointers for ALL Content: contents.north, contents.center - , resizers: $Rs // property - object pointers for ALL Resizers, eg: resizers.north - , togglers: $Ts // property - object pointers for ALL Togglers, eg: togglers.north - // border-pane open/close - , hide: hide // method - ditto - , show: show // method - ditto - , toggle: toggle // method - pass a 'pane' ("north", "west", etc) - , open: open // method - ditto - , close: close // method - ditto - , slideOpen: slideOpen // method - ditto - , slideClose: slideClose // method - ditto - , slideToggle: slideToggle // method - ditto - // pane actions - , setSizeLimits: setSizeLimits // method - pass a 'pane' - update state min/max data - , _sizePane: sizePane // method -intended for user by plugins only! - , sizePane: manualSizePane // method - pass a 'pane' AND an 'outer-size' in pixels or percent, or 'auto' - , sizeContent: sizeContent // method - pass a 'pane' - , swapPanes: swapPanes // method - pass TWO 'panes' - will swap them - , showMasks: showMasks // method - pass a 'pane' OR list of panes - default = all panes with mask option set - , hideMasks: hideMasks // method - ditto' - // pane element methods - , initContent: initContent // method - ditto - , addPane: addPane // method - pass a 'pane' - , removePane: removePane // method - pass a 'pane' to remove from layout, add 'true' to delete the pane-elem - , createChildren: createChildren // method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].children - , refreshChildren: refreshChildren // method - pass a 'pane' and a layout-instance - // special pane option setting - , enableClosable: enableClosable // method - pass a 'pane' - , disableClosable: disableClosable // method - ditto - , enableSlidable: enableSlidable // method - ditto - , disableSlidable: disableSlidable // method - ditto - , enableResizable: enableResizable // method - ditto - , disableResizable: disableResizable// method - ditto - // utility methods for panes - , allowOverflow: allowOverflow // utility - pass calling element (this) - , resetOverflow: resetOverflow // utility - ditto - // layout control - , destroy: destroy // method - no parameters - , initPanes: isInitialized // method - no parameters - , resizeAll: resizeAll // method - no parameters - // callback triggering - , runCallbacks: _runCallbacks // method - pass evtName & pane (if a pane-event), eg: trigger("onopen", "west") - // alias collections of options, state and children - created in addPane and extended elsewhere - , hasParentLayout: false // set by initContainer() - , children: children // pointers to child-layouts, eg: Instance.children.west.layoutName - , north: false // alias group: { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], children: children[pane] } - , south: false // ditto - , west: false // ditto - , east: false // ditto - , center: false // ditto - }; - - // create the border layout NOW - if (_create() === 'cancel') // onload_start callback returned false to CANCEL layout creation - return null; - else // true OR false -- if layout-elements did NOT init (hidden or do not exist), can auto-init later - return Instance; // return the Instance object - -} - - -/* OLD versions of jQuery only set $.support.boxModel after page is loaded - * so if this is IE, use support.boxModel to test for quirks-mode (ONLY IE changes boxModel). - */ -$(function(){ - var b = $.layout.browser; - if (b.msie) b.boxModel = $.support.boxModel; -}); - - -})( jQuery ); -// END Layout - keep internal vars internal! - - - -// START Plugins - shared wrapper, no global vars -(function ($) { - - -/** - * jquery.layout.state 1.0 - * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ - * - * Copyright (c) 2012 - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * @requires: UI Layout 1.3.0.rc30.1 or higher - * @requires: $.ui.cookie (above) - * - * @see: http://groups.google.com/group/jquery-ui-layout - */ -/* - * State-management options stored in options.stateManagement, which includes a .cookie hash - * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden - * - * // STATE/COOKIE OPTIONS - * @example $(el).layout({ - stateManagement: { - enabled: true - , stateKeys: "east.size,west.size,east.isClosed,west.isClosed" - , cookie: { name: "appLayout", path: "/" } - } - }) - * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies - * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } }) - * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" }) - * - * // STATE/COOKIE METHODS - * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} ); - * @example myLayout.loadCookie(); - * @example myLayout.deleteCookie(); - * @example var JSON = myLayout.readState(); // CURRENT Layout State - * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie) - * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash) - * - * CUSTOM STATE-MANAGEMENT (eg, saved in a database) - * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" ); - * @example myLayout.loadState( JSON ); - */ - -/** - * UI COOKIE UTILITY - * - * A $.cookie OR $.ui.cookie namespace *should be standard*, but until then... - * This creates $.ui.cookie so Layout does not need the cookie.jquery.js plugin - * NOTE: This utility is REQUIRED by the layout.state plugin - * - * Cookie methods in Layout are created as part of State Management - */ -if (!$.ui) $.ui = {}; -$.ui.cookie = { - - // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6 - acceptsCookies: !!navigator.cookieEnabled - -, read: function (name) { - var - c = document.cookie - , cs = c ? c.split(';') : [] - , pair // loop var - ; - for (var i=0, n=cs.length; i < n; i++) { - pair = $.trim(cs[i]).split('='); // name=value pair - if (pair[0] == name) // found the layout cookie - return decodeURIComponent(pair[1]); - - } - return null; - } - -, write: function (name, val, cookieOpts) { - var - params = '' - , date = '' - , clear = false - , o = cookieOpts || {} - , x = o.expires - ; - if (x && x.toUTCString) - date = x; - else if (x === null || typeof x === 'number') { - date = new Date(); - if (x > 0) - date.setDate(date.getDate() + x); - else { - date.setFullYear(1970); - clear = true; - } - } - if (date) params += ';expires='+ date.toUTCString(); - if (o.path) params += ';path='+ o.path; - if (o.domain) params += ';domain='+ o.domain; - if (o.secure) params += ';secure'; - document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie - } - -, clear: function (name) { - $.ui.cookie.write(name, '', {expires: -1}); - } - -}; -// if cookie.jquery.js is not loaded, create an alias to replicate it -// this may be useful to other plugins or code dependent on that plugin -if (!$.cookie) $.cookie = function (k, v, o) { - var C = $.ui.cookie; - if (v === null) - C.clear(k); - else if (v === undefined) - return C.read(k); - else - C.write(k, v, o); -}; - - -// tell Layout that the state plugin is available -$.layout.plugins.stateManagement = true; - -// Add State-Management options to layout.defaults -$.layout.config.optionRootKeys.push("stateManagement"); -$.layout.defaults.stateManagement = { - enabled: false // true = enable state-management, even if not using cookies -, autoSave: true // Save a state-cookie when page exits? -, autoLoad: true // Load the state-cookie when Layout inits? -, animateLoad: true // animate panes when loading state into an active layout -, includeChildren: true // recurse into child layouts to include their state as well - // List state-data to save - must be pane-specific -, stateKeys: "north.size,south.size,east.size,west.size,"+ - "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+ - "north.isHidden,south.isHidden,east.isHidden,west.isHidden" -, cookie: { - name: "" // If not specified, will use Layout.name, else just "Layout" - , domain: "" // blank = current domain - , path: "" // blank = current page, '/' = entire website - , expires: "" // 'days' to keep cookie - leave blank for 'session cookie' - , secure: false - } -}; -// Set stateManagement as a layout-option, NOT a pane-option -$.layout.optionsMap.layout.push("stateManagement"); - -/* - * State Management methods - */ -$.layout.state = { - - /** - * Get the current layout state and save it to a cookie - * - * myLayout.saveCookie( keys, cookieOpts ) - * - * @param {Object} inst - * @param {(string|Array)=} keys - * @param {Object=} cookieOpts - */ - saveCookie: function (inst, keys, cookieOpts) { - var o = inst.options - , sm = o.stateManagement - , oC = $.extend(true, {}, sm.cookie, cookieOpts || null) - , data = inst.state.stateData = inst.readState( keys || sm.stateKeys ) // read current panes-state - ; - $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC ); - return $.extend(true, {}, data); // return COPY of state.stateData data - } - - /** - * Remove the state cookie - * - * @param {Object} inst - */ -, deleteCookie: function (inst) { - var o = inst.options; - $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" ); - } - - /** - * Read & return data from the cookie - as JSON - * - * @param {Object} inst - */ -, readCookie: function (inst) { - var o = inst.options; - var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" ); - // convert cookie string back to a hash and return it - return c ? $.layout.state.decodeJSON(c) : {}; - } - - /** - * Get data from the cookie and USE IT to loadState - * - * @param {Object} inst - */ -, loadCookie: function (inst) { - var c = $.layout.state.readCookie(inst); // READ the cookie - if (c) { - inst.state.stateData = $.extend(true, {}, c); // SET state.stateData - inst.loadState(c); // LOAD the retrieved state - } - return c; - } - - /** - * Update layout options from the cookie, if one exists - * - * @param {Object} inst - * @param {Object=} stateData - * @param {boolean=} animate - */ -, loadState: function (inst, data, opts) { - if (!$.isPlainObject( data ) || $.isEmptyObject( data )) return; - - // normalize data & cache in the state object - data = inst.state.stateData = $.layout.transformData( data ); // panes = default subkey - - // add missing/default state-restore options - var smo = inst.options.stateManagement; - opts = $.extend({ - animateLoad: false //smo.animateLoad - , includeChildren: smo.includeChildren - }, opts ); - - if (!inst.state.initialized) { - /* - * layout NOT initialized, so just update its options - */ - // MUST remove pane.children keys before applying to options - // use a copy so we don't remove keys from original data - var o = $.extend(true, {}, data); - //delete o.center; // center has no state-data - only children - $.each($.layout.config.allPanes, function (idx, pane) { - if (o[pane]) delete o[pane].children; - }); - // update CURRENT layout-options with saved state data - $.extend(true, inst.options, o); - } - else { - /* - * layout already initialized, so modify layout's configuration - */ - var noAnimate = !opts.animateLoad - , o, c, h, state, open - ; - $.each($.layout.config.borderPanes, function (idx, pane) { - o = data[ pane ]; - if (!$.isPlainObject( o )) return; // no key, skip pane - - s = o.size; - c = o.initClosed; - h = o.initHidden; - ar = o.autoResize - state = inst.state[pane]; - open = state.isVisible; - - // reset autoResize - if (ar) - state.autoResize = ar; - // resize BEFORE opening - if (!open) - inst._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize - // open/close as necessary - DO NOT CHANGE THIS ORDER! - if (h === true) inst.hide(pane, noAnimate); - else if (c === true) inst.close(pane, false, noAnimate); - else if (c === false) inst.open (pane, false, noAnimate); - else if (h === false) inst.show (pane, false, noAnimate); - // resize AFTER any other actions - if (open) - inst._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed - }); - - /* - * RECURSE INTO CHILD-LAYOUTS - */ - if (opts.includeChildren) { - var paneStateChildren, childState; - $.each(inst.children, function (pane, paneChildren) { - paneStateChildren = data[pane] ? data[pane].children : 0; - if (paneStateChildren && paneChildren) { - $.each(paneChildren, function (stateKey, child) { - childState = paneStateChildren[stateKey]; - if (child && childState) - child.loadState( childState ); - }); - } - }); - } - } - } - - /** - * Get the *current layout state* and return it as a hash - * - * @param {Object=} inst // Layout instance to get state for - * @param {object=} [opts] // State-Managements override options - */ -, readState: function (inst, opts) { - // backward compatility - if ($.type(opts) === 'string') opts = { keys: opts }; - if (!opts) opts = {}; - var sm = inst.options.stateManagement - , ic = opts.includeChildren - , recurse = ic !== undefined ? ic : sm.includeChildren - , keys = opts.stateKeys || sm.stateKeys - , alt = { isClosed: 'initClosed', isHidden: 'initHidden' } - , state = inst.state - , panes = $.layout.config.allPanes - , data = {} - , pair, pane, key, val - , ps, pC, child, array, count, branch - ; - if ($.isArray(keys)) keys = keys.join(","); - // convert keys to an array and change delimiters from '__' to '.' - keys = keys.replace(/__/g, ".").split(','); - // loop keys and create a data hash - for (var i=0, n=keys.length; i < n; i++) { - pair = keys[i].split("."); - pane = pair[0]; - key = pair[1]; - if ($.inArray(pane, panes) < 0) continue; // bad pane! - val = state[ pane ][ key ]; - if (val == undefined) continue; - if (key=="isClosed" && state[pane]["isSliding"]) - val = true; // if sliding, then *really* isClosed - ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val; - } - - // recurse into the child-layouts for each pane - if (recurse) { - $.each(panes, function (idx, pane) { - pC = inst.children[pane]; - ps = state.stateData[pane]; - if ($.isPlainObject( pC ) && !$.isEmptyObject( pC )) { - // ensure a key exists for this 'pane', eg: branch = data.center - branch = data[pane] || (data[pane] = {}); - if (!branch.children) branch.children = {}; - $.each( pC, function (key, child) { - // ONLY read state from an initialize layout - if ( child.state.initialized ) - branch.children[ key ] = $.layout.state.readState( child ); - // if we have PREVIOUS (onLoad) state for this child-layout, KEEP IT! - else if ( ps && ps.children && ps.children[ key ] ) { - branch.children[ key ] = $.extend(true, {}, ps.children[ key ] ); - } - }); - } - }); - } - - return data; - } - - /** - * Stringify a JSON hash so can save in a cookie or db-field - */ -, encodeJSON: function (JSON) { - return parse(JSON); - function parse (h) { - var D=[], i=0, k, v, t // k = key, v = value - , a = $.isArray(h) - ; - for (k in h) { - v = h[k]; - t = typeof v; - if (t == 'string') // STRING - add quotes - v = '"'+ v +'"'; - else if (t == 'object') // SUB-KEY - recurse into it - v = parse(v); - D[i++] = (!a ? '"'+ k +'":' : '') + v; - } - return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}'); - }; - } - - /** - * Convert stringified JSON back to a hash object - * @see $.parseJSON(), adding in jQuery 1.4.1 - */ -, decodeJSON: function (str) { - try { return $.parseJSON ? $.parseJSON(str) : window["eval"]("("+ str +")") || {}; } - catch (e) { return {}; } - } - - -, _create: function (inst) { - var _ = $.layout.state - , o = inst.options - , sm = o.stateManagement - ; - // ADD State-Management plugin methods to inst - $.extend( inst, { - // readCookie - update options from cookie - returns hash of cookie data - readCookie: function () { return _.readCookie(inst); } - // deleteCookie - , deleteCookie: function () { _.deleteCookie(inst); } - // saveCookie - optionally pass keys-list and cookie-options (hash) - , saveCookie: function (keys, cookieOpts) { return _.saveCookie(inst, keys, cookieOpts); } - // loadCookie - readCookie and use to loadState() - returns hash of cookie data - , loadCookie: function () { return _.loadCookie(inst); } - // loadState - pass a hash of state to use to update options - , loadState: function (stateData, opts) { _.loadState(inst, stateData, opts); } - // readState - returns hash of current layout-state - , readState: function (keys) { return _.readState(inst, keys); } - // add JSON utility methods too... - , encodeJSON: _.encodeJSON - , decodeJSON: _.decodeJSON - }); - - // init state.stateData key, even if plugin is initially disabled - inst.state.stateData = {}; - - // autoLoad MUST BE one of: data-array, data-hash, callback-function, or TRUE - if ( !sm.autoLoad ) return; - - // When state-data exists in the autoLoad key USE IT, - // even if stateManagement.enabled == false - if ($.isPlainObject( sm.autoLoad )) { - if (!$.isEmptyObject( sm.autoLoad )) { - inst.loadState( sm.autoLoad ); - } - } - else if ( sm.enabled ) { - // update the options from cookie or callback - // if options is a function, call it to get stateData - if ($.isFunction( sm.autoLoad )) { - var d = {}; - try { - d = sm.autoLoad( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn - } catch (e) {} - if (d && $.isPlainObject( d ) && !$.isEmptyObject( d )) - inst.loadState(d); - } - else // any other truthy value will trigger loadCookie - inst.loadCookie(); - } - } - -, _unload: function (inst) { - var sm = inst.options.stateManagement; - if (sm.enabled && sm.autoSave) { - // if options is a function, call it to save the stateData - if ($.isFunction( sm.autoSave )) { - try { - sm.autoSave( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn - } catch (e) {} - } - else // any truthy value will trigger saveCookie - inst.saveCookie(); - } - } - -}; - -// add state initialization method to Layout's onCreate array of functions -$.layout.onCreate.push( $.layout.state._create ); -$.layout.onUnload.push( $.layout.state._unload ); - - - - -/** - * jquery.layout.buttons 1.0 - * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ - * - * Copyright (c) 2012 - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * @requires: UI Layout 1.3.0.rc30.1 or higher - * - * @see: http://groups.google.com/group/jquery-ui-layout - * - * Docs: [ to come ] - * Tips: [ to come ] - */ - -// tell Layout that the state plugin is available -$.layout.plugins.buttons = true; - -// Add buttons options to layout.defaults -$.layout.defaults.autoBindCustomButtons = false; -// Specify autoBindCustomButtons as a layout-option, NOT a pane-option -$.layout.optionsMap.layout.push("autoBindCustomButtons"); - -/* - * Button methods - */ -$.layout.buttons = { - - /** - * Searches for .ui-layout-button-xxx elements and auto-binds them as layout-buttons - * - * @see _create() - * - * @param {Object} inst Layout Instance object - */ - init: function (inst) { - var pre = "ui-layout-button-" - , layout = inst.options.name || "" - , name; - $.each("toggle,open,close,pin,toggle-slide,open-slide".split(","), function (i, action) { - $.each($.layout.config.borderPanes, function (ii, pane) { - $("."+pre+action+"-"+pane).each(function(){ - // if button was previously 'bound', data.layoutName was set, but is blank if layout has no 'name' - name = $(this).data("layoutName") || $(this).attr("layoutName"); - if (name == undefined || name === layout) - inst.bindButton(this, action, pane); - }); - }); - }); - } - - /** - * Helper function to validate params received by addButton utilities - * - * Two classes are added to the element, based on the buttonClass... - * The type of button is appended to create the 2nd className: - * - ui-layout-button-pin // action btnClass - * - ui-layout-button-pin-west // action btnClass + pane - * - ui-layout-button-toggle - * - ui-layout-button-open - * - ui-layout-button-close - * - * @param {Object} inst Layout Instance object - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - * - * @return {Array.} If both params valid, the element matching 'selector' in a jQuery wrapper - otherwise returns null - */ -, get: function (inst, selector, pane, action) { - var $E = $(selector) - , o = inst.options - , err = o.errors.addButtonError - ; - if (!$E.length) { // element not found - $.layout.msg(err +" "+ o.errors.selector +": "+ selector, true); - } - else if ($.inArray(pane, $.layout.config.borderPanes) < 0) { // invalid 'pane' sepecified - $.layout.msg(err +" "+ o.errors.pane +": "+ pane, true); - $E = $(""); // NO BUTTON - } - else { // VALID - var btn = o[pane].buttonClass +"-"+ action; - $E .addClass( btn +" "+ btn +"-"+ pane ) - .data("layoutName", o.name); // add layout identifier - even if blank! - } - return $E; - } - - - /** - * NEW syntax for binding layout-buttons - will eventually replace addToggle, addOpen, etc. - * - * @param {Object} inst Layout Instance object - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} action - * @param {string} pane - */ -, bind: function (inst, selector, action, pane) { - var _ = $.layout.buttons; - switch (action.toLowerCase()) { - case "toggle": _.addToggle (inst, selector, pane); break; - case "open": _.addOpen (inst, selector, pane); break; - case "close": _.addClose (inst, selector, pane); break; - case "pin": _.addPin (inst, selector, pane); break; - case "toggle-slide": _.addToggle (inst, selector, pane, true); break; - case "open-slide": _.addOpen (inst, selector, pane, true); break; - } - return inst; - } - - /** - * Add a custom Toggler button for a pane - * - * @param {Object} inst Layout Instance object - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - * @param {boolean=} slide true = slide-open, false = pin-open - */ -, addToggle: function (inst, selector, pane, slide) { - $.layout.buttons.get(inst, selector, pane, "toggle") - .click(function(evt){ - inst.toggle(pane, !!slide); - evt.stopPropagation(); - }); - return inst; - } - - /** - * Add a custom Open button for a pane - * - * @param {Object} inst Layout Instance object - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - * @param {boolean=} slide true = slide-open, false = pin-open - */ -, addOpen: function (inst, selector, pane, slide) { - $.layout.buttons.get(inst, selector, pane, "open") - .attr("title", inst.options[pane].tips.Open) - .click(function (evt) { - inst.open(pane, !!slide); - evt.stopPropagation(); - }); - return inst; - } - - /** - * Add a custom Close button for a pane - * - * @param {Object} inst Layout Instance object - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. - */ -, addClose: function (inst, selector, pane) { - $.layout.buttons.get(inst, selector, pane, "close") - .attr("title", inst.options[pane].tips.Close) - .click(function (evt) { - inst.close(pane); - evt.stopPropagation(); - }); - return inst; - } - - /** - * Add a custom Pin button for a pane - * - * Four classes are added to the element, based on the paneClass for the associated pane... - * Assuming the default paneClass and the pin is 'up', these classes are added for a west-pane pin: - * - ui-layout-pane-pin - * - ui-layout-pane-west-pin - * - ui-layout-pane-pin-up - * - ui-layout-pane-west-pin-up - * - * @param {Object} inst Layout Instance object - * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" - * @param {string} pane Name of the pane the pin is for: 'north', 'south', etc. - */ -, addPin: function (inst, selector, pane) { - var _ = $.layout.buttons - , $E = _.get(inst, selector, pane, "pin"); - if ($E.length) { - var s = inst.state[pane]; - $E.click(function (evt) { - _.setPinState(inst, $(this), pane, (s.isSliding || s.isClosed)); - if (s.isSliding || s.isClosed) inst.open( pane ); // change from sliding to open - else inst.close( pane ); // slide-closed - evt.stopPropagation(); - }); - // add up/down pin attributes and classes - _.setPinState(inst, $E, pane, (!s.isClosed && !s.isSliding)); - // add this pin to the pane data so we can 'sync it' automatically - // PANE.pins key is an array so we can store multiple pins for each pane - s.pins.push( selector ); // just save the selector string - } - return inst; - } - - /** - * Change the class of the pin button to make it look 'up' or 'down' - * - * @see addPin(), syncPins() - * - * @param {Object} inst Layout Instance object - * @param {Array.} $Pin The pin-span element in a jQuery wrapper - * @param {string} pane These are the params returned to callbacks by layout() - * @param {boolean} doPin true = set the pin 'down', false = set it 'up' - */ -, setPinState: function (inst, $Pin, pane, doPin) { - var updown = $Pin.attr("pin"); - if (updown && doPin === (updown=="down")) return; // already in correct state - var - o = inst.options[pane] - , pin = o.buttonClass +"-pin" - , side = pin +"-"+ pane - , UP = pin +"-up "+ side +"-up" - , DN = pin +"-down "+side +"-down" - ; - $Pin - .attr("pin", doPin ? "down" : "up") // logic - .attr("title", doPin ? o.tips.Unpin : o.tips.Pin) - .removeClass( doPin ? UP : DN ) - .addClass( doPin ? DN : UP ) - ; - } - - /** - * INTERNAL function to sync 'pin buttons' when pane is opened or closed - * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes - * - * @see open(), close() - * - * @param {Object} inst Layout Instance object - * @param {string} pane These are the params returned to callbacks by layout() - * @param {boolean} doPin True means set the pin 'down', False means 'up' - */ -, syncPinBtns: function (inst, pane, doPin) { - // REAL METHOD IS _INSIDE_ LAYOUT - THIS IS HERE JUST FOR REFERENCE - $.each(inst.state[pane].pins, function (i, selector) { - $.layout.buttons.setPinState(inst, $(selector), pane, doPin); - }); - } - - -, _load: function (inst) { - var _ = $.layout.buttons; - // ADD Button methods to Layout Instance - // Note: sel = jQuery Selector string - $.extend( inst, { - bindButton: function (sel, action, pane) { return _.bind(inst, sel, action, pane); } - // DEPRECATED METHODS - , addToggleBtn: function (sel, pane, slide) { return _.addToggle(inst, sel, pane, slide); } - , addOpenBtn: function (sel, pane, slide) { return _.addOpen(inst, sel, pane, slide); } - , addCloseBtn: function (sel, pane) { return _.addClose(inst, sel, pane); } - , addPinBtn: function (sel, pane) { return _.addPin(inst, sel, pane); } - }); - - // init state array to hold pin-buttons - for (var i=0; i<4; i++) { - var pane = $.layout.config.borderPanes[i]; - inst.state[pane].pins = []; - } - - // auto-init buttons onLoad if option is enabled - if ( inst.options.autoBindCustomButtons ) - _.init(inst); - } - -, _unload: function (inst) { - // TODO: unbind all buttons??? - } - -}; - -// add initialization method to Layout's onLoad array of functions -$.layout.onLoad.push( $.layout.buttons._load ); -//$.layout.onUnload.push( $.layout.buttons._unload ); - - - -/** - * jquery.layout.browserZoom 1.0 - * $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $ - * - * Copyright (c) 2012 - * Kevin Dalman (http://allpro.net) - * - * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) - * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. - * - * @requires: UI Layout 1.3.0.rc30.1 or higher - * - * @see: http://groups.google.com/group/jquery-ui-layout - * - * TODO: Extend logic to handle other problematic zooming in browsers - * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event - */ - -// tell Layout that the plugin is available -$.layout.plugins.browserZoom = true; - -$.layout.defaults.browserZoomCheckInterval = 1000; -$.layout.optionsMap.layout.push("browserZoomCheckInterval"); - -/* - * browserZoom methods - */ -$.layout.browserZoom = { - - _init: function (inst) { - // abort if browser does not need this check - if ($.layout.browserZoom.ratio() !== false) - $.layout.browserZoom._setTimer(inst); - } - -, _setTimer: function (inst) { - // abort if layout destroyed or browser does not need this check - if (inst.destroyed) return; - var o = inst.options - , s = inst.state - // don't need check if inst has parentLayout, but check occassionally in case parent destroyed! - // MINIMUM 100ms interval, for performance - , ms = inst.hasParentLayout ? 5000 : Math.max( o.browserZoomCheckInterval, 100 ) - ; - // set the timer - setTimeout(function(){ - if (inst.destroyed || !o.resizeWithWindow) return; - var d = $.layout.browserZoom.ratio(); - if (d !== s.browserZoom) { - s.browserZoom = d; - inst.resizeAll(); - } - // set a NEW timeout - $.layout.browserZoom._setTimer(inst); - } - , ms ); - } - -, ratio: function () { - var w = window - , s = screen - , d = document - , dE = d.documentElement || d.body - , b = $.layout.browser - , v = b.version - , r, sW, cW - ; - // we can ignore all browsers that fire window.resize event onZoom - if ((b.msie && v > 8) - || !b.msie - ) return false; // don't need to track zoom - - if (s.deviceXDPI && s.systemXDPI) // syntax compiler hack - return calc(s.deviceXDPI, s.systemXDPI); - // everything below is just for future reference! - if (b.webkit && (r = d.body.getBoundingClientRect)) - return calc((r.left - r.right), d.body.offsetWidth); - if (b.webkit && (sW = w.outerWidth)) - return calc(sW, w.innerWidth); - if ((sW = s.width) && (cW = dE.clientWidth)) - return calc(sW, cW); - return false; // no match, so cannot - or don't need to - track zoom - - function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); } - } - -}; -// add initialization method to Layout's onLoad array of functions -$.layout.onReady.push( $.layout.browserZoom._init ); - - +/** + * @preserve + * jquery.layout 1.3.0 - Release Candidate 30.74 + * $Date: 2012-10-28 08:00:00 (Sun, 28 Oct 2012) $ + * $Rev: 303007 $ + * + * Copyright (c) 2012 + * Fabrizio Balliano (http://www.fabrizioballiano.net) + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.74 + * + * Docs: http://layout.jquery-dev.net/documentation.html + * Tips: http://layout.jquery-dev.net/tips.html + * Help: http://groups.google.com/group/jquery-ui-layout + */ + +/* JavaDoc Info: http://code.google.com/closure/compiler/docs/js-for-compiler.html + * {!Object} non-nullable type (never NULL) + * {?string} nullable type (sometimes NULL) - default for {Object} + * {number=} optional parameter + * {*} ALL types + */ + +// NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars + +;(function ($) { + +// alias Math methods - used a lot! +var min = Math.min +, max = Math.max +, round = Math.floor + +, isStr = function (v) { return $.type(v) === "string"; } + + /** + * @param {!Object} Instance + * @param {Array.} a_fn + */ +, runPluginCallbacks = function (Instance, a_fn) { + if ($.isArray(a_fn)) + for (var i=0, c=a_fn.length; i').appendTo("body"); + var d = { width: $c.css("width") - $c[0].clientWidth, height: $c.height() - $c[0].clientHeight }; + $c.remove(); + window.scrollbarWidth = d.width; + window.scrollbarHeight = d.height; + return dim.match(/^(width|height)$/) ? d[dim] : d; + } + + + /** + * Returns hash container 'display' and 'visibility' + * + * @see $.swap() - swaps CSS, runs callback, resets CSS + * @param {!Object} $E jQuery element + * @param {boolean=} [force=false] Run even if display != none + * @return {!Object} Returns current style props, if applicable + */ +, showInvisibly: function ($E, force) { + if ($E && $E.length && (force || $E.css("display") === "none")) { // only if not *already hidden* + var s = $E[0].style + // save ONLY the 'style' props because that is what we must restore + , CSS = { display: s.display || '', visibility: s.visibility || '' }; + // show element 'invisibly' so can be measured + $E.css({ display: "block", visibility: "hidden" }); + return CSS; + } + return {}; + } + + /** + * Returns data for setting size of an element (container or a pane). + * + * @see _create(), onWindowResize() for container, plus others for pane + * @return JSON Returns a hash of all dimensions: top, bottom, left, right, outerWidth, innerHeight, etc + */ +, getElementDimensions: function ($E, inset) { + var + // dimensions hash - start with current data IF passed + d = { css: {}, inset: {} } + , x = d.css // CSS hash + , i = { bottom: 0 } // TEMP insets (bottom = complier hack) + , N = $.layout.cssNum + , off = $E.offset() + , b, p, ei // TEMP border, padding + ; + d.offsetLeft = off.left; + d.offsetTop = off.top; + + if (!inset) inset = {}; // simplify logic below + + $.each("Left,Right,Top,Bottom".split(","), function (idx, e) { // e = edge + b = x["border" + e] = $.layout.borderWidth($E, e); + p = x["padding"+ e] = $.layout.cssNum($E, "padding"+e); + ei = e.toLowerCase(); + d.inset[ei] = inset[ei] >= 0 ? inset[ei] : p; // any missing insetX value = paddingX + i[ei] = d.inset[ei] + b; // total offset of content from outer side + }); + + x.width = $E.css("width"); + x.height = $E.height(); + x.top = N($E,"top",true); + x.bottom = N($E,"bottom",true); + x.left = N($E,"left",true); + x.right = N($E,"right",true); + + d.outerWidth = $E.outerWidth(); + d.outerHeight = $E.outerHeight(); + // calc the TRUE inner-dimensions, even in quirks-mode! + d.innerWidth = max(0, d.outerWidth - i.left - i.right); + d.innerHeight = max(0, d.outerHeight - i.top - i.bottom); + // layoutWidth/Height is used in calcs for manual resizing + // layoutW/H only differs from innerW/H when in quirks-mode - then is like outerW/H + d.layoutWidth = $E.innerWidth(); + d.layoutHeight = $E.innerHeight(); + + //if ($E.prop('tagName') === 'BODY') { debugData( d, $E.prop('tagName') ); } // DEBUG + + //d.visible = $E.is(":visible");// && x.width > 0 && x.height > 0; + + return d; + } + +, getElementStyles: function ($E, list) { + var + CSS = {} + , style = $E[0].style + , props = list.split(",") + , sides = "Top,Bottom,Left,Right".split(",") + , attrs = "Color,Style,Width".split(",") + , p, s, a, i, j, k + ; + for (i=0; i < props.length; i++) { + p = props[i]; + if (p.match(/(border|padding|margin)$/)) + for (j=0; j < 4; j++) { + s = sides[j]; + if (p === "border") + for (k=0; k < 3; k++) { + a = attrs[k]; + CSS[p+s+a] = style[p+s+a]; + } + else + CSS[p+s] = style[p+s]; + } + else + CSS[p] = style[p]; + }; + return CSS + } + + /** + * Return the innerWidth for the current browser/doctype + * + * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() + * @param {Array.} $E Must pass a jQuery object - first element is processed + * @param {number=} outerWidth (optional) Can pass a width, allowing calculations BEFORE element is resized + * @return {number} Returns the innerWidth of the elem by subtracting padding and borders + */ +, cssWidth: function ($E, outerWidth) { + // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed + if (outerWidth <= 0) return 0; + + if (!$.layout.browser.boxModel) return outerWidth; + + // strip border and padding from outerWidth to get CSS Width + var b = $.layout.borderWidth + , n = $.layout.cssNum + , W = outerWidth + - b($E, "Left") + - b($E, "Right") + - n($E, "paddingLeft") + - n($E, "paddingRight"); + + return max(0,W); + } + + /** + * Return the innerHeight for the current browser/doctype + * + * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() + * @param {Array.} $E Must pass a jQuery object - first element is processed + * @param {number=} outerHeight (optional) Can pass a width, allowing calculations BEFORE element is resized + * @return {number} Returns the innerHeight of the elem by subtracting padding and borders + */ +, cssHeight: function ($E, outerHeight) { + // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed + if (outerHeight <= 0) return 0; + + if (!$.layout.browser.boxModel) return outerHeight; + + // strip border and padding from outerHeight to get CSS Height + var b = $.layout.borderWidth + , n = $.layout.cssNum + , H = outerHeight + - b($E, "Top") + - b($E, "Bottom") + - n($E, "paddingTop") + - n($E, "paddingBottom"); + + return max(0,H); + } + + /** + * Returns the 'current CSS numeric value' for a CSS property - 0 if property does not exist + * + * @see Called by many methods + * @param {Array.} $E Must pass a jQuery object - first element is processed + * @param {string} prop The name of the CSS property, eg: top, width, etc. + * @param {boolean=} [allowAuto=false] true = return 'auto' if that is value; false = return 0 + * @return {(string|number)} Usually used to get an integer value for position (top, left) or size (height, width) + */ +, cssNum: function ($E, prop, allowAuto) { + if (!$E.jquery) $E = $($E); + var CSS = $.layout.showInvisibly($E) + , p = $.css($E[0], prop, true) + , v = allowAuto && p=="auto" ? p : Math.round(parseFloat(p) || 0); + $E.css( CSS ); // RESET + return v; + } + +, borderWidth: function (el, side) { + if (el.jquery) el = el[0]; + var b = "border"+ side.substr(0,1).toUpperCase() + side.substr(1); // left => Left + return $.css(el, b+"Style", true) === "none" ? 0 : Math.round(parseFloat($.css(el, b+"Width", true)) || 0); + } + + /** + * Mouse-tracking utility - FUTURE REFERENCE + * + * init: if (!window.mouse) { + * window.mouse = { x: 0, y: 0 }; + * $(document).mousemove( $.layout.trackMouse ); + * } + * + * @param {Object} evt + * +, trackMouse: function (evt) { + window.mouse = { x: evt.clientX, y: evt.clientY }; + } + */ + + /** + * SUBROUTINE for preventPrematureSlideClose option + * + * @param {Object} evt + * @param {Object=} el + */ +, isMouseOverElem: function (evt, el) { + var + $E = $(el || this) + , d = $E.offset() + , T = d.top + , L = d.left + , R = L + $E.outerWidth() + , B = T + $E.outerHeight() + , x = evt.pageX // evt.clientX ? + , y = evt.pageY // evt.clientY ? + ; + // if X & Y are < 0, probably means is over an open SELECT + return ($.layout.browser.msie && x < 0 && y < 0) || ((x >= L && x <= R) && (y >= T && y <= B)); + } + + /** + * Message/Logging Utility + * + * @example $.layout.msg("My message"); // log text + * @example $.layout.msg("My message", true); // alert text + * @example $.layout.msg({ foo: "bar" }, "Title"); // log hash-data, with custom title + * @example $.layout.msg({ foo: "bar" }, true, "Title", { sort: false }); -OR- + * @example $.layout.msg({ foo: "bar" }, "Title", { sort: false, display: true }); // alert hash-data + * + * @param {(Object|string)} info String message OR Hash/Array + * @param {(Boolean|string|Object)=} [popup=false] True means alert-box - can be skipped + * @param {(Object|string)=} [debugTitle=""] Title for Hash data - can be skipped + * @param {Object=} [debugOpts] Extra options for debug output + */ +, msg: function (info, popup, debugTitle, debugOpts) { + if ($.isPlainObject(info) && window.debugData) { + if (typeof popup === "string") { + debugOpts = debugTitle; + debugTitle = popup; + } + else if (typeof debugTitle === "object") { + debugOpts = debugTitle; + debugTitle = null; + } + var t = debugTitle || "log( )" + , o = $.extend({ sort: false, returnHTML: false, display: false }, debugOpts); + if (popup === true || o.display) + debugData( info, t, o ); + else if (window.console) + console.log(debugData( info, t, o )); + } + else if (popup) + alert(info); + else if (window.console) + console.log(info); + else { + var id = "#layoutLogger" + , $l = $(id); + if (!$l.length) + $l = createLog(); + $l.children("ul").append('
            • '+ info.replace(/\/g,">") +'
            • '); + } + + function createLog () { + var pos = $.support.fixedPosition ? 'fixed' : 'absolute' + , $e = $('
              ' + + '
              ' + + 'XLayout console.log
              ' + + '
                ' + + '
                ' + ).appendTo("body"); + $e.css('left', $(window).width() - $e.outerWidth() - 5) + if ($.ui.draggable) $e.draggable({ handle: ':first-child' }); + return $e; + }; + } + +}; + +// DEFAULT OPTIONS +$.layout.defaults = { +/* + * LAYOUT & LAYOUT-CONTAINER OPTIONS + * - none of these options are applicable to individual panes + */ + name: "" // Not required, but useful for buttons and used for the state-cookie +, containerClass: "ui-layout-container" // layout-container element +, inset: null // custom container-inset values (override padding) +, scrollToBookmarkOnLoad: true // after creating a layout, scroll to bookmark in URL (.../page.htm#myBookmark) +, resizeWithWindow: true // bind thisLayout.resizeAll() to the window.resize event +, resizeWithWindowDelay: 200 // delay calling resizeAll because makes window resizing very jerky +, resizeWithWindowMaxDelay: 0 // 0 = none - force resize every XX ms while window is being resized +, maskPanesEarly: false // true = create pane-masks on resizer.mouseDown instead of waiting for resizer.dragstart +, onresizeall_start: null // CALLBACK when resizeAll() STARTS - NOT pane-specific +, onresizeall_end: null // CALLBACK when resizeAll() ENDS - NOT pane-specific +, onload_start: null // CALLBACK when Layout inits - after options initialized, but before elements +, onload_end: null // CALLBACK when Layout inits - after EVERYTHING has been initialized +, onunload_start: null // CALLBACK when Layout is destroyed OR onWindowUnload +, onunload_end: null // CALLBACK when Layout is destroyed OR onWindowUnload +, initPanes: true // false = DO NOT initialize the panes onLoad - will init later +, showErrorMessages: true // enables fatal error messages to warn developers of common errors +, showDebugMessages: false // display console-and-alert debug msgs - IF this Layout version _has_ debugging code! +// Changing this zIndex value will cause other zIndex values to automatically change +, zIndex: null // the PANE zIndex - resizers and masks will be +1 +// DO NOT CHANGE the zIndex values below unless you clearly understand their relationships +, zIndexes: { // set _default_ z-index values here... + pane_normal: 0 // normal z-index for panes + , content_mask: 1 // applied to overlays used to mask content INSIDE panes during resizing + , resizer_normal: 2 // normal z-index for resizer-bars + , pane_sliding: 100 // applied to *BOTH* the pane and its resizer when a pane is 'slid open' + , pane_animate: 1000 // applied to the pane when being animated - not applied to the resizer + , resizer_drag: 10000 // applied to the CLONED resizer-bar when being 'dragged' + } +, errors: { + pane: "pane" // description of "layout pane element" - used only in error messages + , selector: "selector" // description of "jQuery-selector" - used only in error messages + , addButtonError: "Error Adding Button \n\nInvalid " + , containerMissing: "UI Layout Initialization Error\n\nThe specified layout-container does not exist." + , centerPaneMissing: "UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element." + , noContainerHeight: "UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!" + , callbackError: "UI Layout Callback Error\n\nThe EVENT callback is not a valid function." + } +/* + * PANE DEFAULT SETTINGS + * - settings under the 'panes' key become the default settings for *all panes* + * - ALL pane-options can also be set specifically for each panes, which will override these 'default values' + */ +, panes: { // default options for 'all panes' - will be overridden by 'per-pane settings' + applyDemoStyles: false // NOTE: renamed from applyDefaultStyles for clarity + , closable: true // pane can open & close + , resizable: true // when open, pane can be resized + , slidable: true // when closed, pane can 'slide open' over other panes - closes on mouse-out + , initClosed: false // true = init pane as 'closed' + , initHidden: false // true = init pane as 'hidden' - no resizer-bar/spacing + // SELECTORS + //, paneSelector: "" // MUST be pane-specific - jQuery selector for pane + , contentSelector: ".ui-layout-content" // INNER div/element to auto-size so only it scrolls, not the entire pane! + , contentIgnoreSelector: ".ui-layout-ignore" // element(s) to 'ignore' when measuring 'content' + , findNestedContent: false // true = $P.find(contentSelector), false = $P.children(contentSelector) + // GENERIC ROOT-CLASSES - for auto-generated classNames + , paneClass: "ui-layout-pane" // Layout Pane + , resizerClass: "ui-layout-resizer" // Resizer Bar + , togglerClass: "ui-layout-toggler" // Toggler Button + , buttonClass: "ui-layout-button" // CUSTOM Buttons - eg: '[ui-layout-button]-toggle/-open/-close/-pin' + // ELEMENT SIZE & SPACING + //, size: 100 // MUST be pane-specific -initial size of pane + , minSize: 0 // when manually resizing a pane + , maxSize: 0 // ditto, 0 = no limit + , spacing_open: 6 // space between pane and adjacent panes - when pane is 'open' + , spacing_closed: 6 // ditto - when pane is 'closed' + , togglerLength_open: 50 // Length = WIDTH of toggler button on north/south sides - HEIGHT on east/west sides + , togglerLength_closed: 50 // 100% OR -1 means 'full height/width of resizer bar' - 0 means 'hidden' + , togglerAlign_open: "center" // top/left, bottom/right, center, OR... + , togglerAlign_closed: "center" // 1 => nn = offset from top/left, -1 => -nn == offset from bottom/right + , togglerContent_open: "" // text or HTML to put INSIDE the toggler + , togglerContent_closed: "" // ditto + // RESIZING OPTIONS + , resizerDblClickToggle: true // + , autoResize: true // IF size is 'auto' or a percentage, then recalc 'pixel size' whenever the layout resizes + , autoReopen: true // IF a pane was auto-closed due to noRoom, reopen it when there is room? False = leave it closed + , resizerDragOpacity: 1 // option for ui.draggable + //, resizerCursor: "" // MUST be pane-specific - cursor when over resizer-bar + , maskContents: false // true = add DIV-mask over-or-inside this pane so can 'drag' over IFRAMES + , maskObjects: false // true = add IFRAME-mask over-or-inside this pane to cover objects/applets - content-mask will overlay this mask + , maskZindex: null // will override zIndexes.content_mask if specified - not applicable to iframe-panes + , resizingGrid: false // grid size that the resizers will snap-to during resizing, eg: [20,20] + , livePaneResizing: false // true = LIVE Resizing as resizer is dragged + , liveContentResizing: false // true = re-measure header/footer heights as resizer is dragged + , liveResizingTolerance: 1 // how many px change before pane resizes, to control performance + // SLIDING OPTIONS + , sliderCursor: "pointer" // cursor when resizer-bar will trigger 'sliding' + , slideTrigger_open: "click" // click, dblclick, mouseenter + , slideTrigger_close: "mouseleave"// click, mouseleave + , slideDelay_open: 300 // applies only for mouseenter event - 0 = instant open + , slideDelay_close: 300 // applies only for mouseleave event (300ms is the minimum!) + , hideTogglerOnSlide: false // when pane is slid-open, should the toggler show? + , preventQuickSlideClose: $.layout.browser.webkit // Chrome triggers slideClosed as it is opening + , preventPrematureSlideClose: false // handle incorrect mouseleave trigger, like when over a SELECT-list in IE + // PANE-SPECIFIC TIPS & MESSAGES + , tips: { + Open: "Open" // eg: "Open Pane" + , Close: "Close" + , Resize: "Resize" + , Slide: "Slide Open" + , Pin: "Pin" + , Unpin: "Un-Pin" + , noRoomToOpen: "Not enough room to show this panel." // alert if user tries to open a pane that cannot + , minSizeWarning: "Panel has reached its minimum size" // displays in browser statusbar + , maxSizeWarning: "Panel has reached its maximum size" // ditto + } + // HOT-KEYS & MISC + , showOverflowOnHover: false // will bind allowOverflow() utility to pane.onMouseOver + , enableCursorHotkey: true // enabled 'cursor' hotkeys + //, customHotkey: "" // MUST be pane-specific - EITHER a charCode OR a character + , customHotkeyModifier: "SHIFT" // either 'SHIFT', 'CTRL' or 'CTRL+SHIFT' - NOT 'ALT' + // PANE ANIMATION + // NOTE: fxSss_open, fxSss_close & fxSss_size options (eg: fxName_open) are auto-generated if not passed + , fxName: "slide" // ('none' or blank), slide, drop, scale -- only relevant to 'open' & 'close', NOT 'size' + , fxSpeed: null // slow, normal, fast, 200, nnn - if passed, will OVERRIDE fxSettings.duration + , fxSettings: {} // can be passed, eg: { easing: "easeOutBounce", duration: 1500 } + , fxOpacityFix: true // tries to fix opacity in IE to restore anti-aliasing after animation + , animatePaneSizing: false // true = animate resizing after dragging resizer-bar OR sizePane() is called + /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set: + fxName_open: "slide" // 'Open' pane animation + fnName_close: "slide" // 'Close' pane animation + fxName_size: "slide" // 'Size' pane animation - when animatePaneSizing = true + fxSpeed_open: null + fxSpeed_close: null + fxSpeed_size: null + fxSettings_open: {} + fxSettings_close: {} + fxSettings_size: {} + */ + // CHILD/NESTED LAYOUTS + , children: null // Layout-options for nested/child layout - even {} is valid as options + , containerSelector: '' // if child is NOT 'directly nested', a selector to find it/them (can have more than one child layout!) + , initChildren: true // true = child layout will be created as soon as _this_ layout completes initialization + , destroyChildren: true // true = destroy child-layout if this pane is destroyed + , resizeChildren: true // true = trigger child-layout.resizeAll() when this pane is resized + // EVENT TRIGGERING + , triggerEventsOnLoad: false // true = trigger onopen OR onclose callbacks when layout initializes + , triggerEventsDuringLiveResize: true // true = trigger onresize callback REPEATEDLY if livePaneResizing==true + // PANE CALLBACKS + , onshow_start: null // CALLBACK when pane STARTS to Show - BEFORE onopen/onhide_start + , onshow_end: null // CALLBACK when pane ENDS being Shown - AFTER onopen/onhide_end + , onhide_start: null // CALLBACK when pane STARTS to Close - BEFORE onclose_start + , onhide_end: null // CALLBACK when pane ENDS being Closed - AFTER onclose_end + , onopen_start: null // CALLBACK when pane STARTS to Open + , onopen_end: null // CALLBACK when pane ENDS being Opened + , onclose_start: null // CALLBACK when pane STARTS to Close + , onclose_end: null // CALLBACK when pane ENDS being Closed + , onresize_start: null // CALLBACK when pane STARTS being Resized ***FOR ANY REASON*** + , onresize_end: null // CALLBACK when pane ENDS being Resized ***FOR ANY REASON*** + , onsizecontent_start: null // CALLBACK when sizing of content-element STARTS + , onsizecontent_end: null // CALLBACK when sizing of content-element ENDS + , onswap_start: null // CALLBACK when pane STARTS to Swap + , onswap_end: null // CALLBACK when pane ENDS being Swapped + , ondrag_start: null // CALLBACK when pane STARTS being ***MANUALLY*** Resized + , ondrag_end: null // CALLBACK when pane ENDS being ***MANUALLY*** Resized + } +/* + * PANE-SPECIFIC SETTINGS + * - options listed below MUST be specified per-pane - they CANNOT be set under 'panes' + * - all options under the 'panes' key can also be set specifically for any pane + * - most options under the 'panes' key apply only to 'border-panes' - NOT the the center-pane + */ +, north: { + paneSelector: ".ui-layout-north" + , size: "auto" // eg: "auto", "30%", .30, 200 + , resizerCursor: "n-resize" // custom = url(myCursor.cur) + , customHotkey: "" // EITHER a charCode (43) OR a character ("o") + } +, south: { + paneSelector: ".ui-layout-south" + , size: "auto" + , resizerCursor: "s-resize" + , customHotkey: "" + } +, east: { + paneSelector: ".ui-layout-east" + , size: 200 + , resizerCursor: "e-resize" + , customHotkey: "" + } +, west: { + paneSelector: ".ui-layout-west" + , size: 200 + , resizerCursor: "w-resize" + , customHotkey: "" + } +, center: { + paneSelector: ".ui-layout-center" + , minWidth: 0 + , minHeight: 0 + } +}; + +$.layout.optionsMap = { + // layout/global options - NOT pane-options + layout: ("name,instanceKey,stateManagement,effects,inset,zIndexes,errors," + + "zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly," + + "outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay," + + "onresizeall,onresizeall_start,onresizeall_end,onload,onunload").split(",") +// borderPanes: [ ALL options that are NOT specified as 'layout' ] + // default.panes options that apply to the center-pane (most options apply _only_ to border-panes) +, center: ("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad," + + "showOverflowOnHover,maskContents,maskObjects,liveContentResizing," + + "containerSelector,children,initChildren,resizeChildren,destroyChildren," + + "onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(",") + // options that MUST be specifically set 'per-pane' - CANNOT set in the panes (defaults) key +, noDefault: ("paneSelector,resizerCursor,customHotkey").split(",") +}; + +/** + * Processes options passed in converts flat-format data into subkey (JSON) format + * In flat-format, subkeys are _currently_ separated with 2 underscores, like north__optName + * Plugins may also call this method so they can transform their own data + * + * @param {!Object} hash Data/options passed by user - may be a single level or nested levels + * @param {boolean=} [addKeys=false] Should the primary layout.options keys be added if they do not exist? + * @return {Object} Returns hash of minWidth & minHeight + */ +$.layout.transformData = function (hash, addKeys) { + var json = addKeys ? { panes: {}, center: {} } : {} // init return object + , branch, optKey, keys, key, val, i, c; + + if (typeof hash !== "object") return json; // no options passed + + // convert all 'flat-keys' to 'sub-key' format + for (optKey in hash) { + branch = json; + val = hash[ optKey ]; + keys = optKey.split("__"); // eg: west__size or north__fxSettings__duration + c = keys.length - 1; + // convert underscore-delimited to subkeys + for (i=0; i <= c; i++) { + key = keys[i]; + if (i === c) { // last key = value + if ($.isPlainObject( val )) + branch[key] = $.layout.transformData( val ); // RECURSE + else + branch[key] = val; + } + else { + if (!branch[key]) + branch[key] = {}; // create the subkey + // recurse to sub-key for next loop - if not done + branch = branch[key]; + } + } + } + return json; +}; + +// INTERNAL CONFIG DATA - DO NOT CHANGE THIS! +$.layout.backwardCompatibility = { + // data used by renameOldOptions() + map: { + // OLD Option Name: NEW Option Name + applyDefaultStyles: "applyDemoStyles" + // CHILD/NESTED LAYOUTS + , childOptions: "children" + , initChildLayout: "initChildren" + , destroyChildLayout: "destroyChildren" + , resizeChildLayout: "resizeChildren" + , resizeNestedLayout: "resizeChildren" + // MISC Options + , resizeWhileDragging: "livePaneResizing" + , resizeContentWhileDragging: "liveContentResizing" + , triggerEventsWhileDragging: "triggerEventsDuringLiveResize" + , maskIframesOnResize: "maskContents" + // STATE MANAGEMENT + , useStateCookie: "stateManagement.enabled" + , "cookie.autoLoad": "stateManagement.autoLoad" + , "cookie.autoSave": "stateManagement.autoSave" + , "cookie.keys": "stateManagement.stateKeys" + , "cookie.name": "stateManagement.cookie.name" + , "cookie.domain": "stateManagement.cookie.domain" + , "cookie.path": "stateManagement.cookie.path" + , "cookie.expires": "stateManagement.cookie.expires" + , "cookie.secure": "stateManagement.cookie.secure" + // OLD Language options + , noRoomToOpenTip: "tips.noRoomToOpen" + , togglerTip_open: "tips.Close" // open = Close + , togglerTip_closed: "tips.Open" // closed = Open + , resizerTip: "tips.Resize" + , sliderTip: "tips.Slide" + } + +/** +* @param {Object} opts +*/ +, renameOptions: function (opts) { + var map = $.layout.backwardCompatibility.map + , oldData, newData, value + ; + for (var itemPath in map) { + oldData = getBranch( itemPath ); + value = oldData.branch[ oldData.key ]; + if (value !== undefined) { + newData = getBranch( map[itemPath], true ); + newData.branch[ newData.key ] = value; + delete oldData.branch[ oldData.key ]; + } + } + + /** + * @param {string} path + * @param {boolean=} [create=false] Create path if does not exist + */ + function getBranch (path, create) { + var a = path.split(".") // split keys into array + , c = a.length - 1 + , D = { branch: opts, key: a[c] } // init branch at top & set key (last item) + , i = 0, k, undef; + for (; i 0) { + if (autoHide && $E.data('autoHidden') && $E.innerHeight() > 0) { + $E.show().data('autoHidden', false); + if (!browser.mozilla) // FireFox refreshes iframes - IE does not + // make hidden, then visible to 'refresh' display after animation + $E.css(_c.hidden).css(_c.visible); + } + } + else if (autoHide && !$E.data('autoHidden')) + $E.hide().data('autoHidden', true); + } + + /** + * @param {(string|!Object)} el + * @param {number=} outerHeight + * @param {boolean=} [autoHide=false] + */ +, setOuterHeight = function (el, outerHeight, autoHide) { + var $E = el, h; + if (isStr(el)) $E = $Ps[el]; // west + else if (!el.jquery) $E = $(el); + h = cssH($E, outerHeight); + $E.css({ height: h, visibility: "visible" }); // may have been 'hidden' by sizeContent + if (h > 0 && $E.innerWidth() > 0) { + if (autoHide && $E.data('autoHidden')) { + $E.show().data('autoHidden', false); + if (!browser.mozilla) // FireFox refreshes iframes - IE does not + $E.css(_c.hidden).css(_c.visible); + } + } + else if (autoHide && !$E.data('autoHidden')) + $E.hide().data('autoHidden', true); + } + + + /** + * Converts any 'size' params to a pixel/integer size, if not already + * If 'auto' or a decimal/percentage is passed as 'size', a pixel-size is calculated + * + /** + * @param {string} pane + * @param {(string|number)=} size + * @param {string=} [dir] + * @return {number} + */ +, _parseSize = function (pane, size, dir) { + if (!dir) dir = _c[pane].dir; + + if (isStr(size) && size.match(/%/)) + size = (size === '100%') ? -1 : parseInt(size, 10) / 100; // convert % to decimal + + if (size === 0) + return 0; + else if (size >= 1) + return parseInt(size, 10); + + var o = options, avail = 0; + if (dir=="horz") // north or south or center.minHeight + avail = sC.innerHeight - ($Ps.north ? o.north.spacing_open : 0) - ($Ps.south ? o.south.spacing_open : 0); + else if (dir=="vert") // east or west or center.minWidth + avail = sC.innerWidth - ($Ps.west ? o.west.spacing_open : 0) - ($Ps.east ? o.east.spacing_open : 0); + + if (size === -1) // -1 == 100% + return avail; + else if (size > 0) // percentage, eg: .25 + return round(avail * size); + else if (pane=="center") + return 0; + else { // size < 0 || size=='auto' || size==Missing || size==Invalid + // auto-size the pane + var dim = (dir === "horz" ? "height" : "width") + , $P = $Ps[pane] + , $C = dim === 'height' ? $Cs[pane] : false + , vis = $.layout.showInvisibly($P) // show pane invisibly if hidden + , szP = $P.css(dim) // SAVE current pane size + , szC = $C ? $C.css(dim) : 0 // SAVE current content size + ; + $P.css(dim, "auto"); + if ($C) $C.css(dim, "auto"); + size = (dim === "height") ? $P.outerHeight() : $P.outerWidth(); // MEASURE + $P.css(dim, szP).css(vis); // RESET size & visibility + if ($C) $C.css(dim, szC); + return size; + } + } + + /** + * Calculates current 'size' (outer-width or outer-height) of a border-pane - optionally with 'pane-spacing' added + * + * @param {(string|!Object)} pane + * @param {boolean=} [inclSpace=false] + * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes + */ +, getPaneSize = function (pane, inclSpace) { + var + $P = $Ps[pane] + , o = options[pane] + , s = state[pane] + , oSp = (inclSpace ? o.spacing_open : 0) + , cSp = (inclSpace ? o.spacing_closed : 0) + ; + if (!$P || s.isHidden) + return 0; + else if (s.isClosed || (s.isSliding && inclSpace)) + return cSp; + else if (_c[pane].dir === "horz") + return $P.outerHeight() + oSp; + else // dir === "vert" + return $P.outerWidth() + oSp; + } + + /** + * Calculate min/max pane dimensions and limits for resizing + * + * @param {string} pane + * @param {boolean=} [slide=false] + */ +, setSizeLimits = function (pane, slide) { + if (!isInitialized()) return; + var + o = options[pane] + , s = state[pane] + , c = _c[pane] + , dir = c.dir + , type = c.sizeType.toLowerCase() + , isSliding = (slide != undefined ? slide : s.isSliding) // only open() passes 'slide' param + , $P = $Ps[pane] + , paneSpacing = o.spacing_open + // measure the pane on the *opposite side* from this pane + , altPane = _c.oppositeEdge[pane] + , altS = state[altPane] + , $altP = $Ps[altPane] + , altPaneSize = (!$altP || altS.isVisible===false || altS.isSliding ? 0 : (dir=="horz" ? $altP.outerHeight() : $altP.outerWidth())) + , altPaneSpacing = ((!$altP || altS.isHidden ? 0 : options[altPane][ altS.isClosed !== false ? "spacing_closed" : "spacing_open" ]) || 0) + // limitSize prevents this pane from 'overlapping' opposite pane + , containerSize = (dir=="horz" ? sC.innerHeight : sC.innerWidth) + , minCenterDims = cssMinDims("center") + , minCenterSize = dir=="horz" ? max(options.center.minHeight, minCenterDims.minHeight) : max(options.center.minWidth, minCenterDims.minWidth) + // if pane is 'sliding', then ignore center and alt-pane sizes - because 'overlays' them + , limitSize = (containerSize - paneSpacing - (isSliding ? 0 : (_parseSize("center", minCenterSize, dir) + altPaneSize + altPaneSpacing))) + , minSize = s.minSize = max( _parseSize(pane, o.minSize), cssMinDims(pane).minSize ) + , maxSize = s.maxSize = min( (o.maxSize ? _parseSize(pane, o.maxSize) : 100000), limitSize ) + , r = s.resizerPosition = {} // used to set resizing limits + , top = sC.inset.top + , left = sC.inset.left + , W = sC.innerWidth + , H = sC.innerHeight + , rW = o.spacing_open // subtract resizer-width to get top/left position for south/east + ; + switch (pane) { + case "north": r.min = top + minSize; + r.max = top + maxSize; + break; + case "west": r.min = left + minSize; + r.max = left + maxSize; + break; + case "south": r.min = top + H - maxSize - rW; + r.max = top + H - minSize - rW; + break; + case "east": r.min = left + W - maxSize - rW; + r.max = left + W - minSize - rW; + break; + }; + } + + /** + * Returns data for setting the size/position of center pane. Also used to set Height for east/west panes + * + * @return JSON Returns a hash of all dimensions: top, bottom, left, right, (outer) width and (outer) height + */ +, calcNewCenterPaneDims = function () { + var d = { + top: getPaneSize("north", true) // true = include 'spacing' value for pane + , bottom: getPaneSize("south", true) + , left: getPaneSize("west", true) + , right: getPaneSize("east", true) + , width: 0 + , height: 0 + }; + + // NOTE: sC = state.container + // calc center-pane outer dimensions + d.width = sC.innerWidth - d.left - d.right; // outerWidth + d.height = sC.innerHeight - d.bottom - d.top; // outerHeight + // add the 'container border/padding' to get final positions relative to the container + d.top += sC.inset.top; + d.bottom += sC.inset.bottom; + d.left += sC.inset.left; + d.right += sC.inset.right; + + return d; + } + + + /** + * @param {!Object} el + * @param {boolean=} [allStates=false] + */ +, getHoverClasses = function (el, allStates) { + var + $El = $(el) + , type = $El.data("layoutRole") + , pane = $El.data("layoutEdge") + , o = options[pane] + , root = o[type +"Class"] + , _pane = "-"+ pane // eg: "-west" + , _open = "-open" + , _closed = "-closed" + , _slide = "-sliding" + , _hover = "-hover " // NOTE the trailing space + , _state = $El.hasClass(root+_closed) ? _closed : _open + , _alt = _state === _closed ? _open : _closed + , classes = (root+_hover) + (root+_pane+_hover) + (root+_state+_hover) + (root+_pane+_state+_hover) + ; + if (allStates) // when 'removing' classes, also remove alternate-state classes + classes += (root+_alt+_hover) + (root+_pane+_alt+_hover); + + if (type=="resizer" && $El.hasClass(root+_slide)) + classes += (root+_slide+_hover) + (root+_pane+_slide+_hover); + + return $.trim(classes); + } +, addHover = function (evt, el) { + var $E = $(el || this); + if (evt && $E.data("layoutRole") === "toggler") + evt.stopPropagation(); // prevent triggering 'slide' on Resizer-bar + $E.addClass( getHoverClasses($E) ); + } +, removeHover = function (evt, el) { + var $E = $(el || this); + $E.removeClass( getHoverClasses($E, true) ); + } + +, onResizerEnter = function (evt) { // ALSO called by toggler.mouseenter + var pane = $(this).data("layoutEdge") + , s = state[pane] + ; + // ignore closed-panes and mouse moving back & forth over resizer! + // also ignore if ANY pane is currently resizing + if ( s.isClosed || s.isResizing || state.paneResizing ) return; + + if ($.fn.disableSelection) + $("body").disableSelection(); + if (options.maskPanesEarly) + showMasks( pane, { resizing: true }); + } +, onResizerLeave = function (evt, el) { + var e = el || this // el is only passed when called by the timer + , pane = $(e).data("layoutEdge") + , name = pane +"ResizerLeave" + ; + timer.clear(pane+"_openSlider"); // cancel slideOpen timer, if set + timer.clear(name); // cancel enableSelection timer - may re/set below + // this method calls itself on a timer because it needs to allow + // enough time for dragging to kick-in and set the isResizing flag + // dragging has a 100ms delay set, so this delay must be >100 + if (!el) // 1st call - mouseleave event + timer.set(name, function(){ onResizerLeave(evt, e); }, 200); + // if user is resizing, then dragStop will enableSelection(), so can skip it here + else if ( !state.paneResizing ) { // 2nd call - by timer + if ($.fn.enableSelection) + $("body").enableSelection(); + if (options.maskPanesEarly) + hideMasks(); + } + } + +/* + * ########################### + * INITIALIZATION METHODS + * ########################### + */ + + /** + * Initialize the layout - called automatically whenever an instance of layout is created + * + * @see none - triggered onInit + * @return mixed true = fully initialized | false = panes not initialized (yet) | 'cancel' = abort + */ +, _create = function () { + // initialize config/options + initOptions(); + var o = options + , s = state; + + // TEMP state so isInitialized returns true during init process + s.creatingLayout = true; + + // init plugins for this layout, if there are any (eg: stateManagement) + runPluginCallbacks( Instance, $.layout.onCreate ); + + // options & state have been initialized, so now run beforeLoad callback + // onload will CANCEL layout creation if it returns false + if (false === _runCallbacks("onload_start")) + return 'cancel'; + + // initialize the container element + _initContainer(); + + // bind hotkey function - keyDown - if required + initHotkeys(); + + // bind window.onunload + $(window).bind("unload."+ sID, unload); + + // init plugins for this layout, if there are any (eg: customButtons) + runPluginCallbacks( Instance, $.layout.onLoad ); + + // if layout elements are hidden, then layout WILL NOT complete initialization! + // initLayoutElements will set initialized=true and run the onload callback IF successful + if (o.initPanes) _initLayoutElements(); + + delete s.creatingLayout; + + return state.initialized; + } + + /** + * Initialize the layout IF not already + * + * @see All methods in Instance run this test + * @return boolean true = layoutElements have been initialized | false = panes are not initialized (yet) + */ +, isInitialized = function () { + if (state.initialized || state.creatingLayout) return true; // already initialized + else return _initLayoutElements(); // try to init panes NOW + } + + /** + * Initialize the layout - called automatically whenever an instance of layout is created + * + * @see _create() & isInitialized + * @param {boolean=} [retry=false] // indicates this is a 2nd try + * @return An object pointer to the instance created + */ +, _initLayoutElements = function (retry) { + // initialize config/options + var o = options; + // CANNOT init panes inside a hidden container! + if (!$N.is(":visible")) { + // handle Chrome bug where popup window 'has no height' + // if layout is BODY element, try again in 50ms + // SEE: http://layout.jquery-dev.net/samples/test_popup_window.html + if ( !retry && browser.webkit && $N[0].tagName === "BODY" ) + setTimeout(function(){ _initLayoutElements(true); }, 50); + return false; + } + + // a center pane is required, so make sure it exists + if (!getPane("center").length) { + return _log( o.errors.centerPaneMissing ); + } + + // TEMP state so isInitialized returns true during init process + state.creatingLayout = true; + + // update Container dims + $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values + + // initialize all layout elements + initPanes(); // size & position panes - calls initHandles() - which calls initResizable() + + if (o.scrollToBookmarkOnLoad) { + var l = self.location; + if (l.hash) l.replace( l.hash ); // scrollTo Bookmark + } + + // check to see if this layout 'nested' inside a pane + if (Instance.hasParentLayout) + o.resizeWithWindow = false; + // bind resizeAll() for 'this layout instance' to window.resize event + else if (o.resizeWithWindow) + $(window).bind("resize."+ sID, windowResize); + + delete state.creatingLayout; + state.initialized = true; + + // init plugins for this layout, if there are any + runPluginCallbacks( Instance, $.layout.onReady ); + + // now run the onload callback, if exists + _runCallbacks("onload_end"); + + return true; // elements initialized successfully + } + + /** + * Initialize nested layouts for a specific pane - can optionally pass layout-options + * + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].children + * @return An object pointer to the layout instance created - or null + */ +, createChildren = function (evt_or_pane, opts) { + var pane = evtPane.call(this, evt_or_pane) + , $P = $Ps[pane] + ; + if (!$P) return; + var $C = $Cs[pane] + , s = state[pane] + , o = options[pane] + , sm = options.stateManagement || {} + , cos = opts ? (o.children = opts) : o.children + ; + if ( $.isPlainObject( cos ) ) + cos = [ cos ]; // convert a hash to a 1-elem array + else if (!cos || !$.isArray( cos )) + return; + + $.each( cos, function (idx, co) { + if ( !$.isPlainObject( co ) ) return; + + // determine which element is supposed to be the 'child container' + // if pane has a 'containerSelector' OR a 'content-div', use those instead of the pane + var $containers = co.containerSelector ? $P.find( co.containerSelector ) : ($C || $P); + + $containers.each(function(){ + var $cont = $(this) + , child = $cont.data("layout") // see if a child-layout ALREADY exists on this element + ; + // if no layout exists, but children are set, try to create the layout now + if (!child) { + // TODO: see about moving this to the stateManagement plugin, as a method + // set a unique child-instance key for this layout, if not already set + setInstanceKey({ container: $cont, options: co }, s ); + // If THIS layout has a hash in stateManagement.autoLoad, + // then see if it also contains state-data for this child-layout + // If so, copy the stateData to child.options.stateManagement.autoLoad + if ( sm.includeChildren && state.stateData[pane] ) { + // THIS layout's state was cached when its state was loaded + var paneChildren = state.stateData[pane].children || {} + , childState = paneChildren[ co.instanceKey ] + , co_sm = co.stateManagement || (co.stateManagement = { autoLoad: true }) + ; + // COPY the stateData into the autoLoad key + if ( co_sm.autoLoad === true && childState ) { + co_sm.autoSave = false; // disable autoSave because saving handled by parent-layout + co_sm.includeChildren = true; // cascade option - FOR NOW + co_sm.autoLoad = $.extend(true, {}, childState); // COPY the state-hash + } + } + + // create the layout + child = $cont.layout( co ); + + // if successful, update data + if (child) { + // add the child and update all layout-pointers + // MAY have already been done by child-layout calling parent.refreshChildren() + refreshChildren( pane, child ); + } + } + }); + }); + } + +, setInstanceKey = function (child, parentPaneState) { + // create a named key for use in state and instance branches + var $c = child.container + , o = child.options + , sm = o.stateManagement + , key = o.instanceKey || $c.data("layoutInstanceKey") + ; + if (!key) key = (sm && sm.cookie ? sm.cookie.name : '') || o.name; // look for a name/key + if (!key) key = "layout"+ (++parentPaneState.childIdx); // if no name/key found, generate one + else key = key.replace(/[^\w-]/gi, '_').replace(/_{2,}/g, '_'); // ensure is valid as a hash key + o.instanceKey = key; + $c.data("layoutInstanceKey", key); // useful if layout is destroyed and then recreated + return key; + } + + /** + * @param {string} pane The pane being opened, ie: north, south, east, or west + * @param {Object=} newChild New child-layout Instance to add to this pane + */ +, refreshChildren = function (pane, newChild) { + var $P = $Ps[pane] + , pC = children[pane] + , s = state[pane] + , o + ; + // check for destroy()ed layouts and update the child pointers & arrays + if ($.isPlainObject( pC )) { + $.each( pC, function (key, child) { + if (child.destroyed) delete pC[key] + }); + // if no more children, remove the children hash + if ($.isEmptyObject( pC )) + pC = children[pane] = null; // clear children hash + } + + // see if there is a directly-nested layout inside this pane + // if there is, then there can be only ONE child-layout, so check that... + if (!newChild && !pC) { + newChild = $P.data("layout"); + } + + // if a newChild instance was passed, add it to children[pane] + if (newChild) { + // update child.state + newChild.hasParentLayout = true; // set parent-flag in child + // instanceKey is a key-name used in both state and children + o = newChild.options; + // set a unique child-instance key for this layout, if not already set + setInstanceKey( newChild, s ); + // add pointer to pane.children hash + if (!pC) pC = children[pane] = {}; // create an empty children hash + pC[ o.instanceKey ] = newChild.container.data("layout"); // add childLayout instance + } + + // ALWAYS refresh the pane.children alias, even if null + Instance[pane].children = children[pane]; + + // if newChild was NOT passed - see if there is a child layout NOW + if (!newChild) { + createChildren(pane); // MAY create a child and re-call this method + } + } + +, windowResize = function () { + var o = options + , delay = Number(o.resizeWithWindowDelay); + if (delay < 10) delay = 100; // MUST have a delay! + // resizing uses a delay-loop because the resize event fires repeatly - except in FF, but delay anyway + timer.clear("winResize"); // if already running + timer.set("winResize", function(){ + timer.clear("winResize"); + timer.clear("winResizeRepeater"); + var dims = elDims( $N, o.inset ); + // only trigger resizeAll() if container has changed size + if (dims.innerWidth !== sC.innerWidth || dims.innerHeight !== sC.innerHeight) + resizeAll(); + }, delay); + // ALSO set fixed-delay timer, if not already running + if (!timer.data["winResizeRepeater"]) setWindowResizeRepeater(); + } + +, setWindowResizeRepeater = function () { + var delay = Number(options.resizeWithWindowMaxDelay); + if (delay > 0) + timer.set("winResizeRepeater", function(){ setWindowResizeRepeater(); resizeAll(); }, delay); + } + +, unload = function () { + var o = options; + + _runCallbacks("onunload_start"); + + // trigger plugin callabacks for this layout (eg: stateManagement) + runPluginCallbacks( Instance, $.layout.onUnload ); + + _runCallbacks("onunload_end"); + } + + /** + * Validate and initialize container CSS and events + * + * @see _create() + */ +, _initContainer = function () { + var + N = $N[0] + , $H = $("html") + , tag = sC.tagName = N.tagName + , id = sC.id = N.id + , cls = sC.className = N.className + , o = options + , name = o.name + , props = "position,margin,padding,border" + , css = "layoutCSS" + , CSS = {} + , hid = "hidden" // used A LOT! + // see if this container is a 'pane' inside an outer-layout + , parent = $N.data("parentLayout") // parent-layout Instance + , pane = $N.data("layoutEdge") // pane-name in parent-layout + , isChild = parent && pane + , num = $.layout.cssNum + , $parent, n + ; + // sC = state.container + sC.selector = $N.selector.split(".slice")[0]; + sC.ref = (o.name ? o.name +' layout / ' : '') + tag + (id ? "#"+id : cls ? '.['+cls+']' : ''); // used in messages + sC.isBody = (tag === "BODY"); + + // try to find a parent-layout + if (!isChild && !sC.isBody) { + $parent = $N.closest("."+ $.layout.defaults.panes.paneClass); + parent = $parent.data("parentLayout"); + pane = $parent.data("layoutEdge"); + isChild = parent && pane; + } + + $N .data({ + layout: Instance + , layoutContainer: sID // FLAG to indicate this is a layout-container - contains unique internal ID + }) + .addClass(o.containerClass) + ; + var layoutMethods = { + destroy: '' + , initPanes: '' + , resizeAll: 'resizeAll' + , resize: 'resizeAll' + }; + // loop hash and bind all methods - include layoutID namespacing + for (name in layoutMethods) { + $N.bind("layout"+ name.toLowerCase() +"."+ sID, Instance[ layoutMethods[name] || name ]); + } + + // if this container is another layout's 'pane', then set child/parent pointers + if (isChild) { + // update parent flag + Instance.hasParentLayout = true; + // set pointers to THIS child-layout (Instance) in parent-layout + parent.refreshChildren( pane, Instance ); + } + + // SAVE original container CSS for use in destroy() + if (!$N.data(css)) { + // handle props like overflow different for BODY & HTML - has 'system default' values + if (sC.isBody) { + // SAVE CSS + $N.data(css, $.extend( styles($N, props), { + height: $N.css("height") + , overflow: $N.css("overflow") + , overflowX: $N.css("overflowX") + , overflowY: $N.css("overflowY") + })); + // ALSO SAVE CSS + $H.data(css, $.extend( styles($H, 'padding'), { + height: "auto" // FF would return a fixed px-size! + , overflow: $H.css("overflow") + , overflowX: $H.css("overflowX") + , overflowY: $H.css("overflowY") + })); + } + else // handle props normally for non-body elements + $N.data(css, styles($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY") ); + } + + try { + // common container CSS + CSS = { + overflow: hid + , overflowX: hid + , overflowY: hid + }; + $N.css( CSS ); + + if (o.inset && !$.isPlainObject(o.inset)) { + // can specify a single number for equal outset all-around + n = parseInt(o.inset, 10) || 0 + o.inset = { + top: n + , bottom: n + , left: n + , right: n + }; + } + + // format html & body if this is a full page layout + if (sC.isBody) { + // if HTML has padding, use this as an outer-spacing around BODY + if (!o.outset) { + // use padding from parent-elem (HTML) as outset + o.outset = { + top: num($H, "paddingTop") + , bottom: num($H, "paddingBottom") + , left: num($H, "paddingLeft") + , right: num($H, "paddingRight") + }; + } + else if (!$.isPlainObject(o.outset)) { + // can specify a single number for equal outset all-around + n = parseInt(o.outset, 10) || 0 + o.outset = { + top: n + , bottom: n + , left: n + , right: n + }; + } + // HTML + $H.css( CSS ).css({ + height: "100%" + , border: "none" // no border or padding allowed when using height = 100% + , padding: 0 // ditto + , margin: 0 + }); + // BODY + if (browser.isIE6) { + // IE6 CANNOT use the trick of setting absolute positioning on all 4 sides - must have 'height' + $N.css({ + width: "100%" + , height: "100%" + , border: "none" // no border or padding allowed when using height = 100% + , padding: 0 // ditto + , margin: 0 + , position: "relative" + }); + // convert body padding to an inset option - the border cannot be measured in IE6! + if (!o.inset) o.inset = elDims( $N ).inset; + } + else { // use absolute positioning for BODY to allow borders & padding without overflow + $N.css({ + width: "auto" + , height: "auto" + , margin: 0 + , position: "absolute" // allows for border and padding on BODY + }); + // apply edge-positioning created above + $N.css( o.outset ); + } + // set current layout-container dimensions + $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values + } + else { + // container MUST have 'position' + var p = $N.css("position"); + if (!p || !p.match(/(fixed|absolute|relative)/)) + $N.css("position","relative"); + + // set current layout-container dimensions + if ( $N.is(":visible") ) { + $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT change insetX (padding) values + if (sC.innerHeight < 1) // container has no 'height' - warn developer + _log( o.errors.noContainerHeight.replace(/CONTAINER/, sC.ref) ); + } + } + + // if container has min-width/height, then enable scrollbar(s) + if ( num($N, "minWidth") ) $N.parent().css("overflowX","auto"); + if ( num($N, "minHeight") ) $N.parent().css("overflowY","auto"); + + } catch (ex) {} + } + + /** + * Bind layout hotkeys - if options enabled + * + * @see _create() and addPane() + * @param {string=} [panes=""] The edge(s) to process + */ +, initHotkeys = function (panes) { + panes = panes ? panes.split(",") : _c.borderPanes; + // bind keyDown to capture hotkeys, if option enabled for ANY pane + $.each(panes, function (i, pane) { + var o = options[pane]; + if (o.enableCursorHotkey || o.customHotkey) { + $(document).bind("keydown."+ sID, keyDown); // only need to bind this ONCE + return false; // BREAK - binding was done + } + }); + } + + /** + * Build final OPTIONS data + * + * @see _create() + */ +, initOptions = function () { + var data, d, pane, key, val, i, c, o; + + // reprocess user's layout-options to have correct options sub-key structure + opts = $.layout.transformData( opts, true ); // panes = default subkey + + // auto-rename old options for backward compatibility + opts = $.layout.backwardCompatibility.renameAllOptions( opts ); + + // if user-options has 'panes' key (pane-defaults), clean it... + if (!$.isEmptyObject(opts.panes)) { + // REMOVE any pane-defaults that MUST be set per-pane + data = $.layout.optionsMap.noDefault; + for (i=0, c=data.length; i 0) { + z.pane_normal = zo; + z.content_mask = max(zo+1, z.content_mask); // MIN = +1 + z.resizer_normal = max(zo+2, z.resizer_normal); // MIN = +2 + } + + // DELETE 'panes' key now that we are done - values were copied to EACH pane + delete options.panes; + + + function createFxOptions ( pane ) { + var o = options[pane] + , d = options.panes; + // ensure fxSettings key to avoid errors + if (!o.fxSettings) o.fxSettings = {}; + if (!d.fxSettings) d.fxSettings = {}; + + $.each(["_open","_close","_size"], function (i,n) { + var + sName = "fxName"+ n + , sSpeed = "fxSpeed"+ n + , sSettings = "fxSettings"+ n + // recalculate fxName according to specificity rules + , fxName = o[sName] = + o[sName] // options.west.fxName_open + || d[sName] // options.panes.fxName_open + || o.fxName // options.west.fxName + || d.fxName // options.panes.fxName + || "none" // MEANS $.layout.defaults.panes.fxName == "" || false || null || 0 + , fxExists = $.effects && ($.effects[fxName] || ($.effects.effect && $.effects.effect[fxName])) + ; + // validate fxName to ensure is valid effect - MUST have effect-config data in options.effects + if (fxName === "none" || !options.effects[fxName] || !fxExists) + fxName = o[sName] = "none"; // effect not loaded OR unrecognized fxName + + // set vars for effects subkeys to simplify logic + var fx = options.effects[fxName] || {} // effects.slide + , fx_all = fx.all || null // effects.slide.all + , fx_pane = fx[pane] || null // effects.slide.west + ; + // create fxSpeed[_open|_close|_size] + o[sSpeed] = + o[sSpeed] // options.west.fxSpeed_open + || d[sSpeed] // options.west.fxSpeed_open + || o.fxSpeed // options.west.fxSpeed + || d.fxSpeed // options.panes.fxSpeed + || null // DEFAULT - let fxSetting.duration control speed + ; + // create fxSettings[_open|_close|_size] + o[sSettings] = $.extend( + true + , {} + , fx_all // effects.slide.all + , fx_pane // effects.slide.west + , d.fxSettings // options.panes.fxSettings + , o.fxSettings // options.west.fxSettings + , d[sSettings] // options.panes.fxSettings_open + , o[sSettings] // options.west.fxSettings_open + ); + }); + + // DONE creating action-specific-settings for this pane, + // so DELETE generic options - are no longer meaningful + delete o.fxName; + delete o.fxSpeed; + delete o.fxSettings; + } + } + + /** + * Initialize module objects, styling, size and position for all panes + * + * @see _initElements() + * @param {string} pane The pane to process + */ +, getPane = function (pane) { + var sel = options[pane].paneSelector + if (sel.substr(0,1)==="#") // ID selector + // NOTE: elements selected 'by ID' DO NOT have to be 'children' + return $N.find(sel).eq(0); + else { // class or other selector + var $P = $N.children(sel).eq(0); + // look for the pane nested inside a 'form' element + return $P.length ? $P : $N.children("form:first").children(sel).eq(0); + } + } + + /** + * @param {Object=} evt + */ +, initPanes = function (evt) { + // stopPropagation if called by trigger("layoutinitpanes") - use evtPane utility + evtPane(evt); + + // NOTE: do north & south FIRST so we can measure their height - do center LAST + $.each(_c.allPanes, function (idx, pane) { + addPane( pane, true ); + }); + + // init the pane-handles NOW in case we have to hide or close the pane below + initHandles(); + + // now that all panes have been initialized and initially-sized, + // make sure there is really enough space available for each pane + $.each(_c.borderPanes, function (i, pane) { + if ($Ps[pane] && state[pane].isVisible) { // pane is OPEN + setSizeLimits(pane); + makePaneFit(pane); // pane may be Closed, Hidden or Resized by makePaneFit() + } + }); + // size center-pane AGAIN in case we 'closed' a border-pane in loop above + sizeMidPanes("center"); + + // Chrome/Webkit sometimes fires callbacks BEFORE it completes resizing! + // Before RC30.3, there was a 10ms delay here, but that caused layout + // to load asynchrously, which is BAD, so try skipping delay for now + + // process pane contents and callbacks, and init/resize child-layout if exists + $.each(_c.allPanes, function (idx, pane) { + afterInitPane(pane); + }); + } + + /** + * Add a pane to the layout - subroutine of initPanes() + * + * @see initPanes() + * @param {string} pane The pane to process + * @param {boolean=} [force=false] Size content after init + */ +, addPane = function (pane, force) { + if (!force && !isInitialized()) return; + var + o = options[pane] + , s = state[pane] + , c = _c[pane] + , dir = c.dir + , fx = s.fx + , spacing = o.spacing_open || 0 + , isCenter = (pane === "center") + , CSS = {} + , $P = $Ps[pane] + , size, minSize, maxSize, child + ; + // if pane-pointer already exists, remove the old one first + if ($P) + removePane( pane, false, true, false ); + else + $Cs[pane] = false; // init + + $P = $Ps[pane] = getPane(pane); + if (!$P.length) { + $Ps[pane] = false; // logic + return; + } + + // SAVE original Pane CSS + if (!$P.data("layoutCSS")) { + var props = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"; + $P.data("layoutCSS", styles($P, props)); + } + + // create alias for pane data in Instance - initHandles will add more + Instance[pane] = { + name: pane + , pane: $Ps[pane] + , content: $Cs[pane] + , options: options[pane] + , state: state[pane] + , children: children[pane] + }; + + // add classes, attributes & events + $P .data({ + parentLayout: Instance // pointer to Layout Instance + , layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + , layoutRole: "pane" + }) + .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal) + .css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles + .addClass( o.paneClass +" "+ o.paneClass+"-"+pane ) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector' + .bind("mouseenter."+ sID, addHover ) + .bind("mouseleave."+ sID, removeHover ) + ; + var paneMethods = { + hide: '' + , show: '' + , toggle: '' + , close: '' + , open: '' + , slideOpen: '' + , slideClose: '' + , slideToggle: '' + , size: 'sizePane' + , sizePane: 'sizePane' + , sizeContent: '' + , sizeHandles: '' + , enableClosable: '' + , disableClosable: '' + , enableSlideable: '' + , disableSlideable: '' + , enableResizable: '' + , disableResizable: '' + , swapPanes: 'swapPanes' + , swap: 'swapPanes' + , move: 'swapPanes' + , removePane: 'removePane' + , remove: 'removePane' + , createChildren: '' + , resizeChildren: '' + , resizeAll: 'resizeAll' + , resizeLayout: 'resizeAll' + } + , name; + // loop hash and bind all methods - include layoutID namespacing + for (name in paneMethods) { + $P.bind("layoutpane"+ name.toLowerCase() +"."+ sID, Instance[ paneMethods[name] || name ]); + } + + // see if this pane has a 'scrolling-content element' + initContent(pane, false); // false = do NOT sizeContent() - called later + + if (!isCenter) { + // call _parseSize AFTER applying pane classes & styles - but before making visible (if hidden) + // if o.size is auto or not valid, then MEASURE the pane and use that as its 'size' + size = s.size = _parseSize(pane, o.size); + minSize = _parseSize(pane,o.minSize) || 1; + maxSize = _parseSize(pane,o.maxSize) || 100000; + if (size > 0) size = max(min(size, maxSize), minSize); + s.autoResize = o.autoResize; // used with percentage sizes + + // state for border-panes + s.isClosed = false; // true = pane is closed + s.isSliding = false; // true = pane is currently open by 'sliding' over adjacent panes + s.isResizing= false; // true = pane is in process of being resized + s.isHidden = false; // true = pane is hidden - no spacing, resizer or toggler is visible! + + // array for 'pin buttons' whose classNames are auto-updated on pane-open/-close + if (!s.pins) s.pins = []; + } + // states common to ALL panes + s.tagName = $P[0].tagName; + s.edge = pane; // useful if pane is (or about to be) 'swapped' - easy find out where it is (or is going) + s.noRoom = false; // true = pane 'automatically' hidden due to insufficient room - will unhide automatically + s.isVisible = true; // false = pane is invisible - closed OR hidden - simplify logic + + // init pane positioning + setPanePosition( pane ); + + // if pane is not visible, + if (dir === "horz") // north or south pane + CSS.height = cssH($P, size); + else if (dir === "vert") // east or west pane + CSS.width = cssW($P, size); + //else if (isCenter) {} + + $P.css(CSS); // apply size -- top, bottom & height will be set by sizeMidPanes + if (dir != "horz") sizeMidPanes(pane, true); // true = skipCallback + + // if manually adding a pane AFTER layout initialization, then... + if (state.initialized) { + initHandles( pane ); + initHotkeys( pane ); + } + + // close or hide the pane if specified in settings + if (o.initClosed && o.closable && !o.initHidden) + close(pane, true, true); // true, true = force, noAnimation + else if (o.initHidden || o.initClosed) + hide(pane); // will be completely invisible - no resizer or spacing + else if (!s.noRoom) + // make the pane visible - in case was initially hidden + $P.css("display","block"); + // ELSE setAsOpen() - called later by initHandles() + + // RESET visibility now - pane will appear IF display:block + $P.css("visibility","visible"); + + // check option for auto-handling of pop-ups & drop-downs + if (o.showOverflowOnHover) + $P.hover( allowOverflow, resetOverflow ); + + // if manually adding a pane AFTER layout initialization, then... + if (state.initialized) { + afterInitPane( pane ); + } + } + +, afterInitPane = function (pane) { + var $P = $Ps[pane] + , s = state[pane] + , o = options[pane] + ; + if (!$P) return; + + // see if there is a directly-nested layout inside this pane + if ($P.data("layout")) + refreshChildren( pane, $P.data("layout") ); + + // process pane contents and callbacks, and init/resize child-layout if exists + if (s.isVisible) { // pane is OPEN + if (state.initialized) // this pane was added AFTER layout was created + resizeAll(); // will also sizeContent + else + sizeContent(pane); + + if (o.triggerEventsOnLoad) + _runCallbacks("onresize_end", pane); + else // automatic if onresize called, otherwise call it specifically + // resize child - IF inner-layout already exists (created before this layout) + resizeChildren(pane, true); // a previously existing childLayout + } + + // init childLayouts - even if pane is not visible + if (o.initChildren && o.children) + createChildren(pane); + } + + /** + * @param {string=} panes The pane(s) to process + */ +, setPanePosition = function (panes) { + panes = panes ? panes.split(",") : _c.borderPanes; + + // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV + $.each(panes, function (i, pane) { + var $P = $Ps[pane] + , $R = $Rs[pane] + , o = options[pane] + , s = state[pane] + , side = _c[pane].side + , CSS = {} + ; + if (!$P) return; // pane does not exist - skip + + // set css-position to account for container borders & padding + switch (pane) { + case "north": CSS.top = sC.inset.top; + CSS.left = sC.inset.left; + CSS.right = sC.inset.right; + break; + case "south": CSS.bottom = sC.inset.bottom; + CSS.left = sC.inset.left; + CSS.right = sC.inset.right; + break; + case "west": CSS.left = sC.inset.left; // top, bottom & height set by sizeMidPanes() + break; + case "east": CSS.right = sC.inset.right; // ditto + break; + case "center": // top, left, width & height set by sizeMidPanes() + } + // apply position + $P.css(CSS); + + // update resizer position + if ($R && s.isClosed) + $R.css(side, sC.inset[side]); + else if ($R && !s.isHidden) + $R.css(side, sC.inset[side] + getPaneSize(pane)); + }); + } + + /** + * Initialize module objects, styling, size and position for all resize bars and toggler buttons + * + * @see _create() + * @param {string=} [panes=""] The edge(s) to process + */ +, initHandles = function (panes) { + panes = panes ? panes.split(",") : _c.borderPanes; + + // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV + $.each(panes, function (i, pane) { + var $P = $Ps[pane]; + $Rs[pane] = false; // INIT + $Ts[pane] = false; + if (!$P) return; // pane does not exist - skip + + var + o = options[pane] + , s = state[pane] + , c = _c[pane] + , paneId = o.paneSelector.substr(0,1) === "#" ? o.paneSelector.substr(1) : "" + , rClass = o.resizerClass + , tClass = o.togglerClass + , spacing = (s.isVisible ? o.spacing_open : o.spacing_closed) + , _pane = "-"+ pane // used for classNames + , _state = (s.isVisible ? "-open" : "-closed") // used for classNames + , I = Instance[pane] + // INIT RESIZER BAR + , $R = I.resizer = $Rs[pane] = $("
                ") + // INIT TOGGLER BUTTON + , $T = I.toggler = (o.closable ? $Ts[pane] = $("
                ") : false) + ; + + //if (s.isVisible && o.resizable) ... handled by initResizable + if (!s.isVisible && o.slidable) + $R.attr("title", o.tips.Slide).css("cursor", o.sliderCursor); + + $R // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "paneLeft-resizer" + .attr("id", paneId ? paneId +"-resizer" : "" ) + .data({ + parentLayout: Instance + , layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + , layoutRole: "resizer" + }) + .css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal) + .css(o.applyDemoStyles ? _c.resizers.cssDemo : {}) // add demo styles + .addClass(rClass +" "+ rClass+_pane) + .hover(addHover, removeHover) // ALWAYS add hover-classes, even if resizing is not enabled - handle with CSS instead + .hover(onResizerEnter, onResizerLeave) // ALWAYS NEED resizer.mouseleave to balance toggler.mouseenter + .appendTo($N) // append DIV to container + ; + if (o.resizerDblClickToggle) + $R.bind("dblclick."+ sID, toggle ); + + if ($T) { + $T // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "#paneLeft-toggler" + .attr("id", paneId ? paneId +"-toggler" : "" ) + .data({ + parentLayout: Instance + , layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + , layoutRole: "toggler" + }) + .css(_c.togglers.cssReq) // add base/required styles + .css(o.applyDemoStyles ? _c.togglers.cssDemo : {}) // add demo styles + .addClass(tClass +" "+ tClass+_pane) + .hover(addHover, removeHover) // ALWAYS add hover-classes, even if toggling is not enabled - handle with CSS instead + .bind("mouseenter", onResizerEnter) // NEED toggler.mouseenter because mouseenter MAY NOT fire on resizer + .appendTo($R) // append SPAN to resizer DIV + ; + // ADD INNER-SPANS TO TOGGLER + if (o.togglerContent_open) // ui-layout-open + $(""+ o.togglerContent_open +"") + .data({ + layoutEdge: pane + , layoutRole: "togglerContent" + }) + .data("layoutRole", "togglerContent") + .data("layoutEdge", pane) + .addClass("content content-open") + .css("display","none") + .appendTo( $T ) + //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-open instead! + ; + if (o.togglerContent_closed) // ui-layout-closed + $(""+ o.togglerContent_closed +"") + .data({ + layoutEdge: pane + , layoutRole: "togglerContent" + }) + .addClass("content content-closed") + .css("display","none") + .appendTo( $T ) + //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-closed instead! + ; + // ADD TOGGLER.click/.hover + enableClosable(pane); + } + + // add Draggable events + initResizable(pane); + + // ADD CLASSNAMES & SLIDE-BINDINGS - eg: class="resizer resizer-west resizer-open" + if (s.isVisible) + setAsOpen(pane); // onOpen will be called, but NOT onResize + else { + setAsClosed(pane); // onClose will be called + bindStartSlidingEvents(pane, true); // will enable events IF option is set + } + + }); + + // SET ALL HANDLE DIMENSIONS + sizeHandles(); + } + + + /** + * Initialize scrolling ui-layout-content div - if exists + * + * @see initPane() - or externally after an Ajax injection + * @param {string} pane The pane to process + * @param {boolean=} [resize=true] Size content after init + */ +, initContent = function (pane, resize) { + if (!isInitialized()) return; + var + o = options[pane] + , sel = o.contentSelector + , I = Instance[pane] + , $P = $Ps[pane] + , $C + ; + if (sel) $C = I.content = $Cs[pane] = (o.findNestedContent) + ? $P.find(sel).eq(0) // match 1-element only + : $P.children(sel).eq(0) + ; + if ($C && $C.length) { + $C.data("layoutRole", "content"); + // SAVE original Content CSS + if (!$C.data("layoutCSS")) + $C.data("layoutCSS", styles($C, "height")); + $C.css( _c.content.cssReq ); + if (o.applyDemoStyles) { + $C.css( _c.content.cssDemo ); // add padding & overflow: auto to content-div + $P.css( _c.content.cssDemoPane ); // REMOVE padding/scrolling from pane + } + // ensure no vertical scrollbar on pane - will mess up measurements + if ($P.css("overflowX").match(/(scroll|auto)/)) { + $P.css("overflow", "hidden"); + } + state[pane].content = {}; // init content state + if (resize !== false) sizeContent(pane); + // sizeContent() is called AFTER init of all elements + } + else + I.content = $Cs[pane] = false; + } + + + /** + * Add resize-bars to all panes that specify it in options + * -dependancy: $.fn.resizable - will skip if not found + * + * @see _create() + * @param {string=} [panes=""] The edge(s) to process + */ +, initResizable = function (panes) { + var draggingAvailable = $.layout.plugins.draggable + , side // set in start() + ; + panes = panes ? panes.split(",") : _c.borderPanes; + + $.each(panes, function (idx, pane) { + var o = options[pane]; + if (!draggingAvailable || !$Ps[pane] || !o.resizable) { + o.resizable = false; + return true; // skip to next + } + + var s = state[pane] + , z = options.zIndexes + , c = _c[pane] + , side = c.dir=="horz" ? "top" : "left" + , $P = $Ps[pane] + , $R = $Rs[pane] + , base = o.resizerClass + , lastPos = 0 // used when live-resizing + , r, live // set in start because may change + // 'drag' classes are applied to the ORIGINAL resizer-bar while dragging is in process + , resizerClass = base+"-drag" // resizer-drag + , resizerPaneClass = base+"-"+pane+"-drag" // resizer-north-drag + // 'helper' class is applied to the CLONED resizer-bar while it is being dragged + , helperClass = base+"-dragging" // resizer-dragging + , helperPaneClass = base+"-"+pane+"-dragging" // resizer-north-dragging + , helperLimitClass = base+"-dragging-limit" // resizer-drag + , helperPaneLimitClass = base+"-"+pane+"-dragging-limit" // resizer-north-drag + , helperClassesSet = false // logic var + ; + + if (!s.isClosed) + $R.attr("title", o.tips.Resize) + .css("cursor", o.resizerCursor); // n-resize, s-resize, etc + + $R.draggable({ + containment: $N[0] // limit resizing to layout container + , axis: (c.dir=="horz" ? "y" : "x") // limit resizing to horz or vert axis + , delay: 0 + , distance: 1 + , grid: o.resizingGrid + // basic format for helper - style it using class: .ui-draggable-dragging + , helper: "clone" + , opacity: o.resizerDragOpacity + , addClasses: false // avoid ui-state-disabled class when disabled + //, iframeFix: o.draggableIframeFix // TODO: consider using when bug is fixed + , zIndex: z.resizer_drag + + , start: function (e, ui) { + // REFRESH options & state pointers in case we used swapPanes + o = options[pane]; + s = state[pane]; + // re-read options + live = o.livePaneResizing; + + // ondrag_start callback - will CANCEL hide if returns false + // TODO: dragging CANNOT be cancelled like this, so see if there is a way? + if (false === _runCallbacks("ondrag_start", pane)) return false; + + s.isResizing = true; // prevent pane from closing while resizing + state.paneResizing = pane; // easy to see if ANY pane is resizing + timer.clear(pane+"_closeSlider"); // just in case already triggered + + // SET RESIZER LIMITS - used in drag() + setSizeLimits(pane); // update pane/resizer state + r = s.resizerPosition; + lastPos = ui.position[ side ] + + $R.addClass( resizerClass +" "+ resizerPaneClass ); // add drag classes + helperClassesSet = false; // reset logic var - see drag() + + // DISABLE TEXT SELECTION (probably already done by resizer.mouseOver) + $('body').disableSelection(); + + // MASK PANES CONTAINING IFRAMES, APPLETS OR OTHER TROUBLESOME ELEMENTS + showMasks( pane, { resizing: true }); + } + + , drag: function (e, ui) { + if (!helperClassesSet) { // can only add classes after clone has been added to the DOM + //$(".ui-draggable-dragging") + ui.helper + .addClass( helperClass +" "+ helperPaneClass ) // add helper classes + .css({ right: "auto", bottom: "auto" }) // fix dir="rtl" issue + .children().css("visibility","hidden") // hide toggler inside dragged resizer-bar + ; + helperClassesSet = true; + // draggable bug!? RE-SET zIndex to prevent E/W resize-bar showing through N/S pane! + if (s.isSliding) $Ps[pane].css("zIndex", z.pane_sliding); + } + // CONTAIN RESIZER-BAR TO RESIZING LIMITS + var limit = 0; + if (ui.position[side] < r.min) { + ui.position[side] = r.min; + limit = -1; + } + else if (ui.position[side] > r.max) { + ui.position[side] = r.max; + limit = 1; + } + // ADD/REMOVE dragging-limit CLASS + if (limit) { + ui.helper.addClass( helperLimitClass +" "+ helperPaneLimitClass ); // at dragging-limit + window.defaultStatus = (limit>0 && pane.match(/(north|west)/)) || (limit<0 && pane.match(/(south|east)/)) ? o.tips.maxSizeWarning : o.tips.minSizeWarning; + } + else { + ui.helper.removeClass( helperLimitClass +" "+ helperPaneLimitClass ); // not at dragging-limit + window.defaultStatus = ""; + } + // DYNAMICALLY RESIZE PANES IF OPTION ENABLED + // won't trigger unless resizer has actually moved! + if (live && Math.abs(ui.position[side] - lastPos) >= o.liveResizingTolerance) { + lastPos = ui.position[side]; + resizePanes(e, ui, pane) + } + } + + , stop: function (e, ui) { + $('body').enableSelection(); // RE-ENABLE TEXT SELECTION + window.defaultStatus = ""; // clear 'resizing limit' message from statusbar + $R.removeClass( resizerClass +" "+ resizerPaneClass ); // remove drag classes from Resizer + s.isResizing = false; + state.paneResizing = false; // easy to see if ANY pane is resizing + resizePanes(e, ui, pane, true); // true = resizingDone + } + + }); + }); + + /** + * resizePanes + * + * Sub-routine called from stop() - and drag() if livePaneResizing + * + * @param {!Object} evt + * @param {!Object} ui + * @param {string} pane + * @param {boolean=} [resizingDone=false] + */ + var resizePanes = function (evt, ui, pane, resizingDone) { + var dragPos = ui.position + , c = _c[pane] + , o = options[pane] + , s = state[pane] + , resizerPos + ; + switch (pane) { + case "north": resizerPos = dragPos.top; break; + case "west": resizerPos = dragPos.left; break; + case "south": resizerPos = sC.layoutHeight - dragPos.top - o.spacing_open; break; + case "east": resizerPos = sC.layoutWidth - dragPos.left - o.spacing_open; break; + }; + // remove container margin from resizer position to get the pane size + var newSize = resizerPos - sC.inset[c.side]; + + // Disable OR Resize Mask(s) created in drag.start + if (!resizingDone) { + // ensure we meet liveResizingTolerance criteria + if (Math.abs(newSize - s.size) < o.liveResizingTolerance) + return; // SKIP resize this time + // resize the pane + manualSizePane(pane, newSize, false, true); // true = noAnimation + sizeMasks(); // resize all visible masks + } + else { // resizingDone + // ondrag_end callback + if (false !== _runCallbacks("ondrag_end", pane)) + manualSizePane(pane, newSize, false, true); // true = noAnimation + hideMasks(true); // true = force hiding all masks even if one is 'sliding' + if (s.isSliding) // RE-SHOW 'object-masks' so objects won't show through sliding pane + showMasks( pane, { resizing: true }); + } + }; + } + + /** + * sizeMask + * + * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane + * Called when mask created, and during livePaneResizing + */ +, sizeMask = function () { + var $M = $(this) + , pane = $M.data("layoutMask") // eg: "west" + , s = state[pane] + ; + // only masks over an IFRAME-pane need manual resizing + if (s.tagName == "IFRAME" && s.isVisible) // no need to mask closed/hidden panes + $M.css({ + top: s.offsetTop + , left: s.offsetLeft + , width: s.outerWidth + , height: s.outerHeight + }); + /* ALT Method... + var $P = $Ps[pane]; + $M.css( $P.position() ).css({ width: $P[0].offsetWidth, height: $P[0].offsetHeight }); + */ + } +, sizeMasks = function () { + $Ms.each( sizeMask ); // resize all 'visible' masks + } + + /** + * @param {string} pane The pane being resized, animated or isSliding + * @param {Object=} [args] (optional) Options: which masks to apply, and to which panes + */ +, showMasks = function (pane, args) { + var c = _c[pane] + , panes = ["center"] + , z = options.zIndexes + , a = $.extend({ + objectsOnly: false + , animation: false + , resizing: true + , sliding: state[pane].isSliding + }, args ) + , o, s + ; + if (a.resizing) + panes.push( pane ); + if (a.sliding) + panes.push( _c.oppositeEdge[pane] ); // ADD the oppositeEdge-pane + + if (c.dir === "horz") { + panes.push("west"); + panes.push("east"); + } + + $.each(panes, function(i,p){ + s = state[p]; + o = options[p]; + if (s.isVisible && ( o.maskObjects || (!a.objectsOnly && o.maskContents) )) { + getMasks(p).each(function(){ + sizeMask.call(this); + this.style.zIndex = s.isSliding ? z.pane_sliding+1 : z.pane_normal+1 + this.style.display = "block"; + }); + } + }); + } + + /** + * @param {boolean=} force Hide masks even if a pane is sliding + */ +, hideMasks = function (force) { + // ensure no pane is resizing - could be a timing issue + if (force || !state.paneResizing) { + $Ms.hide(); // hide ALL masks + } + // if ANY pane is sliding, then DO NOT remove masks from panes with maskObjects enabled + else if (!force && !$.isEmptyObject( state.panesSliding )) { + var i = $Ms.length - 1 + , p, $M; + for (; i >= 0; i--) { + $M = $Ms.eq(i); + p = $M.data("layoutMask"); + if (!options[p].maskObjects) { + $M.hide(); + } + } + } + } + + /** + * @param {string} pane + */ +, getMasks = function (pane) { + var $Masks = $([]) + , $M, i = 0, c = $Ms.length + ; + for (; i CSS + if (sC.tagName === "BODY" && ($N = $("html")).data(css)) // RESET CSS + $N.css( $N.data(css) ).removeData(css); + + // trigger plugins for this layout, if there are any + runPluginCallbacks( Instance, $.layout.onDestroy ); + + // trigger state-management and onunload callback + unload(); + + // clear the Instance of everything except for container & options (so could recreate) + // RE-CREATE: myLayout = myLayout.container.layout( myLayout.options ); + for (var n in Instance) + if (!n.match(/^(container|options)$/)) delete Instance[ n ]; + // add a 'destroyed' flag to make it easy to check + Instance.destroyed = true; + + // if this is a child layout, CLEAR the child-pointer in the parent + /* for now the pointer REMAINS, but with only container, options and destroyed keys + if (parentPane) { + var layout = parentPane.pane.data("parentLayout") + , key = layout.options.instanceKey || 'error'; + // THIS SYNTAX MAY BE WRONG! + parentPane.children[key] = layout.children[ parentPane.name ].children[key] = null; + } + */ + + return Instance; // for coding convenience + } + + /** + * Remove a pane from the layout - subroutine of destroy() + * + * @see destroy() + * @param {(string|Object)} evt_or_pane The pane to process + * @param {boolean=} [remove=false] Remove the DOM element? + * @param {boolean=} [skipResize=false] Skip calling resizeAll()? + * @param {boolean=} [destroyChild=true] Destroy Child-layouts? If not passed, obeys options setting + */ +, removePane = function (evt_or_pane, remove, skipResize, destroyChild) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $P = $Ps[pane] + , $C = $Cs[pane] + , $R = $Rs[pane] + , $T = $Ts[pane] + ; + // NOTE: elements can still exist even after remove() + // so check for missing data(), which is cleared by removed() + if ($P && $.isEmptyObject( $P.data() )) $P = false; + if ($C && $.isEmptyObject( $C.data() )) $C = false; + if ($R && $.isEmptyObject( $R.data() )) $R = false; + if ($T && $.isEmptyObject( $T.data() )) $T = false; + + if ($P) $P.stop(true, true); + + var o = options[pane] + , s = state[pane] + , d = "layout" + , css = "layoutCSS" + , pC = children[pane] + , hasChildren = $.isPlainObject( pC ) && !$.isEmptyObject( pC ) + , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildren + ; + // FIRST destroy the child-layout(s) + if (hasChildren && destroy) { + $.each( pC, function (key, child) { + if (!child.destroyed) + child.destroy(true);// tell child-layout to destroy ALL its child-layouts too + if (child.destroyed) // destroy was successful + delete pC[key]; + }); + // if no more children, remove the children hash + if ($.isEmptyObject( pC )) { + pC = children[pane] = null; // clear children hash + hasChildren = false; + } + } + + // Note: can't 'remove' a pane element with non-destroyed children + if ($P && remove && !hasChildren) + $P.remove(); // remove the pane-element and everything inside it + else if ($P && $P[0]) { + // create list of ALL pane-classes that need to be removed + var root = o.paneClass // default="ui-layout-pane" + , pRoot = root +"-"+ pane // eg: "ui-layout-pane-west" + , _open = "-open" + , _sliding= "-sliding" + , _closed = "-closed" + , classes = [ root, root+_open, root+_closed, root+_sliding, // generic classes + pRoot, pRoot+_open, pRoot+_closed, pRoot+_sliding ] // pane-specific classes + ; + $.merge(classes, getHoverClasses($P, true)); // ADD hover-classes + // remove all Layout classes from pane-element + $P .removeClass( classes.join(" ") ) // remove ALL pane-classes + .removeData("parentLayout") + .removeData("layoutPane") + .removeData("layoutRole") + .removeData("layoutEdge") + .removeData("autoHidden") // in case set + .unbind("."+ sID) // remove ALL Layout events + // TODO: remove these extra unbind commands when jQuery is fixed + //.unbind("mouseenter"+ sID) + //.unbind("mouseleave"+ sID) + ; + // do NOT reset CSS if this pane/content is STILL the container of a nested layout! + // the nested layout will reset its 'container' CSS when/if it is destroyed + if (hasChildren && $C) { + // a content-div may not have a specific width, so give it one to contain the Layout + $C.width( $C.width() ); + $.each( pC, function (key, child) { + child.resizeAll(); // resize the Layout + }); + } + else if ($C) + $C.css( $C.data(css) ).removeData(css).removeData("layoutRole"); + // remove pane AFTER content in case there was a nested layout + if (!$P.data(d)) + $P.css( $P.data(css) ).removeData(css); + } + + // REMOVE pane resizer and toggler elements + if ($T) $T.remove(); + if ($R) $R.remove(); + + // CLEAR all pointers and state data + Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = false; + s = { removed: true }; + + if (!skipResize) + resizeAll(); + } + + +/* + * ########################### + * ACTION METHODS + * ########################### + */ + + /** + * @param {string} pane + */ +, _hidePane = function (pane) { + var $P = $Ps[pane] + , o = options[pane] + , s = $P[0].style + ; + if (o.useOffscreenClose) { + if (!$P.data(_c.offscreenReset)) + $P.data(_c.offscreenReset, { left: s.left, right: s.right }); + $P.css( _c.offscreenCSS ); + } + else + $P.hide().removeData(_c.offscreenReset); + } + + /** + * @param {string} pane + */ +, _showPane = function (pane) { + var $P = $Ps[pane] + , o = options[pane] + , off = _c.offscreenCSS + , old = $P.data(_c.offscreenReset) + , s = $P[0].style + ; + $P .show() // ALWAYS show, just in case + .removeData(_c.offscreenReset); + if (o.useOffscreenClose && old) { + if (s.left == off.left) + s.left = old.left; + if (s.right == off.right) + s.right = old.right; + } + } + + + /** + * Completely 'hides' a pane, including its spacing - as if it does not exist + * The pane is not actually 'removed' from the source, so can use 'show' to un-hide it + * + * @param {(string|Object)} evt_or_pane The pane being hidden, ie: north, south, east, or west + * @param {boolean=} [noAnimation=false] + */ +, hide = function (evt_or_pane, noAnimation) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , o = options[pane] + , s = state[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + ; + if (!$P || s.isHidden) return; // pane does not exist OR is already hidden + + // onhide_start callback - will CANCEL hide if returns false + if (state.initialized && false === _runCallbacks("onhide_start", pane)) return; + + s.isSliding = false; // just in case + delete state.panesSliding[pane]; + + // now hide the elements + if ($R) $R.hide(); // hide resizer-bar + if (!state.initialized || s.isClosed) { + s.isClosed = true; // to trigger open-animation on show() + s.isHidden = true; + s.isVisible = false; + if (!state.initialized) + _hidePane(pane); // no animation when loading page + sizeMidPanes(_c[pane].dir === "horz" ? "" : "center"); + if (state.initialized || o.triggerEventsOnLoad) + _runCallbacks("onhide_end", pane); + } + else { + s.isHiding = true; // used by onclose + close(pane, false, noAnimation); // adjust all panes to fit + } + } + + /** + * Show a hidden pane - show as 'closed' by default unless openPane = true + * + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + * @param {boolean=} [openPane=false] + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [noAlert=false] + */ +, show = function (evt_or_pane, openPane, noAnimation, noAlert) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , o = options[pane] + , s = state[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + ; + if (!$P || !s.isHidden) return; // pane does not exist OR is not hidden + + // onshow_start callback - will CANCEL show if returns false + if (false === _runCallbacks("onshow_start", pane)) return; + + s.isShowing = true; // used by onopen/onclose + //s.isHidden = false; - will be set by open/close - if not cancelled + s.isSliding = false; // just in case + delete state.panesSliding[pane]; + + // now show the elements + //if ($R) $R.show(); - will be shown by open/close + if (openPane === false) + close(pane, true); // true = force + else + open(pane, false, noAnimation, noAlert); // adjust all panes to fit + } + + + /** + * Toggles a pane open/closed by calling either open or close + * + * @param {(string|Object)} evt_or_pane The pane being toggled, ie: north, south, east, or west + * @param {boolean=} [slide=false] + */ +, toggle = function (evt_or_pane, slide) { + if (!isInitialized()) return; + var evt = evtObj(evt_or_pane) + , pane = evtPane.call(this, evt_or_pane) + , s = state[pane] + ; + if (evt) // called from to $R.dblclick OR triggerPaneEvent + evt.stopImmediatePropagation(); + if (s.isHidden) + show(pane); // will call 'open' after unhiding it + else if (s.isClosed) + open(pane, !!slide); + else + close(pane); + } + + + /** + * Utility method used during init or other auto-processes + * + * @param {string} pane The pane being closed + * @param {boolean=} [setHandles=false] + */ +, _closePane = function (pane, setHandles) { + var + $P = $Ps[pane] + , s = state[pane] + ; + _hidePane(pane); + s.isClosed = true; + s.isVisible = false; + // UNUSED: if (setHandles) setAsClosed(pane, true); // true = force + } + + /** + * Close the specified pane (animation optional), and resize all other panes as needed + * + * @param {(string|Object)} evt_or_pane The pane being closed, ie: north, south, east, or west + * @param {boolean=} [force=false] + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [skipCallback=false] + */ +, close = function (evt_or_pane, force, noAnimation, skipCallback) { + var pane = evtPane.call(this, evt_or_pane); + // if pane has been initialized, but NOT the complete layout, close pane instantly + if (!state.initialized && $Ps[pane]) { + _closePane(pane); // INIT pane as closed + return; + } + if (!isInitialized()) return; + + var + $P = $Ps[pane] + , $R = $Rs[pane] + , $T = $Ts[pane] + , o = options[pane] + , s = state[pane] + , c = _c[pane] + , doFX, isShowing, isHiding, wasSliding; + + // QUEUE in case another action/animation is in progress + $N.queue(function( queueNext ){ + + if ( !$P + || (!o.closable && !s.isShowing && !s.isHiding) // invalid request // (!o.resizable && !o.closable) ??? + || (!force && s.isClosed && !s.isShowing) // already closed + ) return queueNext(); + + // onclose_start callback - will CANCEL hide if returns false + // SKIP if just 'showing' a hidden pane as 'closed' + var abort = !s.isShowing && false === _runCallbacks("onclose_start", pane); + + // transfer logic vars to temp vars + isShowing = s.isShowing; + isHiding = s.isHiding; + wasSliding = s.isSliding; + // now clear the logic vars (REQUIRED before aborting) + delete s.isShowing; + delete s.isHiding; + + if (abort) return queueNext(); + + doFX = !noAnimation && !s.isClosed && (o.fxName_close != "none"); + s.isMoving = true; + s.isClosed = true; + s.isVisible = false; + // update isHidden BEFORE sizing panes + if (isHiding) s.isHidden = true; + else if (isShowing) s.isHidden = false; + + if (s.isSliding) // pane is being closed, so UNBIND trigger events + bindStopSlidingEvents(pane, false); // will set isSliding=false + else // resize panes adjacent to this one + sizeMidPanes(_c[pane].dir === "horz" ? "" : "center", false); // false = NOT skipCallback + + // if this pane has a resizer bar, move it NOW - before animation + setAsClosed(pane); + + // CLOSE THE PANE + if (doFX) { // animate the close + lockPaneForFX(pane, true); // need to set left/top so animation will work + $P.hide( o.fxName_close, o.fxSettings_close, o.fxSpeed_close, function () { + lockPaneForFX(pane, false); // undo + if (s.isClosed) close_2(); + queueNext(); + }); + } + else { // hide the pane without animation + _hidePane(pane); + close_2(); + queueNext(); + }; + }); + + // SUBROUTINE + function close_2 () { + s.isMoving = false; + bindStartSlidingEvents(pane, true); // will enable if o.slidable = true + + // if opposite-pane was autoClosed, see if it can be autoOpened now + var altPane = _c.oppositeEdge[pane]; + if (state[ altPane ].noRoom) { + setSizeLimits( altPane ); + makePaneFit( altPane ); + } + + if (!skipCallback && (state.initialized || o.triggerEventsOnLoad)) { + // onclose callback - UNLESS just 'showing' a hidden pane as 'closed' + if (!isShowing) _runCallbacks("onclose_end", pane); + // onhide OR onshow callback + if (isShowing) _runCallbacks("onshow_end", pane); + if (isHiding) _runCallbacks("onhide_end", pane); + } + } + } + + /** + * @param {string} pane The pane just closed, ie: north, south, east, or west + */ +, setAsClosed = function (pane) { + var + $P = $Ps[pane] + , $R = $Rs[pane] + , $T = $Ts[pane] + , o = options[pane] + , s = state[pane] + , side = _c[pane].side + , rClass = o.resizerClass + , tClass = o.togglerClass + , _pane = "-"+ pane // used for classNames + , _open = "-open" + , _sliding= "-sliding" + , _closed = "-closed" + ; + $R + .css(side, sC.inset[side]) // move the resizer + .removeClass( rClass+_open +" "+ rClass+_pane+_open ) + .removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) + .addClass( rClass+_closed +" "+ rClass+_pane+_closed ) + ; + // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvents? + if (o.resizable && $.layout.plugins.draggable) + $R + .draggable("disable") + .removeClass("ui-state-disabled") // do NOT apply disabled styling - not suitable here + .css("cursor", "default") + .attr("title","") + ; + + // if pane has a toggler button, adjust that too + if ($T) { + $T + .removeClass( tClass+_open +" "+ tClass+_pane+_open ) + .addClass( tClass+_closed +" "+ tClass+_pane+_closed ) + .attr("title", o.tips.Open) // may be blank + ; + // toggler-content - if exists + $T.children(".content-open").hide(); + $T.children(".content-closed").css("display","block"); + } + + // sync any 'pin buttons' + syncPinBtns(pane, false); + + if (state.initialized) { + // resize 'length' and position togglers for adjacent panes + sizeHandles(); + } + } + + /** + * Open the specified pane (animation optional), and resize all other panes as needed + * + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + * @param {boolean=} [slide=false] + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [noAlert=false] + */ +, open = function (evt_or_pane, slide, noAnimation, noAlert) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $P = $Ps[pane] + , $R = $Rs[pane] + , $T = $Ts[pane] + , o = options[pane] + , s = state[pane] + , c = _c[pane] + , doFX, isShowing + ; + // QUEUE in case another action/animation is in progress + $N.queue(function( queueNext ){ + + if ( !$P + || (!o.resizable && !o.closable && !s.isShowing) // invalid request + || (s.isVisible && !s.isSliding) // already open + ) return queueNext(); + + // pane can ALSO be unhidden by just calling show(), so handle this scenario + if (s.isHidden && !s.isShowing) { + queueNext(); // call before show() because it needs the queue free + show(pane, true); + return; + } + + if (s.autoResize && s.size != o.size) // resize pane to original size set in options + sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize + else + // make sure there is enough space available to open the pane + setSizeLimits(pane, slide); + + // onopen_start callback - will CANCEL open if returns false + var cbReturn = _runCallbacks("onopen_start", pane); + + if (cbReturn === "abort") + return queueNext(); + + // update pane-state again in case options were changed in onopen_start + if (cbReturn !== "NC") // NC = "No Callback" + setSizeLimits(pane, slide); + + if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN! + syncPinBtns(pane, false); // make sure pin-buttons are reset + if (!noAlert && o.tips.noRoomToOpen) + alert(o.tips.noRoomToOpen); + return queueNext(); // ABORT + } + + if (slide) // START Sliding - will set isSliding=true + bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane + else if (s.isSliding) // PIN PANE (stop sliding) - open pane 'normally' instead + bindStopSlidingEvents(pane, false); // UNBIND trigger events - will set isSliding=false + else if (o.slidable) + bindStartSlidingEvents(pane, false); // UNBIND trigger events + + s.noRoom = false; // will be reset by makePaneFit if 'noRoom' + makePaneFit(pane); + + // transfer logic var to temp var + isShowing = s.isShowing; + // now clear the logic var + delete s.isShowing; + + doFX = !noAnimation && s.isClosed && (o.fxName_open != "none"); + s.isMoving = true; + s.isVisible = true; + s.isClosed = false; + // update isHidden BEFORE sizing panes - WHY??? Old? + if (isShowing) s.isHidden = false; + + if (doFX) { // ANIMATE + // mask adjacent panes with objects + lockPaneForFX(pane, true); // need to set left/top so animation will work + $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() { + lockPaneForFX(pane, false); // undo + if (s.isVisible) open_2(); // continue + queueNext(); + }); + } + else { // no animation + _showPane(pane);// just show pane and... + open_2(); // continue + queueNext(); + }; + }); + + // SUBROUTINE + function open_2 () { + s.isMoving = false; + + // cure iframe display issues + _fixIframe(pane); + + // NOTE: if isSliding, then other panes are NOT 'resized' + if (!s.isSliding) { // resize all panes adjacent to this one + sizeMidPanes(_c[pane].dir=="vert" ? "center" : "", false); // false = NOT skipCallback + } + + // set classes, position handles and execute callbacks... + setAsOpen(pane); + }; + + } + + /** + * @param {string} pane The pane just opened, ie: north, south, east, or west + * @param {boolean=} [skipCallback=false] + */ +, setAsOpen = function (pane, skipCallback) { + var + $P = $Ps[pane] + , $R = $Rs[pane] + , $T = $Ts[pane] + , o = options[pane] + , s = state[pane] + , side = _c[pane].side + , rClass = o.resizerClass + , tClass = o.togglerClass + , _pane = "-"+ pane // used for classNames + , _open = "-open" + , _closed = "-closed" + , _sliding= "-sliding" + ; + $R + .css(side, sC.inset[side] + getPaneSize(pane)) // move the resizer + .removeClass( rClass+_closed +" "+ rClass+_pane+_closed ) + .addClass( rClass+_open +" "+ rClass+_pane+_open ) + ; + if (s.isSliding) + $R.addClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) + else // in case 'was sliding' + $R.removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) + + removeHover( 0, $R ); // remove hover classes + if (o.resizable && $.layout.plugins.draggable) + $R .draggable("enable") + .css("cursor", o.resizerCursor) + .attr("title", o.tips.Resize); + else if (!s.isSliding) + $R.css("cursor", "default"); // n-resize, s-resize, etc + + // if pane also has a toggler button, adjust that too + if ($T) { + $T .removeClass( tClass+_closed +" "+ tClass+_pane+_closed ) + .addClass( tClass+_open +" "+ tClass+_pane+_open ) + .attr("title", o.tips.Close); // may be blank + removeHover( 0, $T ); // remove hover classes + // toggler-content - if exists + $T.children(".content-closed").hide(); + $T.children(".content-open").css("display","block"); + } + + // sync any 'pin buttons' + syncPinBtns(pane, !s.isSliding); + + // update pane-state dimensions - BEFORE resizing content + $.extend(s, elDims($P)); + + if (state.initialized) { + // resize resizer & toggler sizes for all panes + sizeHandles(); + // resize content every time pane opens - to be sure + sizeContent(pane, true); // true = remeasure headers/footers, even if 'pane.isMoving' + } + + if (!skipCallback && (state.initialized || o.triggerEventsOnLoad) && $P.is(":visible")) { + // onopen callback + _runCallbacks("onopen_end", pane); + // onshow callback - TODO: should this be here? + if (s.isShowing) _runCallbacks("onshow_end", pane); + + // ALSO call onresize because layout-size *may* have changed while pane was closed + if (state.initialized) + _runCallbacks("onresize_end", pane); + } + + // TODO: Somehow sizePane("north") is being called after this point??? + } + + + /** + * slideOpen / slideClose / slideToggle + * + * Pass-though methods for sliding + */ +, slideOpen = function (evt_or_pane) { + if (!isInitialized()) return; + var evt = evtObj(evt_or_pane) + , pane = evtPane.call(this, evt_or_pane) + , s = state[pane] + , delay = options[pane].slideDelay_open + ; + // prevent event from triggering on NEW resizer binding created below + if (evt) evt.stopImmediatePropagation(); + + if (s.isClosed && evt && evt.type === "mouseenter" && delay > 0) + // trigger = mouseenter - use a delay + timer.set(pane+"_openSlider", open_NOW, delay); + else + open_NOW(); // will unbind events if is already open + + /** + * SUBROUTINE for timed open + */ + function open_NOW () { + if (!s.isClosed) // skip if no longer closed! + bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane + else if (!s.isMoving) + open(pane, true); // true = slide - open() will handle binding + }; + } + +, slideClose = function (evt_or_pane) { + if (!isInitialized()) return; + var evt = evtObj(evt_or_pane) + , pane = evtPane.call(this, evt_or_pane) + , o = options[pane] + , s = state[pane] + , delay = s.isMoving ? 1000 : 300 // MINIMUM delay - option may override + ; + if (s.isClosed || s.isResizing) + return; // skip if already closed OR in process of resizing + else if (o.slideTrigger_close === "click") + close_NOW(); // close immediately onClick + else if (o.preventQuickSlideClose && s.isMoving) + return; // handle Chrome quick-close on slide-open + else if (o.preventPrematureSlideClose && evt && $.layout.isMouseOverElem(evt, $Ps[pane])) + return; // handle incorrect mouseleave trigger, like when over a SELECT-list in IE + else if (evt) // trigger = mouseleave - use a delay + // 1 sec delay if 'opening', else .3 sec + timer.set(pane+"_closeSlider", close_NOW, max(o.slideDelay_close, delay)); + else // called programically + close_NOW(); + + /** + * SUBROUTINE for timed close + */ + function close_NOW () { + if (s.isClosed) // skip 'close' if already closed! + bindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here? + else if (!s.isMoving) + close(pane); // close will handle unbinding + }; + } + + /** + * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west + */ +, slideToggle = function (evt_or_pane) { + var pane = evtPane.call(this, evt_or_pane); + toggle(pane, true); + } + + + /** + * Must set left/top on East/South panes so animation will work properly + * + * @param {string} pane The pane to lock, 'east' or 'south' - any other is ignored! + * @param {boolean} doLock true = set left/top, false = remove + */ +, lockPaneForFX = function (pane, doLock) { + var $P = $Ps[pane] + , s = state[pane] + , o = options[pane] + , z = options.zIndexes + ; + if (doLock) { + showMasks( pane, { animation: true, objectsOnly: true }); + $P.css({ zIndex: z.pane_animate }); // overlay all elements during animation + if (pane=="south") + $P.css({ top: sC.inset.top + sC.innerHeight - $P.outerHeight() }); + else if (pane=="east") + $P.css({ left: sC.inset.left + sC.innerWidth - $P.outerWidth() }); + } + else { // animation DONE - RESET CSS + hideMasks(); + $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); + if (pane=="south") + $P.css({ top: "auto" }); + // if pane is positioned 'off-screen', then DO NOT screw with it! + else if (pane=="east" && !$P.css("left").match(/\-99999/)) + $P.css({ left: "auto" }); + // fix anti-aliasing in IE - only needed for animations that change opacity + if (browser.msie && o.fxOpacityFix && o.fxName_open != "slide" && $P.css("filter") && $P.css("opacity") == 1) + $P[0].style.removeAttribute('filter'); + } + } + + + /** + * Toggle sliding functionality of a specific pane on/off by adding removing 'slide open' trigger + * + * @see open(), close() + * @param {string} pane The pane to enable/disable, 'north', 'south', etc. + * @param {boolean} enable Enable or Disable sliding? + */ +, bindStartSlidingEvents = function (pane, enable) { + var o = options[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + , evtName = o.slideTrigger_open.toLowerCase() + ; + if (!$R || (enable && !o.slidable)) return; + + // make sure we have a valid event + if (evtName.match(/mouseover/)) + evtName = o.slideTrigger_open = "mouseenter"; + else if (!evtName.match(/(click|dblclick|mouseenter)/)) + evtName = o.slideTrigger_open = "click"; + + // must remove double-click-toggle when using dblclick-slide + if (o.resizerDblClickToggle && evtName.match(/click/)) { + $R[enable ? "unbind" : "bind"]('dblclick.'+ sID, toggle) + } + + $R + // add or remove event + [enable ? "bind" : "unbind"](evtName +'.'+ sID, slideOpen) + // set the appropriate cursor & title/tip + .css("cursor", enable ? o.sliderCursor : "default") + .attr("title", enable ? o.tips.Slide : "") + ; + } + + /** + * Add or remove 'mouseleave' events to 'slide close' when pane is 'sliding' open or closed + * Also increases zIndex when pane is sliding open + * See bindStartSlidingEvents for code to control 'slide open' + * + * @see slideOpen(), slideClose() + * @param {string} pane The pane to process, 'north', 'south', etc. + * @param {boolean} enable Enable or Disable events? + */ +, bindStopSlidingEvents = function (pane, enable) { + var o = options[pane] + , s = state[pane] + , c = _c[pane] + , z = options.zIndexes + , evtName = o.slideTrigger_close.toLowerCase() + , action = (enable ? "bind" : "unbind") + , $P = $Ps[pane] + , $R = $Rs[pane] + ; + timer.clear(pane+"_closeSlider"); // just in case + + if (enable) { + s.isSliding = true; + state.panesSliding[pane] = true; + // remove 'slideOpen' event from resizer + // ALSO will raise the zIndex of the pane & resizer + bindStartSlidingEvents(pane, false); + } + else { + s.isSliding = false; + delete state.panesSliding[pane]; + } + + // RE/SET zIndex - increases when pane is sliding-open, resets to normal when not + $P.css("zIndex", enable ? z.pane_sliding : z.pane_normal); + $R.css("zIndex", enable ? z.pane_sliding+2 : z.resizer_normal); // NOTE: mask = pane_sliding+1 + + // make sure we have a valid event + if (!evtName.match(/(click|mouseleave)/)) + evtName = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout' + + // add/remove slide triggers + $R[action](evtName, slideClose); // base event on resize + // need extra events for mouseleave + if (evtName === "mouseleave") { + // also close on pane.mouseleave + $P[action]("mouseleave."+ sID, slideClose); + // cancel timer when mouse moves between 'pane' and 'resizer' + $R[action]("mouseenter."+ sID, cancelMouseOut); + $P[action]("mouseenter."+ sID, cancelMouseOut); + } + + if (!enable) + timer.clear(pane+"_closeSlider"); + else if (evtName === "click" && !o.resizable) { + // IF pane is not resizable (which already has a cursor and tip) + // then set the a cursor & title/tip on resizer when sliding + $R.css("cursor", enable ? o.sliderCursor : "default"); + $R.attr("title", enable ? o.tips.Close : ""); // use Toggler-tip, eg: "Close Pane" + } + + // SUBROUTINE for mouseleave timer clearing + function cancelMouseOut (evt) { + timer.clear(pane+"_closeSlider"); + evt.stopPropagation(); + } + } + + + /** + * Hides/closes a pane if there is insufficient room - reverses this when there is room again + * MUST have already called setSizeLimits() before calling this method + * + * @param {string} pane The pane being resized + * @param {boolean=} [isOpening=false] Called from onOpen? + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [force=false] + */ +, makePaneFit = function (pane, isOpening, skipCallback, force) { + var + o = options[pane] + , s = state[pane] + , c = _c[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + , isSidePane = c.dir==="vert" + , hasRoom = false + ; + // special handling for center & east/west panes + if (pane === "center" || (isSidePane && s.noVerticalRoom)) { + // see if there is enough room to display the pane + // ERROR: hasRoom = s.minHeight <= s.maxHeight && (isSidePane || s.minWidth <= s.maxWidth); + hasRoom = (s.maxHeight >= 0); + if (hasRoom && s.noRoom) { // previously hidden due to noRoom, so show now + _showPane(pane); + if ($R) $R.show(); + s.isVisible = true; + s.noRoom = false; + if (isSidePane) s.noVerticalRoom = false; + _fixIframe(pane); + } + else if (!hasRoom && !s.noRoom) { // not currently hidden, so hide now + _hidePane(pane); + if ($R) $R.hide(); + s.isVisible = false; + s.noRoom = true; + } + } + + // see if there is enough room to fit the border-pane + if (pane === "center") { + // ignore center in this block + } + else if (s.minSize <= s.maxSize) { // pane CAN fit + hasRoom = true; + if (s.size > s.maxSize) // pane is too big - shrink it + sizePane(pane, s.maxSize, skipCallback, true, force); // true = noAnimation + else if (s.size < s.minSize) // pane is too small - enlarge it + sizePane(pane, s.minSize, skipCallback, true, force); // true = noAnimation + // need s.isVisible because new pseudoClose method keeps pane visible, but off-screen + else if ($R && s.isVisible && $P.is(":visible")) { + // make sure resizer-bar is positioned correctly + // handles situation where nested layout was 'hidden' when initialized + var pos = s.size + sC.inset[c.side]; + if ($.layout.cssNum( $R, c.side ) != pos) $R.css( c.side, pos ); + } + + // if was previously hidden due to noRoom, then RESET because NOW there is room + if (s.noRoom) { + // s.noRoom state will be set by open or show + if (s.wasOpen && o.closable) { + if (o.autoReopen) + open(pane, false, true, true); // true = noAnimation, true = noAlert + else // leave the pane closed, so just update state + s.noRoom = false; + } + else + show(pane, s.wasOpen, true, true); // true = noAnimation, true = noAlert + } + } + else { // !hasRoom - pane CANNOT fit + if (!s.noRoom) { // pane not set as noRoom yet, so hide or close it now... + s.noRoom = true; // update state + s.wasOpen = !s.isClosed && !s.isSliding; + if (s.isClosed){} // SKIP + else if (o.closable) // 'close' if possible + close(pane, true, true); // true = force, true = noAnimation + else // 'hide' pane if cannot just be closed + hide(pane, true); // true = noAnimation + } + } + } + + + /** + * sizePane / manualSizePane + * sizePane is called only by internal methods whenever a pane needs to be resized + * manualSizePane is an exposed flow-through method allowing extra code when pane is 'manually resized' + * + * @param {(string|Object)} evt_or_pane The pane being resized + * @param {number} size The *desired* new size for this pane - will be validated + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [force=false] Force resizing even if does not seem necessary + */ +, manualSizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , o = options[pane] + , s = state[pane] + // if resizing callbacks have been delayed and resizing is now DONE, force resizing to complete... + , forceResize = force || (o.livePaneResizing && !s.isResizing) + ; + // ANY call to manualSizePane disables autoResize - ie, percentage sizing + s.autoResize = false; + // flow-through... + sizePane(pane, size, skipCallback, noAnimation, forceResize); // will animate resize if option enabled + } + + /** + * @param {(string|Object)} evt_or_pane The pane being resized + * @param {number} size The *desired* new size for this pane - will be validated + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [noAnimation=false] + * @param {boolean=} [force=false] Force resizing even if does not seem necessary + */ +, sizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) // probably NEVER called from event? + , o = options[pane] + , s = state[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + , side = _c[pane].side + , dimName = _c[pane].sizeType.toLowerCase() + , skipResizeWhileDragging = s.isResizing && !o.triggerEventsDuringLiveResize + , doFX = noAnimation !== true && o.animatePaneSizing + , oldSize, newSize + ; + // QUEUE in case another action/animation is in progress + $N.queue(function( queueNext ){ + // calculate 'current' min/max sizes + setSizeLimits(pane); // update pane-state + oldSize = s.size; + size = _parseSize(pane, size); // handle percentages & auto + size = max(size, _parseSize(pane, o.minSize)); + size = min(size, s.maxSize); + if (size < s.minSize) { // not enough room for pane! + queueNext(); // call before makePaneFit() because it needs the queue free + makePaneFit(pane, false, skipCallback); // will hide or close pane + return; + } + + // IF newSize is same as oldSize, then nothing to do - abort + if (!force && size === oldSize) + return queueNext(); + + s.newSize = size; + + // onresize_start callback CANNOT cancel resizing because this would break the layout! + if (!skipCallback && state.initialized && s.isVisible) + _runCallbacks("onresize_start", pane); + + // resize the pane, and make sure its visible + newSize = cssSize(pane, size); + + if (doFX && $P.is(":visible")) { // ANIMATE + var fx = $.layout.effects.size[pane] || $.layout.effects.size.all + , easing = o.fxSettings_size.easing || fx.easing + , z = options.zIndexes + , props = {}; + props[ dimName ] = newSize +'px'; + s.isMoving = true; + // overlay all elements during animation + $P.css({ zIndex: z.pane_animate }) + .show().animate( props, o.fxSpeed_size, easing, function(){ + // reset zIndex after animation + $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); + s.isMoving = false; + delete s.newSize; + sizePane_2(); // continue + queueNext(); + }); + } + else { // no animation + $P.css( dimName, newSize ); // resize pane + delete s.newSize; + // if pane is visible, then + if ($P.is(":visible")) + sizePane_2(); // continue + else { + // pane is NOT VISIBLE, so just update state data... + // when pane is *next opened*, it will have the new size + s.size = size; // update state.size + $.extend(s, elDims($P)); // update state dimensions + } + queueNext(); + }; + + }); + + // SUBROUTINE + function sizePane_2 () { + /* Panes are sometimes not sized precisely in some browsers!? + * This code will resize the pane up to 3 times to nudge the pane to the correct size + */ + var actual = dimName==='width' ? $P.outerWidth() : $P.outerHeight() + , tries = [{ + pane: pane + , count: 1 + , target: size + , actual: actual + , correct: (size === actual) + , attempt: size + , cssSize: newSize + }] + , lastTry = tries[0] + , thisTry = {} + , msg = 'Inaccurate size after resizing the '+ pane +'-pane.' + ; + while ( !lastTry.correct ) { + thisTry = { pane: pane, count: lastTry.count+1, target: size }; + + if (lastTry.actual > size) + thisTry.attempt = max(0, lastTry.attempt - (lastTry.actual - size)); + else // lastTry.actual < size + thisTry.attempt = max(0, lastTry.attempt + (size - lastTry.actual)); + + thisTry.cssSize = cssSize(pane, thisTry.attempt); + $P.css( dimName, thisTry.cssSize ); + + thisTry.actual = dimName=='width' ? $P.outerWidth() : $P.outerHeight(); + thisTry.correct = (size === thisTry.actual); + + // log attempts and alert the user of this *non-fatal error* (if showDebugMessages) + if ( tries.length === 1) { + _log(msg, false, true); + _log(lastTry, false, true); + } + _log(thisTry, false, true); + // after 4 tries, is as close as its gonna get! + if (tries.length > 3) break; + + tries.push( thisTry ); + lastTry = tries[ tries.length - 1 ]; + } + // END TESTING CODE + + // update pane-state dimensions + s.size = size; + $.extend(s, elDims($P)); + + if (s.isVisible && $P.is(":visible")) { + // reposition the resizer-bar + if ($R) $R.css( side, size + sC.inset[side] ); + // resize the content-div + sizeContent(pane); + } + + if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible) + _runCallbacks("onresize_end", pane); + + // resize all the adjacent panes, and adjust their toggler buttons + // when skipCallback passed, it means the controlling method will handle 'other panes' + if (!skipCallback) { + // also no callback if live-resize is in progress and NOT triggerEventsDuringLiveResize + if (!s.isSliding) sizeMidPanes(_c[pane].dir=="horz" ? "" : "center", skipResizeWhileDragging, force); + sizeHandles(); + } + + // if opposite-pane was autoClosed, see if it can be autoOpened now + var altPane = _c.oppositeEdge[pane]; + if (size < oldSize && state[ altPane ].noRoom) { + setSizeLimits( altPane ); + makePaneFit( altPane, false, skipCallback ); + } + + // DEBUG - ALERT user/developer so they know there was a sizing problem + if (tries.length > 1) + _log(msg +'\nSee the Error Console for details.', true, true); + } + } + + /** + * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide() + * @param {(Array.|string)} panes The pane(s) being resized, comma-delmited string + * @param {boolean=} [skipCallback=false] Should the onresize callback be run? + * @param {boolean=} [force=false] + */ +, sizeMidPanes = function (panes, skipCallback, force) { + panes = (panes ? panes : "east,west,center").split(","); + + $.each(panes, function (i, pane) { + if (!$Ps[pane]) return; // NO PANE - skip + var + o = options[pane] + , s = state[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + , isCenter= (pane=="center") + , hasRoom = true + , CSS = {} + // if pane is not visible, show it invisibly NOW rather than for *each call* in this script + , visCSS = $.layout.showInvisibly($P) + + , newCenter = calcNewCenterPaneDims() + ; + + // update pane-state dimensions + $.extend(s, elDims($P)); + + if (pane === "center") { + if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) { + $P.css(visCSS); + return true; // SKIP - pane already the correct size + } + // set state for makePaneFit() logic + $.extend(s, cssMinDims(pane), { + maxWidth: newCenter.width + , maxHeight: newCenter.height + }); + CSS = newCenter; + s.newWidth = CSS.width; + s.newHeight = CSS.height; + // convert OUTER width/height to CSS width/height + CSS.width = cssW($P, CSS.width); + // NEW - allow pane to extend 'below' visible area rather than hide it + CSS.height = cssH($P, CSS.height); + hasRoom = CSS.width >= 0 && CSS.height >= 0; // height >= 0 = ALWAYS TRUE NOW + + // during layout init, try to shrink east/west panes to make room for center + if (!state.initialized && o.minWidth > newCenter.width) { + var + reqPx = o.minWidth - s.outerWidth + , minE = options.east.minSize || 0 + , minW = options.west.minSize || 0 + , sizeE = state.east.size + , sizeW = state.west.size + , newE = sizeE + , newW = sizeW + ; + if (reqPx > 0 && state.east.isVisible && sizeE > minE) { + newE = max( sizeE-minE, sizeE-reqPx ); + reqPx -= sizeE-newE; + } + if (reqPx > 0 && state.west.isVisible && sizeW > minW) { + newW = max( sizeW-minW, sizeW-reqPx ); + reqPx -= sizeW-newW; + } + // IF we found enough extra space, then resize the border panes as calculated + if (reqPx === 0) { + if (sizeE && sizeE != minE) + sizePane('east', newE, true, true, force); // true = skipCallback/noAnimation - initPanes will handle when done + if (sizeW && sizeW != minW) + sizePane('west', newW, true, true, force); // true = skipCallback/noAnimation + // now start over! + sizeMidPanes('center', skipCallback, force); + $P.css(visCSS); + return; // abort this loop + } + } + } + else { // for east and west, set only the height, which is same as center height + // set state.min/maxWidth/Height for makePaneFit() logic + if (s.isVisible && !s.noVerticalRoom) + $.extend(s, elDims($P), cssMinDims(pane)) + if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) { + $P.css(visCSS); + return true; // SKIP - pane already the correct size + } + // east/west have same top, bottom & height as center + CSS.top = newCenter.top; + CSS.bottom = newCenter.bottom; + s.newSize = newCenter.height + // NEW - allow pane to extend 'below' visible area rather than hide it + CSS.height = cssH($P, newCenter.height); + s.maxHeight = CSS.height; + hasRoom = (s.maxHeight >= 0); // ALWAYS TRUE NOW + if (!hasRoom) s.noVerticalRoom = true; // makePaneFit() logic + } + + if (hasRoom) { + // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized + if (!skipCallback && state.initialized) + _runCallbacks("onresize_start", pane); + + $P.css(CSS); // apply the CSS to pane + if (pane !== "center") + sizeHandles(pane); // also update resizer length + if (s.noRoom && !s.isClosed && !s.isHidden) + makePaneFit(pane); // will re-open/show auto-closed/hidden pane + if (s.isVisible) { + $.extend(s, elDims($P)); // update pane dimensions + if (state.initialized) sizeContent(pane); // also resize the contents, if exists + } + } + else if (!s.noRoom && s.isVisible) // no room for pane + makePaneFit(pane); // will hide or close pane + + // reset visibility, if necessary + $P.css(visCSS); + + delete s.newSize; + delete s.newWidth; + delete s.newHeight; + + if (!s.isVisible) + return true; // DONE - next pane + + /* + * Extra CSS for IE6 or IE7 in Quirks-mode - add 'width' to NORTH/SOUTH panes + * Normally these panes have only 'left' & 'right' positions so pane auto-sizes + * ALSO required when pane is an IFRAME because will NOT default to 'full width' + * TODO: Can I use width:100% for a north/south iframe? + * TODO: Sounds like a job for $P.outerWidth( sC.innerWidth ) SETTER METHOD + */ + if (pane === "center") { // finished processing midPanes + var fix = browser.isIE6 || !browser.boxModel; + if ($Ps.north && (fix || state.north.tagName=="IFRAME")) + $Ps.north.css("width", cssW($Ps.north, sC.innerWidth)); + if ($Ps.south && (fix || state.south.tagName=="IFRAME")) + $Ps.south.css("width", cssW($Ps.south, sC.innerWidth)); + } + + // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized + if (!skipCallback && state.initialized) + _runCallbacks("onresize_end", pane); + }); + } + + + /** + * @see window.onresize(), callbacks or custom code + * @param {(Object|boolean)=} evt_or_refresh If 'true', then also reset pane-positioning + */ +, resizeAll = function (evt_or_refresh) { + var oldW = sC.innerWidth + , oldH = sC.innerHeight + ; + // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility + evtPane(evt_or_refresh); + + // cannot size layout when 'container' is hidden or collapsed + if (!$N.is(":visible")) return; + + if (!state.initialized) { + _initLayoutElements(); + return; // no need to resize since we just initialized! + } + + if (evt_or_refresh === true && $.isPlainObject(options.outset)) { + // update container CSS in case outset option has changed + $N.css( options.outset ); + } + // UPDATE container dimensions + $.extend(sC, elDims( $N, options.inset )); + if (!sC.outerHeight) return; + + // if 'true' passed, refresh pane & handle positioning too + if (evt_or_refresh === true) { + setPanePosition(); + } + + // onresizeall_start will CANCEL resizing if returns false + // state.container has already been set, so user can access this info for calcuations + if (false === _runCallbacks("onresizeall_start")) return false; + + var // see if container is now 'smaller' than before + shrunkH = (sC.innerHeight < oldH) + , shrunkW = (sC.innerWidth < oldW) + , $P, o, s + ; + // NOTE special order for sizing: S-N-E-W + $.each(["south","north","east","west"], function (i, pane) { + if (!$Ps[pane]) return; // no pane - SKIP + o = options[pane]; + s = state[pane]; + if (s.autoResize && s.size != o.size) // resize pane to original size set in options + sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize + else { + setSizeLimits(pane); + makePaneFit(pane, false, true, true); // true=skipCallback/forceResize + } + }); + + sizeMidPanes("", true, true); // true=skipCallback/forceResize + sizeHandles(); // reposition the toggler elements + + // trigger all individual pane callbacks AFTER layout has finished resizing + $.each(_c.allPanes, function (i, pane) { + $P = $Ps[pane]; + if (!$P) return; // SKIP + if (state[pane].isVisible) // undefined for non-existent panes + _runCallbacks("onresize_end", pane); // callback - if exists + }); + + _runCallbacks("onresizeall_end"); + //_triggerLayoutEvent(pane, 'resizeall'); + } + + /** + * Whenever a pane resizes or opens that has a nested layout, trigger resizeAll + * + * @param {(string|Object)} evt_or_pane The pane just resized or opened + */ +, resizeChildren = function (evt_or_pane, skipRefresh) { + var pane = evtPane.call(this, evt_or_pane); + + if (!options[pane].resizeChildren) return; + + // ensure the pane-children are up-to-date + if (!skipRefresh) refreshChildren( pane ); + var pC = children[pane]; + if ($.isPlainObject( pC )) { + // resize one or more children + $.each( pC, function (key, child) { + child.resizeAll(); + }); + } + } + + /** + * IF pane has a content-div, then resize all elements inside pane to fit pane-height + * + * @param {(string|Object)} evt_or_panes The pane(s) being resized + * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured? + */ +, sizeContent = function (evt_or_panes, remeasure) { + if (!isInitialized()) return; + + var panes = evtPane.call(this, evt_or_panes); + panes = panes ? panes.split(",") : _c.allPanes; + + $.each(panes, function (idx, pane) { + var + $P = $Ps[pane] + , $C = $Cs[pane] + , o = options[pane] + , s = state[pane] + , m = s.content // m = measurements + ; + if (!$P || !$C || !$P.is(":visible")) return true; // NOT VISIBLE - skip + + // if content-element was REMOVED, update OR remove the pointer + if (!$C.length) { + initContent(pane, false); // false = do NOT sizeContent() - already there! + if (!$C) return; // no replacement element found - pointer have been removed + } + + // onsizecontent_start will CANCEL resizing if returns false + if (false === _runCallbacks("onsizecontent_start", pane)) return; + + // skip re-measuring offsets if live-resizing + if ((!s.isMoving && !s.isResizing) || o.liveContentResizing || remeasure || m.top == undefined) { + _measure(); + // if any footers are below pane-bottom, they may not measure correctly, + // so allow pane overflow and re-measure + if (m.hiddenFooters > 0 && $P.css("overflow") === "hidden") { + $P.css("overflow", "visible"); + _measure(); // remeasure while overflowing + $P.css("overflow", "hidden"); + } + } + // NOTE: spaceAbove/Below *includes* the pane paddingTop/Bottom, but not pane.borders + var newH = s.innerHeight - (m.spaceAbove - s.css.paddingTop) - (m.spaceBelow - s.css.paddingBottom); + + if (!$C.is(":visible") || m.height != newH) { + // size the Content element to fit new pane-size - will autoHide if not enough room + setOuterHeight($C, newH, true); // true=autoHide + m.height = newH; // save new height + }; + + if (state.initialized) + _runCallbacks("onsizecontent_end", pane); + + function _below ($E) { + return max(s.css.paddingBottom, (parseInt($E.css("marginBottom"), 10) || 0)); + }; + + function _measure () { + var + ignore = options[pane].contentIgnoreSelector + , $Fs = $C.nextAll().not(".ui-layout-mask").not(ignore || ":lt(0)") // not :lt(0) = ALL + , $Fs_vis = $Fs.filter(':visible') + , $F = $Fs_vis.filter(':last') + ; + m = { + top: $C[0].offsetTop + , height: $C.outerHeight() + , numFooters: $Fs.length + , hiddenFooters: $Fs.length - $Fs_vis.length + , spaceBelow: 0 // correct if no content footer ($E) + } + m.spaceAbove = m.top; // just for state - not used in calc + m.bottom = m.top + m.height; + if ($F.length) + //spaceBelow = (LastFooter.top + LastFooter.height) [footerBottom] - Content.bottom + max(LastFooter.marginBottom, pane.paddingBotom) + m.spaceBelow = ($F[0].offsetTop + $F.outerHeight()) - m.bottom + _below($F); + else // no footer - check marginBottom on Content element itself + m.spaceBelow = _below($C); + }; + }); + } + + + /** + * Called every time a pane is opened, closed, or resized to slide the togglers to 'center' and adjust their length if necessary + * + * @see initHandles(), open(), close(), resizeAll() + * @param {(string|Object)=} evt_or_panes The pane(s) being resized + */ +, sizeHandles = function (evt_or_panes) { + var panes = evtPane.call(this, evt_or_panes) + panes = panes ? panes.split(",") : _c.borderPanes; + + $.each(panes, function (i, pane) { + var + o = options[pane] + , s = state[pane] + , $P = $Ps[pane] + , $R = $Rs[pane] + , $T = $Ts[pane] + , $TC + ; + if (!$P || !$R) return; + + var + dir = _c[pane].dir + , _state = (s.isClosed ? "_closed" : "_open") + , spacing = o["spacing"+ _state] + , togAlign = o["togglerAlign"+ _state] + , togLen = o["togglerLength"+ _state] + , paneLen + , left + , offset + , CSS = {} + ; + + if (spacing === 0) { + $R.hide(); + return; + } + else if (!s.noRoom && !s.isHidden) // skip if resizer was hidden for any reason + $R.show(); // in case was previously hidden + + // Resizer Bar is ALWAYS same width/height of pane it is attached to + if (dir === "horz") { // north/south + //paneLen = $P.outerWidth(); // s.outerWidth || + paneLen = sC.innerWidth; // handle offscreen-panes + s.resizerLength = paneLen; + left = $.layout.cssNum($P, "left") + $R.css({ + width: cssW($R, paneLen) // account for borders & padding + , height: cssH($R, spacing) // ditto + , left: left > -9999 ? left : sC.inset.left // handle offscreen-panes + }); + } + else { // east/west + paneLen = $P.outerHeight(); // s.outerHeight || + s.resizerLength = paneLen; + $R.css({ + height: cssH($R, paneLen) // account for borders & padding + , width: cssW($R, spacing) // ditto + , top: sC.inset.top + getPaneSize("north", true) // TODO: what if no North pane? + //, top: $.layout.cssNum($Ps["center"], "top") + }); + } + + // remove hover classes + removeHover( o, $R ); + + if ($T) { + if (togLen === 0 || (s.isSliding && o.hideTogglerOnSlide)) { + $T.hide(); // always HIDE the toggler when 'sliding' + return; + } + else + $T.show(); // in case was previously hidden + + if (!(togLen > 0) || togLen === "100%" || togLen > paneLen) { + togLen = paneLen; + offset = 0; + } + else { // calculate 'offset' based on options.PANE.togglerAlign_open/closed + if (isStr(togAlign)) { + switch (togAlign) { + case "top": + case "left": offset = 0; + break; + case "bottom": + case "right": offset = paneLen - togLen; + break; + case "middle": + case "center": + default: offset = round((paneLen - togLen) / 2); // 'default' catches typos + } + } + else { // togAlign = number + var x = parseInt(togAlign, 10); // + if (togAlign >= 0) offset = x; + else offset = paneLen - togLen + x; // NOTE: x is negative! + } + } + + if (dir === "horz") { // north/south + var width = cssW($T, togLen); + $T.css({ + width: width // account for borders & padding + , height: cssH($T, spacing) // ditto + , left: offset // TODO: VERIFY that toggler positions correctly for ALL values + , top: 0 + }); + // CENTER the toggler content SPAN + $T.children(".content").each(function(){ + $TC = $(this); + $TC.css("marginLeft", round((width-$TC.outerWidth())/2)); // could be negative + }); + } + else { // east/west + var height = cssH($T, togLen); + $T.css({ + height: height // account for borders & padding + , width: cssW($T, spacing) // ditto + , top: offset // POSITION the toggler + , left: 0 + }); + // CENTER the toggler content SPAN + $T.children(".content").each(function(){ + $TC = $(this); + $TC.css("marginTop", round((height-$TC.outerHeight())/2)); // could be negative + }); + } + + // remove ALL hover classes + removeHover( 0, $T ); + } + + // DONE measuring and sizing this resizer/toggler, so can be 'hidden' now + if (!state.initialized && (o.initHidden || s.noRoom)) { + $R.hide(); + if ($T) $T.hide(); + } + }); + } + + + /** + * @param {(string|Object)} evt_or_pane + */ +, enableClosable = function (evt_or_pane) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $T = $Ts[pane] + , o = options[pane] + ; + if (!$T) return; + o.closable = true; + $T .bind("click."+ sID, function(evt){ evt.stopPropagation(); toggle(pane); }) + .css("visibility", "visible") + .css("cursor", "pointer") + .attr("title", state[pane].isClosed ? o.tips.Open : o.tips.Close) // may be blank + .show(); + } + /** + * @param {(string|Object)} evt_or_pane + * @param {boolean=} [hide=false] + */ +, disableClosable = function (evt_or_pane, hide) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $T = $Ts[pane] + ; + if (!$T) return; + options[pane].closable = false; + // is closable is disable, then pane MUST be open! + if (state[pane].isClosed) open(pane, false, true); + $T .unbind("."+ sID) + .css("visibility", hide ? "hidden" : "visible") // instead of hide(), which creates logic issues + .css("cursor", "default") + .attr("title", ""); + } + + + /** + * @param {(string|Object)} evt_or_pane + */ +, enableSlidable = function (evt_or_pane) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + ; + if (!$R || !$R.data('draggable')) return; + options[pane].slidable = true; + if (state[pane].isClosed) + bindStartSlidingEvents(pane, true); + } + /** + * @param {(string|Object)} evt_or_pane + */ +, disableSlidable = function (evt_or_pane) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + ; + if (!$R) return; + options[pane].slidable = false; + if (state[pane].isSliding) + close(pane, false, true); + else { + bindStartSlidingEvents(pane, false); + $R .css("cursor", "default") + .attr("title", ""); + removeHover(null, $R[0]); // in case currently hovered + } + } + + + /** + * @param {(string|Object)} evt_or_pane + */ +, enableResizable = function (evt_or_pane) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + , o = options[pane] + ; + if (!$R || !$R.data('draggable')) return; + o.resizable = true; + $R.draggable("enable"); + if (!state[pane].isClosed) + $R .css("cursor", o.resizerCursor) + .attr("title", o.tips.Resize); + } + /** + * @param {(string|Object)} evt_or_pane + */ +, disableResizable = function (evt_or_pane) { + if (!isInitialized()) return; + var pane = evtPane.call(this, evt_or_pane) + , $R = $Rs[pane] + ; + if (!$R || !$R.data('draggable')) return; + options[pane].resizable = false; + $R .draggable("disable") + .css("cursor", "default") + .attr("title", ""); + removeHover(null, $R[0]); // in case currently hovered + } + + + /** + * Move a pane from source-side (eg, west) to target-side (eg, east) + * If pane exists on target-side, move that to source-side, ie, 'swap' the panes + * + * @param {(string|Object)} evt_or_pane1 The pane/edge being swapped + * @param {string} pane2 ditto + */ +, swapPanes = function (evt_or_pane1, pane2) { + if (!isInitialized()) return; + var pane1 = evtPane.call(this, evt_or_pane1); + // change state.edge NOW so callbacks can know where pane is headed... + state[pane1].edge = pane2; + state[pane2].edge = pane1; + // run these even if NOT state.initialized + if (false === _runCallbacks("onswap_start", pane1) + || false === _runCallbacks("onswap_start", pane2) + ) { + state[pane1].edge = pane1; // reset + state[pane2].edge = pane2; + return; + } + + var + oPane1 = copy( pane1 ) + , oPane2 = copy( pane2 ) + , sizes = {} + ; + sizes[pane1] = oPane1 ? oPane1.state.size : 0; + sizes[pane2] = oPane2 ? oPane2.state.size : 0; + + // clear pointers & state + $Ps[pane1] = false; + $Ps[pane2] = false; + state[pane1] = {}; + state[pane2] = {}; + + // ALWAYS remove the resizer & toggler elements + if ($Ts[pane1]) $Ts[pane1].remove(); + if ($Ts[pane2]) $Ts[pane2].remove(); + if ($Rs[pane1]) $Rs[pane1].remove(); + if ($Rs[pane2]) $Rs[pane2].remove(); + $Rs[pane1] = $Rs[pane2] = $Ts[pane1] = $Ts[pane2] = false; + + // transfer element pointers and data to NEW Layout keys + move( oPane1, pane2 ); + move( oPane2, pane1 ); + + // cleanup objects + oPane1 = oPane2 = sizes = null; + + // make panes 'visible' again + if ($Ps[pane1]) $Ps[pane1].css(_c.visible); + if ($Ps[pane2]) $Ps[pane2].css(_c.visible); + + // fix any size discrepancies caused by swap + resizeAll(); + + // run these even if NOT state.initialized + _runCallbacks("onswap_end", pane1); + _runCallbacks("onswap_end", pane2); + + return; + + function copy (n) { // n = pane + var + $P = $Ps[n] + , $C = $Cs[n] + ; + return !$P ? false : { + pane: n + , P: $P ? $P[0] : false + , C: $C ? $C[0] : false + , state: $.extend(true, {}, state[n]) + , options: $.extend(true, {}, options[n]) + } + }; + + function move (oPane, pane) { + if (!oPane) return; + var + P = oPane.P + , C = oPane.C + , oldPane = oPane.pane + , c = _c[pane] + // save pane-options that should be retained + , s = $.extend(true, {}, state[pane]) + , o = options[pane] + // RETAIN side-specific FX Settings - more below + , fx = { resizerCursor: o.resizerCursor } + , re, size, pos + ; + $.each("fxName,fxSpeed,fxSettings".split(","), function (i, k) { + fx[k +"_open"] = o[k +"_open"]; + fx[k +"_close"] = o[k +"_close"]; + fx[k +"_size"] = o[k +"_size"]; + }); + + // update object pointers and attributes + $Ps[pane] = $(P) + .data({ + layoutPane: Instance[pane] // NEW pointer to pane-alias-object + , layoutEdge: pane + }) + .css(_c.hidden) + .css(c.cssReq) + ; + $Cs[pane] = C ? $(C) : false; + + // set options and state + options[pane] = $.extend(true, {}, oPane.options, fx); + state[pane] = $.extend(true, {}, oPane.state); + + // change classNames on the pane, eg: ui-layout-pane-east ==> ui-layout-pane-west + re = new RegExp(o.paneClass +"-"+ oldPane, "g"); + P.className = P.className.replace(re, o.paneClass +"-"+ pane); + + // ALWAYS regenerate the resizer & toggler elements + initHandles(pane); // create the required resizer & toggler + + // if moving to different orientation, then keep 'target' pane size + if (c.dir != _c[oldPane].dir) { + size = sizes[pane] || 0; + setSizeLimits(pane); // update pane-state + size = max(size, state[pane].minSize); + // use manualSizePane to disable autoResize - not useful after panes are swapped + manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation + } + else // move the resizer here + $Rs[pane].css(c.side, sC.inset[c.side] + (state[pane].isVisible ? getPaneSize(pane) : 0)); + + + // ADD CLASSNAMES & SLIDE-BINDINGS + if (oPane.state.isVisible && !s.isVisible) + setAsOpen(pane, true); // true = skipCallback + else { + setAsClosed(pane); + bindStartSlidingEvents(pane, true); // will enable events IF option is set + } + + // DESTROY the object + oPane = null; + }; + } + + + /** + * INTERNAL method to sync pin-buttons when pane is opened or closed + * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes + * + * @see open(), setAsOpen(), setAsClosed() + * @param {string} pane These are the params returned to callbacks by layout() + * @param {boolean} doPin True means set the pin 'down', False means 'up' + */ +, syncPinBtns = function (pane, doPin) { + if ($.layout.plugins.buttons) + $.each(state[pane].pins, function (i, selector) { + $.layout.buttons.setPinState(Instance, $(selector), pane, doPin); + }); + } + +; // END var DECLARATIONS + + /** + * Capture keys when enableCursorHotkey - toggle pane if hotkey pressed + * + * @see document.keydown() + */ + function keyDown (evt) { + if (!evt) return true; + var code = evt.keyCode; + if (code < 33) return true; // ignore special keys: ENTER, TAB, etc + + var + PANE = { + 38: "north" // Up Cursor - $.ui.keyCode.UP + , 40: "south" // Down Cursor - $.ui.keyCode.DOWN + , 37: "west" // Left Cursor - $.ui.keyCode.LEFT + , 39: "east" // Right Cursor - $.ui.keyCode.RIGHT + } + , ALT = evt.altKey // no worky! + , SHIFT = evt.shiftKey + , CTRL = evt.ctrlKey + , CURSOR = (CTRL && code >= 37 && code <= 40) + , o, k, m, pane + ; + + if (CURSOR && options[PANE[code]].enableCursorHotkey) // valid cursor-hotkey + pane = PANE[code]; + else if (CTRL || SHIFT) // check to see if this matches a custom-hotkey + $.each(_c.borderPanes, function (i, p) { // loop each pane to check its hotkey + o = options[p]; + k = o.customHotkey; + m = o.customHotkeyModifier; // if missing or invalid, treated as "CTRL+SHIFT" + if ((SHIFT && m=="SHIFT") || (CTRL && m=="CTRL") || (CTRL && SHIFT)) { // Modifier matches + if (k && code === (isNaN(k) || k <= 9 ? k.toUpperCase().charCodeAt(0) : k)) { // Key matches + pane = p; + return false; // BREAK + } + } + }); + + // validate pane + if (!pane || !$Ps[pane] || !options[pane].closable || state[pane].isHidden) + return true; + + toggle(pane); + + evt.stopPropagation(); + evt.returnValue = false; // CANCEL key + return false; + }; + + +/* + * ###################################### + * UTILITY METHODS + * called externally or by initButtons + * ###################################### + */ + + /** + * Change/reset a pane overflow setting & zIndex to allow popups/drop-downs to work + * + * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event + */ + function allowOverflow (el) { + if (!isInitialized()) return; + if (this && this.tagName) el = this; // BOUND to element + var $P; + if (isStr(el)) + $P = $Ps[el]; + else if ($(el).data("layoutRole")) + $P = $(el); + else + $(el).parents().each(function(){ + if ($(this).data("layoutRole")) { + $P = $(this); + return false; // BREAK + } + }); + if (!$P || !$P.length) return; // INVALID + + var + pane = $P.data("layoutEdge") + , s = state[pane] + ; + + // if pane is already raised, then reset it before doing it again! + // this would happen if allowOverflow is attached to BOTH the pane and an element + if (s.cssSaved) + resetOverflow(pane); // reset previous CSS before continuing + + // if pane is raised by sliding or resizing, or its closed, then abort + if (s.isSliding || s.isResizing || s.isClosed) { + s.cssSaved = false; + return; + } + + var + newCSS = { zIndex: (options.zIndexes.resizer_normal + 1) } + , curCSS = {} + , of = $P.css("overflow") + , ofX = $P.css("overflowX") + , ofY = $P.css("overflowY") + ; + // determine which, if any, overflow settings need to be changed + if (of != "visible") { + curCSS.overflow = of; + newCSS.overflow = "visible"; + } + if (ofX && !ofX.match(/(visible|auto)/)) { + curCSS.overflowX = ofX; + newCSS.overflowX = "visible"; + } + if (ofY && !ofY.match(/(visible|auto)/)) { + curCSS.overflowY = ofX; + newCSS.overflowY = "visible"; + } + + // save the current overflow settings - even if blank! + s.cssSaved = curCSS; + + // apply new CSS to raise zIndex and, if necessary, make overflow 'visible' + $P.css( newCSS ); + + // make sure the zIndex of all other panes is normal + $.each(_c.allPanes, function(i, p) { + if (p != pane) resetOverflow(p); + }); + + }; + /** + * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event + */ + function resetOverflow (el) { + if (!isInitialized()) return; + if (this && this.tagName) el = this; // BOUND to element + var $P; + if (isStr(el)) + $P = $Ps[el]; + else if ($(el).data("layoutRole")) + $P = $(el); + else + $(el).parents().each(function(){ + if ($(this).data("layoutRole")) { + $P = $(this); + return false; // BREAK + } + }); + if (!$P || !$P.length) return; // INVALID + + var + pane = $P.data("layoutEdge") + , s = state[pane] + , CSS = s.cssSaved || {} + ; + // reset the zIndex + if (!s.isSliding && !s.isResizing) + $P.css("zIndex", options.zIndexes.pane_normal); + + // reset Overflow - if necessary + $P.css( CSS ); + + // clear var + s.cssSaved = false; + }; + +/* + * ##################### + * CREATE/RETURN LAYOUT + * ##################### + */ + + // validate that container exists + var $N = $(this).eq(0); // FIRST matching Container element + if (!$N.length) { + return _log( options.errors.containerMissing ); + }; + + // Users retrieve Instance of a layout with: $N.layout() OR $N.data("layout") + // return the Instance-pointer if layout has already been initialized + if ($N.data("layoutContainer") && $N.data("layout")) + return $N.data("layout"); // cached pointer + + // init global vars + var + $Ps = {} // Panes x5 - set in initPanes() + , $Cs = {} // Content x5 - set in initPanes() + , $Rs = {} // Resizers x4 - set in initHandles() + , $Ts = {} // Togglers x4 - set in initHandles() + , $Ms = $([]) // Masks - up to 2 masks per pane (IFRAME + DIV) + // aliases for code brevity + , sC = state.container // alias for easy access to 'container dimensions' + , sID = state.id // alias for unique layout ID/namespace - eg: "layout435" + ; + + // create Instance object to expose data & option Properties, and primary action Methods + var Instance = { + // layout data + options: options // property - options hash + , state: state // property - dimensions hash + // object pointers + , container: $N // property - object pointers for layout container + , panes: $Ps // property - object pointers for ALL Panes: panes.north, panes.center + , contents: $Cs // property - object pointers for ALL Content: contents.north, contents.center + , resizers: $Rs // property - object pointers for ALL Resizers, eg: resizers.north + , togglers: $Ts // property - object pointers for ALL Togglers, eg: togglers.north + // border-pane open/close + , hide: hide // method - ditto + , show: show // method - ditto + , toggle: toggle // method - pass a 'pane' ("north", "west", etc) + , open: open // method - ditto + , close: close // method - ditto + , slideOpen: slideOpen // method - ditto + , slideClose: slideClose // method - ditto + , slideToggle: slideToggle // method - ditto + // pane actions + , setSizeLimits: setSizeLimits // method - pass a 'pane' - update state min/max data + , _sizePane: sizePane // method -intended for user by plugins only! + , sizePane: manualSizePane // method - pass a 'pane' AND an 'outer-size' in pixels or percent, or 'auto' + , sizeContent: sizeContent // method - pass a 'pane' + , swapPanes: swapPanes // method - pass TWO 'panes' - will swap them + , showMasks: showMasks // method - pass a 'pane' OR list of panes - default = all panes with mask option set + , hideMasks: hideMasks // method - ditto' + // pane element methods + , initContent: initContent // method - ditto + , addPane: addPane // method - pass a 'pane' + , removePane: removePane // method - pass a 'pane' to remove from layout, add 'true' to delete the pane-elem + , createChildren: createChildren // method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].children + , refreshChildren: refreshChildren // method - pass a 'pane' and a layout-instance + // special pane option setting + , enableClosable: enableClosable // method - pass a 'pane' + , disableClosable: disableClosable // method - ditto + , enableSlidable: enableSlidable // method - ditto + , disableSlidable: disableSlidable // method - ditto + , enableResizable: enableResizable // method - ditto + , disableResizable: disableResizable// method - ditto + // utility methods for panes + , allowOverflow: allowOverflow // utility - pass calling element (this) + , resetOverflow: resetOverflow // utility - ditto + // layout control + , destroy: destroy // method - no parameters + , initPanes: isInitialized // method - no parameters + , resizeAll: resizeAll // method - no parameters + // callback triggering + , runCallbacks: _runCallbacks // method - pass evtName & pane (if a pane-event), eg: trigger("onopen", "west") + // alias collections of options, state and children - created in addPane and extended elsewhere + , hasParentLayout: false // set by initContainer() + , children: children // pointers to child-layouts, eg: Instance.children.west.layoutName + , north: false // alias group: { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], children: children[pane] } + , south: false // ditto + , west: false // ditto + , east: false // ditto + , center: false // ditto + }; + + // create the border layout NOW + if (_create() === 'cancel') // onload_start callback returned false to CANCEL layout creation + return null; + else // true OR false -- if layout-elements did NOT init (hidden or do not exist), can auto-init later + return Instance; // return the Instance object + +} + + +/* OLD versions of jQuery only set $.support.boxModel after page is loaded + * so if this is IE, use support.boxModel to test for quirks-mode (ONLY IE changes boxModel). + */ +$(function(){ + var b = $.layout.browser; + if (b.msie) b.boxModel = $.support.boxModel; +}); + + +})( jQuery ); +// END Layout - keep internal vars internal! + + + +// START Plugins - shared wrapper, no global vars +(function ($) { + + +/** + * jquery.layout.state 1.0 + * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ + * + * Copyright (c) 2012 + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * @requires: UI Layout 1.3.0.rc30.1 or higher + * @requires: $.ui.cookie (above) + * + * @see: http://groups.google.com/group/jquery-ui-layout + */ +/* + * State-management options stored in options.stateManagement, which includes a .cookie hash + * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden + * + * // STATE/COOKIE OPTIONS + * @example $(el).layout({ + stateManagement: { + enabled: true + , stateKeys: "east.size,west.size,east.isClosed,west.isClosed" + , cookie: { name: "appLayout", path: "/" } + } + }) + * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies + * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } }) + * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" }) + * + * // STATE/COOKIE METHODS + * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} ); + * @example myLayout.loadCookie(); + * @example myLayout.deleteCookie(); + * @example var JSON = myLayout.readState(); // CURRENT Layout State + * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie) + * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash) + * + * CUSTOM STATE-MANAGEMENT (eg, saved in a database) + * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" ); + * @example myLayout.loadState( JSON ); + */ + +/** + * UI COOKIE UTILITY + * + * A $.cookie OR $.ui.cookie namespace *should be standard*, but until then... + * This creates $.ui.cookie so Layout does not need the cookie.jquery.js plugin + * NOTE: This utility is REQUIRED by the layout.state plugin + * + * Cookie methods in Layout are created as part of State Management + */ +if (!$.ui) $.ui = {}; +$.ui.cookie = { + + // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6 + acceptsCookies: !!navigator.cookieEnabled + +, read: function (name) { + var + c = document.cookie + , cs = c ? c.split(';') : [] + , pair // loop var + ; + for (var i=0, n=cs.length; i < n; i++) { + pair = $.trim(cs[i]).split('='); // name=value pair + if (pair[0] == name) // found the layout cookie + return decodeURIComponent(pair[1]); + + } + return null; + } + +, write: function (name, val, cookieOpts) { + var + params = '' + , date = '' + , clear = false + , o = cookieOpts || {} + , x = o.expires + ; + if (x && x.toUTCString) + date = x; + else if (x === null || typeof x === 'number') { + date = new Date(); + if (x > 0) + date.setDate(date.getDate() + x); + else { + date.setFullYear(1970); + clear = true; + } + } + if (date) params += ';expires='+ date.toUTCString(); + if (o.path) params += ';path='+ o.path; + if (o.domain) params += ';domain='+ o.domain; + if (o.secure) params += ';secure'; + document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie + } + +, clear: function (name) { + $.ui.cookie.write(name, '', {expires: -1}); + } + +}; +// if cookie.jquery.js is not loaded, create an alias to replicate it +// this may be useful to other plugins or code dependent on that plugin +if (!$.cookie) $.cookie = function (k, v, o) { + var C = $.ui.cookie; + if (v === null) + C.clear(k); + else if (v === undefined) + return C.read(k); + else + C.write(k, v, o); +}; + + +// tell Layout that the state plugin is available +$.layout.plugins.stateManagement = true; + +// Add State-Management options to layout.defaults +$.layout.config.optionRootKeys.push("stateManagement"); +$.layout.defaults.stateManagement = { + enabled: false // true = enable state-management, even if not using cookies +, autoSave: true // Save a state-cookie when page exits? +, autoLoad: true // Load the state-cookie when Layout inits? +, animateLoad: true // animate panes when loading state into an active layout +, includeChildren: true // recurse into child layouts to include their state as well + // List state-data to save - must be pane-specific +, stateKeys: "north.size,south.size,east.size,west.size,"+ + "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+ + "north.isHidden,south.isHidden,east.isHidden,west.isHidden" +, cookie: { + name: "" // If not specified, will use Layout.name, else just "Layout" + , domain: "" // blank = current domain + , path: "" // blank = current page, '/' = entire website + , expires: "" // 'days' to keep cookie - leave blank for 'session cookie' + , secure: false + } +}; +// Set stateManagement as a layout-option, NOT a pane-option +$.layout.optionsMap.layout.push("stateManagement"); + +/* + * State Management methods + */ +$.layout.state = { + + /** + * Get the current layout state and save it to a cookie + * + * myLayout.saveCookie( keys, cookieOpts ) + * + * @param {Object} inst + * @param {(string|Array)=} keys + * @param {Object=} cookieOpts + */ + saveCookie: function (inst, keys, cookieOpts) { + var o = inst.options + , sm = o.stateManagement + , oC = $.extend(true, {}, sm.cookie, cookieOpts || null) + , data = inst.state.stateData = inst.readState( keys || sm.stateKeys ) // read current panes-state + ; + $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC ); + return $.extend(true, {}, data); // return COPY of state.stateData data + } + + /** + * Remove the state cookie + * + * @param {Object} inst + */ +, deleteCookie: function (inst) { + var o = inst.options; + $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" ); + } + + /** + * Read & return data from the cookie - as JSON + * + * @param {Object} inst + */ +, readCookie: function (inst) { + var o = inst.options; + var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" ); + // convert cookie string back to a hash and return it + return c ? $.layout.state.decodeJSON(c) : {}; + } + + /** + * Get data from the cookie and USE IT to loadState + * + * @param {Object} inst + */ +, loadCookie: function (inst) { + var c = $.layout.state.readCookie(inst); // READ the cookie + if (c) { + inst.state.stateData = $.extend(true, {}, c); // SET state.stateData + inst.loadState(c); // LOAD the retrieved state + } + return c; + } + + /** + * Update layout options from the cookie, if one exists + * + * @param {Object} inst + * @param {Object=} stateData + * @param {boolean=} animate + */ +, loadState: function (inst, data, opts) { + if (!$.isPlainObject( data ) || $.isEmptyObject( data )) return; + + // normalize data & cache in the state object + data = inst.state.stateData = $.layout.transformData( data ); // panes = default subkey + + // add missing/default state-restore options + var smo = inst.options.stateManagement; + opts = $.extend({ + animateLoad: false //smo.animateLoad + , includeChildren: smo.includeChildren + }, opts ); + + if (!inst.state.initialized) { + /* + * layout NOT initialized, so just update its options + */ + // MUST remove pane.children keys before applying to options + // use a copy so we don't remove keys from original data + var o = $.extend(true, {}, data); + //delete o.center; // center has no state-data - only children + $.each($.layout.config.allPanes, function (idx, pane) { + if (o[pane]) delete o[pane].children; + }); + // update CURRENT layout-options with saved state data + $.extend(true, inst.options, o); + } + else { + /* + * layout already initialized, so modify layout's configuration + */ + var noAnimate = !opts.animateLoad + , o, c, h, state, open + ; + $.each($.layout.config.borderPanes, function (idx, pane) { + o = data[ pane ]; + if (!$.isPlainObject( o )) return; // no key, skip pane + + s = o.size; + c = o.initClosed; + h = o.initHidden; + ar = o.autoResize + state = inst.state[pane]; + open = state.isVisible; + + // reset autoResize + if (ar) + state.autoResize = ar; + // resize BEFORE opening + if (!open) + inst._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize + // open/close as necessary - DO NOT CHANGE THIS ORDER! + if (h === true) inst.hide(pane, noAnimate); + else if (c === true) inst.close(pane, false, noAnimate); + else if (c === false) inst.open (pane, false, noAnimate); + else if (h === false) inst.show (pane, false, noAnimate); + // resize AFTER any other actions + if (open) + inst._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed + }); + + /* + * RECURSE INTO CHILD-LAYOUTS + */ + if (opts.includeChildren) { + var paneStateChildren, childState; + $.each(inst.children, function (pane, paneChildren) { + paneStateChildren = data[pane] ? data[pane].children : 0; + if (paneStateChildren && paneChildren) { + $.each(paneChildren, function (stateKey, child) { + childState = paneStateChildren[stateKey]; + if (child && childState) + child.loadState( childState ); + }); + } + }); + } + } + } + + /** + * Get the *current layout state* and return it as a hash + * + * @param {Object=} inst // Layout instance to get state for + * @param {object=} [opts] // State-Managements override options + */ +, readState: function (inst, opts) { + // backward compatility + if ($.type(opts) === 'string') opts = { keys: opts }; + if (!opts) opts = {}; + var sm = inst.options.stateManagement + , ic = opts.includeChildren + , recurse = ic !== undefined ? ic : sm.includeChildren + , keys = opts.stateKeys || sm.stateKeys + , alt = { isClosed: 'initClosed', isHidden: 'initHidden' } + , state = inst.state + , panes = $.layout.config.allPanes + , data = {} + , pair, pane, key, val + , ps, pC, child, array, count, branch + ; + if ($.isArray(keys)) keys = keys.join(","); + // convert keys to an array and change delimiters from '__' to '.' + keys = keys.replace(/__/g, ".").split(','); + // loop keys and create a data hash + for (var i=0, n=keys.length; i < n; i++) { + pair = keys[i].split("."); + pane = pair[0]; + key = pair[1]; + if ($.inArray(pane, panes) < 0) continue; // bad pane! + val = state[ pane ][ key ]; + if (val == undefined) continue; + if (key=="isClosed" && state[pane]["isSliding"]) + val = true; // if sliding, then *really* isClosed + ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val; + } + + // recurse into the child-layouts for each pane + if (recurse) { + $.each(panes, function (idx, pane) { + pC = inst.children[pane]; + ps = state.stateData[pane]; + if ($.isPlainObject( pC ) && !$.isEmptyObject( pC )) { + // ensure a key exists for this 'pane', eg: branch = data.center + branch = data[pane] || (data[pane] = {}); + if (!branch.children) branch.children = {}; + $.each( pC, function (key, child) { + // ONLY read state from an initialize layout + if ( child.state.initialized ) + branch.children[ key ] = $.layout.state.readState( child ); + // if we have PREVIOUS (onLoad) state for this child-layout, KEEP IT! + else if ( ps && ps.children && ps.children[ key ] ) { + branch.children[ key ] = $.extend(true, {}, ps.children[ key ] ); + } + }); + } + }); + } + + return data; + } + + /** + * Stringify a JSON hash so can save in a cookie or db-field + */ +, encodeJSON: function (JSON) { + return parse(JSON); + function parse (h) { + var D=[], i=0, k, v, t // k = key, v = value + , a = $.isArray(h) + ; + for (k in h) { + v = h[k]; + t = typeof v; + if (t == 'string') // STRING - add quotes + v = '"'+ v +'"'; + else if (t == 'object') // SUB-KEY - recurse into it + v = parse(v); + D[i++] = (!a ? '"'+ k +'":' : '') + v; + } + return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}'); + }; + } + + /** + * Convert stringified JSON back to a hash object + * @see $.parseJSON(), adding in jQuery 1.4.1 + */ +, decodeJSON: function (str) { + try { return $.parseJSON ? $.parseJSON(str) : window["eval"]("("+ str +")") || {}; } + catch (e) { return {}; } + } + + +, _create: function (inst) { + var _ = $.layout.state + , o = inst.options + , sm = o.stateManagement + ; + // ADD State-Management plugin methods to inst + $.extend( inst, { + // readCookie - update options from cookie - returns hash of cookie data + readCookie: function () { return _.readCookie(inst); } + // deleteCookie + , deleteCookie: function () { _.deleteCookie(inst); } + // saveCookie - optionally pass keys-list and cookie-options (hash) + , saveCookie: function (keys, cookieOpts) { return _.saveCookie(inst, keys, cookieOpts); } + // loadCookie - readCookie and use to loadState() - returns hash of cookie data + , loadCookie: function () { return _.loadCookie(inst); } + // loadState - pass a hash of state to use to update options + , loadState: function (stateData, opts) { _.loadState(inst, stateData, opts); } + // readState - returns hash of current layout-state + , readState: function (keys) { return _.readState(inst, keys); } + // add JSON utility methods too... + , encodeJSON: _.encodeJSON + , decodeJSON: _.decodeJSON + }); + + // init state.stateData key, even if plugin is initially disabled + inst.state.stateData = {}; + + // autoLoad MUST BE one of: data-array, data-hash, callback-function, or TRUE + if ( !sm.autoLoad ) return; + + // When state-data exists in the autoLoad key USE IT, + // even if stateManagement.enabled == false + if ($.isPlainObject( sm.autoLoad )) { + if (!$.isEmptyObject( sm.autoLoad )) { + inst.loadState( sm.autoLoad ); + } + } + else if ( sm.enabled ) { + // update the options from cookie or callback + // if options is a function, call it to get stateData + if ($.isFunction( sm.autoLoad )) { + var d = {}; + try { + d = sm.autoLoad( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn + } catch (e) {} + if (d && $.isPlainObject( d ) && !$.isEmptyObject( d )) + inst.loadState(d); + } + else // any other truthy value will trigger loadCookie + inst.loadCookie(); + } + } + +, _unload: function (inst) { + var sm = inst.options.stateManagement; + if (sm.enabled && sm.autoSave) { + // if options is a function, call it to save the stateData + if ($.isFunction( sm.autoSave )) { + try { + sm.autoSave( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn + } catch (e) {} + } + else // any truthy value will trigger saveCookie + inst.saveCookie(); + } + } + +}; + +// add state initialization method to Layout's onCreate array of functions +$.layout.onCreate.push( $.layout.state._create ); +$.layout.onUnload.push( $.layout.state._unload ); + + + + +/** + * jquery.layout.buttons 1.0 + * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ + * + * Copyright (c) 2012 + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * @requires: UI Layout 1.3.0.rc30.1 or higher + * + * @see: http://groups.google.com/group/jquery-ui-layout + * + * Docs: [ to come ] + * Tips: [ to come ] + */ + +// tell Layout that the state plugin is available +$.layout.plugins.buttons = true; + +// Add buttons options to layout.defaults +$.layout.defaults.autoBindCustomButtons = false; +// Specify autoBindCustomButtons as a layout-option, NOT a pane-option +$.layout.optionsMap.layout.push("autoBindCustomButtons"); + +/* + * Button methods + */ +$.layout.buttons = { + + /** + * Searches for .ui-layout-button-xxx elements and auto-binds them as layout-buttons + * + * @see _create() + * + * @param {Object} inst Layout Instance object + */ + init: function (inst) { + var pre = "ui-layout-button-" + , layout = inst.options.name || "" + , name; + $.each("toggle,open,close,pin,toggle-slide,open-slide".split(","), function (i, action) { + $.each($.layout.config.borderPanes, function (ii, pane) { + $("."+pre+action+"-"+pane).each(function(){ + // if button was previously 'bound', data.layoutName was set, but is blank if layout has no 'name' + name = $(this).data("layoutName") || $(this).attr("layoutName"); + if (name == undefined || name === layout) + inst.bindButton(this, action, pane); + }); + }); + }); + } + + /** + * Helper function to validate params received by addButton utilities + * + * Two classes are added to the element, based on the buttonClass... + * The type of button is appended to create the 2nd className: + * - ui-layout-button-pin // action btnClass + * - ui-layout-button-pin-west // action btnClass + pane + * - ui-layout-button-toggle + * - ui-layout-button-open + * - ui-layout-button-close + * + * @param {Object} inst Layout Instance object + * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" + * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. + * + * @return {Array.} If both params valid, the element matching 'selector' in a jQuery wrapper - otherwise returns null + */ +, get: function (inst, selector, pane, action) { + var $E = $(selector) + , o = inst.options + , err = o.errors.addButtonError + ; + if (!$E.length) { // element not found + $.layout.msg(err +" "+ o.errors.selector +": "+ selector, true); + } + else if ($.inArray(pane, $.layout.config.borderPanes) < 0) { // invalid 'pane' sepecified + $.layout.msg(err +" "+ o.errors.pane +": "+ pane, true); + $E = $(""); // NO BUTTON + } + else { // VALID + var btn = o[pane].buttonClass +"-"+ action; + $E .addClass( btn +" "+ btn +"-"+ pane ) + .data("layoutName", o.name); // add layout identifier - even if blank! + } + return $E; + } + + + /** + * NEW syntax for binding layout-buttons - will eventually replace addToggle, addOpen, etc. + * + * @param {Object} inst Layout Instance object + * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" + * @param {string} action + * @param {string} pane + */ +, bind: function (inst, selector, action, pane) { + var _ = $.layout.buttons; + switch (action.toLowerCase()) { + case "toggle": _.addToggle (inst, selector, pane); break; + case "open": _.addOpen (inst, selector, pane); break; + case "close": _.addClose (inst, selector, pane); break; + case "pin": _.addPin (inst, selector, pane); break; + case "toggle-slide": _.addToggle (inst, selector, pane, true); break; + case "open-slide": _.addOpen (inst, selector, pane, true); break; + } + return inst; + } + + /** + * Add a custom Toggler button for a pane + * + * @param {Object} inst Layout Instance object + * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" + * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. + * @param {boolean=} slide true = slide-open, false = pin-open + */ +, addToggle: function (inst, selector, pane, slide) { + $.layout.buttons.get(inst, selector, pane, "toggle") + .click(function(evt){ + inst.toggle(pane, !!slide); + evt.stopPropagation(); + }); + return inst; + } + + /** + * Add a custom Open button for a pane + * + * @param {Object} inst Layout Instance object + * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" + * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. + * @param {boolean=} slide true = slide-open, false = pin-open + */ +, addOpen: function (inst, selector, pane, slide) { + $.layout.buttons.get(inst, selector, pane, "open") + .attr("title", inst.options[pane].tips.Open) + .click(function (evt) { + inst.open(pane, !!slide); + evt.stopPropagation(); + }); + return inst; + } + + /** + * Add a custom Close button for a pane + * + * @param {Object} inst Layout Instance object + * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" + * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. + */ +, addClose: function (inst, selector, pane) { + $.layout.buttons.get(inst, selector, pane, "close") + .attr("title", inst.options[pane].tips.Close) + .click(function (evt) { + inst.close(pane); + evt.stopPropagation(); + }); + return inst; + } + + /** + * Add a custom Pin button for a pane + * + * Four classes are added to the element, based on the paneClass for the associated pane... + * Assuming the default paneClass and the pin is 'up', these classes are added for a west-pane pin: + * - ui-layout-pane-pin + * - ui-layout-pane-west-pin + * - ui-layout-pane-pin-up + * - ui-layout-pane-west-pin-up + * + * @param {Object} inst Layout Instance object + * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" + * @param {string} pane Name of the pane the pin is for: 'north', 'south', etc. + */ +, addPin: function (inst, selector, pane) { + var _ = $.layout.buttons + , $E = _.get(inst, selector, pane, "pin"); + if ($E.length) { + var s = inst.state[pane]; + $E.click(function (evt) { + _.setPinState(inst, $(this), pane, (s.isSliding || s.isClosed)); + if (s.isSliding || s.isClosed) inst.open( pane ); // change from sliding to open + else inst.close( pane ); // slide-closed + evt.stopPropagation(); + }); + // add up/down pin attributes and classes + _.setPinState(inst, $E, pane, (!s.isClosed && !s.isSliding)); + // add this pin to the pane data so we can 'sync it' automatically + // PANE.pins key is an array so we can store multiple pins for each pane + s.pins.push( selector ); // just save the selector string + } + return inst; + } + + /** + * Change the class of the pin button to make it look 'up' or 'down' + * + * @see addPin(), syncPins() + * + * @param {Object} inst Layout Instance object + * @param {Array.} $Pin The pin-span element in a jQuery wrapper + * @param {string} pane These are the params returned to callbacks by layout() + * @param {boolean} doPin true = set the pin 'down', false = set it 'up' + */ +, setPinState: function (inst, $Pin, pane, doPin) { + var updown = $Pin.attr("pin"); + if (updown && doPin === (updown=="down")) return; // already in correct state + var + o = inst.options[pane] + , pin = o.buttonClass +"-pin" + , side = pin +"-"+ pane + , UP = pin +"-up "+ side +"-up" + , DN = pin +"-down "+side +"-down" + ; + $Pin + .attr("pin", doPin ? "down" : "up") // logic + .attr("title", doPin ? o.tips.Unpin : o.tips.Pin) + .removeClass( doPin ? UP : DN ) + .addClass( doPin ? DN : UP ) + ; + } + + /** + * INTERNAL function to sync 'pin buttons' when pane is opened or closed + * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes + * + * @see open(), close() + * + * @param {Object} inst Layout Instance object + * @param {string} pane These are the params returned to callbacks by layout() + * @param {boolean} doPin True means set the pin 'down', False means 'up' + */ +, syncPinBtns: function (inst, pane, doPin) { + // REAL METHOD IS _INSIDE_ LAYOUT - THIS IS HERE JUST FOR REFERENCE + $.each(inst.state[pane].pins, function (i, selector) { + $.layout.buttons.setPinState(inst, $(selector), pane, doPin); + }); + } + + +, _load: function (inst) { + var _ = $.layout.buttons; + // ADD Button methods to Layout Instance + // Note: sel = jQuery Selector string + $.extend( inst, { + bindButton: function (sel, action, pane) { return _.bind(inst, sel, action, pane); } + // DEPRECATED METHODS + , addToggleBtn: function (sel, pane, slide) { return _.addToggle(inst, sel, pane, slide); } + , addOpenBtn: function (sel, pane, slide) { return _.addOpen(inst, sel, pane, slide); } + , addCloseBtn: function (sel, pane) { return _.addClose(inst, sel, pane); } + , addPinBtn: function (sel, pane) { return _.addPin(inst, sel, pane); } + }); + + // init state array to hold pin-buttons + for (var i=0; i<4; i++) { + var pane = $.layout.config.borderPanes[i]; + inst.state[pane].pins = []; + } + + // auto-init buttons onLoad if option is enabled + if ( inst.options.autoBindCustomButtons ) + _.init(inst); + } + +, _unload: function (inst) { + // TODO: unbind all buttons??? + } + +}; + +// add initialization method to Layout's onLoad array of functions +$.layout.onLoad.push( $.layout.buttons._load ); +//$.layout.onUnload.push( $.layout.buttons._unload ); + + + +/** + * jquery.layout.browserZoom 1.0 + * $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $ + * + * Copyright (c) 2012 + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * @requires: UI Layout 1.3.0.rc30.1 or higher + * + * @see: http://groups.google.com/group/jquery-ui-layout + * + * TODO: Extend logic to handle other problematic zooming in browsers + * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event + */ + +// tell Layout that the plugin is available +$.layout.plugins.browserZoom = true; + +$.layout.defaults.browserZoomCheckInterval = 1000; +$.layout.optionsMap.layout.push("browserZoomCheckInterval"); + +/* + * browserZoom methods + */ +$.layout.browserZoom = { + + _init: function (inst) { + // abort if browser does not need this check + if ($.layout.browserZoom.ratio() !== false) + $.layout.browserZoom._setTimer(inst); + } + +, _setTimer: function (inst) { + // abort if layout destroyed or browser does not need this check + if (inst.destroyed) return; + var o = inst.options + , s = inst.state + // don't need check if inst has parentLayout, but check occassionally in case parent destroyed! + // MINIMUM 100ms interval, for performance + , ms = inst.hasParentLayout ? 5000 : Math.max( o.browserZoomCheckInterval, 100 ) + ; + // set the timer + setTimeout(function(){ + if (inst.destroyed || !o.resizeWithWindow) return; + var d = $.layout.browserZoom.ratio(); + if (d !== s.browserZoom) { + s.browserZoom = d; + inst.resizeAll(); + } + // set a NEW timeout + $.layout.browserZoom._setTimer(inst); + } + , ms ); + } + +, ratio: function () { + var w = window + , s = screen + , d = document + , dE = d.documentElement || d.body + , b = $.layout.browser + , v = b.version + , r, sW, cW + ; + // we can ignore all browsers that fire window.resize event onZoom + if ((b.msie && v > 8) + || !b.msie + ) return false; // don't need to track zoom + + if (s.deviceXDPI && s.systemXDPI) // syntax compiler hack + return calc(s.deviceXDPI, s.systemXDPI); + // everything below is just for future reference! + if (b.webkit && (r = d.body.getBoundingClientRect)) + return calc((r.left - r.right), d.body.offsetWidth); + if (b.webkit && (sW = w.outerWidth)) + return calc(sW, w.innerWidth); + if ((sW = s.width) && (cW = dE.clientWidth)) + return calc(sW, cW); + return false; // no match, so cannot - or don't need to - track zoom + + function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); } + } + +}; +// add initialization method to Layout's onLoad array of functions +$.layout.onReady.push( $.layout.browserZoom._init ); + + })( jQuery ); \ No newline at end of file From a5ba59312de445e4975ee4acdea8955d2c9199e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jun 2013 19:03:33 +0200 Subject: [PATCH 6/8] Fix: Fix some bug into script to detect bad utf8 and dos files --- dev/fixdosfiles.sh | 4 ++-- dev/fixutf8bomfiles.sh | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dev/fixdosfiles.sh b/dev/fixdosfiles.sh index ac4a305834c..256babb60eb 100755 --- a/dev/fixdosfiles.sh +++ b/dev/fixdosfiles.sh @@ -16,13 +16,13 @@ fi # To detec if [ "x$1" = "xlist" ] then - find . -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF + find . \( -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF fi # To convert if [ "x$1" = "xfix" ] then - for fic in `find . -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF | awk -F':' '{ print $1 }' ` + for fic in `find . \( -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF | awk -F':' '{ print $1 }' ` do echo "Fix file $fic" dos2unix $fic diff --git a/dev/fixutf8bomfiles.sh b/dev/fixutf8bomfiles.sh index 058c1c8a483..db34cdcdc1d 100755 --- a/dev/fixutf8bomfiles.sh +++ b/dev/fixutf8bomfiles.sh @@ -12,20 +12,26 @@ # Syntax if [ "x$1" != "xlist" -a "x$1" != "xfix" ] then - echo "Usage: fixutf8bomfiles.sh [list|fix]" + echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]" +fi + +if [ "x$2" != "xaddincludes" ] +then + export moreoptions="--exclude-dir='includes'" fi # To detec if [ "x$1" = "xlist" ] then - #find . -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}' - grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}' + #find . \( -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' \) -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}' + echo "grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'" + grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}' fi # To convert if [ "x$1" = "xfix" ] then - for fic in `grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'` + for fic in `grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'` do echo "Fixing $fic" sed -i '1s/^\xEF\xBB\xBF//' $fic From 8d04f5a8059534ad33e977023b7cb7fb5a0e136f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jun 2013 19:34:02 +0200 Subject: [PATCH 7/8] Fix: warning --- htdocs/cashdesk/facturation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index e4f23785a97..1636246e536 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -138,10 +138,10 @@ $sql.= " AND t.active = 1"; $sql.= " AND p.code = '".$mysoc->country_code."'"; //print $request; -$res = $db->query($sql); -if ($res) +$resql = $db->query($sql); +if ($resql) { - while ( $tab = $db->fetch_array($res) ) + while ( $tab = $db->fetch_array($resql) ) { foreach ( $tab as $cle => $valeur ) { From eb07c6b2e7f8e19f8c74ab431f856887acd69d75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Jun 2013 19:45:29 +0200 Subject: [PATCH 8/8] Fix: Missing left padding --- htdocs/theme/eldy/style.css.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 8f6c184bb56..607d7d6e4f9 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1709,7 +1709,7 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list white-space: ; text-align: ; } -tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div +tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste_titre div, div.liste_titre { font-family: ; /*font-weight: normal;*/ @@ -1717,6 +1717,9 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste white-space: ; text-shadow:1px 0px 1px #ffffff; } +div.liste_titre { + padding-left: 3px; +} tr.liste_titre_sel th, th.liste_titre_sel, tr.liste_titre_sel td, td.liste_titre_sel, form.liste_titre_sel div { font-family: ;